n8n-nodes-base 0.225.0 → 0.226.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/AirtableApi.credentials.js +6 -0
- package/dist/credentials/AirtableApi.credentials.js.map +1 -1
- package/dist/credentials/AirtableTokenApi.credentials.d.ts +9 -0
- package/dist/credentials/AirtableTokenApi.credentials.js +34 -0
- package/dist/credentials/AirtableTokenApi.credentials.js.map +1 -0
- package/dist/credentials/JotFormApi.credentials.js +4 -0
- package/dist/credentials/JotFormApi.credentials.js.map +1 -1
- package/dist/credentials/NpmApi.credentials.d.ts +9 -0
- package/dist/credentials/NpmApi.credentials.js +41 -0
- package/dist/credentials/NpmApi.credentials.js.map +1 -0
- package/dist/credentials/SshPrivateKey.credentials.js +1 -1
- package/dist/credentials/SshPrivateKey.credentials.js.map +1 -1
- package/dist/known/credentials.json +21 -3
- package/dist/known/nodes.json +4 -0
- package/dist/methods/defined.json +4 -1
- package/dist/methods/referenced.json +4 -1
- package/dist/nodes/Airtable/Airtable.node.js +36 -3
- package/dist/nodes/Airtable/Airtable.node.js.map +1 -1
- package/dist/nodes/Airtable/AirtableTrigger.node.js +31 -1
- package/dist/nodes/Airtable/AirtableTrigger.node.js.map +1 -1
- package/dist/nodes/Airtable/GenericFunctions.js +2 -1
- package/dist/nodes/Airtable/GenericFunctions.js.map +1 -1
- package/dist/nodes/Aws/Rekognition/AwsRekognition.node.js +35 -35
- package/dist/nodes/Aws/Rekognition/AwsRekognition.node.js.map +1 -1
- package/dist/nodes/Aws/Rekognition/test/AwsRekognitionTestWorkflow.json +344 -0
- package/dist/nodes/Code/Code.node.js +59 -35
- package/dist/nodes/Code/Code.node.js.map +1 -1
- package/dist/nodes/Code/Code.node.json +1 -1
- package/dist/nodes/Code/JavaScriptSandbox.d.ts +11 -0
- package/dist/nodes/Code/JavaScriptSandbox.js +81 -0
- package/dist/nodes/Code/JavaScriptSandbox.js.map +1 -0
- package/dist/nodes/Code/Pyodide.d.ts +2 -0
- package/dist/nodes/Code/Pyodide.js +47 -0
- package/dist/nodes/Code/Pyodide.js.map +1 -0
- package/dist/nodes/Code/PythonSandbox.d.ts +13 -0
- package/dist/nodes/Code/PythonSandbox.js +86 -0
- package/dist/nodes/Code/PythonSandbox.js.map +1 -0
- package/dist/nodes/Code/Sandbox.d.ts +20 -11
- package/dist/nodes/Code/Sandbox.js +61 -103
- package/dist/nodes/Code/Sandbox.js.map +1 -1
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.d.ts +2 -0
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.js +73 -0
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.js.map +1 -0
- package/dist/nodes/Code/descriptions/PythonCodeDescription.d.ts +2 -0
- package/dist/nodes/Code/descriptions/PythonCodeDescription.js +61 -0
- package/dist/nodes/Code/descriptions/PythonCodeDescription.js.map +1 -0
- package/dist/nodes/Code/utils.d.ts +0 -2
- package/dist/nodes/Code/utils.js +1 -2
- package/dist/nodes/Code/utils.js.map +1 -1
- package/dist/nodes/DateTime/DateTime.node.d.ts +3 -9
- package/dist/nodes/DateTime/DateTime.node.js +9 -502
- package/dist/nodes/DateTime/DateTime.node.js.map +1 -1
- package/dist/nodes/DateTime/V1/DateTimeV1.node.d.ts +11 -0
- package/dist/nodes/DateTime/V1/DateTimeV1.node.js +523 -0
- package/dist/nodes/DateTime/V1/DateTimeV1.node.js.map +1 -0
- package/dist/nodes/DateTime/V2/AddToDateDescription.d.ts +2 -0
- package/dist/nodes/DateTime/V2/AddToDateDescription.js +105 -0
- package/dist/nodes/DateTime/V2/AddToDateDescription.js.map +1 -0
- package/dist/nodes/DateTime/V2/CurrentDateDescription.d.ts +2 -0
- package/dist/nodes/DateTime/V2/CurrentDateDescription.js +63 -0
- package/dist/nodes/DateTime/V2/CurrentDateDescription.js.map +1 -0
- package/dist/nodes/DateTime/V2/DateTimeV2.node.d.ts +6 -0
- package/dist/nodes/DateTime/V2/DateTimeV2.node.js +187 -0
- package/dist/nodes/DateTime/V2/DateTimeV2.node.js.map +1 -0
- package/dist/nodes/DateTime/V2/ExtractDateDescription.d.ts +2 -0
- package/dist/nodes/DateTime/V2/ExtractDateDescription.js +82 -0
- package/dist/nodes/DateTime/V2/ExtractDateDescription.js.map +1 -0
- package/dist/nodes/DateTime/V2/FormatDateDescription.d.ts +2 -0
- package/dist/nodes/DateTime/V2/FormatDateDescription.js +129 -0
- package/dist/nodes/DateTime/V2/FormatDateDescription.js.map +1 -0
- package/dist/nodes/DateTime/V2/GenericFunctions.d.ts +3 -0
- package/dist/nodes/DateTime/V2/GenericFunctions.js +46 -0
- package/dist/nodes/DateTime/V2/GenericFunctions.js.map +1 -0
- package/dist/nodes/DateTime/V2/GetTimeBetweenDates.d.ts +2 -0
- package/dist/nodes/DateTime/V2/GetTimeBetweenDates.js +106 -0
- package/dist/nodes/DateTime/V2/GetTimeBetweenDates.js.map +1 -0
- package/dist/nodes/DateTime/V2/RoundDateDescription.d.ts +2 -0
- package/dist/nodes/DateTime/V2/RoundDateDescription.js +122 -0
- package/dist/nodes/DateTime/V2/RoundDateDescription.js.map +1 -0
- package/dist/nodes/DateTime/V2/SubtractFromDateDescription.d.ts +2 -0
- package/dist/nodes/DateTime/V2/SubtractFromDateDescription.js +105 -0
- package/dist/nodes/DateTime/V2/SubtractFromDateDescription.js.map +1 -0
- package/dist/nodes/DateTime/test/node/DateTimeWorkflowV2.json +260 -0
- package/dist/nodes/DateTime/test/node/workflow.timestamp_v2.json +352 -0
- package/dist/nodes/Ftp/Ftp.node.js +4 -4
- package/dist/nodes/Ftp/Ftp.node.js.map +1 -1
- package/dist/nodes/HttpRequest/HttpRequest.node.js +2 -1
- package/dist/nodes/HttpRequest/HttpRequest.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +4 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Hubspot/Hubspot.node.d.ts +3 -45
- package/dist/nodes/Hubspot/Hubspot.node.js +9 -2321
- package/dist/nodes/Hubspot/Hubspot.node.js.map +1 -1
- package/dist/nodes/Hubspot/HubspotTrigger.node.js +1 -1
- package/dist/nodes/Hubspot/HubspotTrigger.node.js.map +1 -1
- package/dist/nodes/Hubspot/{CompanyDescription.js → V1/CompanyDescription.js} +1 -0
- package/dist/nodes/Hubspot/V1/CompanyDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V1/ContactDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V1/ContactListDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V1/DealDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V1/DealInterface.js.map +1 -0
- package/dist/nodes/Hubspot/V1/EngagementDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V1/FormDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V1/FormInterface.js.map +1 -0
- package/dist/nodes/Hubspot/V1/GenericFunctions.d.ts +70 -0
- package/dist/nodes/Hubspot/V1/GenericFunctions.js +1964 -0
- package/dist/nodes/Hubspot/V1/GenericFunctions.js.map +1 -0
- package/dist/nodes/Hubspot/V1/HubspotV1.node.d.ts +48 -0
- package/dist/nodes/Hubspot/V1/HubspotV1.node.js +2334 -0
- package/dist/nodes/Hubspot/V1/HubspotV1.node.js.map +1 -0
- package/dist/nodes/Hubspot/V1/TicketDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/CompanyDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/CompanyDescription.js +1134 -0
- package/dist/nodes/Hubspot/V2/CompanyDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/ContactDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/ContactDescription.js +1158 -0
- package/dist/nodes/Hubspot/V2/ContactDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/ContactListDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/ContactListDescription.js +125 -0
- package/dist/nodes/Hubspot/V2/ContactListDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/DealDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/DealDescription.js +949 -0
- package/dist/nodes/Hubspot/V2/DealDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/DealInterface.d.ts +9 -0
- package/dist/nodes/Hubspot/V2/DealInterface.js +3 -0
- package/dist/nodes/Hubspot/V2/DealInterface.js.map +1 -0
- package/dist/nodes/Hubspot/V2/EngagementDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/EngagementDescription.js +530 -0
- package/dist/nodes/Hubspot/V2/EngagementDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/FormDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/FormDescription.js +297 -0
- package/dist/nodes/Hubspot/V2/FormDescription.js.map +1 -0
- package/dist/nodes/Hubspot/V2/FormInterface.d.ts +19 -0
- package/dist/nodes/Hubspot/V2/FormInterface.js +3 -0
- package/dist/nodes/Hubspot/V2/FormInterface.js.map +1 -0
- package/dist/nodes/Hubspot/V2/GenericFunctions.js.map +1 -0
- package/dist/nodes/Hubspot/V2/HubspotV2.node.d.ts +59 -0
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js +2554 -0
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js.map +1 -0
- package/dist/nodes/Hubspot/V2/TicketDescription.d.ts +3 -0
- package/dist/nodes/Hubspot/V2/TicketDescription.js +563 -0
- package/dist/nodes/Hubspot/V2/TicketDescription.js.map +1 -0
- package/dist/nodes/Kafka/KafkaTrigger.node.js +28 -4
- package/dist/nodes/Kafka/KafkaTrigger.node.js.map +1 -1
- package/dist/nodes/MySql/MySql.node.js +2 -1
- package/dist/nodes/MySql/MySql.node.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/router.js +1 -0
- package/dist/nodes/MySql/v2/actions/router.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/versionDescription.js +1 -1
- package/dist/nodes/MySql/v2/actions/versionDescription.js.map +1 -1
- package/dist/nodes/MySql/v2/transport/index.js +3 -0
- package/dist/nodes/MySql/v2/transport/index.js.map +1 -1
- package/dist/nodes/Npm/DistTagDescription.d.ts +3 -0
- package/dist/nodes/Npm/DistTagDescription.js +94 -0
- package/dist/nodes/Npm/DistTagDescription.js.map +1 -0
- package/dist/nodes/Npm/Npm.node.d.ts +4 -0
- package/dist/nodes/Npm/Npm.node.js +57 -0
- package/dist/nodes/Npm/Npm.node.js.map +1 -0
- package/dist/nodes/Npm/Npm.node.json +19 -0
- package/dist/nodes/Npm/PackageDescription.d.ts +3 -0
- package/dist/nodes/Npm/PackageDescription.js +168 -0
- package/dist/nodes/Npm/PackageDescription.js.map +1 -0
- package/dist/nodes/Npm/npm.svg +4 -0
- package/dist/nodes/Npm/test/Npm.workflow.test.json +117 -0
- package/dist/nodes/Postgres/Postgres.node.js +2 -1
- package/dist/nodes/Postgres/Postgres.node.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/router.js +1 -0
- package/dist/nodes/Postgres/v2/actions/router.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/versionDescription.js +1 -1
- package/dist/nodes/Postgres/v2/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Postgres/v2/methods/listSearch.js +4 -2
- package/dist/nodes/Postgres/v2/methods/listSearch.js.map +1 -1
- package/dist/nodes/Postgres/v2/methods/loadOptions.js +2 -1
- package/dist/nodes/Postgres/v2/methods/loadOptions.js.map +1 -1
- package/dist/nodes/Postgres/v2/transport/index.js +7 -0
- package/dist/nodes/Postgres/v2/transport/index.js.map +1 -1
- package/dist/nodes/ReadBinaryFiles/test/ReadBinaryFiles.workflow.json +45 -0
- package/dist/nodes/ReadBinaryFiles/test/data/sample.json +3 -0
- package/dist/nodes/ReadBinaryFiles/test/data/sample2.json +3 -0
- package/dist/package.json +912 -0
- package/dist/types/credentials.json +5 -3
- package/dist/types/nodes.json +21 -15
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +7 -0
- package/dist/utils/constants.js.map +1 -0
- package/package.json +9 -4
- package/dist/nodes/Hubspot/CompanyDescription.js.map +0 -1
- package/dist/nodes/Hubspot/ContactDescription.js.map +0 -1
- package/dist/nodes/Hubspot/ContactListDescription.js.map +0 -1
- package/dist/nodes/Hubspot/DealDescription.js.map +0 -1
- package/dist/nodes/Hubspot/DealInterface.js.map +0 -1
- package/dist/nodes/Hubspot/EngagementDescription.js.map +0 -1
- package/dist/nodes/Hubspot/FormDescription.js.map +0 -1
- package/dist/nodes/Hubspot/FormInterface.js.map +0 -1
- package/dist/nodes/Hubspot/GenericFunctions.js.map +0 -1
- package/dist/nodes/Hubspot/TicketDescription.js.map +0 -1
- /package/dist/nodes/Hubspot/{CompanyDescription.d.ts → V1/CompanyDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{ContactDescription.d.ts → V1/ContactDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{ContactDescription.js → V1/ContactDescription.js} +0 -0
- /package/dist/nodes/Hubspot/{ContactListDescription.d.ts → V1/ContactListDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{ContactListDescription.js → V1/ContactListDescription.js} +0 -0
- /package/dist/nodes/Hubspot/{DealDescription.d.ts → V1/DealDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{DealDescription.js → V1/DealDescription.js} +0 -0
- /package/dist/nodes/Hubspot/{DealInterface.d.ts → V1/DealInterface.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{DealInterface.js → V1/DealInterface.js} +0 -0
- /package/dist/nodes/Hubspot/{EngagementDescription.d.ts → V1/EngagementDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{EngagementDescription.js → V1/EngagementDescription.js} +0 -0
- /package/dist/nodes/Hubspot/{FormDescription.d.ts → V1/FormDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{FormDescription.js → V1/FormDescription.js} +0 -0
- /package/dist/nodes/Hubspot/{FormInterface.d.ts → V1/FormInterface.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{FormInterface.js → V1/FormInterface.js} +0 -0
- /package/dist/nodes/Hubspot/{TicketDescription.d.ts → V1/TicketDescription.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{TicketDescription.js → V1/TicketDescription.js} +0 -0
- /package/dist/nodes/Hubspot/{GenericFunctions.d.ts → V2/GenericFunctions.d.ts} +0 -0
- /package/dist/nodes/Hubspot/{GenericFunctions.js → V2/GenericFunctions.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JavaScriptSandbox.js","sourceRoot":"","sources":["../../../nodes/Code/JavaScriptSandbox.ts"],"names":[],"mappings":";;;AACA,6BAA6B;AAG7B,uDAAoD;AACpD,qDAAkD;AAElD,uCAAoC;AAEpC,MAAM,EAAE,2BAA2B,EAAE,OAAO,EAAE,4BAA4B,EAAE,QAAQ,EAAE,GACrF,OAAO,CAAC,GAAG,CAAC;AAEb,MAAM,iBAAiB,GAAG,CACzB,OAAuB,EACvB,YAAiC,EACjB,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;IAC3D,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACR,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;QAC1C,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK;KAChF;CACD,CAAC,CAAC;AAEH,MAAa,iBAAkB,SAAQ,iBAAO;IAG7C,YACC,OAAuB,EACf,MAAc,EACtB,SAA6B,EAC7B,YAAiC,EACjC,OAAqC;QAErC,KAAK,CACJ;YACC,MAAM,EAAE;gBACP,QA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|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.LoadPyodide = void 0;
|
|
27
|
+
let pyodideInstance;
|
|
28
|
+
async function LoadPyodide() {
|
|
29
|
+
if (pyodideInstance === undefined) {
|
|
30
|
+
globalThis.Blob = (await Promise.resolve().then(() => __importStar(require('node:buffer')))).Blob;
|
|
31
|
+
const { emitWarning } = process;
|
|
32
|
+
process.emitWarning = (warning, ...args) => {
|
|
33
|
+
if (args[0] === 'ExperimentalWarning') {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (args[0] && typeof args[0] === 'object' && args[0].type === 'ExperimentalWarning') {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
return emitWarning(warning, ...args);
|
|
40
|
+
};
|
|
41
|
+
const { loadPyodide } = await Promise.resolve().then(() => __importStar(require('pyodide')));
|
|
42
|
+
pyodideInstance = await loadPyodide();
|
|
43
|
+
}
|
|
44
|
+
return pyodideInstance;
|
|
45
|
+
}
|
|
46
|
+
exports.LoadPyodide = LoadPyodide;
|
|
47
|
+
//# sourceMappingURL=Pyodide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pyodide.js","sourceRoot":"","sources":["../../../nodes/Code/Pyodide.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAI,eAA6C,CAAC;AAE3C,KAAK,UAAU,WAAW;IAChC,IAAI,eAAe,KAAK,SAAS,EAAE;QAGlC,UAAU,CAAC,IAAI,GAAG,CAAC,wDAAa,aAAa,GAAC,CAAC,CAAC,IAAI,CAAC;QAGrD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QAChC,OAAO,CAAC,WAAW,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE;YAC1C,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,qBAAqB,EAAE;gBACtC,OAAO;aACP;YACD,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,qBAAqB,EAAE;gBACrF,OAAO;aACP;YACD,OAAO,WAAW,CAAC,OAAO,EAAE,GAAI,IAAiB,CAAC,CAAC;QACpD,CAAC,CAAC;QAEF,MAAM,EAAE,WAAW,EAAE,GAAG,wDAAa,SAAS,GAAC,CAAC;QAChD,eAAe,GAAG,MAAM,WAAW,EAAE,CAAC;KACtC;IAED,OAAO,eAAe,CAAC;AACxB,CAAC;AAvBD,kCAuBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
import type { SandboxContext } from './Sandbox';
|
|
3
|
+
import { Sandbox } from './Sandbox';
|
|
4
|
+
export declare class PythonSandbox extends Sandbox {
|
|
5
|
+
private pythonCode;
|
|
6
|
+
private moduleImports;
|
|
7
|
+
private readonly context;
|
|
8
|
+
constructor(context: SandboxContext, pythonCode: string, moduleImports: string[], itemIndex: number | undefined, helpers: IExecuteFunctions['helpers']);
|
|
9
|
+
runCodeAllItems(): Promise<INodeExecutionData[]>;
|
|
10
|
+
runCodeEachItem(): Promise<INodeExecutionData>;
|
|
11
|
+
private runCodeInPython;
|
|
12
|
+
private getPrettyError;
|
|
13
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PythonSandbox = void 0;
|
|
4
|
+
const Pyodide_1 = require("./Pyodide");
|
|
5
|
+
const Sandbox_1 = require("./Sandbox");
|
|
6
|
+
const envAccessBlocked = process.env.N8N_BLOCK_ENV_ACCESS_IN_NODE === 'true';
|
|
7
|
+
class PythonSandbox extends Sandbox_1.Sandbox {
|
|
8
|
+
constructor(context, pythonCode, moduleImports, itemIndex, helpers) {
|
|
9
|
+
super({
|
|
10
|
+
object: {
|
|
11
|
+
singular: 'dictionary',
|
|
12
|
+
plural: 'dictionaries',
|
|
13
|
+
},
|
|
14
|
+
}, itemIndex, helpers);
|
|
15
|
+
this.pythonCode = pythonCode;
|
|
16
|
+
this.moduleImports = moduleImports;
|
|
17
|
+
this.context = Object.keys(context).reduce((acc, key) => {
|
|
18
|
+
acc[key.startsWith('$') ? key.replace(/^\$/, '_') : key] = context[key];
|
|
19
|
+
return acc;
|
|
20
|
+
}, {});
|
|
21
|
+
}
|
|
22
|
+
async runCodeAllItems() {
|
|
23
|
+
const executionResult = await this.runCodeInPython();
|
|
24
|
+
return this.validateRunCodeAllItems(executionResult);
|
|
25
|
+
}
|
|
26
|
+
async runCodeEachItem() {
|
|
27
|
+
const executionResult = await this.runCodeInPython();
|
|
28
|
+
return this.validateRunCodeEachItem(executionResult);
|
|
29
|
+
}
|
|
30
|
+
async runCodeInPython() {
|
|
31
|
+
const runCode = `
|
|
32
|
+
from _pyodide_core import jsproxy_typedict
|
|
33
|
+
from js import Object
|
|
34
|
+
jsproxy_typedict[0] = type(Object.new().as_object_map())
|
|
35
|
+
|
|
36
|
+
if printOverwrite:
|
|
37
|
+
print = printOverwrite
|
|
38
|
+
|
|
39
|
+
async def __main():
|
|
40
|
+
${this.pythonCode
|
|
41
|
+
.split('\n')
|
|
42
|
+
.map((line) => ' ' + line)
|
|
43
|
+
.join('\n')}
|
|
44
|
+
await __main()
|
|
45
|
+
`;
|
|
46
|
+
const pyodide = await (0, Pyodide_1.LoadPyodide)();
|
|
47
|
+
const moduleImportsFiltered = this.moduleImports.filter((importModule) => !['asyncio', 'pyodide', 'math'].includes(importModule));
|
|
48
|
+
if (moduleImportsFiltered.length) {
|
|
49
|
+
await pyodide.loadPackage('micropip');
|
|
50
|
+
const micropip = pyodide.pyimport('micropip');
|
|
51
|
+
await Promise.all(moduleImportsFiltered.map((importModule) => micropip.install(importModule)));
|
|
52
|
+
}
|
|
53
|
+
let executionResult;
|
|
54
|
+
try {
|
|
55
|
+
const dict = pyodide.globals.get('dict');
|
|
56
|
+
const globalsDict = dict();
|
|
57
|
+
for (const key of Object.keys(this.context)) {
|
|
58
|
+
if ((key === '_env' && envAccessBlocked) || key === '_node')
|
|
59
|
+
continue;
|
|
60
|
+
const value = this.context[key];
|
|
61
|
+
globalsDict.set(key, value);
|
|
62
|
+
}
|
|
63
|
+
executionResult = await pyodide.runPythonAsync(runCode, { globals: globalsDict });
|
|
64
|
+
globalsDict.destroy();
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
throw this.getPrettyError(error);
|
|
68
|
+
}
|
|
69
|
+
if (executionResult === null || executionResult === void 0 ? void 0 : executionResult.toJs) {
|
|
70
|
+
return executionResult.toJs({
|
|
71
|
+
dict_converter: Object.fromEntries,
|
|
72
|
+
create_proxies: false,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return executionResult;
|
|
76
|
+
}
|
|
77
|
+
getPrettyError(error) {
|
|
78
|
+
const errorTypeIndex = error.message.indexOf(error.type);
|
|
79
|
+
if (errorTypeIndex !== -1) {
|
|
80
|
+
return new Error(error.message.slice(errorTypeIndex));
|
|
81
|
+
}
|
|
82
|
+
return error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.PythonSandbox = PythonSandbox;
|
|
86
|
+
//# sourceMappingURL=PythonSandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PythonSandbox.js","sourceRoot":"","sources":["../../../nodes/Code/PythonSandbox.ts"],"names":[],"mappings":";;;AAEA,uCAAwC;AAExC,uCAAoC;AAQpC,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,KAAK,MAAM,CAAC;AAE7E,MAAa,aAAc,SAAQ,iBAAO;IAGzC,YACC,OAAuB,EACf,UAAkB,EAClB,aAAuB,EAC/B,SAA6B,EAC7B,OAAqC;QAErC,KAAK,CACJ;YACC,MAAM,EAAE;gBACP,QAAQ,EAAE,YAAY;gBACtB,MAAM,EAAE,cAAc;aACtB;SACD,EACD,SAAS,EACT,OAAO,CACP,CAAC;QAdM,eAAU,GAAV,UAAU,CAAQ;QAClB,kBAAa,GAAb,aAAa,CAAU;QAgB/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACvD,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAA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|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, IWorkflowDataProxyData } from 'n8n-workflow';
|
|
2
|
+
interface SandboxTextKeys {
|
|
3
|
+
object: {
|
|
4
|
+
singular: string;
|
|
5
|
+
plural: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface SandboxContext extends IWorkflowDataProxyData {
|
|
4
9
|
$getNodeParameter: IExecuteFunctions['getNodeParameter'];
|
|
5
10
|
$getWorkflowStaticData: IExecuteFunctions['getWorkflowStaticData'];
|
|
6
11
|
helpers: IExecuteFunctions['helpers'];
|
|
7
12
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
13
|
+
export declare const REQUIRED_N8N_ITEM_KEYS: Set<string>;
|
|
14
|
+
export declare function getSandboxContext(this: IExecuteFunctions, index: number): SandboxContext;
|
|
15
|
+
export declare abstract class Sandbox {
|
|
16
|
+
private textKeys;
|
|
17
|
+
protected itemIndex: number | undefined;
|
|
10
18
|
private helpers;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
constructor(textKeys: SandboxTextKeys, itemIndex: number | undefined, helpers: IExecuteFunctions['helpers']);
|
|
20
|
+
abstract runCodeAllItems(): Promise<INodeExecutionData[]>;
|
|
21
|
+
abstract runCodeEachItem(): Promise<INodeExecutionData | undefined>;
|
|
22
|
+
validateRunCodeEachItem(executionResult: INodeExecutionData | undefined): INodeExecutionData;
|
|
23
|
+
validateRunCodeAllItems(executionResult: INodeExecutionData | INodeExecutionData[] | undefined, itemIndex?: number): INodeExecutionData[];
|
|
24
|
+
private getTextKey;
|
|
25
|
+
private validateItem;
|
|
16
26
|
private validateTopLevelKeys;
|
|
17
27
|
}
|
|
18
|
-
export declare function getSandboxContext(this: IExecuteFunctions, index?: number): SandboxContext;
|
|
19
28
|
export {};
|
|
@@ -1,133 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSandboxContext = exports.
|
|
4
|
-
const vm2_1 = require("vm2");
|
|
3
|
+
exports.Sandbox = exports.getSandboxContext = exports.REQUIRED_N8N_ITEM_KEYS = void 0;
|
|
5
4
|
const ValidationError_1 = require("./ValidationError");
|
|
6
|
-
const ExecutionError_1 = require("./ExecutionError");
|
|
7
5
|
const utils_1 = require("./utils");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
exports.REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem']);
|
|
7
|
+
function getSandboxContext(index) {
|
|
8
|
+
return {
|
|
9
|
+
$getNodeParameter: this.getNodeParameter,
|
|
10
|
+
$getWorkflowStaticData: this.getWorkflowStaticData,
|
|
11
|
+
helpers: this.helpers,
|
|
12
|
+
...this.getWorkflowDataProxy(index),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.getSandboxContext = getSandboxContext;
|
|
16
|
+
class Sandbox {
|
|
17
|
+
constructor(textKeys, itemIndex, helpers) {
|
|
18
|
+
this.textKeys = textKeys;
|
|
19
|
+
this.itemIndex = itemIndex;
|
|
20
20
|
this.helpers = helpers;
|
|
21
|
-
this.itemIndex = undefined;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
validateRunCodeEachItem(executionResult) {
|
|
23
|
+
if (typeof executionResult !== 'object') {
|
|
24
|
+
throw new ValidationError_1.ValidationError({
|
|
25
|
+
message: `Code doesn't return ${this.getTextKey('object', { includeArticle: true })}`,
|
|
26
|
+
description: `Please return ${this.getTextKey('object', {
|
|
27
|
+
includeArticle: true,
|
|
28
|
+
})} representing the output item. ('${executionResult}' was returned instead.)`,
|
|
29
|
+
itemIndex: this.itemIndex,
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (Array.isArray(executionResult)) {
|
|
33
|
+
const firstSentence = executionResult.length > 0
|
|
34
|
+
? `An array of ${typeof executionResult[0]}s was returned.`
|
|
35
|
+
: 'An empty array was returned.';
|
|
36
|
+
throw new ValidationError_1.ValidationError({
|
|
37
|
+
message: `Code doesn't return a single ${this.getTextKey('object')}`,
|
|
38
|
+
description: `${firstSentence} If you need to output multiple items, please use the 'Run Once for All Items' mode instead.`,
|
|
39
|
+
itemIndex: this.itemIndex,
|
|
40
|
+
});
|
|
35
41
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
const [returnData] = this.helpers.normalizeItems([executionResult]);
|
|
43
|
+
this.validateItem(returnData);
|
|
44
|
+
this.validateTopLevelKeys(returnData);
|
|
45
|
+
return returnData;
|
|
46
|
+
}
|
|
47
|
+
validateRunCodeAllItems(executionResult, itemIndex) {
|
|
48
|
+
if (typeof executionResult !== 'object') {
|
|
39
49
|
throw new ValidationError_1.ValidationError({
|
|
40
50
|
message: "Code doesn't return items properly",
|
|
41
|
-
description:
|
|
42
|
-
|
|
51
|
+
description: `Please return an array of ${this.getTextKey('object', {
|
|
52
|
+
plural: true,
|
|
53
|
+
})}, one for each item you would like to output.`,
|
|
54
|
+
itemIndex,
|
|
43
55
|
});
|
|
44
56
|
}
|
|
45
57
|
if (Array.isArray(executionResult)) {
|
|
46
|
-
const mustHaveTopLevelN8nKey = executionResult.some((item) => Object.keys(item).find((key) =>
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
const mustHaveTopLevelN8nKey = executionResult.some((item) => Object.keys(item).find((key) => exports.REQUIRED_N8N_ITEM_KEYS.has(key)));
|
|
59
|
+
if (mustHaveTopLevelN8nKey) {
|
|
60
|
+
for (const item of executionResult) {
|
|
49
61
|
this.validateTopLevelKeys(item);
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
65
|
const returnData = this.helpers.normalizeItems(executionResult);
|
|
54
|
-
returnData.forEach((item) => this.
|
|
66
|
+
returnData.forEach((item) => this.validateItem(item));
|
|
55
67
|
return returnData;
|
|
56
68
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const match = this.jsCode.match(/\$input\.(?<disallowedMethod>first|last|all|itemMatching)/);
|
|
62
|
-
if ((_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.disallowedMethod) {
|
|
63
|
-
const { disallowedMethod } = match.groups;
|
|
64
|
-
const lineNumber = this.jsCode.split('\n').findIndex((line) => {
|
|
65
|
-
return line.includes(disallowedMethod) && !line.startsWith('//') && !line.startsWith('*');
|
|
66
|
-
}) + 1;
|
|
67
|
-
const disallowedMethodFound = lineNumber !== 0;
|
|
68
|
-
if (disallowedMethodFound) {
|
|
69
|
-
throw new ValidationError_1.ValidationError({
|
|
70
|
-
message: `Can't use .${disallowedMethod}() here`,
|
|
71
|
-
description: "This is only available in 'Run Once for All Items' mode",
|
|
72
|
-
itemIndex: this.itemIndex,
|
|
73
|
-
lineNumber,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
let executionResult;
|
|
78
|
-
try {
|
|
79
|
-
executionResult = await this.run(script, __dirname);
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
if (error.message === 'item is not defined' && !/(let|const|var) item =/.test(script)) {
|
|
83
|
-
const quoted = error.message.replace('item', '`item`');
|
|
84
|
-
error.message = quoted + '. Did you mean `$input.item.json`?';
|
|
85
|
-
}
|
|
86
|
-
throw new ExecutionError_1.ExecutionError(error, this.itemIndex);
|
|
69
|
+
getTextKey(key, options) {
|
|
70
|
+
const response = this.textKeys[key][(options === null || options === void 0 ? void 0 : options.plural) ? 'plural' : 'singular'];
|
|
71
|
+
if (!(options === null || options === void 0 ? void 0 : options.includeArticle)) {
|
|
72
|
+
return response;
|
|
87
73
|
}
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
90
|
-
if (executionResult === undefined || typeof executionResult !== 'object') {
|
|
91
|
-
throw new ValidationError_1.ValidationError({
|
|
92
|
-
message: "Code doesn't return an object",
|
|
93
|
-
description: `Please return an object representing the output item. ('${executionResult}' was returned instead.)`,
|
|
94
|
-
itemIndex: this.itemIndex,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
if (Array.isArray(executionResult)) {
|
|
98
|
-
const firstSentence = executionResult.length > 0
|
|
99
|
-
? `An array of ${typeof executionResult[0]}s was returned.`
|
|
100
|
-
: 'An empty array was returned.';
|
|
101
|
-
throw new ValidationError_1.ValidationError({
|
|
102
|
-
message: "Code doesn't return a single object",
|
|
103
|
-
description: `${firstSentence} If you need to output multiple items, please use the 'Run Once for All Items' mode instead`,
|
|
104
|
-
itemIndex: this.itemIndex,
|
|
105
|
-
});
|
|
74
|
+
if (['a', 'e', 'i', 'o', 'u'].some((value) => response.startsWith(value))) {
|
|
75
|
+
return `an ${response}`;
|
|
106
76
|
}
|
|
107
|
-
|
|
108
|
-
this.validateResult(returnData);
|
|
109
|
-
this.validateTopLevelKeys(returnData);
|
|
110
|
-
return returnData;
|
|
77
|
+
return `a ${response}`;
|
|
111
78
|
}
|
|
112
|
-
|
|
79
|
+
validateItem({ json, binary }) {
|
|
113
80
|
if (json === undefined || !(0, utils_1.isObject)(json)) {
|
|
114
81
|
throw new ValidationError_1.ValidationError({
|
|
115
|
-
message:
|
|
116
|
-
description:
|
|
82
|
+
message: `A 'json' property isn't ${this.getTextKey('object', { includeArticle: true })}`,
|
|
83
|
+
description: `In the returned data, every key named 'json' must point to ${this.getTextKey('object', { includeArticle: true })}.`,
|
|
117
84
|
itemIndex: this.itemIndex,
|
|
118
85
|
});
|
|
119
86
|
}
|
|
120
87
|
if (binary !== undefined && !(0, utils_1.isObject)(binary)) {
|
|
121
88
|
throw new ValidationError_1.ValidationError({
|
|
122
|
-
message:
|
|
123
|
-
description:
|
|
89
|
+
message: `A 'binary' property isn't ${this.getTextKey('object', { includeArticle: true })}`,
|
|
90
|
+
description: `In the returned data, every key named 'binary’ must point to ${this.getTextKey('object', { includeArticle: true })}.`,
|
|
124
91
|
itemIndex: this.itemIndex,
|
|
125
92
|
});
|
|
126
93
|
}
|
|
127
94
|
}
|
|
128
95
|
validateTopLevelKeys(item) {
|
|
129
96
|
Object.keys(item).forEach((key) => {
|
|
130
|
-
if (
|
|
97
|
+
if (exports.REQUIRED_N8N_ITEM_KEYS.has(key))
|
|
131
98
|
return;
|
|
132
99
|
throw new ValidationError_1.ValidationError({
|
|
133
100
|
message: `Unknown top-level item key: ${key}`,
|
|
@@ -138,13 +105,4 @@ class Sandbox extends vm2_1.NodeVM {
|
|
|
138
105
|
}
|
|
139
106
|
}
|
|
140
107
|
exports.Sandbox = Sandbox;
|
|
141
|
-
function getSandboxContext(index) {
|
|
142
|
-
return {
|
|
143
|
-
$getNodeParameter: this.getNodeParameter,
|
|
144
|
-
$getWorkflowStaticData: this.getWorkflowStaticData,
|
|
145
|
-
helpers: this.helpers,
|
|
146
|
-
...this.getWorkflowDataProxy(index !== null && index !== void 0 ? index : 0),
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
exports.getSandboxContext = getSandboxContext;
|
|
150
108
|
//# sourceMappingURL=Sandbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sandbox.js","sourceRoot":"","sources":["../../../nodes/Code/Sandbox.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Sandbox.js","sourceRoot":"","sources":["../../../nodes/Code/Sandbox.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AACpD,mCAAmC;AAiBtB,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;AAEhF,SAAgB,iBAAiB,CAA0B,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AAE,cAAc,EAAE,IAAI,EAAE,CACxB,GAAG;gBACJ,SAAS,EAAE,IAAI,CAAC,SAAS;aACzB,CAAC,CAAC;SACH;IACF,CAAC;IAEO,oBAAoB,CAAC,IAAwB;QACpD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACjC,IAAI,8BAAsB,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO;YAC5C,MAAM,IAAI,iCAAe,CAAC;gBACzB,OAAO,EAAE,+BAA+B,GAAG,EAAE;gBAC7C,WAAW,EAAE,kEAAkE;gBAC/E,SAAS,EAAE,IAAI,CAAC,SAAS;aACzB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AApID,0BAoIC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.javascriptCodeDescription = void 0;
|
|
4
|
+
const commonDescription = {
|
|
5
|
+
displayName: 'JavaScript',
|
|
6
|
+
name: 'jsCode',
|
|
7
|
+
type: 'string',
|
|
8
|
+
typeOptions: {
|
|
9
|
+
editor: 'codeNodeEditor',
|
|
10
|
+
editorLanguage: 'javaScript',
|
|
11
|
+
},
|
|
12
|
+
default: '',
|
|
13
|
+
description: 'JavaScript code to execute.<br><br>Tip: You can use luxon vars like <code>$today</code> for dates and <code>$jmespath</code> for querying JSON structures. <a href="https://docs.n8n.io/nodes/n8n-nodes-base.function">Learn more</a>.',
|
|
14
|
+
noDataExpression: true,
|
|
15
|
+
};
|
|
16
|
+
const v1Properties = [
|
|
17
|
+
{
|
|
18
|
+
...commonDescription,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: {
|
|
21
|
+
'@version': [1],
|
|
22
|
+
mode: ['runOnceForAllItems'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
...commonDescription,
|
|
28
|
+
displayOptions: {
|
|
29
|
+
show: {
|
|
30
|
+
'@version': [1],
|
|
31
|
+
mode: ['runOnceForEachItem'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
const v2Properties = [
|
|
37
|
+
{
|
|
38
|
+
...commonDescription,
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
'@version': [2],
|
|
42
|
+
language: ['javaScript'],
|
|
43
|
+
mode: ['runOnceForAllItems'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
...commonDescription,
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
'@version': [2],
|
|
52
|
+
language: ['javaScript'],
|
|
53
|
+
mode: ['runOnceForEachItem'],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
exports.javascriptCodeDescription = [
|
|
59
|
+
...v1Properties,
|
|
60
|
+
...v2Properties,
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Type <code>$</code> for a list of <a target="_blank" href="https://docs.n8n.io/code-examples/methods-variables-reference/">special vars/methods</a>. Debug by using <code>console.log()</code> statements and viewing their output in the browser console.',
|
|
63
|
+
name: 'notice',
|
|
64
|
+
type: 'notice',
|
|
65
|
+
displayOptions: {
|
|
66
|
+
show: {
|
|
67
|
+
language: ['javaScript'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
default: '',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
//# sourceMappingURL=JavascriptCodeDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JavascriptCodeDescription.js","sourceRoot":"","sources":["../../../../nodes/Code/descriptions/JavascriptCodeDescription.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAoB;IAC1C,WAAW,EAAE,YAAY;IACzB,IAA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 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pythonCodeDescription = void 0;
|
|
4
|
+
const commonDescription = {
|
|
5
|
+
displayName: 'Python',
|
|
6
|
+
name: 'pythonCode',
|
|
7
|
+
type: 'string',
|
|
8
|
+
typeOptions: {
|
|
9
|
+
editor: 'codeNodeEditor',
|
|
10
|
+
editorLanguage: 'python',
|
|
11
|
+
},
|
|
12
|
+
default: '',
|
|
13
|
+
description: 'Python code to execute.<br><br>Tip: You can use luxon vars like <code>_today</code> for dates and <code>$_mespath</code> for querying JSON structures. <a href="https://docs.n8n.io/nodes/n8n-nodes-base.function">Learn more</a>.',
|
|
14
|
+
noDataExpression: true,
|
|
15
|
+
};
|
|
16
|
+
exports.pythonCodeDescription = [
|
|
17
|
+
{
|
|
18
|
+
...commonDescription,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: {
|
|
21
|
+
language: ['python'],
|
|
22
|
+
mode: ['runOnceForAllItems'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
...commonDescription,
|
|
28
|
+
displayOptions: {
|
|
29
|
+
show: {
|
|
30
|
+
language: ['python'],
|
|
31
|
+
mode: ['runOnceForEachItem'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Debug by using <code>print()</code> statements and viewing their output in the browser console.',
|
|
37
|
+
name: 'notice',
|
|
38
|
+
type: 'notice',
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
language: ['python'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
default: '',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: 'Python Modules',
|
|
48
|
+
name: 'modules',
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
language: ['python'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
type: 'string',
|
|
55
|
+
default: '',
|
|
56
|
+
placeholder: 'opencv-python',
|
|
57
|
+
description: 'Comma-separated list of Python modules to load. They have to be installed to be able to be loaded and imported.',
|
|
58
|
+
noDataExpression: true,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=PythonCodeDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PythonCodeDescription.js","sourceRoot":"","sources":["../../../../nodes/Code/descriptions/PythonCodeDescription.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAoB;IAC1C,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE;QACZ,MAAM,EAAE,gBAAgB;QACxB,cAAc,EAAE,QAAQ;KACxB;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EACV,oOAAoO;IACrO,gBAAgB,EAAE,IAAI;CACtB,CAAC;AAEW,QAAA,qBAAqB,GAAsB;IACvD;QACC,GAAG,iBAAiB;QACpB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,IAAI,EAAE,CAAC,oBAAoB,CAAC;aAC5B;SACD;KACD;IACD;QACC,GAAG,iBAAiB;QACpB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,IAAI,EAAE,CAAC,oBAAoB,CAAC;aAC5B;SACD;KACD;IACD;QACC,WAAW,EACV,iGAAiG;QAClG,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACpB;SACD;QACD,OAAO,EAAE,EAAE;KACX;IACD;QACC,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACpB;SACD;QACD,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,eAAe;QAC5B,WAAW,EACV,iHAAiH;QAClH,gBAAgB,EAAE,IAAI;KACtB;CACD,CAAC"}
|
|
@@ -3,5 +3,3 @@ export declare function isObject(maybe: unknown): maybe is {
|
|
|
3
3
|
[key: string]: unknown;
|
|
4
4
|
};
|
|
5
5
|
export declare function standardizeOutput(output: IDataObject): IDataObject;
|
|
6
|
-
export type CodeNodeMode = 'runOnceForAllItems' | 'runOnceForEachItem';
|
|
7
|
-
export declare const REQUIRED_N8N_ITEM_KEYS: Set<string>;
|
package/dist/nodes/Code/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.standardizeOutput = exports.isObject = void 0;
|
|
4
4
|
function isObject(maybe) {
|
|
5
5
|
return (typeof maybe === 'object' && maybe !== null && !Array.isArray(maybe) && !(maybe instanceof Date));
|
|
6
6
|
}
|
|
@@ -30,5 +30,4 @@ function standardizeOutput(output) {
|
|
|
30
30
|
return output;
|
|
31
31
|
}
|
|
32
32
|
exports.standardizeOutput = standardizeOutput;
|
|
33
|
-
exports.REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem']);
|
|
34
33
|
//# sourceMappingURL=utils.js.map
|