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
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 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 { export interface IRequired {
required?: string[]; required?: string[];
not?: { required?: string[] }; not?: { required?: string[] };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,8 +2,8 @@
// sea-table // sea-table
// ---------------------------------- // ----------------------------------
type TSeaTableServerVersion = '2.0.6'; export type TSeaTableServerVersion = '2.0.6';
type TSeaTableServerEdition = 'enterprise edition'; export type TSeaTableServerEdition = 'enterprise edition';
// ---------------------------------- // ----------------------------------
// dtable // dtable
@@ -12,9 +12,9 @@ type TSeaTableServerEdition = 'enterprise edition';
import type { IDtableMetadataColumn, IDtableMetadataTable, TDtableViewColumn } from './Interfaces'; import type { IDtableMetadataColumn, IDtableMetadataTable, TDtableViewColumn } from './Interfaces';
import type { ICredentialDataDecryptedObject } from 'n8n-workflow'; import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
type TInheritColumnTypeTime = 'ctime' | 'mtime'; export type TInheritColumnTypeTime = 'ctime' | 'mtime';
type TInheritColumnTypeUser = 'creator' | 'last-modifier'; export type TInheritColumnTypeUser = 'creator' | 'last-modifier';
type TColumnType = export type TColumnType =
| 'text' | 'text'
| 'long-text' | 'long-text'
| 'number' | 'number'
@@ -33,7 +33,7 @@ type TColumnType =
| 'auto-number'; | 'auto-number';
type TImplementInheritColumnKey = '_seq'; type TImplementInheritColumnKey = '_seq';
type TInheritColumnKey = export type TInheritColumnKey =
| '_id' | '_id'
| '_creator' | '_creator'
| '_ctime' | '_ctime'
@@ -41,8 +41,8 @@ type TInheritColumnKey =
| '_mtime' | '_mtime'
| TImplementInheritColumnKey; | TImplementInheritColumnKey;
type TColumnValue = undefined | boolean | number | string | string[] | null; export type TColumnValue = undefined | boolean | number | string | string[] | null;
type TColumnKey = TInheritColumnKey | string; export type TColumnKey = TInheritColumnKey | string;
export type TDtableMetadataTables = readonly IDtableMetadataTable[]; export type TDtableMetadataTables = readonly IDtableMetadataTable[];
export type TDtableMetadataColumns = readonly IDtableMetadataColumn[]; export type TDtableMetadataColumns = readonly IDtableMetadataColumn[];
@@ -52,34 +52,34 @@ export type TDtableViewColumns = readonly TDtableViewColumn[];
// api // 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 // Template Literal Types requires-ts-4.1.5 -- deferred
type TMethod = 'GET' | 'POST'; export type TMethod = 'GET' | 'POST';
type TDeferredEndpoint = string; type TDeferredEndpoint = string;
type TDeferredEndpointExpr = string; type TDeferredEndpointExpr = string;
type TEndpoint = type TEndpoint =
| '/api/v2.1/dtable/app-access-token/' | '/api/v2.1/dtable/app-access-token/'
| '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/' | '/dtable-server/api/v1/dtables/{{dtable_uuid}}/rows/'
| TDeferredEndpoint; | TDeferredEndpoint;
type TEndpointExpr = TEndpoint | TDeferredEndpointExpr; export type TEndpointExpr = TEndpoint | TDeferredEndpointExpr;
type TEndpointResolvedExpr = export type TEndpointResolvedExpr =
| TEndpoint | TEndpoint
| string; /* deferred: but already in use for header values, e.g. authentication */ | 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 // 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; name: string;
}; };
export type TColumnsUiValues = Array<{ 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'; export type NameType = 'Account_Name' | 'Full_Name' | 'Deal_Name' | 'Product_Name' | 'Vendor_Name';
type LocationType = export type LocationType =
| 'Address' | 'Address'
| 'Billing_Address' | 'Billing_Address'
| 'Mailing_Address' | 'Mailing_Address'
| 'Shipping_Address' | 'Shipping_Address'
| 'Other_Address'; | 'Other_Address';
type DateType = export type DateType =
| 'Date_of_Birth' | 'Date_of_Birth'
| 'Closing_Date' | 'Closing_Date'
| 'Due_Date' | 'Due_Date'

View File

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