mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
refactor: Delete unnecessary interface re-exports from core, and delete unused code in nodes-base (no-changelog) (#6631)
This commit is contained in:
parent
329d22f5d1
commit
e57e85edf7
|
@ -3,26 +3,10 @@ import type {
|
|||
IPollResponse,
|
||||
ITriggerResponse,
|
||||
IWorkflowSettings as IWorkflowSettingsWorkflow,
|
||||
IExecuteFunctions as IExecuteFunctionsBase,
|
||||
IExecuteSingleFunctions as IExecuteSingleFunctionsBase,
|
||||
IHookFunctions as IHookFunctionsBase,
|
||||
ILoadOptionsFunctions as ILoadOptionsFunctionsBase,
|
||||
IPollFunctions as IPollFunctionsBase,
|
||||
ITriggerFunctions as ITriggerFunctionsBase,
|
||||
IWebhookFunctions as IWebhookFunctionsBase,
|
||||
BinaryMetadata,
|
||||
ValidationResult,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
// TODO: remove these after removing `n8n-core` dependency from `nodes-bases`
|
||||
export type IExecuteFunctions = IExecuteFunctionsBase;
|
||||
export type IExecuteSingleFunctions = IExecuteSingleFunctionsBase;
|
||||
export type IHookFunctions = IHookFunctionsBase;
|
||||
export type ILoadOptionsFunctions = ILoadOptionsFunctionsBase;
|
||||
export type IPollFunctions = IPollFunctionsBase;
|
||||
export type ITriggerFunctions = ITriggerFunctionsBase;
|
||||
export type IWebhookFunctions = IWebhookFunctionsBase;
|
||||
|
||||
export interface IProcessMessage {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data?: any;
|
||||
|
|
|
@ -61,8 +61,8 @@ would look like this:
|
|||
File named: `MyNode.node.ts`
|
||||
|
||||
```TypeScript
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { getWorkflowFilenames, testWorkflows } from '../../../../test/nodes/Helpers';
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
|
|
@ -448,7 +448,6 @@ export class Chargebee implements INodeType {
|
|||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
let _item: INodeExecutionData;
|
||||
|
||||
const credentials = await this.getCredentials('chargebeeApi');
|
||||
|
||||
|
@ -461,7 +460,6 @@ export class Chargebee implements INodeType {
|
|||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
try {
|
||||
_item = items[i];
|
||||
const resource = this.getNodeParameter('resource', i);
|
||||
const operation = this.getNodeParameter('operation', i);
|
||||
|
||||
|
|
|
@ -3,11 +3,7 @@ import { NodeVM } from 'vm2';
|
|||
import type { IExecuteFunctions, IWorkflowDataProxyData } from 'n8n-workflow';
|
||||
import { NodeHelpers } from 'n8n-workflow';
|
||||
import { normalizeItems } from 'n8n-core';
|
||||
import {
|
||||
testWorkflows,
|
||||
getWorkflowFilenames,
|
||||
initBinaryDataManager,
|
||||
} from '../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames, initBinaryDataManager } from '@test/nodes/Helpers';
|
||||
import { Code } from '../Code.node';
|
||||
import { ValidationError } from '../ValidationError';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-loop-func */
|
||||
import type { WorkflowTestData } from '../../../../test/nodes/types';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
|
@ -7,8 +7,8 @@ import {
|
|||
setup,
|
||||
initBinaryDataManager,
|
||||
readJsonFileSync,
|
||||
} from '../../../../test/nodes/Helpers';
|
||||
import { executeWorkflow } from '../../../../test/nodes/ExecuteWorkflow';
|
||||
} from '@test/nodes/Helpers';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import path from 'path';
|
||||
import os from 'node:os';
|
||||
|
|
|
@ -373,7 +373,7 @@ export class CrateDb implements INodeType {
|
|||
returning,
|
||||
);
|
||||
}
|
||||
const _updateItems = await db.multi(pgp.helpers.concat(queries));
|
||||
await db.multi(pgp.helpers.concat(queries));
|
||||
returnItems = this.helpers.returnJsonArray(getItemsCopy(items, columns));
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import fs from 'fs';
|
||||
import fsPromises from 'fs/promises';
|
||||
import { Readable } from 'stream';
|
||||
import {
|
||||
testWorkflows,
|
||||
getWorkflowFilenames,
|
||||
initBinaryDataManager,
|
||||
} from '../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames, initBinaryDataManager } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import moment from 'moment';
|
||||
import { testWorkflows, getWorkflowFilenames } from '../../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -577,12 +577,10 @@ export class Disqus implements INodeType {
|
|||
|
||||
let endpoint = '';
|
||||
let requestMethod = '';
|
||||
let _body: IDataObject | Buffer;
|
||||
let qs: IDataObject;
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
try {
|
||||
_body = {};
|
||||
qs = {};
|
||||
|
||||
if (resource === 'forum') {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
describe('Execute Execute Command Node', () => testWorkflows(workflows));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -217,12 +217,9 @@ export class Git implements INodeType {
|
|||
};
|
||||
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
let _item: INodeExecutionData;
|
||||
const returnItems: INodeExecutionData[] = [];
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
try {
|
||||
_item = items[itemIndex];
|
||||
|
||||
const repositoryPath = this.getNodeParameter('repositoryPath', itemIndex, '') as string;
|
||||
const options = this.getNodeParameter('options', itemIndex, {});
|
||||
|
||||
|
|
|
@ -1319,22 +1319,22 @@ export class Gitlab implements INodeType {
|
|||
const items = this.getInputData();
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
|
||||
let _credentials;
|
||||
// let _credentials;
|
||||
|
||||
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
||||
// const authenticationMethod = this.getNodeParameter('authentication', 0);
|
||||
|
||||
try {
|
||||
if (authenticationMethod === 'accessToken') {
|
||||
_credentials = await this.getCredentials('gitlabApi');
|
||||
} else {
|
||||
_credentials = await this.getCredentials('gitlabOAuth2Api');
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
return [this.helpers.returnJsonArray([{ error: error.message }])];
|
||||
}
|
||||
throw new NodeOperationError(this.getNode(), error as Error);
|
||||
}
|
||||
// try {
|
||||
// if (authenticationMethod === 'accessToken') {
|
||||
// _credentials = await this.getCredentials('gitlabApi');
|
||||
// } else {
|
||||
// _credentials = await this.getCredentials('gitlabOAuth2Api');
|
||||
// }
|
||||
// } catch (error) {
|
||||
// if (this.continueOnFail()) {
|
||||
// return [this.helpers.returnJsonArray([{ error: error.message }])];
|
||||
// }
|
||||
// throw new NodeOperationError(this.getNode(), error as Error);
|
||||
// }
|
||||
|
||||
// Operations which overwrite the returned data
|
||||
const overwriteDataOperations = [
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { setup, workflowToTests } from '../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { setup, workflowToTests } from '../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { setup, workflowToTests } from '../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import { prepareOutput } from '../../../v2/helpers/utils';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
|
||||
describe('Google BigQuery v2 Utils', () => {
|
||||
it('should prepareOutput', () => {
|
||||
const thisArg = mock<IExecuteFunctions>({ helpers: mock({ constructExecutionMetaData }) });
|
||||
const response: IDataObject = {
|
||||
kind: 'bigquery#getQueryResultsResponse',
|
||||
etag: 'e_tag',
|
||||
|
@ -211,7 +214,7 @@ describe('Google BigQuery v2 Utils', () => {
|
|||
jobComplete: true,
|
||||
cacheHit: true,
|
||||
};
|
||||
const returnData = prepareOutput(response, 0, false, false);
|
||||
const returnData = prepareOutput.call(thisArg, response, 0, false, false);
|
||||
|
||||
expect(returnData).toBeDefined();
|
||||
// expect(returnData).toHaveProperty('nodes');
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeBaseDescription,
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { NodeOperationError, sleep } from 'n8n-workflow';
|
||||
import { getResolvables, updateDisplayOptions } from '@utils/utilities';
|
||||
|
@ -232,7 +235,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
qs,
|
||||
);
|
||||
|
||||
returnData.push(...prepareOutput(queryResponse, i, raw, includeSchema));
|
||||
returnData.push(...prepareOutput.call(this, queryResponse, i, raw, includeSchema));
|
||||
} else {
|
||||
jobs.push({ jobId, projectId, i, raw, includeSchema, location: options.location });
|
||||
}
|
||||
|
@ -271,7 +274,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
if (response.jobComplete) {
|
||||
completedJobs.push(job.jobId);
|
||||
|
||||
returnData.push(...prepareOutput(response, job.i, job.raw, job.includeSchema));
|
||||
returnData.push(...prepareOutput.call(this, response, job.i, job.raw, job.includeSchema));
|
||||
}
|
||||
if ((response?.errors as IDataObject[])?.length) {
|
||||
const errorMessages = (response.errors as IDataObject[]).map((error) => error.message);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import type { GoogleBigQuery } from './node.type';
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IDataObject, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { jsonParse, NodeOperationError } from 'n8n-workflow';
|
||||
import type { SchemaField, TableRawData, TableSchema } from './interfaces';
|
||||
|
||||
|
@ -56,6 +54,7 @@ export function simplify(data: TableRawData[], schema: SchemaField[], includeSch
|
|||
}
|
||||
|
||||
export function prepareOutput(
|
||||
this: IExecuteFunctions,
|
||||
response: IDataObject,
|
||||
itemIndex: number,
|
||||
rawOutput: boolean,
|
||||
|
@ -82,9 +81,12 @@ export function prepareOutput(
|
|||
}
|
||||
}
|
||||
|
||||
const executionData = constructExecutionMetaData(wrapData(responseData as IDataObject[]), {
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
wrapData(responseData as IDataObject[]),
|
||||
{
|
||||
itemData: { item: itemIndex },
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
return executionData;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
import type { IDataObject, JsonObject } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../../GenericFunctions';
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
};
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
|
||||
import * as uuid from 'uuid';
|
||||
|
||||
jest.mock('uuid', () => {
|
||||
const originalModule = jest.requireActual('uuid');
|
||||
return {
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { sharedDriveRLC } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { sharedDriveRLC } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
import { googleApiRequest, googleApiRequestAllItems } from '../../transport';
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { sharedDriveRLC } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeParameterResourceLocator,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { driveRLC, fileRLC, folderRLC } from '../common.descriptions';
|
||||
import { setParentFolder } from '../../helpers/utils';
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { driveRLC, folderRLC, updateCommonOptions } from '../common.descriptions';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { DRIVE } from '../../helpers/interfaces';
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { fileRLC } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IBinaryKeyData,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { fileRLC } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { driveRLC, fileRLC, folderRLC } from '../common.descriptions';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { setParentFolder } from '../../helpers/utils';
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { fileRLC, permissionsOptions, shareOptions } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import {
|
||||
getItemBinaryData,
|
||||
prepareQueryString,
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { driveRLC, folderRLC, updateCommonOptions } from '../common.descriptions';
|
||||
import {
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { driveRLC, fileTypesOptions, folderRLC } from '../common.descriptions';
|
||||
import { googleApiRequest, googleApiRequestAllItems } from '../../transport';
|
||||
import { prepareQueryString, updateDriveScopes } from '../../helpers/utils';
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { driveRLC, folderRLC } from '../common.descriptions';
|
||||
import { DRIVE } from '../../helpers/interfaces';
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { folderNoRootRLC } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { googleApiRequest } from '../../transport';
|
||||
import { folderNoRootRLC, permissionsOptions, shareOptions } from '../common.descriptions';
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
import type { ICredentialTestFunctions, IDataObject, IPollFunctions } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
IPollFunctions,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import type { OptionsWithUri } from 'request';
|
||||
import moment from 'moment-timezone';
|
||||
|
|
|
@ -399,7 +399,7 @@ export class GoogleSheet {
|
|||
if (itemKey === undefined || itemKey === null) {
|
||||
// Item does not have the indexKey so we can ignore it or append it if upsert true
|
||||
if (upsert) {
|
||||
const _data = await this.appendSheetData(
|
||||
await this.appendSheetData(
|
||||
[inputItem],
|
||||
this.encodeRange(range),
|
||||
keyRowIndex,
|
||||
|
@ -415,7 +415,7 @@ export class GoogleSheet {
|
|||
if (itemKeyIndex === -1) {
|
||||
// Key does not exist in the Sheet so it can not be updated so skip it or append it if upsert true
|
||||
if (upsert) {
|
||||
const _data = await this.appendSheetData(
|
||||
await this.appendSheetData(
|
||||
[inputItem],
|
||||
this.encodeRange(range),
|
||||
keyRowIndex,
|
||||
|
|
|
@ -130,7 +130,7 @@ export class GoogleSheetsV1 implements INodeType {
|
|||
const usePathForKeyRow = (options.usePathForKeyRow || false) as boolean;
|
||||
|
||||
// Convert data into array format
|
||||
const _data = await sheet.appendSheetData(
|
||||
await sheet.appendSheetData(
|
||||
setData,
|
||||
sheet.encodeRange(range),
|
||||
keyRow,
|
||||
|
@ -242,7 +242,7 @@ export class GoogleSheetsV1 implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
const _data = await sheet.spreadsheetBatchUpdate(requests);
|
||||
await sheet.spreadsheetBatchUpdate(requests);
|
||||
|
||||
const items = this.getInputData();
|
||||
return await this.prepareOutputData(items);
|
||||
|
@ -395,7 +395,7 @@ export class GoogleSheetsV1 implements INodeType {
|
|||
});
|
||||
}
|
||||
|
||||
const _data = await sheet.batchUpdate(updateData, valueInputMode);
|
||||
await sheet.batchUpdate(updateData, valueInputMode);
|
||||
} else {
|
||||
const keyName = this.getNodeParameter('key', 0) as string;
|
||||
const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10);
|
||||
|
@ -406,7 +406,7 @@ export class GoogleSheetsV1 implements INodeType {
|
|||
setData.push(item.json);
|
||||
});
|
||||
|
||||
const _data = await sheet.updateSheetData(
|
||||
await sheet.updateSheetData(
|
||||
setData,
|
||||
keyName,
|
||||
range,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
|
||||
import { oldVersionNotice } from '../../../../utils/descriptions';
|
||||
import { oldVersionNotice } from '@utils/descriptions';
|
||||
|
||||
export const versionDescription: INodeTypeDescription = {
|
||||
displayName: 'Google Sheets ',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { ILoadOptionsFunctions } from 'n8n-core';
|
||||
import type { IDataObject, ResourceMapperFields } from 'n8n-workflow';
|
||||
import type { IDataObject, ILoadOptionsFunctions, ResourceMapperFields } from 'n8n-workflow';
|
||||
import { GoogleSheet } from '../helpers/GoogleSheet';
|
||||
import type { ResourceLocator } from '../helpers/GoogleSheets.types';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
|
|
|
@ -113,7 +113,6 @@ export class HelpScout implements INodeType {
|
|||
);
|
||||
for (const tag of tags) {
|
||||
const tagName = tag.name;
|
||||
const _tagId = tag.id;
|
||||
returnData.push({
|
||||
name: tagName,
|
||||
value: tagName,
|
||||
|
@ -457,7 +456,6 @@ export class HelpScout implements INodeType {
|
|||
//https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/chat
|
||||
if (operation === 'create') {
|
||||
const conversationId = this.getNodeParameter('conversationId', i) as string;
|
||||
const _type = this.getNodeParameter('type', i) as string;
|
||||
const text = this.getNodeParameter('text', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const attachments = this.getNodeParameter('attachmentsUi', i) as IDataObject;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
import {
|
||||
setup,
|
||||
equalityTest,
|
||||
workflowToTests,
|
||||
getWorkflowFilenames,
|
||||
} from '../../../../test/nodes/Helpers';
|
||||
import { setup, equalityTest, workflowToTests, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import type {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialsDecrypted,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeCredentialTestResult,
|
||||
INodeExecutionData,
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialsDecrypted,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeCredentialTestResult,
|
||||
INodeExecutionData,
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/* eslint-disable @typescript-eslint/no-loop-func */
|
||||
import type { WorkflowTestData } from '../../../../test/nodes/types';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
|
||||
import {
|
||||
getResultNodeData,
|
||||
setup,
|
||||
readJsonFileSync,
|
||||
initBinaryDataManager,
|
||||
} from '../../../../test/nodes/Helpers';
|
||||
import { executeWorkflow } from '../../../../test/nodes/ExecuteWorkflow';
|
||||
} from '@test/nodes/Helpers';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
describe('Execute iCalendar Node', () => {
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { deepCopy, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialsDecrypted,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeCredentialTestResult,
|
||||
INodeExecutionData,
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import type { IDataObject, IHookFunctions, IWebhookFunctions } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import { BASE_URL } from './constants';
|
||||
|
||||
export async function lonescaleApiRequest(
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import type { IWebhookFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
IHookFunctions,
|
||||
|
@ -7,6 +5,7 @@ import type {
|
|||
INodePropertyOptions,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IWebhookFunctions,
|
||||
IWebhookResponseData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { testWorkflows, getWorkflowFilenames } from '../../../../test/nodes/Helpers';
|
||||
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
@ -12,14 +6,7 @@ jest.mock('../../../../v2/transport', () => {
|
|||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (
|
||||
method: string,
|
||||
resource: string,
|
||||
body?: IDataObject,
|
||||
qs?: IDataObject,
|
||||
uri?: string,
|
||||
headers?: IDataObject,
|
||||
) {
|
||||
microsoftApiRequest: jest.fn(async function (method: string, resource: string) {
|
||||
if (method === 'GET' && resource.includes('usedRange')) {
|
||||
return {
|
||||
address: 'Sheet4!A1:D6',
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import { getResultNodeData, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '../../../../../../../test/nodes/types';
|
||||
import { executeWorkflow } from '../../../../../../../test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as _transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as _transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import { equalityTest, setup, workflowToTests } from '../../../../../../../test/nodes/Helpers';
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import * as _transport from '../../../../v2/transport';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { get } from 'lodash';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import {
|
||||
prepareOutput,
|
||||
updateByAutoMaping,
|
||||
|
@ -86,27 +88,34 @@ const responseData = {
|
|||
};
|
||||
|
||||
describe('Test MicrosoftExcelV2, prepareOutput', () => {
|
||||
const thisArg = mock<IExecuteFunctions>({
|
||||
helpers: mock({ constructExecutionMetaData }),
|
||||
});
|
||||
|
||||
it('should return empty array', () => {
|
||||
const output = prepareOutput(node, { values: [] }, { rawData: false });
|
||||
const output = prepareOutput.call(thisArg, node, { values: [] }, { rawData: false });
|
||||
expect(output).toBeDefined();
|
||||
expect(output).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return raw response', () => {
|
||||
const output = prepareOutput(node, responseData, { rawData: true });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, { rawData: true });
|
||||
expect(output).toBeDefined();
|
||||
expect(output[0].json.data).toEqual(responseData);
|
||||
});
|
||||
|
||||
it('should return raw response in custom property', () => {
|
||||
const customKey = 'customKey';
|
||||
const output = prepareOutput(node, responseData, { rawData: true, dataProperty: customKey });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, {
|
||||
rawData: true,
|
||||
dataProperty: customKey,
|
||||
});
|
||||
expect(output).toBeDefined();
|
||||
expect(output[0].json.customKey).toEqual(responseData);
|
||||
});
|
||||
|
||||
it('should return formated response', () => {
|
||||
const output = prepareOutput(node, responseData, { rawData: false });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, { rawData: false });
|
||||
expect(output).toBeDefined();
|
||||
expect(output.length).toEqual(3);
|
||||
expect(output[0].json).toEqual({
|
||||
|
@ -118,7 +127,10 @@ describe('Test MicrosoftExcelV2, prepareOutput', () => {
|
|||
});
|
||||
|
||||
it('should return response with selected first data row', () => {
|
||||
const output = prepareOutput(node, responseData, { rawData: false, firstDataRow: 3 });
|
||||
const output = prepareOutput.call(thisArg, node, responseData, {
|
||||
rawData: false,
|
||||
firstDataRow: 3,
|
||||
});
|
||||
expect(output).toBeDefined();
|
||||
expect(output.length).toEqual(1);
|
||||
expect(output[0].json).toEqual({
|
||||
|
@ -132,7 +144,11 @@ describe('Test MicrosoftExcelV2, prepareOutput', () => {
|
|||
it('should return response with selected first data row', () => {
|
||||
const [firstRow, ...rest] = responseData.values;
|
||||
const response = { values: [...rest, firstRow] };
|
||||
const output = prepareOutput(node, response, { rawData: false, keyRow: 3, firstDataRow: 0 });
|
||||
const output = prepareOutput.call(thisArg, node, response, {
|
||||
rawData: false,
|
||||
keyRow: 3,
|
||||
firstDataRow: 0,
|
||||
});
|
||||
expect(output).toBeDefined();
|
||||
expect(output.length).toEqual(3);
|
||||
expect(output[0].json).toEqual({
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
|
@ -25,7 +24,7 @@ import { worksheetFields, worksheetOperations } from './WorksheetDescription';
|
|||
|
||||
import { tableFields, tableOperations } from './TableDescription';
|
||||
|
||||
import { oldVersionNotice } from '../../../../utils/descriptions';
|
||||
import { oldVersionNotice } from '@utils/descriptions';
|
||||
|
||||
const versionDescription: INodeTypeDescription = {
|
||||
displayName: 'Microsoft Excel',
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type { INodeType, INodeTypeBaseDescription, INodeTypeDescription } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeType,
|
||||
INodeTypeBaseDescription,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { listSearch, loadOptions } from './methods';
|
||||
import { versionDescription } from './actions/versionDescription';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import type { MicrosoftExcel } from './node.type';
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
import type { ExcelResponse } from '../../helpers/interfaces';
|
||||
import { prepareOutput } from '../../helpers/utils';
|
||||
|
@ -260,7 +264,7 @@ export async function execute(
|
|||
const dataProperty = (options.dataProperty as string) || 'data';
|
||||
|
||||
returnData.push(
|
||||
...prepareOutput(this.getNode(), responseData as ExcelResponse, {
|
||||
...prepareOutput.call(this, this.getNode(), responseData as ExcelResponse, {
|
||||
columnsRow,
|
||||
dataProperty,
|
||||
rawData,
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { tableRLC, workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { tableRLC, workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest, microsoftApiRequestAllItemsSkip } from '../../transport';
|
||||
import { tableRLC, workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest, microsoftApiRequestAllItemsSkip } from '../../transport';
|
||||
import { tableRLC, workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties, JsonObject } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequestAllItemsSkip } from '../../transport';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { workbookRLC } from '../common.descriptions';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { microsoftApiRequest, microsoftApiRequestAllItems } from '../../transport';
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
import type { ExcelResponse } from '../../helpers/interfaces';
|
||||
import { prepareOutput } from '../../helpers/utils';
|
||||
|
@ -220,7 +224,11 @@ export async function execute(
|
|||
const dataProperty = this.getNodeParameter('options.dataProperty', 0, 'data') as string;
|
||||
|
||||
returnData.push(
|
||||
...prepareOutput(this.getNode(), responseData, { columnsRow, dataProperty, rawData }),
|
||||
...prepareOutput.call(this, this.getNode(), responseData, {
|
||||
columnsRow,
|
||||
dataProperty,
|
||||
rawData,
|
||||
}),
|
||||
);
|
||||
|
||||
return returnData;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue