mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
refactor(core): Fix type errors in workflow, core, nodes-langchain, and nodes-base (no-changelog) (#9450)
This commit is contained in:
parent
d9616fc36f
commit
2bdc459bb2
|
@ -46,7 +46,7 @@ function getInputs(
|
|||
[NodeConnectionType.AiOutputParser]: 'Output Parser',
|
||||
};
|
||||
|
||||
return inputs.map(({ type, filter, required }) => {
|
||||
return inputs.map(({ type, filter }) => {
|
||||
const input: INodeInputConfiguration = {
|
||||
type,
|
||||
displayName: type in displayNames ? displayNames[type] : undefined,
|
||||
|
@ -370,13 +370,13 @@ export class Agent implements INodeType {
|
|||
if (agentType === 'conversationalAgent') {
|
||||
return await conversationalAgentExecute.call(this, nodeVersion);
|
||||
} else if (agentType === 'toolsAgent') {
|
||||
return await toolsAgentExecute.call(this, nodeVersion);
|
||||
return await toolsAgentExecute.call(this);
|
||||
} else if (agentType === 'openAiFunctionsAgent') {
|
||||
return await openAiFunctionsAgentExecute.call(this, nodeVersion);
|
||||
} else if (agentType === 'reActAgent') {
|
||||
return await reActAgentAgentExecute.call(this, nodeVersion);
|
||||
} else if (agentType === 'sqlAgent') {
|
||||
return await sqlAgentAgentExecute.call(this, nodeVersion);
|
||||
return await sqlAgentAgentExecute.call(this);
|
||||
} else if (agentType === 'planAndExecuteAgent') {
|
||||
return await planAndExecuteAgentExecute.call(this, nodeVersion);
|
||||
}
|
||||
|
|
|
@ -123,5 +123,5 @@ export async function conversationalAgentExecute(
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -125,5 +125,5 @@ export async function openAiFunctionsAgentExecute(
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -102,5 +102,5 @@ export async function planAndExecuteAgentExecute(
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -123,5 +123,5 @@ export async function reActAgentAgentExecute(
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ const parseTablesString = (tablesString: string) =>
|
|||
|
||||
export async function sqlAgentAgentExecute(
|
||||
this: IExecuteFunctions,
|
||||
nodeVersion: number,
|
||||
): Promise<INodeExecutionData[][]> {
|
||||
this.logger.verbose('Executing SQL Agent');
|
||||
|
||||
|
@ -152,5 +151,5 @@ export async function sqlAgentAgentExecute(
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -39,10 +39,7 @@ function getOutputParserSchema(outputParser: BaseOutputParser): ZodObject<any, a
|
|||
return schema;
|
||||
}
|
||||
|
||||
export async function toolsAgentExecute(
|
||||
this: IExecuteFunctions,
|
||||
nodeVersion: number,
|
||||
): Promise<INodeExecutionData[][]> {
|
||||
export async function toolsAgentExecute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
this.logger.verbose('Executing Tools Agent');
|
||||
const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0);
|
||||
|
||||
|
@ -185,5 +182,5 @@ export async function toolsAgentExecute(
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -392,6 +392,6 @@ export class OpenAiAssistant implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,6 +189,6 @@ export class ChainRetrievalQa implements INodeType {
|
|||
throw error;
|
||||
}
|
||||
}
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -258,6 +258,6 @@ export class ChainSummarizationV1 implements INodeType {
|
|||
returnData.push({ json: { response } });
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -425,6 +425,6 @@ export class ChainSummarizationV2 implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ export class MemoryChatRetriever implements INodeType {
|
|||
const messages = await memory?.chatHistory.getMessages();
|
||||
|
||||
if (simplifyOutput && messages) {
|
||||
return await this.prepareOutputData(simplifyMessages(messages));
|
||||
return [simplifyMessages(messages)];
|
||||
}
|
||||
|
||||
const serializedMessages =
|
||||
|
@ -107,6 +107,6 @@ export class MemoryChatRetriever implements INodeType {
|
|||
return { json: serializedMessage as unknown as IDataObject };
|
||||
}) ?? [];
|
||||
|
||||
return await this.prepareOutputData(serializedMessages);
|
||||
return [serializedMessages];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { IExecuteFunctions, IWorkflowDataProxyData } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INode, IWorkflowDataProxyData } from 'n8n-workflow';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { normalizeItems } from 'n8n-core';
|
||||
import type { z } from 'zod';
|
||||
|
@ -12,7 +12,7 @@ describe('OutputParserStructured', () => {
|
|||
});
|
||||
const workflowDataProxy = mock<IWorkflowDataProxyData>({ $input: mock() });
|
||||
thisArg.getWorkflowDataProxy.mockReturnValue(workflowDataProxy);
|
||||
thisArg.getNode.mockReturnValue({ typeVersion: 1.1 });
|
||||
thisArg.getNode.mockReturnValue(mock<INode>({ typeVersion: 1.1 }));
|
||||
thisArg.addInputData.mockReturnValue({ index: 0 });
|
||||
thisArg.addOutputData.mockReturnValue();
|
||||
|
||||
|
|
|
@ -108,6 +108,6 @@ export class VectorStoreInMemoryInsert implements INodeType {
|
|||
clearStore,
|
||||
);
|
||||
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
return [serializedDocuments];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,6 +134,6 @@ export class VectorStorePineconeInsert implements INodeType {
|
|||
pineconeIndex,
|
||||
});
|
||||
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
return [serializedDocuments];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export const VectorStoreQdrant = createVectorStoreNode({
|
|||
methods: { listSearch: { qdrantCollectionsSearch } },
|
||||
insertFields,
|
||||
sharedFields,
|
||||
async getVectorStoreClient(context, filter, embeddings, itemIndex) {
|
||||
async getVectorStoreClient(context, _, embeddings, itemIndex) {
|
||||
const collection = context.getNodeParameter('qdrantCollection', itemIndex, '', {
|
||||
extractValue: true,
|
||||
}) as string;
|
||||
|
|
|
@ -122,6 +122,6 @@ export class VectorStoreSupabaseInsert implements INodeType {
|
|||
queryName,
|
||||
});
|
||||
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
return [serializedDocuments];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,6 +139,6 @@ export class VectorStoreZepInsert implements INodeType {
|
|||
|
||||
await ZepVectorStore.fromDocuments(processedDocuments, embeddings, zepConfig);
|
||||
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
return [serializedDocuments];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
|||
void logAiEvent(this, 'n8n.ai.vector.store.searched', { query: prompt });
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(resultData);
|
||||
return [resultData];
|
||||
}
|
||||
|
||||
if (mode === 'insert') {
|
||||
|
@ -270,7 +270,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
|||
}
|
||||
}
|
||||
|
||||
return await this.prepareOutputData(resultData);
|
||||
return [resultData];
|
||||
}
|
||||
|
||||
throw new NodeOperationError(
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ExpressionError } from 'n8n-workflow';
|
|||
|
||||
function buildSecretsValueProxy(value: IDataObject): unknown {
|
||||
return new Proxy(value, {
|
||||
get(target, valueName) {
|
||||
get(_target, valueName) {
|
||||
if (typeof valueName !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export function getSecretsProxy(additionalData: IWorkflowExecuteAdditionalData):
|
|||
return new Proxy(
|
||||
{},
|
||||
{
|
||||
get(target, providerName) {
|
||||
get(_target, providerName) {
|
||||
if (typeof providerName !== 'string') {
|
||||
return {};
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export function getSecretsProxy(additionalData: IWorkflowExecuteAdditionalData):
|
|||
return new Proxy(
|
||||
{},
|
||||
{
|
||||
get(target2, secretName) {
|
||||
get(_target2, secretName) {
|
||||
if (typeof secretName !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import fs from 'node:fs/promises';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { ObjectStoreManager } from '@/BinaryData/ObjectStore.manager';
|
||||
import { ObjectStoreService } from '@/ObjectStore/ObjectStore.service.ee';
|
||||
import { isStream } from '@/ObjectStore/utils';
|
||||
import type { MetadataResponseHeaders } from '@/ObjectStore/types';
|
||||
import { mockInstance, toFileId, toStream } from './utils';
|
||||
|
||||
jest.mock('fs/promises');
|
||||
|
@ -74,11 +76,13 @@ describe('getMetadata()', () => {
|
|||
const mimeType = 'text/plain';
|
||||
const fileName = 'file.txt';
|
||||
|
||||
objectStoreService.getMetadata.mockResolvedValue({
|
||||
'content-length': '1',
|
||||
'content-type': mimeType,
|
||||
'x-amz-meta-filename': fileName,
|
||||
});
|
||||
objectStoreService.getMetadata.mockResolvedValue(
|
||||
mock<MetadataResponseHeaders>({
|
||||
'content-length': '1',
|
||||
'content-type': mimeType,
|
||||
'x-amz-meta-filename': fileName,
|
||||
}),
|
||||
);
|
||||
|
||||
const metadata = await objectStoreManager.getMetadata(fileId);
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ export async function agileCrmApiRequestAllItems(
|
|||
export async function agileCrmApiRequestUpdate(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: IHttpRequestMethods = 'PUT',
|
||||
endpoint?: string,
|
||||
_endpoint?: string,
|
||||
body: any = {},
|
||||
_query: IDataObject = {},
|
||||
uri?: string,
|
||||
|
|
|
@ -14,7 +14,7 @@ export async function clockifyApiRequest(
|
|||
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
_uri?: string,
|
||||
_option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const BASE_URL = 'https://api.clockify.me/api/v1';
|
||||
|
|
|
@ -15,7 +15,7 @@ export async function cloudflareApiRequest(
|
|||
resource: string,
|
||||
body = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
_uri?: string,
|
||||
headers: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const options: IRequestOptions = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { anyNumber, mock } from 'jest-mock-extended';
|
||||
import { NodeVM } from '@n8n/vm2';
|
||||
import type { IExecuteFunctions, IWorkflowDataProxyData } from 'n8n-workflow';
|
||||
import { ApplicationError, NodeHelpers } from 'n8n-workflow';
|
||||
import { ApplicationError } from 'n8n-workflow';
|
||||
import { normalizeItems } from 'n8n-core';
|
||||
import { Code } from '../Code.node';
|
||||
import { ValidationError } from '../ValidationError';
|
||||
|
@ -22,7 +22,6 @@ describe('Code Node unit test', () => {
|
|||
const thisArg = mock<IExecuteFunctions>({
|
||||
getNode: () => mock(),
|
||||
helpers: { normalizeItems },
|
||||
prepareOutputData: NodeHelpers.prepareOutputData,
|
||||
});
|
||||
const workflowDataProxy = mock<IWorkflowDataProxyData>({ $input: mock() });
|
||||
thisArg.getWorkflowDataProxy.mockReturnValue(workflowDataProxy);
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'POST') {
|
||||
return {
|
||||
id: '1168528323006181417',
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'DELETE') {
|
||||
return {
|
||||
id: '1168528323006181417',
|
||||
|
|
|
@ -5,10 +5,11 @@ import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
|||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
|
||||
// TODO: use nock
|
||||
const requestApiSpy = jest.spyOn(transport, 'requestApi');
|
||||
|
||||
requestApiSpy.mockImplementation(
|
||||
async (options: IRequestOptions, credentialType: string, endpoint: string) => {
|
||||
async (_options: IRequestOptions, _credentialType: string, endpoint: string) => {
|
||||
if (endpoint === '/users/@me/guilds') {
|
||||
return {
|
||||
headers: {},
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'GET') {
|
||||
return [
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, _) => {
|
||||
if (method === 'PATCH') {
|
||||
return {
|
||||
id: '1168516240332034067',
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'GET') {
|
||||
return [
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'PUT') {
|
||||
return {
|
||||
success: true,
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'DELETE') {
|
||||
return {
|
||||
success: true,
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'DELETE') {
|
||||
return {
|
||||
success: true,
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'GET') {
|
||||
return {
|
||||
id: '1168777380144369718',
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'GET') {
|
||||
return [
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'PUT') {
|
||||
return {
|
||||
success: true,
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'POST') {
|
||||
return {
|
||||
id: '1168784010269433998',
|
||||
|
|
|
@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
|||
|
||||
const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest');
|
||||
|
||||
discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => {
|
||||
discordApiRequestSpy.mockImplementation(async (method: string) => {
|
||||
if (method === 'POST') {
|
||||
return {
|
||||
id: '1168768986385747999',
|
||||
|
|
|
@ -14,7 +14,7 @@ import moment from 'moment-timezone';
|
|||
|
||||
import * as losslessJSON from 'lossless-json';
|
||||
|
||||
function convertLosslessNumber(key: any, value: any) {
|
||||
function convertLosslessNumber(_: any, value: any) {
|
||||
if (value?.isLosslessNumber) {
|
||||
return value.toString();
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../v2/transport';
|
||||
|
|
|
@ -36,7 +36,7 @@ describe('test GoogleDriveV2: drive create', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with', async () => {
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
name: 'newDrive',
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: drive deleteDrive', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with', async () => {
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
operation: 'deleteDrive',
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: drive get', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with', async () => {
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
operation: 'get',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import nock from 'nock';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
import * as list from '../../../../v2/actions/drive/list.operation';
|
||||
|
||||
|
@ -33,7 +34,7 @@ describe('test GoogleDriveV2: drive list', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with limit', async () => {
|
||||
it('should be called with limit', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
operation: 'list',
|
||||
|
@ -54,7 +55,7 @@ describe('test GoogleDriveV2: drive list', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('shuold be called with returnAll true', async () => {
|
||||
it('should be called with returnAll true', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
operation: 'list',
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: drive update', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with', async () => {
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
operation: 'update',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import nock from 'nock';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
import * as move from '../../../../v2/actions/file/move.operation';
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import nock from 'nock';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
import * as upload from '../../../../v2/actions/file/upload.operation';
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import nock from 'nock';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
import * as search from '../../../../v2/actions/fileFolder/search.operation';
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: folder create', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with', async () => {
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
name: 'testFolder 2',
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: folder deleteFolder', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with PATCH', async () => {
|
||||
it('should be called with PATCH', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
operation: 'deleteFolder',
|
||||
|
@ -52,7 +52,7 @@ describe('test GoogleDriveV2: folder deleteFolder', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('shuold be called with DELETE', async () => {
|
||||
it('should be called with DELETE', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
operation: 'deleteFolder',
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('test GoogleDriveV2: folder share', () => {
|
|||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('shuold be called with', async () => {
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
operation: 'share',
|
||||
|
|
|
@ -477,7 +477,6 @@ export function prepareEmailBody(
|
|||
export async function prepareEmailAttachments(
|
||||
this: IExecuteFunctions,
|
||||
options: IDataObject,
|
||||
items: INodeExecutionData[],
|
||||
itemIndex: number,
|
||||
) {
|
||||
const attachmentsList: IDataObject[] = [];
|
||||
|
@ -536,7 +535,6 @@ export function unescapeSnippets(items: INodeExecutionData[]) {
|
|||
|
||||
export async function replyToEmail(
|
||||
this: IExecuteFunctions,
|
||||
items: INodeExecutionData[],
|
||||
gmailId: string,
|
||||
options: IDataObject,
|
||||
itemIndex: number,
|
||||
|
@ -558,7 +556,6 @@ export async function replyToEmail(
|
|||
attachments = await prepareEmailAttachments.call(
|
||||
this,
|
||||
options.attachmentsUi as IDataObject,
|
||||
items,
|
||||
itemIndex,
|
||||
);
|
||||
if (attachments.length) {
|
||||
|
|
|
@ -325,7 +325,6 @@ export class GmailV2 implements INodeType {
|
|||
attachments = await prepareEmailAttachments.call(
|
||||
this,
|
||||
options.attachmentsUi as IDataObject,
|
||||
items,
|
||||
i,
|
||||
);
|
||||
if (attachments.length) {
|
||||
|
@ -374,7 +373,7 @@ export class GmailV2 implements INodeType {
|
|||
const messageIdGmail = this.getNodeParameter('messageId', i) as string;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
responseData = await replyToEmail.call(this, items, messageIdGmail, options, i);
|
||||
responseData = await replyToEmail.call(this, messageIdGmail, options, i);
|
||||
}
|
||||
if (operation === 'get') {
|
||||
//https://developers.google.com/gmail/api/v1/reference/users/messages/get
|
||||
|
@ -581,7 +580,6 @@ export class GmailV2 implements INodeType {
|
|||
attachments = await prepareEmailAttachments.call(
|
||||
this,
|
||||
options.attachmentsUi as IDataObject,
|
||||
items,
|
||||
i,
|
||||
);
|
||||
if (attachments.length) {
|
||||
|
@ -793,7 +791,7 @@ export class GmailV2 implements INodeType {
|
|||
const messageIdGmail = this.getNodeParameter('messageId', i) as string;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
responseData = await replyToEmail.call(this, items, messageIdGmail, options, i);
|
||||
responseData = await replyToEmail.call(this, messageIdGmail, options, i);
|
||||
}
|
||||
if (operation === 'trash') {
|
||||
//https://developers.google.com/gmail/api/reference/rest/v1/users.threads/trash
|
||||
|
|
|
@ -95,7 +95,7 @@ export async function googleApiRequestAllItems(
|
|||
export function hexToRgb(hex: string) {
|
||||
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
||||
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
||||
hex = hex.replace(shorthandRegex, (m, r, g, b) => {
|
||||
hex = hex.replace(shorthandRegex, (_, r, g, b) => {
|
||||
return r + r + g + g + b + b;
|
||||
});
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ export function getColumnNumber(colPosition: string): number {
|
|||
export function hexToRgb(hex: string) {
|
||||
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
||||
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
||||
hex = hex.replace(shorthandRegex, (m, r, g, b) => {
|
||||
hex = hex.replace(shorthandRegex, (_, r, g, b) => {
|
||||
return r + r + g + g + b + b;
|
||||
});
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ export async function hubspotApiRequest(
|
|||
*/
|
||||
export async function hubspotApiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
propertyName: string,
|
||||
_propertyName: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
|
|
|
@ -12,7 +12,7 @@ import { NodeApiError } from 'n8n-workflow';
|
|||
export async function lineApiRequest(
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions,
|
||||
method: IHttpRequestMethods,
|
||||
resource: string,
|
||||
_resource: string,
|
||||
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
|
|
|
@ -57,7 +57,6 @@ export async function matrixApiRequest(
|
|||
|
||||
export async function handleMatrixCall(
|
||||
this: IExecuteFunctions,
|
||||
item: IDataObject,
|
||||
index: number,
|
||||
resource: string,
|
||||
operation: string,
|
||||
|
|
|
@ -143,7 +143,7 @@ export class Matrix implements INodeType {
|
|||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
try {
|
||||
const responseData = await handleMatrixCall.call(this, items[i], i, resource, operation);
|
||||
const responseData = await handleMatrixCall.call(this, i, resource, operation);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import nock from 'nock';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
|
||||
import nock from 'nock';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import nock from 'nock';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import nock from 'nock';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import nock from 'nock';
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
|
||||
jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
|
|
|
@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => {
|
|||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequestAllItems: jest.fn(async function (method: string) {
|
||||
microsoftApiRequestAllItems: jest.fn(async function () {
|
||||
return [
|
||||
{
|
||||
'@odata.etag': 'W/"CQAAABYAAABZf4De/LkrSqpPI8eyjUmAAAFW3CAj"',
|
||||
|
|
|
@ -7,7 +7,7 @@ import type {
|
|||
IRequestOptions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { BINARY_ENCODING, NodeApiError } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function microsoftApiRequest(
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
|
@ -222,23 +222,3 @@ export async function downloadAttachments(
|
|||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
export async function binaryToAttachments(
|
||||
this: IExecuteFunctions,
|
||||
attachments: IDataObject[],
|
||||
items: INodeExecutionData[],
|
||||
i: number,
|
||||
) {
|
||||
return await Promise.all(
|
||||
attachments.map(async (attachment) => {
|
||||
const binaryPropertyName = attachment.binaryPropertyName as string;
|
||||
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
||||
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||
return {
|
||||
'@odata.type': '#microsoft.graph.fileAttachment',
|
||||
name: binaryData.fileName,
|
||||
contentBytes: dataBuffer.toString(BINARY_ENCODING),
|
||||
};
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -64,12 +64,7 @@ const displayOptions = {
|
|||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
i: number,
|
||||
nodeVersion: number,
|
||||
instanceId: string,
|
||||
) {
|
||||
export async function execute(this: IExecuteFunctions, i: number, instanceId: string) {
|
||||
// https://docs.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http
|
||||
|
||||
const chatId = this.getNodeParameter('chatId', i, '', { extractValue: true }) as string;
|
||||
|
|
|
@ -46,7 +46,6 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
|||
responseData = await chatMessage[microsoftTeamsTypeData.operation].execute.call(
|
||||
this,
|
||||
i,
|
||||
nodeVersion,
|
||||
instanceId,
|
||||
);
|
||||
break;
|
||||
|
|
|
@ -48,6 +48,7 @@ describe('Test MySql V2, runQueries', () => {
|
|||
const pool = createFakePool(fakeConnection);
|
||||
const mockExecuteFns = createMockExecuteFunction({}, mySqlMockNode);
|
||||
|
||||
// @ts-expect-error
|
||||
pool.query = jest.fn(async () => [
|
||||
[[{ finishedAt: '2023-12-30' }], [{ finishedAt: '2023-12-31' }]],
|
||||
]);
|
||||
|
|
|
@ -44,7 +44,10 @@ describe('Peekalink Node', () => {
|
|||
typeVersion: 1,
|
||||
position: [960, 380],
|
||||
credentials: {
|
||||
peekalinkApi: 'token',
|
||||
peekalinkApi: {
|
||||
id: '1',
|
||||
name: 'peekalink',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -113,7 +116,10 @@ describe('Peekalink Node', () => {
|
|||
typeVersion: 1,
|
||||
position: [960, 380],
|
||||
credentials: {
|
||||
peekalinkApi: 'token',
|
||||
peekalinkApi: {
|
||||
id: '1',
|
||||
name: 'peekalink',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
@ -296,12 +296,7 @@ export async function loadResource(this: ILoadOptionsFunctions, resource: string
|
|||
/**
|
||||
* Populate the `Line` property in a request body.
|
||||
*/
|
||||
export function processLines(
|
||||
this: IExecuteFunctions,
|
||||
body: IDataObject,
|
||||
lines: IDataObject[],
|
||||
resource: string,
|
||||
) {
|
||||
export function processLines(this: IExecuteFunctions, lines: IDataObject[], resource: string) {
|
||||
lines.forEach((line) => {
|
||||
if (resource === 'bill') {
|
||||
if (line.DetailType === 'AccountBasedExpenseLineDetail') {
|
||||
|
|
|
@ -263,7 +263,7 @@ export class QuickBooks implements INodeType {
|
|||
},
|
||||
} as IDataObject;
|
||||
|
||||
body.Line = processLines.call(this, body, lines, resource);
|
||||
body.Line = processLines.call(this, lines, resource);
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
|
@ -528,7 +528,7 @@ export class QuickBooks implements INodeType {
|
|||
},
|
||||
} as IDataObject;
|
||||
|
||||
body.Line = processLines.call(this, body, lines, resource);
|
||||
body.Line = processLines.call(this, lines, resource);
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
body = populateFields.call(this, body, additionalFields, resource);
|
||||
|
@ -688,7 +688,7 @@ export class QuickBooks implements INodeType {
|
|||
},
|
||||
} as IDataObject;
|
||||
|
||||
body.Line = processLines.call(this, body, lines, resource);
|
||||
body.Line = processLines.call(this, lines, resource);
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ function endpointCtxExpr(ctx: ICtx, endpoint: string): string {
|
|||
|
||||
return endpoint.replace(
|
||||
/({{ *(access_token|dtable_uuid|server) *}})/g,
|
||||
(match: string, expr: string, name: TEndpointVariableName) => {
|
||||
(match: string, _: string, name: TEndpointVariableName) => {
|
||||
return endpointVariables[name] || match;
|
||||
},
|
||||
);
|
||||
|
@ -228,7 +228,7 @@ export const split = (subject: string): string[] =>
|
|||
normalize(subject)
|
||||
.split(/\s*((?:[^\\,]*?(?:\\[\s\S])*)*?)\s*(?:,|$)/)
|
||||
.filter((s) => s.length)
|
||||
.map((s) => s.replace(/\\([\s\S])/gm, ($0, $1) => $1));
|
||||
.map((s) => s.replace(/\\([\s\S])/gm, (_, $1) => $1));
|
||||
|
||||
export function columnNamesToArray(columnNames: string): string[] {
|
||||
return columnNames ? split(columnNames).filter(nonInternalPredicate).filter(uniquePredicate) : [];
|
||||
|
|
|
@ -21,7 +21,7 @@ export async function execute(
|
|||
conn.execute({
|
||||
sqlText,
|
||||
binds,
|
||||
complete: (error, stmt, rows) => (error ? reject(error) : resolve(rows)),
|
||||
complete: (error, _, rows) => (error ? reject(error) : resolve(rows)),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ export function getFilters(
|
|||
filterTypeDisplayName = 'Filter',
|
||||
filterFixedCollectionDisplayName = 'Filters',
|
||||
|
||||
filterStringDisplayName = 'Filters (String)',
|
||||
mustMatchOptions = [
|
||||
{
|
||||
name: 'Any Filter',
|
||||
|
|
|
@ -74,7 +74,6 @@ export const rowFields: INodeProperties[] = [
|
|||
...getFilters(['row'], ['update'], {
|
||||
includeNoneOption: false,
|
||||
filterTypeDisplayName: 'Select Type',
|
||||
filterStringDisplayName: 'Select Condition (String)',
|
||||
filterFixedCollectionDisplayName: 'Select Conditions',
|
||||
mustMatchOptions: [
|
||||
{
|
||||
|
@ -177,7 +176,6 @@ export const rowFields: INodeProperties[] = [
|
|||
...getFilters(['row'], ['delete'], {
|
||||
includeNoneOption: false,
|
||||
filterTypeDisplayName: 'Select Type',
|
||||
filterStringDisplayName: 'Select Condition (String)',
|
||||
filterFixedCollectionDisplayName: 'Select Conditions',
|
||||
mustMatchOptions: [
|
||||
{
|
||||
|
|
|
@ -29,19 +29,19 @@ export function Eq(field: string, value: any): IQueryObject {
|
|||
return { _field: field, _value: value };
|
||||
}
|
||||
|
||||
export function Gt(field: string, value: any): IQueryObject {
|
||||
export function Gt(_field: string, value: any): IQueryObject {
|
||||
return { _gt: { field: value } };
|
||||
}
|
||||
|
||||
export function Gte(field: string, value: any): IQueryObject {
|
||||
export function Gte(_field: string, value: any): IQueryObject {
|
||||
return { _gte: { field: value } };
|
||||
}
|
||||
|
||||
export function Lt(field: string, value: any): IQueryObject {
|
||||
export function Lt(_field: string, value: any): IQueryObject {
|
||||
return { _lt: { field: value } };
|
||||
}
|
||||
|
||||
export function Lte(field: string, value: any): IQueryObject {
|
||||
export function Lte(_field: string, value: any): IQueryObject {
|
||||
return { _lte: { field: value } };
|
||||
}
|
||||
export function And(...criteria: IQueryObject[]): IQueryObject {
|
||||
|
|
|
@ -76,5 +76,5 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
|||
throw error;
|
||||
}
|
||||
}
|
||||
return await this.prepareOutputData(returnData);
|
||||
return [returnData];
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ export async function uprocApiRequest(
|
|||
method: IHttpRequestMethods,
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
_option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const options: IHttpRequestOptions = {
|
||||
|
|
|
@ -19,7 +19,6 @@ export async function venafiApiRequest(
|
|||
resource: string,
|
||||
body = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
|
|
|
@ -301,7 +301,6 @@ export class VenafiTlsProtectCloud implements INodeType {
|
|||
`/outagedetection/v1/certificates/${certificateId}/contents`,
|
||||
{},
|
||||
qs,
|
||||
undefined,
|
||||
{ encoding: null, json: false, resolveWithFullResponse: true, cert: true },
|
||||
);
|
||||
} else {
|
||||
|
@ -342,7 +341,6 @@ export class VenafiTlsProtectCloud implements INodeType {
|
|||
`/outagedetection/v1/certificates/${certificateId}/keystore`,
|
||||
body,
|
||||
{},
|
||||
undefined,
|
||||
{ encoding: null, json: false, resolveWithFullResponse: true },
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ export async function wufooApiRequest(
|
|||
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const credentials = await this.getCredentials('wufooApi');
|
||||
|
|
|
@ -53,7 +53,7 @@ describe('pgUpdate', () => {
|
|||
},
|
||||
];
|
||||
|
||||
const results = await PostgresFun.pgUpdate(getNodeParam, pgp, db, items);
|
||||
await PostgresFun.pgUpdate(getNodeParam, pgp, db, items);
|
||||
|
||||
expect(db.any).toHaveBeenCalledWith(
|
||||
'update "myschema"."mytable" as t set "id"=v."id","name"=v."name" from (values(1234,\'test\')) as v("id","name") WHERE v."id" = t."id" RETURNING *',
|
||||
|
|
|
@ -290,7 +290,7 @@ describe('AugmentObject', () => {
|
|||
});
|
||||
|
||||
test('should work with complex values on first level', () => {
|
||||
const originalObject = {
|
||||
const originalObject: any = {
|
||||
a: {
|
||||
b: {
|
||||
cc: '3',
|
||||
|
@ -483,7 +483,7 @@ describe('AugmentObject', () => {
|
|||
|
||||
test('should be faster than doing a deepCopy', () => {
|
||||
const iterations = 100;
|
||||
const originalObject: IDataObject = {
|
||||
const originalObject: any = {
|
||||
a: {
|
||||
b: {
|
||||
c: {
|
||||
|
@ -530,7 +530,7 @@ describe('AugmentObject', () => {
|
|||
});
|
||||
|
||||
test('should return property descriptors', () => {
|
||||
const originalObject = {
|
||||
const originalObject: any = {
|
||||
x: {
|
||||
y: {},
|
||||
z: {},
|
||||
|
@ -559,7 +559,7 @@ describe('AugmentObject', () => {
|
|||
});
|
||||
|
||||
test('should return valid values on `has` calls', () => {
|
||||
const originalObject = {
|
||||
const originalObject: any = {
|
||||
x: {
|
||||
y: {},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue