n8n-workflow
Advanced tools
Comparing version 1.14.1 to 1.15.0
export declare const BINARY_ENCODING = "base64"; | ||
export declare const WAIT_TIME_UNLIMITED = "3000-01-01T00:00:00.000Z"; | ||
export declare const LOG_LEVELS: readonly ["silent", "error", "warn", "info", "debug", "verbose"]; | ||
export declare const CODE_LANGUAGES: readonly ["javaScript", "json", "python"]; | ||
@@ -4,0 +5,0 @@ export declare const CODE_EXECUTION_MODES: readonly ["runOnceForAllItems", "runOnceForEachItem"]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FORM_TRIGGER_PATH_IDENTIFIER = exports.CREDENTIAL_EMPTY_VALUE = exports.NODES_WITH_RENAMABLE_CONTENT = exports.CODE_EXECUTION_MODES = exports.CODE_LANGUAGES = exports.WAIT_TIME_UNLIMITED = exports.BINARY_ENCODING = void 0; | ||
exports.FORM_TRIGGER_PATH_IDENTIFIER = exports.CREDENTIAL_EMPTY_VALUE = exports.NODES_WITH_RENAMABLE_CONTENT = exports.CODE_EXECUTION_MODES = exports.CODE_LANGUAGES = exports.LOG_LEVELS = exports.WAIT_TIME_UNLIMITED = exports.BINARY_ENCODING = void 0; | ||
exports.BINARY_ENCODING = 'base64'; | ||
exports.WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z'; | ||
exports.LOG_LEVELS = ['silent', 'error', 'warn', 'info', 'debug', 'verbose']; | ||
exports.CODE_LANGUAGES = ['javaScript', 'json', 'python']; | ||
@@ -7,0 +8,0 @@ exports.CODE_EXECUTION_MODES = ['runOnceForAllItems', 'runOnceForEachItem']; |
import * as tmpl from '@n8n_io/riot-tmpl'; | ||
import type { IDataObject, IExecuteData, INode, INodeExecutionData, INodeParameterResourceLocator, INodeParameters, IRunExecutionData, IWorkflowDataProxyAdditionalKeys, NodeParameterValue, NodeParameterValueType, WorkflowExecuteMode } from './Interfaces'; | ||
import { ExpressionError } from './ExpressionError'; | ||
import type { Workflow } from './Workflow'; | ||
export declare const isSyntaxError: (error: unknown) => error is SyntaxError; | ||
export declare const isExpressionError: (error: unknown) => error is ExpressionError; | ||
export declare const isTypeError: (error: unknown) => error is TypeError; | ||
export declare class Expression { | ||
workflow: Workflow; | ||
private readonly workflow; | ||
constructor(workflow: Workflow); | ||
static resolveWithoutWorkflow(expression: string, data?: IDataObject): tmpl.ReturnValue; | ||
convertObjectValueToString(value: object): string; | ||
resolveSimpleParameterValue(parameterValue: NodeParameterValue, siblingParameters: INodeParameters, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, timezone: string, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, returnObjectAsString?: boolean, selfData?: {}, contextNodeName?: string): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[]; | ||
resolveSimpleParameterValue(parameterValue: NodeParameterValue, siblingParameters: INodeParameters, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, returnObjectAsString?: boolean, selfData?: {}, contextNodeName?: string): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[]; | ||
private renderExpression; | ||
getSimpleParameterValue(node: INode, parameterValue: string | boolean | undefined, mode: WorkflowExecuteMode, timezone: string, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, defaultValue?: boolean | number | string | unknown[]): boolean | number | string | undefined | unknown[]; | ||
getComplexParameterValue(node: INode, parameterValue: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[], mode: WorkflowExecuteMode, timezone: string, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, defaultValue?: NodeParameterValueType | undefined, selfData?: {}): NodeParameterValueType | undefined; | ||
getParameterValue(parameterValue: NodeParameterValueType | INodeParameterResourceLocator, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, timezone: string, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, returnObjectAsString?: boolean, selfData?: {}, contextNodeName?: string): NodeParameterValueType; | ||
getSimpleParameterValue(node: INode, parameterValue: string | boolean | undefined, mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, defaultValue?: boolean | number | string | unknown[]): boolean | number | string | undefined | unknown[]; | ||
getComplexParameterValue(node: INode, parameterValue: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[], mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, defaultValue?: NodeParameterValueType | undefined, selfData?: {}): NodeParameterValueType | undefined; | ||
getParameterValue(parameterValue: NodeParameterValueType | INodeParameterResourceLocator, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, returnObjectAsString?: boolean, selfData?: {}, contextNodeName?: string): NodeParameterValueType; | ||
} |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Expression = exports.isTypeError = exports.isExpressionError = exports.isSyntaxError = void 0; | ||
exports.Expression = void 0; | ||
const luxon_1 = require("luxon"); | ||
@@ -36,2 +36,3 @@ const tmpl = __importStar(require("@n8n_io/riot-tmpl")); | ||
const ExpressionEvaluatorProxy_1 = require("./ExpressionEvaluatorProxy"); | ||
const GlobalState_1 = require("./GlobalState"); | ||
const IS_FRONTEND_IN_DEV_MODE = typeof process === 'object' && | ||
@@ -43,9 +44,6 @@ Object.keys(process).length === 1 && | ||
const isSyntaxError = (error) => error instanceof SyntaxError || (error instanceof Error && error.name === 'SyntaxError'); | ||
exports.isSyntaxError = isSyntaxError; | ||
const isExpressionError = (error) => error instanceof ExpressionError_1.ExpressionError || error instanceof ExpressionError_1.ExpressionExtensionError; | ||
exports.isExpressionError = isExpressionError; | ||
const isTypeError = (error) => error instanceof TypeError || (error instanceof Error && error.name === 'TypeError'); | ||
exports.isTypeError = isTypeError; | ||
(0, ExpressionEvaluatorProxy_1.setErrorHandler)((error) => { | ||
if ((0, exports.isExpressionError)(error)) | ||
if (isExpressionError(error)) | ||
throw error; | ||
@@ -77,3 +75,3 @@ }); | ||
result = luxon_1.DateTime.fromJSDate(value, { | ||
zone: (_b = (_a = this.workflow.settings) === null || _a === void 0 ? void 0 : _a.timezone) !== null && _b !== void 0 ? _b : 'default', | ||
zone: (_b = (_a = this.workflow.settings) === null || _a === void 0 ? void 0 : _a.timezone) !== null && _b !== void 0 ? _b : (0, GlobalState_1.getGlobalState)().defaultTimezone, | ||
}).toISO(); | ||
@@ -89,3 +87,3 @@ } | ||
} | ||
resolveSimpleParameterValue(parameterValue, siblingParameters, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, timezone, additionalKeys, executeData, returnObjectAsString = false, selfData = {}, contextNodeName) { | ||
resolveSimpleParameterValue(parameterValue, siblingParameters, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, additionalKeys, executeData, returnObjectAsString = false, selfData = {}, contextNodeName) { | ||
if (typeof parameterValue !== 'string' || parameterValue.charAt(0) !== '=') { | ||
@@ -95,3 +93,3 @@ return parameterValue; | ||
parameterValue = parameterValue.substr(1); | ||
const dataProxy = new WorkflowDataProxy_1.WorkflowDataProxy(this.workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, timezone, additionalKeys, executeData, -1, selfData, contextNodeName); | ||
const dataProxy = new WorkflowDataProxy_1.WorkflowDataProxy(this.workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, additionalKeys, executeData, -1, selfData, contextNodeName); | ||
const data = dataProxy.getDataProxy(); | ||
@@ -228,7 +226,7 @@ data.process = | ||
catch (error) { | ||
if ((0, exports.isExpressionError)(error)) | ||
if (isExpressionError(error)) | ||
throw error; | ||
if ((0, exports.isSyntaxError)(error)) | ||
if (isSyntaxError(error)) | ||
throw new Error('invalid syntax'); | ||
if ((0, exports.isTypeError)(error) && IS_FRONTEND && error.message.endsWith('is not a function')) { | ||
if (isTypeError(error) && IS_FRONTEND && error.message.endsWith('is not a function')) { | ||
const match = error.message.match(/(?<msg>[^.]+is not a function)/); | ||
@@ -248,3 +246,3 @@ if (!((_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.msg)) | ||
} | ||
getSimpleParameterValue(node, parameterValue, mode, timezone, additionalKeys, executeData, defaultValue) { | ||
getSimpleParameterValue(node, parameterValue, mode, additionalKeys, executeData, defaultValue) { | ||
if (parameterValue === undefined) { | ||
@@ -261,5 +259,5 @@ return defaultValue; | ||
}; | ||
return this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData, mode, timezone, additionalKeys, executeData); | ||
return this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData, mode, additionalKeys, executeData); | ||
} | ||
getComplexParameterValue(node, parameterValue, mode, timezone, additionalKeys, executeData, defaultValue = undefined, selfData = {}) { | ||
getComplexParameterValue(node, parameterValue, mode, additionalKeys, executeData, defaultValue = undefined, selfData = {}) { | ||
if (parameterValue === undefined) { | ||
@@ -276,6 +274,6 @@ return defaultValue; | ||
}; | ||
const returnData = this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData, mode, timezone, additionalKeys, executeData, false, selfData); | ||
return this.getParameterValue(returnData, runData, runIndex, itemIndex, node.name, connectionInputData, mode, timezone, additionalKeys, executeData, false, selfData); | ||
const returnData = this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData, mode, additionalKeys, executeData, false, selfData); | ||
return this.getParameterValue(returnData, runData, runIndex, itemIndex, node.name, connectionInputData, mode, additionalKeys, executeData, false, selfData); | ||
} | ||
getParameterValue(parameterValue, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, timezone, additionalKeys, executeData, returnObjectAsString = false, selfData = {}, contextNodeName) { | ||
getParameterValue(parameterValue, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, additionalKeys, executeData, returnObjectAsString = false, selfData = {}, contextNodeName) { | ||
const isComplexParameter = (value) => { | ||
@@ -286,8 +284,8 @@ return typeof value === 'object'; | ||
if (isComplexParameter(value)) { | ||
return this.getParameterValue(value, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, timezone, additionalKeys, executeData, returnObjectAsString, selfData, contextNodeName); | ||
return this.getParameterValue(value, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, additionalKeys, executeData, returnObjectAsString, selfData, contextNodeName); | ||
} | ||
return this.resolveSimpleParameterValue(value, siblingParameters, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, timezone, additionalKeys, executeData, returnObjectAsString, selfData, contextNodeName); | ||
return this.resolveSimpleParameterValue(value, siblingParameters, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, additionalKeys, executeData, returnObjectAsString, selfData, contextNodeName); | ||
}; | ||
if (!isComplexParameter(parameterValue)) { | ||
return this.resolveSimpleParameterValue(parameterValue, {}, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, timezone, additionalKeys, executeData, returnObjectAsString, selfData, contextNodeName); | ||
return this.resolveSimpleParameterValue(parameterValue, {}, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, additionalKeys, executeData, returnObjectAsString, selfData, contextNodeName); | ||
} | ||
@@ -294,0 +292,0 @@ if (Array.isArray(parameterValue)) { |
@@ -13,2 +13,3 @@ /// <reference types="node" /> | ||
export * from './DeferredPromise'; | ||
export * from './GlobalState'; | ||
export * from './Interfaces'; | ||
@@ -15,0 +16,0 @@ export * from './MessageEventBus'; |
@@ -44,2 +44,3 @@ "use strict"; | ||
__exportStar(require("./DeferredPromise"), exports); | ||
__exportStar(require("./GlobalState"), exports); | ||
__exportStar(require("./Interfaces"), exports); | ||
@@ -46,0 +47,0 @@ __exportStar(require("./MessageEventBus"), exports); |
@@ -15,3 +15,3 @@ /// <reference types="node" /> | ||
import type { AuthenticationMethod } from './Authentication'; | ||
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES } from './Constants'; | ||
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES, LOG_LEVELS } from './Constants'; | ||
import type { IDeferredPromise } from './DeferredPromise'; | ||
@@ -135,6 +135,6 @@ import type { ExecutionStatus } from './ExecutionStatus'; | ||
abstract getParentTypes(name: string): string[]; | ||
abstract authenticate(credentials: ICredentialDataDecryptedObject, typeName: string, requestOptions: IHttpRequestOptions | IRequestOptionsSimplified, workflow: Workflow, node: INode, defaultTimezone: string): Promise<IHttpRequestOptions>; | ||
abstract authenticate(credentials: ICredentialDataDecryptedObject, typeName: string, requestOptions: IHttpRequestOptions | IRequestOptionsSimplified, workflow: Workflow, node: INode): Promise<IHttpRequestOptions>; | ||
abstract preAuthentication(helpers: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject, typeName: string, node: INode, credentialsExpired: boolean): Promise<ICredentialDataDecryptedObject | undefined>; | ||
abstract getCredentials(nodeCredentials: INodeCredentialsDetails, type: string): Promise<ICredentials>; | ||
abstract getDecrypted(additionalData: IWorkflowExecuteAdditionalData, nodeCredentials: INodeCredentialsDetails, type: string, mode: WorkflowExecuteMode, defaultTimezone: string, raw?: boolean, expressionResolveValues?: ICredentialsExpressionResolveValues): Promise<ICredentialDataDecryptedObject>; | ||
abstract getDecrypted(additionalData: IWorkflowExecuteAdditionalData, nodeCredentials: INodeCredentialsDetails, type: string, mode: WorkflowExecuteMode, raw?: boolean, expressionResolveValues?: ICredentialsExpressionResolveValues): Promise<ICredentialDataDecryptedObject>; | ||
abstract updateCredentials(nodeCredentials: INodeCredentialsDetails, type: string, data: ICredentialDataDecryptedObject): Promise<void>; | ||
@@ -320,5 +320,12 @@ } | ||
} | ||
export interface PaginationOptions { | ||
binaryResult?: boolean; | ||
continue: boolean | string; | ||
request: IRequestOptionsSimplifiedAuth; | ||
maxRequests?: number; | ||
} | ||
export type IN8nHttpResponse = IDataObject | Buffer | GenericValue | GenericValue[] | null; | ||
export interface IN8nHttpFullResponse { | ||
body: IN8nHttpResponse | Readable; | ||
__bodyResolved?: boolean; | ||
headers: IDataObject; | ||
@@ -426,2 +433,3 @@ statusCode: number; | ||
httpRequestWithAuthentication(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions, additionalCredentialOptions?: IAdditionalCredentialOptions): Promise<any>; | ||
requestWithAuthenticationPaginated(this: IAllExecuteFunctions, requestOptions: OptionsWithUri, itemIndex: number, paginationOptions: PaginationOptions, credentialsType?: string, additionalCredentialOptions?: IAdditionalCredentialOptions): Promise<any[]>; | ||
requestOAuth1(this: IAllExecuteFunctions, credentialsType: string, requestOptions: OptionsWithUrl | RequestPromiseOptions): Promise<any>; | ||
@@ -431,3 +439,3 @@ requestOAuth2(this: IAllExecuteFunctions, credentialsType: string, requestOptions: OptionsWithUri | RequestPromiseOptions, oAuth2Options?: IOAuth2Options): Promise<any>; | ||
export interface FunctionsBase { | ||
logger: ILogger; | ||
logger: Logger; | ||
getCredentials(type: string, itemIndex?: number): Promise<ICredentialDataDecryptedObject>; | ||
@@ -449,6 +457,7 @@ getExecutionId(): string; | ||
}; | ||
export type ContextType = 'flow' | 'node'; | ||
type BaseExecutionFunctions = FunctionsBaseWithRequiredKeys<'getMode'> & { | ||
continueOnFail(): boolean; | ||
evaluateExpression(expression: string, itemIndex: number): NodeParameterValueType; | ||
getContext(type: string): IContextObject; | ||
getContext(type: ContextType): IContextObject; | ||
getExecuteData(): IExecuteData; | ||
@@ -538,2 +547,3 @@ getWorkflowDataProxy(itemIndex: number): IWorkflowDataProxyData; | ||
} | ||
export type OnError = 'continueErrorOutput' | 'continueRegularOutput' | 'stopWorkflow'; | ||
export interface INode { | ||
@@ -553,2 +563,3 @@ id: string; | ||
executeOnce?: boolean; | ||
onError?: OnError; | ||
continueOnFail?: boolean; | ||
@@ -985,2 +996,3 @@ parameters: INodeParameters; | ||
export interface INodeOutputConfiguration { | ||
category?: string; | ||
displayName?: string; | ||
@@ -1085,2 +1097,3 @@ required?: boolean; | ||
$today: any; | ||
$getPairedItem: (destinationNodeName: string, incomingSourceData: ISourceData | null, pairedItem: IPairedItemData) => INodeExecutionData | null; | ||
constructor: any; | ||
@@ -1243,3 +1256,2 @@ } | ||
sendDataToUI?: (type: string, data: IDataObject | IDataObject[]) => void; | ||
timezone: string; | ||
webhookBaseUrl: string; | ||
@@ -1300,11 +1312,4 @@ webhookWaitingBaseUrl: string; | ||
} | ||
export type LogTypes = 'debug' | 'verbose' | 'info' | 'warn' | 'error'; | ||
export interface ILogger { | ||
log: (type: LogTypes, message: string, meta?: object) => void; | ||
debug: (message: string, meta?: object) => void; | ||
verbose: (message: string, meta?: object) => void; | ||
info: (message: string, meta?: object) => void; | ||
warn: (message: string, meta?: object) => void; | ||
error: (message: string, meta?: object) => void; | ||
} | ||
export type LogLevel = (typeof LOG_LEVELS)[number]; | ||
export type Logger = Record<Exclude<LogLevel, 'silent'>, (message: string, meta?: object) => void>; | ||
export interface IStatusCodeMessages { | ||
@@ -1541,3 +1546,2 @@ [key: string]: string; | ||
} | ||
export type ILogLevel = 'info' | 'debug' | 'warn' | 'error' | 'verbose' | 'silent'; | ||
export type ExpressionEvaluatorType = 'tmpl' | 'tournament'; | ||
@@ -1592,3 +1596,3 @@ export interface IN8nUISettings { | ||
workflowTagsDisabled: boolean; | ||
logLevel: ILogLevel; | ||
logLevel: LogLevel; | ||
hiringBannerEnabled: boolean; | ||
@@ -1595,0 +1599,0 @@ templates: { |
@@ -1,9 +0,7 @@ | ||
import type { ILogger, LogTypes } from './Interfaces'; | ||
export declare function init<L extends ILogger>(loggerInstance: L): L; | ||
export declare function getInstance(): ILogger; | ||
export declare function log(type: LogTypes, message: string, meta?: object): void; | ||
export declare function debug(message: string, meta?: object): void; | ||
export declare function info(message: string, meta?: object): void; | ||
export declare function error(message: string, meta?: object): void; | ||
export declare function verbose(message: string, meta?: object): void; | ||
export declare function warn(message: string, meta?: object): void; | ||
import type { Logger } from './Interfaces'; | ||
export declare let error: Logger['error']; | ||
export declare let warn: Logger['warn']; | ||
export declare let info: Logger['info']; | ||
export declare let debug: Logger['debug']; | ||
export declare let verbose: Logger['verbose']; | ||
export declare const init: (logger: Logger) => void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.warn = exports.verbose = exports.error = exports.info = exports.debug = exports.log = exports.getInstance = exports.init = void 0; | ||
let logger; | ||
function init(loggerInstance) { | ||
logger = loggerInstance; | ||
return loggerInstance; | ||
} | ||
exports.init = exports.verbose = exports.debug = exports.info = exports.warn = exports.error = void 0; | ||
const noOp = () => { }; | ||
exports.error = noOp; | ||
exports.warn = noOp; | ||
exports.info = noOp; | ||
exports.debug = noOp; | ||
exports.verbose = noOp; | ||
const init = (logger) => { | ||
exports.error = (message, meta) => logger.error(message, meta); | ||
exports.warn = (message, meta) => logger.warn(message, meta); | ||
exports.info = (message, meta) => logger.info(message, meta); | ||
exports.debug = (message, meta) => logger.debug(message, meta); | ||
exports.verbose = (message, meta) => logger.verbose(message, meta); | ||
}; | ||
exports.init = init; | ||
function getInstance() { | ||
if (logger === undefined) { | ||
throw new Error('LoggerProxy not initialized'); | ||
} | ||
return logger; | ||
} | ||
exports.getInstance = getInstance; | ||
function log(type, message, meta = {}) { | ||
getInstance().log(type, message, meta); | ||
} | ||
exports.log = log; | ||
function debug(message, meta = {}) { | ||
getInstance().debug(message, meta); | ||
} | ||
exports.debug = debug; | ||
function info(message, meta = {}) { | ||
getInstance().info(message, meta); | ||
} | ||
exports.info = info; | ||
function error(message, meta = {}) { | ||
getInstance().error(message, meta); | ||
} | ||
exports.error = error; | ||
function verbose(message, meta = {}) { | ||
getInstance().verbose(message, meta); | ||
} | ||
exports.verbose = verbose; | ||
function warn(message, meta = {}) { | ||
getInstance().warn(message, meta); | ||
} | ||
exports.warn = warn; | ||
//# sourceMappingURL=LoggerProxy.js.map |
@@ -585,3 +585,3 @@ "use strict"; | ||
} | ||
let nodeWebhookPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.path, mode, additionalData.timezone, {}); | ||
let nodeWebhookPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.path, mode, {}); | ||
if (nodeWebhookPath === undefined) { | ||
@@ -598,6 +598,6 @@ console.error(`No webhook path could be found for node "${node.name}" in workflow "${workflowId}".`); | ||
} | ||
const isFullPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.isFullPath, 'internal', additionalData.timezone, {}, undefined, false); | ||
const restartWebhook = workflow.expression.getSimpleParameterValue(node, webhookDescription.restartWebhook, 'internal', additionalData.timezone, {}, undefined, false); | ||
const isFullPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.isFullPath, 'internal', {}, undefined, false); | ||
const restartWebhook = workflow.expression.getSimpleParameterValue(node, webhookDescription.restartWebhook, 'internal', {}, undefined, false); | ||
const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath, isFullPath, restartWebhook); | ||
const httpMethod = workflow.expression.getSimpleParameterValue(node, webhookDescription.httpMethod, mode, additionalData.timezone, {}, undefined, 'GET'); | ||
const httpMethod = workflow.expression.getSimpleParameterValue(node, webhookDescription.httpMethod, mode, {}, undefined, 'GET'); | ||
if (httpMethod === undefined) { | ||
@@ -667,3 +667,3 @@ console.error(`The webhook "${path}" for node "${node.name}" in workflow "${workflowId}" could not be added because the httpMethod is not defined.`); | ||
try { | ||
return (workflow.expression.getSimpleParameterValue(node, nodeTypeData.inputs, 'internal', '', {}) || []); | ||
return (workflow.expression.getSimpleParameterValue(node, nodeTypeData.inputs, 'internal', {}) || []); | ||
} | ||
@@ -676,11 +676,34 @@ catch (e) { | ||
function getNodeOutputs(workflow, node, nodeTypeData) { | ||
let outputs = []; | ||
if (Array.isArray(nodeTypeData.outputs)) { | ||
return nodeTypeData.outputs; | ||
outputs = nodeTypeData.outputs; | ||
} | ||
try { | ||
return (workflow.expression.getSimpleParameterValue(node, nodeTypeData.outputs, 'internal', '', {}) || []); | ||
else { | ||
try { | ||
outputs = (workflow.expression.getSimpleParameterValue(node, nodeTypeData.outputs, 'internal', {}) || []); | ||
} | ||
catch (e) { | ||
throw new Error(`Could not calculate outputs dynamically for node "${node.name}"`); | ||
} | ||
} | ||
catch (e) { | ||
throw new Error(`Could not calculate outputs dynamically for node "${node.name}"`); | ||
if (node.onError === 'continueErrorOutput') { | ||
outputs = (0, utils_1.deepCopy)(outputs); | ||
if (outputs.length === 1) { | ||
if (typeof outputs[0] === 'string') { | ||
outputs[0] = { | ||
type: outputs[0], | ||
}; | ||
} | ||
outputs[0].displayName = 'Success'; | ||
} | ||
return [ | ||
...outputs, | ||
{ | ||
category: 'error', | ||
type: 'main', | ||
displayName: 'Error', | ||
}, | ||
]; | ||
} | ||
return outputs; | ||
} | ||
@@ -687,0 +710,0 @@ exports.getNodeOutputs = getNodeOutputs; |
@@ -73,4 +73,5 @@ "use strict"; | ||
for (let i = 0; i < items.length; i++) { | ||
let thisArgs; | ||
try { | ||
const thisArgs = nodeExecuteFunctions.getExecuteSingleFunctions(this.workflow, this.runExecutionData, runIndex, this.connectionInputData, inputData, this.node, i, this.additionalData, executeData, this.mode); | ||
thisArgs = nodeExecuteFunctions.getExecuteSingleFunctions(this.workflow, this.runExecutionData, runIndex, this.connectionInputData, inputData, this.node, i, this.additionalData, executeData, this.mode); | ||
const requestData = { | ||
@@ -109,14 +110,17 @@ options: { | ||
catch (error) { | ||
if ((0, get_1.default)(this.node, 'continueOnFail', false)) { | ||
returnData.push({ json: {}, error: error.message }); | ||
if (thisArgs !== undefined && thisArgs.continueOnFail()) { | ||
returnData.push({ json: {}, error: error }); | ||
continue; | ||
} | ||
let routingError = error; | ||
if (error instanceof NodeErrors_1.NodeApiError) | ||
error = error.cause; | ||
routingError = error.cause; | ||
throw new NodeErrors_1.NodeApiError(this.node, error, { | ||
runIndex, | ||
itemIndex: i, | ||
message: error === null || error === void 0 ? void 0 : error.message, | ||
description: error === null || error === void 0 ? void 0 : error.description, | ||
httpCode: error.isAxiosError && error.response && String((_c = error.response) === null || _c === void 0 ? void 0 : _c.status), | ||
message: routingError === null || routingError === void 0 ? void 0 : routingError.message, | ||
description: routingError === null || routingError === void 0 ? void 0 : routingError.description, | ||
httpCode: routingError.isAxiosError && routingError.response | ||
? String((_c = routingError.response) === null || _c === void 0 ? void 0 : _c.status) | ||
: 'none', | ||
}); | ||
@@ -372,3 +376,3 @@ } | ||
(typeof parameterValue === 'string' && parameterValue.charAt(0) === '=')) { | ||
return this.workflow.expression.getParameterValue(parameterValue, (_a = this.runExecutionData) !== null && _a !== void 0 ? _a : null, runIndex, itemIndex, this.node.name, this.connectionInputData, this.mode, this.additionalData.timezone, additionalKeys !== null && additionalKeys !== void 0 ? additionalKeys : {}, executeData, returnObjectAsString); | ||
return this.workflow.expression.getParameterValue(parameterValue, (_a = this.runExecutionData) !== null && _a !== void 0 ? _a : null, runIndex, itemIndex, this.node.name, this.connectionInputData, this.mode, additionalKeys !== null && additionalKeys !== void 0 ? additionalKeys : {}, executeData, returnObjectAsString); | ||
} | ||
@@ -375,0 +379,0 @@ return parameterValue; |
@@ -1,2 +0,2 @@ | ||
import type { IExecuteData, INodeExecutionData, INodeParameters, IRunExecutionData, IWorkflowDataProxyAdditionalKeys, IWorkflowDataProxyData, INodeParameterResourceLocator, WorkflowExecuteMode } from './Interfaces'; | ||
import type { IDataObject, IExecuteData, INodeExecutionData, INodeParameters, IRunExecutionData, IWorkflowDataProxyAdditionalKeys, IWorkflowDataProxyData, INodeParameterResourceLocator, WorkflowExecuteMode } from './Interfaces'; | ||
import type { Workflow } from './Workflow'; | ||
@@ -6,17 +6,16 @@ export declare function isResourceLocatorValue(value: unknown): value is INodeParameterResourceLocator; | ||
private workflow; | ||
private runExecutionData; | ||
private defaultReturnRunIndex; | ||
private runIndex; | ||
private itemIndex; | ||
private activeNodeName; | ||
private contextNodeName; | ||
private connectionInputData; | ||
private siblingParameters; | ||
private mode; | ||
private additionalKeys; | ||
private executeData?; | ||
private defaultReturnRunIndex; | ||
private selfData; | ||
private additionalKeys; | ||
private executeData; | ||
private defaultTimezone; | ||
private contextNodeName; | ||
private runExecutionData; | ||
private connectionInputData; | ||
private timezone; | ||
constructor(workflow: Workflow, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], siblingParameters: INodeParameters, mode: WorkflowExecuteMode, defaultTimezone: string, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, defaultReturnRunIndex?: number, selfData?: {}, contextNodeName?: string); | ||
constructor(workflow: Workflow, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], siblingParameters: INodeParameters, mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData | undefined, defaultReturnRunIndex?: number, selfData?: IDataObject, contextNodeName?: string); | ||
private nodeContextGetter; | ||
@@ -23,0 +22,0 @@ private selfGetter; |
@@ -33,2 +33,3 @@ "use strict"; | ||
const utils_1 = require("./utils"); | ||
const GlobalState_1 = require("./GlobalState"); | ||
function isResourceLocatorValue(value) { | ||
@@ -48,7 +49,15 @@ return Boolean(typeof value === 'object' && value && 'mode' in value && 'value' in value && '__rl' in value); | ||
class WorkflowDataProxy { | ||
constructor(workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, defaultTimezone, additionalKeys, executeData, defaultReturnRunIndex = -1, selfData = {}, contextNodeName) { | ||
constructor(workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, additionalKeys, executeData, defaultReturnRunIndex = -1, selfData = {}, contextNodeName = activeNodeName) { | ||
var _a, _b; | ||
this.workflow = workflow; | ||
this.runIndex = runIndex; | ||
this.itemIndex = itemIndex; | ||
this.activeNodeName = activeNodeName; | ||
this.contextNodeName = contextNodeName || activeNodeName; | ||
this.workflow = workflow; | ||
this.siblingParameters = siblingParameters; | ||
this.mode = mode; | ||
this.additionalKeys = additionalKeys; | ||
this.executeData = executeData; | ||
this.defaultReturnRunIndex = defaultReturnRunIndex; | ||
this.selfData = selfData; | ||
this.contextNodeName = contextNodeName; | ||
this.runExecutionData = isScriptingNode(this.contextNodeName, workflow) | ||
@@ -62,12 +71,3 @@ ? runExecutionData !== null | ||
: connectionInputData; | ||
this.defaultReturnRunIndex = defaultReturnRunIndex; | ||
this.runIndex = runIndex; | ||
this.itemIndex = itemIndex; | ||
this.siblingParameters = siblingParameters; | ||
this.mode = mode; | ||
this.defaultTimezone = defaultTimezone; | ||
this.timezone = (_b = (_a = workflow.settings) === null || _a === void 0 ? void 0 : _a.timezone) !== null && _b !== void 0 ? _b : defaultTimezone; | ||
this.selfData = selfData; | ||
this.additionalKeys = additionalKeys; | ||
this.executeData = executeData; | ||
this.timezone = (_b = (_a = workflow.settings) === null || _a === void 0 ? void 0 : _a.timezone) !== null && _b !== void 0 ? _b : (0, GlobalState_1.getGlobalState)().defaultTimezone; | ||
luxon_1.Settings.defaultZone = this.timezone; | ||
@@ -178,3 +178,3 @@ } | ||
if (typeof returnValue === 'string' && returnValue.charAt(0) === '=') { | ||
return that.workflow.expression.getParameterValue(returnValue, that.runExecutionData, that.runIndex, that.itemIndex, that.activeNodeName, that.connectionInputData, that.mode, that.timezone, that.additionalKeys, that.executeData, false, {}, that.contextNodeName); | ||
return that.workflow.expression.getParameterValue(returnValue, that.runExecutionData, that.runIndex, that.itemIndex, that.activeNodeName, that.connectionInputData, that.mode, that.additionalKeys, that.executeData, false, {}, that.contextNodeName); | ||
} | ||
@@ -856,7 +856,7 @@ return returnValue; | ||
itemIndex = itemIndex || that.itemIndex; | ||
return that.workflow.expression.getParameterValue(`=${expression}`, that.runExecutionData, that.runIndex, itemIndex, that.activeNodeName, that.connectionInputData, that.mode, that.timezone, that.additionalKeys, that.executeData, false, {}, that.contextNodeName); | ||
return that.workflow.expression.getParameterValue(`=${expression}`, that.runExecutionData, that.runIndex, itemIndex, that.activeNodeName, that.connectionInputData, that.mode, that.additionalKeys, that.executeData, false, {}, that.contextNodeName); | ||
}, | ||
$item: (itemIndex, runIndex) => { | ||
const defaultReturnRunIndex = runIndex === undefined ? -1 : runIndex; | ||
const dataProxy = new WorkflowDataProxy(this.workflow, this.runExecutionData, this.runIndex, itemIndex, this.activeNodeName, this.connectionInputData, that.siblingParameters, that.mode, that.defaultTimezone, that.additionalKeys, that.executeData, defaultReturnRunIndex, that.contextNodeName); | ||
const dataProxy = new WorkflowDataProxy(this.workflow, this.runExecutionData, this.runIndex, itemIndex, this.activeNodeName, this.connectionInputData, that.siblingParameters, that.mode, that.additionalKeys, that.executeData, defaultReturnRunIndex, {}, that.contextNodeName); | ||
return dataProxy.getDataProxy(); | ||
@@ -897,2 +897,3 @@ }, | ||
...that.additionalKeys, | ||
$getPairedItem: getPairedItem, | ||
$jmespath: jmespathWrapper, | ||
@@ -899,0 +900,0 @@ $position: this.itemIndex, |
@@ -8,2 +8,3 @@ "use strict"; | ||
super(message, { cause: undefined }); | ||
this.severity = 'warning'; | ||
this.name = this.constructor.name; | ||
@@ -10,0 +11,0 @@ this.node = node; |
{ | ||
"name": "n8n-workflow", | ||
"version": "1.14.1", | ||
"version": "1.15.0", | ||
"description": "Workflow base code of n8n", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
714292
136
9754