refactor: Stop using .d.ts files for type-collection files (no-changelog) (#6634)

refactor: Stop using `.d.ts` files for type-collection files
This commit is contained in:
Iván Ovejero 2023-07-10 19:35:34 +02:00 committed by GitHub
parent 07744986ea
commit d6b2ae0255
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 44 additions and 35 deletions

View file

@ -138,13 +138,13 @@ export type OperationID = 'getUsers' | 'getUser';
type PaginationBase = { limit: number };
type PaginationOffsetDecoded = PaginationBase & { offset: number };
export type PaginationOffsetDecoded = PaginationBase & { offset: number };
type PaginationCursorDecoded = PaginationBase & { lastId: string };
export type PaginationCursorDecoded = PaginationBase & { lastId: string };
type OffsetPagination = PaginationBase & { offset: number; numberOfTotalRecords: number };
export type OffsetPagination = PaginationBase & { offset: number; numberOfTotalRecords: number };
type CursorPagination = PaginationBase & { lastId: string; numberOfNextRecords: number };
export type CursorPagination = PaginationBase & { lastId: string; numberOfNextRecords: number };
export interface IRequired {
required?: string[];
not?: { required?: string[] };

View file

@ -1,4 +1,6 @@
interface IResult {
import type { ExecutionStatus } from 'n8n-workflow';
export interface IResult {
totalWorkflows: number;
slackMessage: string;
summary: {
@ -14,7 +16,7 @@ interface IResult {
executions: IExecutionResult[];
}
interface IExecutionResult {
export interface IExecutionResult {
workflowId: string;
workflowName: string;
executionTime: number; // Given in seconds with decimals for milliseconds
@ -32,16 +34,16 @@ interface IExecutionError {
error: string;
}
interface IWorkflowExecutionProgress {
export interface IWorkflowExecutionProgress {
workflowId: string;
status: ExecutionStatus;
}
interface INodeSpecialCases {
export interface INodeSpecialCases {
[nodeName: string]: INodeSpecialCase;
}
interface INodeSpecialCase {
export interface INodeSpecialCase {
ignoredProperties?: string[];
capResults?: number;
keepOnlyProperties?: string[];

View file

@ -18,6 +18,13 @@ import { findCliWorkflowStart } from '@/utils';
import { initEvents } from '@/events';
import { BaseCommand } from './BaseCommand';
import { Container } from 'typedi';
import type {
IExecutionResult,
INodeSpecialCase,
INodeSpecialCases,
IResult,
IWorkflowExecutionProgress,
} from './Interfaces';
const re = /\d+/;

View file

@ -14,7 +14,7 @@ export type Resource =
export type Operation = 'create' | 'delete' | 'get' | 'getAll' | 'update' | 'add' | 'remove';
// @ts-ignore
export type LanguageCodes = (typeof LanguageOptions)[number]['value'];
export type LanguageCodes = LanguageOptions[number]['value'];
// ----------------------------------------
// UI fields

View file

@ -16,7 +16,7 @@ export interface IAttributeValue {
[attribute: string]: IAttributeValueValue;
}
interface IAttributeValueValue {
export interface IAttributeValueValue {
[type: string]: string | string[] | IAttributeValue[];
}
@ -31,7 +31,7 @@ export interface IAttributeNameUi {
value: string;
}
type AttributeValueType =
export type AttributeValueType =
| 'B' // binary
| 'BOOL' // boolean
| 'BS' // binary set

View file

@ -11,8 +11,7 @@ import type {
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import type { Address, Filter, FilterGroup, ProductAttribute, Search } from './Types';
import type { Filter, Address, Search, FilterGroup, ProductAttribute } from './types';
export async function magentoApiRequest(
this: IWebhookFunctions | IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,

View file

@ -35,7 +35,7 @@ import type {
NewCustomer,
NewProduct,
Search,
} from './Types';
} from './types';
import { capitalCase } from 'change-case';

View file

@ -2,8 +2,8 @@
// sea-table
// ----------------------------------
type TSeaTableServerVersion = '2.0.6';
type TSeaTableServerEdition = 'enterprise edition';
export type TSeaTableServerVersion = '2.0.6';
export type TSeaTableServerEdition = 'enterprise edition';
// ----------------------------------
// dtable
@ -12,9 +12,9 @@ type TSeaTableServerEdition = 'enterprise edition';
import type { IDtableMetadataColumn, IDtableMetadataTable, TDtableViewColumn } from './Interfaces';
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
type TInheritColumnTypeTime = 'ctime' | 'mtime';
type TInheritColumnTypeUser = 'creator' | 'last-modifier';
type TColumnType =
export type TInheritColumnTypeTime = 'ctime' | 'mtime';
export type TInheritColumnTypeUser = 'creator' | 'last-modifier';
export type TColumnType =
| 'text'
| 'long-text'
| 'number'
@ -33,7 +33,7 @@ type TColumnType =
| 'auto-number';
type TImplementInheritColumnKey = '_seq';
type TInheritColumnKey =
export type TInheritColumnKey =
| '_id'
| '_creator'
| '_ctime'
@ -41,8 +41,8 @@ type TInheritColumnKey =
| '_mtime'
| TImplementInheritColumnKey;
type TColumnValue = undefined | boolean | number | string | string[] | null;
type TColumnKey = TInheritColumnKey | string;
export type TColumnValue = undefined | boolean | number | string | string[] | null;
export type TColumnKey = TInheritColumnKey | string;
export type TDtableMetadataTables = readonly IDtableMetadataTable[];
export type TDtableMetadataColumns = readonly IDtableMetadataColumn[];
@ -52,34 +52,34 @@ export type TDtableViewColumns = readonly TDtableViewColumn[];
// api
// ----------------------------------
type TEndpointVariableName = 'access_token' | 'dtable_uuid' | 'server';
export type TEndpointVariableName = 'access_token' | 'dtable_uuid' | 'server';
// Template Literal Types requires-ts-4.1.5 -- deferred
type TMethod = 'GET' | 'POST';
export type TMethod = 'GET' | 'POST';
type TDeferredEndpoint = string;
type TDeferredEndpointExpr = string;
type TEndpoint =
| '/api/v2.1/dtable/app-access-token/'
| '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/'
| TDeferredEndpoint;
type TEndpointExpr = TEndpoint | TDeferredEndpointExpr;
type TEndpointResolvedExpr =
export type TEndpointExpr = TEndpoint | TDeferredEndpointExpr;
export type TEndpointResolvedExpr =
| TEndpoint
| string; /* deferred: but already in use for header values, e.g. authentication */
type TDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ' /* moment.js */;
export type TDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ' /* moment.js */;
// ----------------------------------
// node
// ----------------------------------
type TCredentials = ICredentialDataDecryptedObject | undefined;
export type TCredentials = ICredentialDataDecryptedObject | undefined;
type TTriggerOperation = 'create' | 'update';
export type TTriggerOperation = 'create' | 'update';
type TOperation = 'append' | 'list' | 'metadata';
export type TOperation = 'append' | 'list' | 'metadata';
type TLoadedResource = {
export type TLoadedResource = {
name: string;
};
export type TColumnsUiValues = Array<{

View file

@ -41,14 +41,14 @@ export type IdType = 'accountId' | 'contactId' | 'dealId' | 'purchaseOrderId';
export type NameType = 'Account_Name' | 'Full_Name' | 'Deal_Name' | 'Product_Name' | 'Vendor_Name';
type LocationType =
export type LocationType =
| 'Address'
| 'Billing_Address'
| 'Mailing_Address'
| 'Shipping_Address'
| 'Other_Address';
type DateType =
export type DateType =
| 'Date_of_Birth'
| 'Closing_Date'
| 'Due_Date'

View file

@ -7,4 +7,5 @@ export type ExecutionStatus =
| 'running'
| 'success'
| 'unknown'
| 'waiting';
| 'waiting'
| 'warning';