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