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