n8n-nodes-base 1.108.0 → 1.109.0
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/nodes/Airtop/__schema__/v1.0.0/extraction/query.json +1 -7
- package/dist/nodes/Airtop/__schema__/v1.0.0/session/create.json +4 -1
- package/dist/nodes/Airtop/actions/interaction/click.operation.d.ts.map +1 -1
- package/dist/nodes/Airtop/actions/interaction/click.operation.js +31 -0
- package/dist/nodes/Airtop/actions/interaction/click.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/interaction/helpers.d.ts.map +1 -1
- package/dist/nodes/Airtop/actions/interaction/helpers.js +4 -2
- package/dist/nodes/Airtop/actions/interaction/helpers.js.map +1 -1
- package/dist/nodes/Airtop/constants.d.ts +0 -1
- package/dist/nodes/Airtop/constants.d.ts.map +1 -1
- package/dist/nodes/Airtop/constants.js +1 -2
- package/dist/nodes/Airtop/constants.js.map +1 -1
- package/dist/nodes/Airtop/transport/index.d.ts +1 -1
- package/dist/nodes/Airtop/transport/index.d.ts.map +1 -1
- package/dist/nodes/Airtop/transport/index.js +2 -2
- package/dist/nodes/Airtop/transport/index.js.map +1 -1
- package/dist/nodes/Airtop/transport/types.d.ts +1 -0
- package/dist/nodes/Airtop/transport/types.d.ts.map +1 -1
- package/dist/nodes/Amqp/Amqp.node.d.ts.map +1 -1
- package/dist/nodes/Amqp/Amqp.node.js.map +1 -1
- package/dist/nodes/Amqp/AmqpTrigger.node.d.ts.map +1 -1
- package/dist/nodes/Amqp/AmqpTrigger.node.js +5 -2
- package/dist/nodes/Amqp/AmqpTrigger.node.js.map +1 -1
- package/dist/nodes/Amqp/types.d.ts +8 -0
- package/dist/nodes/Amqp/types.d.ts.map +1 -0
- package/dist/nodes/Amqp/types.js +3 -0
- package/dist/nodes/Amqp/types.js.map +1 -0
- package/dist/nodes/Box/__schema__/v1.0.0/file/download.json +1 -7
- package/dist/nodes/Brevo/__schema__/v1.0.0/contact/get.json +9 -1
- package/dist/nodes/Code/Code.node.d.ts.map +1 -1
- package/dist/nodes/Code/Code.node.js +30 -36
- package/dist/nodes/Code/Code.node.js.map +1 -1
- package/dist/nodes/Code/JsTaskRunnerSandbox.d.ts.map +1 -1
- package/dist/nodes/Code/JsTaskRunnerSandbox.js +13 -3
- package/dist/nodes/Code/JsTaskRunnerSandbox.js.map +1 -1
- package/dist/nodes/Code/Sandbox.d.ts +0 -4
- package/dist/nodes/Code/Sandbox.d.ts.map +1 -1
- package/dist/nodes/Code/Sandbox.js +4 -126
- package/dist/nodes/Code/Sandbox.js.map +1 -1
- package/dist/nodes/Code/reserved-key-found-error.d.ts +5 -0
- package/dist/nodes/Code/reserved-key-found-error.d.ts.map +1 -0
- package/dist/nodes/Code/reserved-key-found-error.js +15 -0
- package/dist/nodes/Code/reserved-key-found-error.js.map +1 -0
- package/dist/nodes/Code/result-validation.d.ts +17 -0
- package/dist/nodes/Code/result-validation.d.ts.map +1 -0
- package/dist/nodes/Code/result-validation.js +129 -0
- package/dist/nodes/Code/result-validation.js.map +1 -0
- package/dist/nodes/DataTable/DataTable.node.js +2 -2
- package/dist/nodes/DataTable/DataTable.node.json +1 -1
- package/dist/nodes/DataTable/actions/router.d.ts.map +1 -1
- package/dist/nodes/DataTable/actions/router.js +43 -17
- package/dist/nodes/DataTable/actions/router.js.map +1 -1
- package/dist/nodes/DataTable/actions/row/Row.resource.d.ts.map +1 -1
- package/dist/nodes/DataTable/actions/row/Row.resource.js +2 -1
- package/dist/nodes/DataTable/actions/row/Row.resource.js.map +1 -1
- package/dist/nodes/DataTable/actions/row/get.operation.d.ts.map +1 -1
- package/dist/nodes/DataTable/actions/row/get.operation.js +14 -1
- package/dist/nodes/DataTable/actions/row/get.operation.js.map +1 -1
- package/dist/nodes/DataTable/actions/row/insert.operation.d.ts +2 -1
- package/dist/nodes/DataTable/actions/row/insert.operation.d.ts.map +1 -1
- package/dist/nodes/DataTable/actions/row/insert.operation.js +6 -0
- package/dist/nodes/DataTable/actions/row/insert.operation.js.map +1 -1
- package/dist/nodes/DataTable/actions/row/update.operation.d.ts.map +1 -1
- package/dist/nodes/DataTable/actions/row/update.operation.js +8 -16
- package/dist/nodes/DataTable/actions/row/update.operation.js.map +1 -1
- package/dist/nodes/DataTable/actions/row/upsert.operation.d.ts.map +1 -1
- package/dist/nodes/DataTable/actions/row/upsert.operation.js +7 -21
- package/dist/nodes/DataTable/actions/row/upsert.operation.js.map +1 -1
- package/dist/nodes/DataTable/common/addRow.d.ts +1 -0
- package/dist/nodes/DataTable/common/addRow.d.ts.map +1 -1
- package/dist/nodes/DataTable/common/addRow.js +4 -3
- package/dist/nodes/DataTable/common/addRow.js.map +1 -1
- package/dist/nodes/DataTable/common/methods.d.ts.map +1 -1
- package/dist/nodes/DataTable/common/methods.js +17 -15
- package/dist/nodes/DataTable/common/methods.js.map +1 -1
- package/dist/nodes/DataTable/common/selectMany.d.ts +2 -2
- package/dist/nodes/DataTable/common/selectMany.d.ts.map +1 -1
- package/dist/nodes/DataTable/common/selectMany.js +26 -15
- package/dist/nodes/DataTable/common/selectMany.js.map +1 -1
- package/dist/nodes/DataTable/common/utils.d.ts +3 -3
- package/dist/nodes/DataTable/common/utils.d.ts.map +1 -1
- package/dist/nodes/DataTable/common/utils.js +6 -3
- package/dist/nodes/DataTable/common/utils.js.map +1 -1
- package/dist/nodes/Discord/__schema__/v2.0.0/channel/get.json +4 -1
- package/dist/nodes/Dropbox/__schema__/v1.0.0/file/download.json +1 -10
- package/dist/nodes/Dropbox/__schema__/v1.0.0/folder/create.json +21 -1
- package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/fetchRequest.json +7 -1
- package/dist/nodes/EmailSend/__schema__/v2.1.0/email/send.json +7 -1
- package/dist/nodes/Form/Form.node.js +1 -1
- package/dist/nodes/Form/Form.node.js.map +1 -1
- package/dist/nodes/Form/common.descriptions.d.ts.map +1 -1
- package/dist/nodes/Form/common.descriptions.js +1 -0
- package/dist/nodes/Form/common.descriptions.js.map +1 -1
- package/dist/nodes/Github/__schema__/v1.1.0/file/get.json +14 -2
- package/dist/nodes/Google/Ads/__schema__/v1.0.0/campaign/getAll.json +1 -10
- package/dist/nodes/Google/Analytics/__schema__/v2.0.0/report/get.json +1 -34
- package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/create.json +1 -4
- package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +4 -4
- package/dist/nodes/Google/Chat/__schema__/v1.0.0/member/getAll.json +1 -7
- package/dist/nodes/Google/Chat/__schema__/v1.0.0/message/create.json +1 -30
- package/dist/nodes/Google/Contacts/__schema__/v1.0.0/contact/create.json +40 -1
- package/dist/nodes/Google/Contacts/__schema__/v1.0.0/contact/getAll.json +1 -21
- package/dist/nodes/Google/Drive/v2/actions/file/createFromText.operation.d.ts.map +1 -1
- package/dist/nodes/Google/Drive/v2/actions/file/createFromText.operation.js +20 -6
- package/dist/nodes/Google/Drive/v2/actions/file/createFromText.operation.js.map +1 -1
- package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.d.ts.map +1 -1
- package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js +25 -5
- package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/create.json +7 -1
- package/dist/nodes/Google/GSuiteAdmin/__schema__/v1.0.0/user/get.json +96 -1
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +13 -1
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/getAll.json +117 -27
- package/dist/nodes/Google/Task/__schema__/v1.0.0/task/getAll.json +1 -4
- package/dist/nodes/Google/YouTube/__schema__/v1.0.0/channel/get.json +1 -4
- package/dist/nodes/Google/YouTube/__schema__/v1.0.0/channel/getAll.json +1 -13
- package/dist/nodes/Google/YouTube/__schema__/v1.0.0/video/get.json +20 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/company/getAll.json +18 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/contact/get.json +345 -74
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/getAll.json +15 -4
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +1 -7
- package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +1 -67
- package/dist/nodes/JinaAI/__schema__/v1.0.0/reader/read.json +1 -9
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +228 -1
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +5 -131
- package/dist/nodes/Mailchimp/__schema__/v1.0.0/member/get.json +4 -1
- package/dist/nodes/Merge/v2/MergeV2.node.d.ts.map +1 -1
- package/dist/nodes/Merge/v2/MergeV2.node.js +6 -6
- package/dist/nodes/Merge/v2/MergeV2.node.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineByFields.d.ts.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineByFields.js +6 -6
- package/dist/nodes/Merge/v3/actions/mode/combineByFields.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.d.ts.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +3 -3
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
- package/dist/nodes/Microsoft/AzureCosmosDb/__schema__/v1.0.0/item/create.json +24 -0
- package/dist/nodes/Microsoft/Entra/__schema__/v1.0.0/user/create.json +4 -4
- package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/file/download.json +1 -89
- package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/folder/create.json +7 -15
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/contact/getAll.json +4 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +16 -8
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/get.json +4 -23
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +31 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/messageAttachment/get.json +16 -1
- package/dist/nodes/Microsoft/SharePoint/__schema__/v1.0.0/item/get.json +1 -4
- package/dist/nodes/Microsoft/Teams/__schema__/v2.0.0/channel/create.json +30 -0
- package/dist/nodes/Microsoft/Teams/__schema__/v2.0.0/chatMessage/sendAndWait.json +3 -6
- package/dist/nodes/Microsoft/ToDo/__schema__/v1.0.0/task/getAll.json +1 -12
- package/dist/nodes/MongoDb/GenericFunctions.d.ts +1 -1
- package/dist/nodes/MongoDb/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/MongoDb/GenericFunctions.js +7 -2
- package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.d.ts.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js +5 -3
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- package/dist/nodes/MySql/__schema__/v2.5.0/database/insert.json +9 -0
- package/dist/nodes/Nasa/__schema__/v1.0.0/donkiSolarFlare/get.json +7 -1
- package/dist/nodes/Odoo/__schema__/v1.0.0/custom/getAll.json +19 -1
- package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +7 -1
- package/dist/nodes/Okta/__schema__/v1.0.0/user/getAll.json +1 -38
- package/dist/nodes/Perplexity/__schema__/v1.0.0/chat/complete.json +4 -1
- package/dist/nodes/Phantombuster/__schema__/v1.0.0/agent/getOutput.json +1 -13
- package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +1 -4
- package/dist/nodes/PostBin/__schema__/v1.0.0/bin/create.json +27 -0
- package/dist/nodes/Reddit/__schema__/v1.0.0/post/getAll.json +1 -63
- package/dist/nodes/Salesforce/__schema__/v1.0.0/case/getAll.json +1 -4
- package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/create.json +1 -15
- package/dist/nodes/Salesforce/__schema__/v1.0.0/lead/getAll.json +4 -1
- package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +1 -7
- package/dist/nodes/Salesforce/__schema__/v1.0.0/task/getAll.json +1 -4
- package/dist/nodes/SendGrid/__schema__/v1.0.0/list/create.json +23 -0
- package/dist/nodes/Shopify/__schema__/v1.0.0/order/getAll.json +4 -1
- package/dist/nodes/Shopify/__schema__/v1.0.0/product/get.json +1 -48
- package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +14 -3
- package/dist/nodes/Ssh/__schema__/v1.0.0/command/execute.json +4 -1
- package/dist/nodes/Strapi/__schema__/v1.0.0/entry/getAll.json +1 -19
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/editMessageText.json +1 -4
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendMessage.json +3 -3
- package/dist/nodes/Trello/__schema__/v1.0.0/list/getAll.json +4 -1
- package/dist/nodes/Trello/__schema__/v1.0.0/list/getCards.json +4 -7
- package/dist/nodes/Twilio/__schema__/v1.0.0/sms/send.json +1 -7
- package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/retweet.json +5 -2
- package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/search.json +7 -1
- package/dist/nodes/Wait/Wait.node.js +1 -1
- package/dist/nodes/Wait/Wait.node.js.map +1 -1
- package/dist/nodes/Wait/validation.js +1 -1
- package/dist/nodes/Wait/validation.js.map +1 -1
- package/dist/nodes/WhatsApp/__schema__/v1.0.0/message/sendAndWait.json +14 -0
- package/dist/nodes/Wordpress/__schema__/v1.0.0/page/create.json +4 -10
- package/dist/nodes/Zoho/__schema__/v1.0.0/account/create.json +37 -0
- package/dist/nodes/Zoho/__schema__/v1.0.0/account/getAll.json +44 -1
- package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +24 -4
- package/dist/nodes/Zoho/__schema__/v1.0.0/lead/getAll.json +1 -18
- package/dist/typecheck.tsbuildinfo +1 -1
- package/dist/types/nodes.json +14 -14
- package/package.json +6 -6
|
@@ -11,7 +11,6 @@ export interface SandboxContext extends IWorkflowDataProxyData {
|
|
|
11
11
|
$getWorkflowStaticData: IExecuteFunctions['getWorkflowStaticData'];
|
|
12
12
|
helpers: IExecuteFunctions['helpers'];
|
|
13
13
|
}
|
|
14
|
-
export declare const REQUIRED_N8N_ITEM_KEYS: Set<string>;
|
|
15
14
|
export declare function getSandboxContext(this: IExecuteFunctions | ISupplyDataFunctions, index: number): SandboxContext;
|
|
16
15
|
export declare abstract class Sandbox extends EventEmitter {
|
|
17
16
|
private textKeys;
|
|
@@ -22,9 +21,6 @@ export declare abstract class Sandbox extends EventEmitter {
|
|
|
22
21
|
abstract runCodeEachItem(itemIndex: number): Promise<INodeExecutionData | undefined>;
|
|
23
22
|
validateRunCodeEachItem(executionResult: INodeExecutionData | undefined, itemIndex: number): INodeExecutionData;
|
|
24
23
|
validateRunCodeAllItems(executionResult: INodeExecutionData | INodeExecutionData[] | undefined): INodeExecutionData[];
|
|
25
|
-
private getTextKey;
|
|
26
|
-
private validateItem;
|
|
27
|
-
private validateTopLevelKeys;
|
|
28
24
|
}
|
|
29
25
|
export {};
|
|
30
26
|
//# sourceMappingURL=Sandbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sandbox.d.ts","sourceRoot":"","sources":["../../../nodes/Code/Sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Sandbox.d.ts","sourceRoot":"","sources":["../../../nodes/Code/Sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,cAAc,CAAC;AAItB,UAAU,eAAe;IACxB,MAAM,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KACf,CAAC;CACF;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC7D,iBAAiB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IACzD,sBAAsB,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;IACnE,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;CACtC;AAED,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,EAC9C,KAAK,EAAE,MAAM,GACX,cAAc,CAgBhB;AAED,8BAAsB,OAAQ,SAAQ,YAAY;IAEhD,OAAO,CAAC,QAAQ;IAChB,SAAS,CAAC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC;gBADvC,QAAQ,EAAE,eAAe,EACvB,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC;IAKhD,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC;IAE3C,QAAQ,CAAC,eAAe,IAAI,OAAO,CAAC,kBAAkB,EAAE,GAAG,kBAAkB,EAAE,EAAE,CAAC;IAElF,QAAQ,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAEpF,uBAAuB,CACtB,eAAe,EAAE,kBAAkB,GAAG,SAAS,EAC/C,SAAS,EAAE,MAAM,GACf,kBAAkB;IASrB,uBAAuB,CACtB,eAAe,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,GAAG,SAAS,GACpE,kBAAkB,EAAE;CAOvB"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Sandbox =
|
|
3
|
+
exports.Sandbox = void 0;
|
|
4
4
|
exports.getSandboxContext = getSandboxContext;
|
|
5
5
|
const events_1 = require("events");
|
|
6
|
-
const
|
|
7
|
-
const ValidationError_1 = require("./ValidationError");
|
|
8
|
-
exports.REQUIRED_N8N_ITEM_KEYS = new Set([
|
|
9
|
-
'json',
|
|
10
|
-
'binary',
|
|
11
|
-
'pairedItem',
|
|
12
|
-
'error',
|
|
13
|
-
/**
|
|
14
|
-
* The `index` key was added accidentally to Function, FunctionItem, Gong,
|
|
15
|
-
* Execute Workflow, and ToolWorkflowV2, so we need to allow it temporarily.
|
|
16
|
-
* Once we stop using it in all nodes, we can stop allowing the `index` key.
|
|
17
|
-
*/
|
|
18
|
-
'index',
|
|
19
|
-
]);
|
|
6
|
+
const result_validation_1 = require("./result-validation");
|
|
20
7
|
function getSandboxContext(index) {
|
|
21
8
|
const helpers = {
|
|
22
9
|
...this.helpers,
|
|
@@ -42,120 +29,11 @@ class Sandbox extends events_1.EventEmitter {
|
|
|
42
29
|
this.helpers = helpers;
|
|
43
30
|
}
|
|
44
31
|
validateRunCodeEachItem(executionResult, itemIndex) {
|
|
45
|
-
|
|
46
|
-
throw new ValidationError_1.ValidationError({
|
|
47
|
-
message: `Code doesn't return ${this.getTextKey('object', { includeArticle: true })}`,
|
|
48
|
-
description: `Please return ${this.getTextKey('object', {
|
|
49
|
-
includeArticle: true,
|
|
50
|
-
})} representing the output item. ('${executionResult}' was returned instead.)`,
|
|
51
|
-
itemIndex,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (Array.isArray(executionResult)) {
|
|
55
|
-
const firstSentence = executionResult.length > 0
|
|
56
|
-
? `An array of ${typeof executionResult[0]}s was returned.`
|
|
57
|
-
: 'An empty array was returned.';
|
|
58
|
-
throw new ValidationError_1.ValidationError({
|
|
59
|
-
message: `Code doesn't return a single ${this.getTextKey('object')}`,
|
|
60
|
-
description: `${firstSentence} If you need to output multiple items, please use the 'Run Once for All Items' mode instead.`,
|
|
61
|
-
itemIndex,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
const [returnData] = this.helpers.normalizeItems([executionResult]);
|
|
65
|
-
this.validateItem(returnData, itemIndex);
|
|
66
|
-
// If at least one top-level key is a supported item key (`json`, `binary`, etc.),
|
|
67
|
-
// and another top-level key is unrecognized, then the user mis-added a property
|
|
68
|
-
// directly on the item, when they intended to add it on the `json` property
|
|
69
|
-
this.validateTopLevelKeys(returnData, itemIndex);
|
|
70
|
-
return returnData;
|
|
32
|
+
return (0, result_validation_1.validateRunCodeEachItem)(executionResult, itemIndex, this.textKeys, this.helpers.normalizeItems.bind(this.helpers));
|
|
71
33
|
}
|
|
72
34
|
validateRunCodeAllItems(executionResult) {
|
|
73
|
-
|
|
74
|
-
throw new ValidationError_1.ValidationError({
|
|
75
|
-
message: "Code doesn't return items properly",
|
|
76
|
-
description: `Please return an array of ${this.getTextKey('object', {
|
|
77
|
-
plural: true,
|
|
78
|
-
})}, one for each item you would like to output.`,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (Array.isArray(executionResult)) {
|
|
82
|
-
/**
|
|
83
|
-
* If at least one top-level key is an n8n item key (`json`, `binary`, etc.),
|
|
84
|
-
* then require all item keys to be an n8n item key.
|
|
85
|
-
*
|
|
86
|
-
* If no top-level key is an n8n key, then skip this check, allowing non-n8n
|
|
87
|
-
* item keys to be wrapped in `json` when normalizing items below.
|
|
88
|
-
*/
|
|
89
|
-
const mustHaveTopLevelN8nKey = executionResult.some((item) => Object.keys(item).find((key) => exports.REQUIRED_N8N_ITEM_KEYS.has(key)));
|
|
90
|
-
if (mustHaveTopLevelN8nKey) {
|
|
91
|
-
for (let index = 0; index < executionResult.length; index++) {
|
|
92
|
-
const item = executionResult[index];
|
|
93
|
-
this.validateTopLevelKeys(item, index);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
const returnData = this.helpers.normalizeItems(executionResult);
|
|
98
|
-
returnData.forEach((item, index) => this.validateItem(item, index));
|
|
99
|
-
return returnData;
|
|
100
|
-
}
|
|
101
|
-
getTextKey(key, options) {
|
|
102
|
-
const response = this.textKeys[key][options?.plural ? 'plural' : 'singular'];
|
|
103
|
-
if (!options?.includeArticle) {
|
|
104
|
-
return response;
|
|
105
|
-
}
|
|
106
|
-
if (['a', 'e', 'i', 'o', 'u'].some((value) => response.startsWith(value))) {
|
|
107
|
-
return `an ${response}`;
|
|
108
|
-
}
|
|
109
|
-
return `a ${response}`;
|
|
110
|
-
}
|
|
111
|
-
validateItem({ json, binary }, itemIndex) {
|
|
112
|
-
if (json === undefined || !(0, utils_1.isObject)(json)) {
|
|
113
|
-
throw new ValidationError_1.ValidationError({
|
|
114
|
-
message: `A 'json' property isn't ${this.getTextKey('object', { includeArticle: true })}`,
|
|
115
|
-
description: `In the returned data, every key named 'json' must point to ${this.getTextKey('object', { includeArticle: true })}.`,
|
|
116
|
-
itemIndex,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
if (binary !== undefined && !(0, utils_1.isObject)(binary)) {
|
|
120
|
-
throw new ValidationError_1.ValidationError({
|
|
121
|
-
message: `A 'binary' property isn't ${this.getTextKey('object', { includeArticle: true })}`,
|
|
122
|
-
description: `In the returned data, every key named 'binary’ must point to ${this.getTextKey('object', { includeArticle: true })}.`,
|
|
123
|
-
itemIndex,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
validateTopLevelKeys(item, itemIndex) {
|
|
128
|
-
let foundReservedKey = null;
|
|
129
|
-
const unknownKeys = [];
|
|
130
|
-
for (const key in item) {
|
|
131
|
-
if (!Object.prototype.hasOwnProperty.call(item, key))
|
|
132
|
-
continue;
|
|
133
|
-
if (exports.REQUIRED_N8N_ITEM_KEYS.has(key)) {
|
|
134
|
-
foundReservedKey ??= key;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
unknownKeys.push(key);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (unknownKeys.length > 0) {
|
|
141
|
-
if (foundReservedKey)
|
|
142
|
-
throw new ReservedKeyFoundError(foundReservedKey, itemIndex);
|
|
143
|
-
throw new ValidationError_1.ValidationError({
|
|
144
|
-
message: `Unknown top-level item key: ${unknownKeys[0]}`,
|
|
145
|
-
description: 'Access the properties of an item under `.json`, e.g. `item.json`',
|
|
146
|
-
itemIndex,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
35
|
+
return (0, result_validation_1.validateRunCodeAllItems)(executionResult, this.textKeys, this.helpers.normalizeItems.bind(this.helpers));
|
|
149
36
|
}
|
|
150
37
|
}
|
|
151
38
|
exports.Sandbox = Sandbox;
|
|
152
|
-
class ReservedKeyFoundError extends ValidationError_1.ValidationError {
|
|
153
|
-
constructor(reservedKey, itemIndex) {
|
|
154
|
-
super({
|
|
155
|
-
message: 'Invalid output format',
|
|
156
|
-
description: `An output item contains the reserved key <code>${reservedKey}</code>. To get around this, please wrap each item in an object, under a key called <code>json</code>. <a href="https://docs.n8n.io/data/data-structure/#data-structure" target="_blank">Example</a>`,
|
|
157
|
-
itemIndex,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
39
|
//# sourceMappingURL=Sandbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sandbox.js","sourceRoot":"","sources":["../../../nodes/Code/Sandbox.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Sandbox.js","sourceRoot":"","sources":["../../../nodes/Code/Sandbox.ts"],"names":[],"mappings":";;;AAuBA,8CAmBC;AA1CD,mCAAsC;AAQtC,2DAAuF;AAevF,SAAgB,iBAAiB,CAEhC,KAAa;IAEb,MAAM,OAAO,GAAG;QACf,GAAG,IAAI,CAAC,OAAO;QACf,6BAA6B,EAAE,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC;QACpF,kCAAkC,EAAE,IAAI,CAAC,OAAO,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC;KAC9F,CAAC;IACF,OAAO;QACN,4BAA4B;QAC5B,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;QACnD,sBAAsB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;QAC7D,OAAO;QAEP,qEAAqE;QACrE,iDAAiD;QACjD,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;KACnC,CAAC;AACH,CAAC;AAED,MAAsB,OAAQ,SAAQ,qBAAY;IAExC;IACE;IAFX,YACS,QAAyB,EACvB,OAAqC;QAE/C,KAAK,EAAE,CAAC;QAHA,aAAQ,GAAR,QAAQ,CAAiB;QACvB,YAAO,GAAP,OAAO,CAA8B;IAGhD,CAAC;IAQD,uBAAuB,CACtB,eAA+C,EAC/C,SAAiB;QAEjB,OAAO,IAAA,2CAAuB,EAC7B,eAAe,EACf,SAAS,EACT,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAC9C,CAAC;IACH,CAAC;IAED,uBAAuB,CACtB,eAAsE;QAEtE,OAAO,IAAA,2CAAuB,EAC7B,eAAe,EACf,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAC9C,CAAC;IACH,CAAC;CACD;AAnCD,0BAmCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-key-found-error.d.ts","sourceRoot":"","sources":["../../../nodes/Code/reserved-key-found-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,qBAAsB,SAAQ,eAAe;gBAC7C,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAOlD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReservedKeyFoundError = void 0;
|
|
4
|
+
const ValidationError_1 = require("./ValidationError");
|
|
5
|
+
class ReservedKeyFoundError extends ValidationError_1.ValidationError {
|
|
6
|
+
constructor(reservedKey, itemIndex) {
|
|
7
|
+
super({
|
|
8
|
+
message: 'Invalid output format',
|
|
9
|
+
description: `An output item contains the reserved key <code>${reservedKey}</code>. To get around this, please wrap each item in an object, under a key called <code>json</code>. <a href="https://docs.n8n.io/data/data-structure/#data-structure" target="_blank">Example</a>`,
|
|
10
|
+
itemIndex,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ReservedKeyFoundError = ReservedKeyFoundError;
|
|
15
|
+
//# sourceMappingURL=reserved-key-found-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-key-found-error.js","sourceRoot":"","sources":["../../../nodes/Code/reserved-key-found-error.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAEpD,MAAa,qBAAsB,SAAQ,iCAAe;IACzD,YAAY,WAAmB,EAAE,SAAiB;QACjD,KAAK,CAAC;YACL,OAAO,EAAE,uBAAuB;YAChC,WAAW,EAAE,kDAAkD,WAAW,sMAAsM;YAChR,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;CACD;AARD,sDAQC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export interface TextKeys {
|
|
3
|
+
object: {
|
|
4
|
+
singular: string;
|
|
5
|
+
plural: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare const REQUIRED_N8N_ITEM_KEYS: Set<string>;
|
|
9
|
+
export declare function getTextKey(textKeys: TextKeys, key: keyof TextKeys, options?: {
|
|
10
|
+
includeArticle?: boolean;
|
|
11
|
+
plural?: boolean;
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function validateItem({ json, binary }: INodeExecutionData, itemIndex: number, textKeys: TextKeys): void;
|
|
14
|
+
export declare function validateTopLevelKeys(item: INodeExecutionData, itemIndex: number): void;
|
|
15
|
+
export declare function validateRunCodeEachItem(executionResult: INodeExecutionData | undefined, itemIndex: number, textKeys: TextKeys, normalizeItems: (items: INodeExecutionData[]) => INodeExecutionData[]): INodeExecutionData;
|
|
16
|
+
export declare function validateRunCodeAllItems(executionResult: INodeExecutionData | INodeExecutionData[] | undefined, textKeys: TextKeys, normalizeItems: (items: INodeExecutionData | INodeExecutionData[]) => INodeExecutionData[]): INodeExecutionData[];
|
|
17
|
+
//# sourceMappingURL=result-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-validation.d.ts","sourceRoot":"","sources":["../../../nodes/Code/result-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMvD,MAAM,WAAW,QAAQ;IACxB,MAAM,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KACf,CAAC;CACF;AAED,eAAO,MAAM,sBAAsB,aAA8D,CAAC;AAElG,wBAAgB,UAAU,CACzB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,MAAM,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,UAUxD;AAED,wBAAgB,YAAY,CAC3B,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,kBAAkB,EACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,QAyBlB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,QAuB/E;AAED,wBAAgB,uBAAuB,CACtC,eAAe,EAAE,kBAAkB,GAAG,SAAS,EAC/C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,GACnE,kBAAkB,CAiCpB;AAED,wBAAgB,uBAAuB,CACtC,eAAe,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,GAAG,SAAS,EACtE,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,GACxF,kBAAkB,EAAE,CA4CtB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REQUIRED_N8N_ITEM_KEYS = void 0;
|
|
4
|
+
exports.getTextKey = getTextKey;
|
|
5
|
+
exports.validateItem = validateItem;
|
|
6
|
+
exports.validateTopLevelKeys = validateTopLevelKeys;
|
|
7
|
+
exports.validateRunCodeEachItem = validateRunCodeEachItem;
|
|
8
|
+
exports.validateRunCodeAllItems = validateRunCodeAllItems;
|
|
9
|
+
const reserved_key_found_error_1 = require("./reserved-key-found-error");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
const ValidationError_1 = require("./ValidationError");
|
|
12
|
+
exports.REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem', 'error', 'index']);
|
|
13
|
+
function getTextKey(textKeys, key, options) {
|
|
14
|
+
const response = textKeys[key][options?.plural ? 'plural' : 'singular'];
|
|
15
|
+
if (!options?.includeArticle) {
|
|
16
|
+
return response;
|
|
17
|
+
}
|
|
18
|
+
if (['a', 'e', 'i', 'o', 'u'].some((value) => response.startsWith(value))) {
|
|
19
|
+
return `an ${response}`;
|
|
20
|
+
}
|
|
21
|
+
return `a ${response}`;
|
|
22
|
+
}
|
|
23
|
+
function validateItem({ json, binary }, itemIndex, textKeys) {
|
|
24
|
+
if (json === undefined || !(0, utils_1.isObject)(json)) {
|
|
25
|
+
throw new ValidationError_1.ValidationError({
|
|
26
|
+
message: `A 'json' property isn't ${getTextKey(textKeys, 'object', { includeArticle: true })}`,
|
|
27
|
+
description: `In the returned data, every key named 'json' must point to ${getTextKey(textKeys, 'object', { includeArticle: true })}.`,
|
|
28
|
+
itemIndex,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (binary !== undefined && !(0, utils_1.isObject)(binary)) {
|
|
32
|
+
throw new ValidationError_1.ValidationError({
|
|
33
|
+
message: `A 'binary' property isn't ${getTextKey(textKeys, 'object', { includeArticle: true })}`,
|
|
34
|
+
description: `In the returned data, every key named 'binary' must point to ${getTextKey(textKeys, 'object', { includeArticle: true })}.`,
|
|
35
|
+
itemIndex,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function validateTopLevelKeys(item, itemIndex) {
|
|
40
|
+
let foundReservedKey = null;
|
|
41
|
+
const unknownKeys = [];
|
|
42
|
+
for (const key in item) {
|
|
43
|
+
if (!Object.prototype.hasOwnProperty.call(item, key))
|
|
44
|
+
continue;
|
|
45
|
+
if (exports.REQUIRED_N8N_ITEM_KEYS.has(key)) {
|
|
46
|
+
foundReservedKey ??= key;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
unknownKeys.push(key);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (unknownKeys.length > 0) {
|
|
53
|
+
if (foundReservedKey)
|
|
54
|
+
throw new reserved_key_found_error_1.ReservedKeyFoundError(foundReservedKey, itemIndex);
|
|
55
|
+
throw new ValidationError_1.ValidationError({
|
|
56
|
+
message: `Unknown top-level item key: ${unknownKeys[0]}`,
|
|
57
|
+
description: 'Access the properties of an item under `.json`, e.g. `item.json`',
|
|
58
|
+
itemIndex,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function validateRunCodeEachItem(executionResult, itemIndex, textKeys, normalizeItems) {
|
|
63
|
+
if (typeof executionResult !== 'object') {
|
|
64
|
+
throw new ValidationError_1.ValidationError({
|
|
65
|
+
message: `Code doesn't return ${getTextKey(textKeys, 'object', { includeArticle: true })}`,
|
|
66
|
+
description: `Please return ${getTextKey(textKeys, 'object', {
|
|
67
|
+
includeArticle: true,
|
|
68
|
+
})} representing the output item. ('${executionResult}' was returned instead.)`,
|
|
69
|
+
itemIndex,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(executionResult)) {
|
|
73
|
+
const firstSentence = executionResult.length > 0
|
|
74
|
+
? `An array of ${typeof executionResult[0]}s was returned.`
|
|
75
|
+
: 'An empty array was returned.';
|
|
76
|
+
throw new ValidationError_1.ValidationError({
|
|
77
|
+
message: `Code doesn't return a single ${getTextKey(textKeys, 'object')}`,
|
|
78
|
+
description: `${firstSentence} If you need to output multiple items, please use the 'Run Once for All Items' mode instead.`,
|
|
79
|
+
itemIndex,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const [returnData] = normalizeItems([executionResult]);
|
|
83
|
+
validateItem(returnData, itemIndex, textKeys);
|
|
84
|
+
// If at least one top-level key is a supported item key (`json`, `binary`, etc.),
|
|
85
|
+
// and another top-level key is unrecognized, then the user mis-added a property
|
|
86
|
+
// directly on the item, when they intended to add it on the `json` property
|
|
87
|
+
validateTopLevelKeys(returnData, itemIndex);
|
|
88
|
+
return returnData;
|
|
89
|
+
}
|
|
90
|
+
function validateRunCodeAllItems(executionResult, textKeys, normalizeItems) {
|
|
91
|
+
if (typeof executionResult !== 'object') {
|
|
92
|
+
throw new ValidationError_1.ValidationError({
|
|
93
|
+
message: "Code doesn't return items properly",
|
|
94
|
+
description: `Please return an array of ${getTextKey(textKeys, 'object', {
|
|
95
|
+
plural: true,
|
|
96
|
+
})}, one for each item you would like to output.`,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (Array.isArray(executionResult)) {
|
|
100
|
+
/**
|
|
101
|
+
* If at least one top-level key is an n8n item key (`json`, `binary`, etc.),
|
|
102
|
+
* then require all item keys to be an n8n item key.
|
|
103
|
+
*
|
|
104
|
+
* If no top-level key is an n8n key, then skip this check, allowing non-n8n
|
|
105
|
+
* item keys to be wrapped in `json` when normalizing items below.
|
|
106
|
+
*/
|
|
107
|
+
for (const item of executionResult) {
|
|
108
|
+
if (!(0, utils_1.isObject)(item)) {
|
|
109
|
+
throw new ValidationError_1.ValidationError({
|
|
110
|
+
message: "Code doesn't return items properly",
|
|
111
|
+
description: `Please return an array of ${getTextKey(textKeys, 'object', {
|
|
112
|
+
plural: true,
|
|
113
|
+
})}, one for each item you would like to output.`,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const mustHaveTopLevelN8nKey = executionResult.some((item) => Object.keys(item).find((key) => exports.REQUIRED_N8N_ITEM_KEYS.has(key)));
|
|
118
|
+
if (mustHaveTopLevelN8nKey) {
|
|
119
|
+
for (let index = 0; index < executionResult.length; index++) {
|
|
120
|
+
const item = executionResult[index];
|
|
121
|
+
validateTopLevelKeys(item, index);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const returnData = normalizeItems(executionResult);
|
|
126
|
+
returnData.forEach((item, index) => validateItem(item, index, textKeys));
|
|
127
|
+
return returnData;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=result-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-validation.js","sourceRoot":"","sources":["../../../nodes/Code/result-validation.ts"],"names":[],"mappings":";;;AAeA,gCAaC;AAED,oCA4BC;AAED,oDAuBC;AAED,0DAsCC;AAED,0DAgDC;AA3KD,yEAAmE;AACnE,mCAAmC;AACnC,uDAAoD;AASvC,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAElG,SAAgB,UAAU,CACzB,QAAkB,EAClB,GAAmB,EACnB,OAAwD;IAExD,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,E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,oCAAoC;oBAC7C,WAAW,EAAE,6BAA6B,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE;wBACxE,MAAM,EAAE,IAAI;qBACZ,CAAC,+CAA+C;iBACjD,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,MAAM,sBAAsB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,8BAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAChE,CAAC;QAEF,IAAI,sBAAsB,EAAE,CAAC;YAC5B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC7D,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;gBACpC,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACnC,CAAC;QACF,CAAC;IACF,CAAC;IAED,MAAM,UAAU,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;IACnD,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IACzE,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -40,7 +40,7 @@ const row = __importStar(require("./actions/row/Row.resource"));
|
|
|
40
40
|
const methods_1 = require("./common/methods");
|
|
41
41
|
class DataTable {
|
|
42
42
|
description = {
|
|
43
|
-
displayName: 'Data
|
|
43
|
+
displayName: 'Data table',
|
|
44
44
|
name: 'dataTable',
|
|
45
45
|
icon: 'fa:table',
|
|
46
46
|
iconColor: 'orange-red',
|
|
@@ -49,7 +49,7 @@ class DataTable {
|
|
|
49
49
|
subtitle: '={{$parameter["action"]}}',
|
|
50
50
|
description: 'Permanently save data across workflow executions in a table',
|
|
51
51
|
defaults: {
|
|
52
|
-
name: 'Data
|
|
52
|
+
name: 'Data table',
|
|
53
53
|
},
|
|
54
54
|
usableAsTool: true,
|
|
55
55
|
// We have custom logic in the frontend to ignore `hidden` for this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../nodes/DataTable/actions/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../nodes/DataTable/actions/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAGlB,MAAM,cAAc,CAAC;AAwBtB,wBAAsB,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAsDrF"}
|
|
@@ -34,10 +34,21 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.router = router;
|
|
37
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
37
|
const row = __importStar(require("./row/Row.resource"));
|
|
38
|
+
const fields_1 = require("../common/fields");
|
|
39
|
+
const utils_1 = require("../common/utils");
|
|
40
|
+
const BULK_OPERATIONS = ['insert'];
|
|
41
|
+
function canBulk(operation) {
|
|
42
|
+
return BULK_OPERATIONS.includes(operation);
|
|
43
|
+
}
|
|
44
|
+
function hasComplexId(ctx) {
|
|
45
|
+
const dataStoreIdExpr = ctx.getNodeParameter(`${fields_1.DATA_TABLE_ID_FIELD}.value`, 0, undefined, {
|
|
46
|
+
rawExpressions: true,
|
|
47
|
+
});
|
|
48
|
+
return typeof dataStoreIdExpr === 'string' && dataStoreIdExpr.includes('{');
|
|
49
|
+
}
|
|
39
50
|
async function router() {
|
|
40
|
-
|
|
51
|
+
let operationResult = [];
|
|
41
52
|
let responseData = [];
|
|
42
53
|
const items = this.getInputData();
|
|
43
54
|
const resource = this.getNodeParameter('resource', 0);
|
|
@@ -46,32 +57,47 @@ async function router() {
|
|
|
46
57
|
resource,
|
|
47
58
|
operation,
|
|
48
59
|
};
|
|
49
|
-
|
|
60
|
+
// If the operation supports
|
|
61
|
+
if (canBulk(dataTableNodeData.operation) && !hasComplexId(this)) {
|
|
50
62
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
break;
|
|
55
|
-
default:
|
|
56
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`);
|
|
57
|
-
}
|
|
58
|
-
const executionData = this.helpers.constructExecutionMetaData(responseData, {
|
|
59
|
-
itemData: { item: i },
|
|
60
|
-
});
|
|
61
|
-
operationResult.push.apply(operationResult, executionData);
|
|
63
|
+
const proxy = await (0, utils_1.getDataTableProxyExecute)(this);
|
|
64
|
+
responseData = await row[dataTableNodeData.operation]['executeBulk'].call(this, proxy);
|
|
65
|
+
operationResult = responseData;
|
|
62
66
|
}
|
|
63
67
|
catch (error) {
|
|
64
68
|
if (this.continueOnFail()) {
|
|
65
|
-
operationResult.
|
|
66
|
-
json
|
|
69
|
+
operationResult = this.getInputData().map((json) => ({
|
|
70
|
+
json,
|
|
67
71
|
error: error,
|
|
68
|
-
});
|
|
72
|
+
}));
|
|
69
73
|
}
|
|
70
74
|
else {
|
|
71
75
|
throw error;
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
}
|
|
79
|
+
else {
|
|
80
|
+
for (let i = 0; i < items.length; i++) {
|
|
81
|
+
try {
|
|
82
|
+
responseData = await row[dataTableNodeData.operation].execute.call(this, i);
|
|
83
|
+
const executionData = this.helpers.constructExecutionMetaData(responseData, {
|
|
84
|
+
itemData: { item: i },
|
|
85
|
+
});
|
|
86
|
+
operationResult.push.apply(operationResult, executionData);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (this.continueOnFail()) {
|
|
90
|
+
operationResult.push({
|
|
91
|
+
json: this.getInputData(i)[0].json,
|
|
92
|
+
error: error,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
75
101
|
return [operationResult];
|
|
76
102
|
}
|
|
77
103
|
//# sourceMappingURL=router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../nodes/DataTable/actions/router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../nodes/DataTable/actions/router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,wBAsDC;AA5ED,wDAA0C;AAC1C,6CAAuD;AACvD,2CAA2D;AAM3D,MAAM,eAAe,GAAG,CAAC,QAAQ,CAAU,CAAC;AAE5C,SAAS,OAAO,CAAC,SAAiB;IACjC,OAAQ,eAAqC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,YAAY,CAAC,GAAsB;IAC3C,MAAM,eAAe,GAAG,GAAG,CAAC,gBAAgB,CAAC,GAAG,4BAAmB,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE;QAC1F,cAAc,EAAE,IAAI;KACpB,CAAC,CAAC;IAEH,OAAO,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AAEM,KAAK,UAAU,MAAM;IAC3B,IAAI,eAAe,GAAyB,EAAE,CAAC;IAC/C,IAAI,YAAY,GAAyB,EAAE,CAAC;IAE5C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UA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,EAAE,CAAC,EAAE;iBACrB,CAAC,CAAC;gBAEH,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,eAAe,CAAC,IAAI,CAAC;wBACpB,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;wBAClC,KAAK,EAAE,KAA2B;qBAClC,CAAC,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACP,MAAM,KAAK,CAAC;gBACb,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,CAAC,eAAe,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.resource.d.ts","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/Row.resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAEnD,eAAO,MAAM,WAAW,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"Row.resource.d.ts","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/Row.resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAEnD,eAAO,MAAM,WAAW,EAAE,eAAe,EA2ExC,CAAC"}
|
|
@@ -91,7 +91,8 @@ exports.description = [
|
|
|
91
91
|
default: 'insert',
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
|
|
94
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
95
|
+
displayName: 'Data table',
|
|
95
96
|
name: fields_1.DATA_TABLE_ID_FIELD,
|
|
96
97
|
type: 'resourceLocator',
|
|
97
98
|
default: { mode: 'list', value: '' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.resource.js","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/Row.resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+DAAiD;AAO3B,gCAAU;AANhC,qDAAuC;AAMtB,kBAAG;AALpB,2DAA6C;AAKpC,wBAAM;AAJf,2DAA6C;AAIX,wBAAM;AAHxC,2DAA6C;AAGH,wBAAM;AAFhD,gDAA0D;AAI7C,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,KAAK,CAAC;aACjB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,WAAW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,WAAW;IACrB,GAAG,MAAM,CAAC,WAAW;CACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Row.resource.js","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/Row.resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+DAAiD;AAO3B,gCAAU;AANhC,qDAAuC;AAMtB,kBAAG;AALpB,2DAA6C;AAKpC,wBAAM;AAJf,2DAA6C;AAIX,wBAAM;AAHxC,2DAA6C;AAGH,wBAAM;AAFhD,gDAA0D;AAI7C,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,KAAK,CAAC;aACjB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,WAAW,EAAE,eAAe;gBAC5B,MAAM,EAAE,eAAe;aACvB;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,WAAW,EAAE,YAAY;gBACzB,MAAM,EAAE,YAAY;aACpB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,WAAW,EAAE,kBAAkB;gBAC/B,MAAM,EAAE,YAAY;aACpB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,WAAW,EAAE,uCAAuC;gBACpD,MAAM,EAAE,eAAe;aACvB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,WAAW,EAAE,+CAA+C;gBAC5D,MAAM,EAAE,eAAe;aACvB;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD;QACC,2EAA2E;QAC3E,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,4BAAmB;QACzB,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,aAAa;oBAC/B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,IAAI;gBACjB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,QAAQ;aACd;SACD;QACD,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;KAC/C;IACD,GAAG,UAAU,CAAC,WAAW;IACzB,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,GAAG,CAAC,WAAW;IAClB,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,MAAM,CAAC,WAAW;CACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/get.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,MAAM,cAAc,CAAC;AAKtB,eAAO,MAAM,KAAK,EAAE,MAAc,CAAC;AASnC,eAAO,MAAM,WAAW,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"get.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/get.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,MAAM,cAAc,CAAC;AAKtB,eAAO,MAAM,KAAK,EAAE,MAAc,CAAC;AASnC,eAAO,MAAM,WAAW,EAAE,eAAe,EAaxC,CAAC;AAEF,wBAAsB,OAAO,CAC5B,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAI/B"}
|
|
@@ -11,7 +11,20 @@ const displayOptions = {
|
|
|
11
11
|
operation: [exports.FIELD],
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
|
-
exports.description = [
|
|
14
|
+
exports.description = [
|
|
15
|
+
...(0, selectMany_1.getSelectFields)(displayOptions),
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Limit',
|
|
18
|
+
name: 'limit',
|
|
19
|
+
type: 'number',
|
|
20
|
+
typeOptions: {
|
|
21
|
+
minValue: 1,
|
|
22
|
+
},
|
|
23
|
+
displayOptions,
|
|
24
|
+
default: null,
|
|
25
|
+
description: 'Max number of results to return',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
15
28
|
async function execute(index) {
|
|
16
29
|
const dataStoreProxy = await (0, utils_1.getDataTableProxyExecute)(this, index);
|
|
17
30
|
return await (0, selectMany_1.executeSelectMany)(this, index, dataStoreProxy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/get.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/get.operation.ts"],"names":[],"mappings":";;;AAkCA,0BAOC;AAlCD,wDAA6E;AAC7E,8CAA8D;AAEjD,QAAA,KAAK,GAAW,KAAK,CAAC;AAEnC,MAAM,cAAc,GAAoB;IACvC,IAAI,EAAE;QACL,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,SAAS,EAAE,CAAC,aAAK,CAAC;KAClB;CACD,CAAC;AAEW,QAAA,WAAW,GAAsB;IAC7C,GAAG,IAAA,4BAAe,EAAC,cAAc,CAAC;IAClC;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;YACZ,QAAQ,EAAE,CAAC;SACX;QACD,cAAc;QACd,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,iCAAiC;KAC9C;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,KAAa;IAEb,MAAM,cAAc,GAAG,MAAM,IAAA,gCAAwB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEnE,OAAO,MAAM,IAAA,8BAAiB,EAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import type { IDataStoreProjectService, IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare const FIELD: string;
|
|
3
3
|
export declare const description: INodeProperties[];
|
|
4
4
|
export declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
|
|
5
|
+
export declare function executeBulk(this: IExecuteFunctions, proxy: IDataStoreProjectService): Promise<INodeExecutionData[]>;
|
|
5
6
|
//# sourceMappingURL=insert.operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/insert.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"insert.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/insert.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EAExB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,MAAM,cAAc,CAAC;AAKtB,eAAO,MAAM,KAAK,EAAE,MAAiB,CAAC;AAStC,eAAO,MAAM,WAAW,EAAE,eAAe,EAAwC,CAAC;AAElF,wBAAsB,OAAO,CAC5B,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAO/B;AAED,wBAAsB,WAAW,CAChC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,wBAAwB,GAC7B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAK/B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.description = exports.FIELD = void 0;
|
|
4
4
|
exports.execute = execute;
|
|
5
|
+
exports.executeBulk = executeBulk;
|
|
5
6
|
const addRow_1 = require("../../common/addRow");
|
|
6
7
|
const utils_1 = require("../../common/utils");
|
|
7
8
|
exports.FIELD = 'insert';
|
|
@@ -18,4 +19,9 @@ async function execute(index) {
|
|
|
18
19
|
const insertedRows = await dataStoreProxy.insertRows([row]);
|
|
19
20
|
return insertedRows.map((json) => ({ json }));
|
|
20
21
|
}
|
|
22
|
+
async function executeBulk(proxy) {
|
|
23
|
+
const rows = this.getInputData().flatMap((_, i) => [(0, addRow_1.getAddRow)(this, i)]);
|
|
24
|
+
const insertedRows = await proxy.insertRows(rows);
|
|
25
|
+
return insertedRows.map((json, item) => ({ json, pairedItem: { item } }));
|
|
26
|
+
}
|
|
21
27
|
//# sourceMappingURL=insert.operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert.operation.js","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/insert.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"insert.operation.js","sourceRoot":"","sources":["../../../../../nodes/DataTable/actions/row/insert.operation.ts"],"names":[],"mappings":";;;AAsBA,0BAUC;AAED,kCAQC;AAlCD,gDAA4D;AAC5D,8CAA8D;AAEjD,QAAA,KAAK,GAAW,QAAQ,CAAC;AAEtC,MAAM,cAAc,GAAoB;IACvC,IAAI,EAAE;QACL,QAAQ,EA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