n8n-nodes-base 1.107.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/known/nodes.json +4 -0
- package/dist/methods/defined.json +4 -0
- package/dist/methods/referenced.json +4 -0
- 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 -33
- 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/PythonTaskRunnerSandbox.d.ts.map +1 -1
- package/dist/nodes/Code/PythonTaskRunnerSandbox.js +8 -0
- package/dist/nodes/Code/PythonTaskRunnerSandbox.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.d.ts +19 -0
- package/dist/nodes/DataTable/DataTable.node.d.ts.map +1 -0
- package/dist/nodes/DataTable/DataTable.node.js +94 -0
- package/dist/nodes/DataTable/DataTable.node.js.map +1 -0
- package/dist/nodes/DataTable/DataTable.node.json +18 -0
- package/dist/nodes/DataTable/actions/router.d.ts +3 -0
- package/dist/nodes/DataTable/actions/router.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/router.js +103 -0
- package/dist/nodes/DataTable/actions/router.js.map +1 -0
- package/dist/nodes/DataTable/actions/row/Row.resource.d.ts +9 -0
- package/dist/nodes/DataTable/actions/row/Row.resource.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/row/Row.resource.js +124 -0
- package/dist/nodes/DataTable/actions/row/Row.resource.js.map +1 -0
- package/dist/nodes/DataTable/actions/row/delete.operation.d.ts +5 -0
- package/dist/nodes/DataTable/actions/row/delete.operation.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/row/delete.operation.js +44 -0
- package/dist/nodes/DataTable/actions/row/delete.operation.js.map +1 -0
- package/dist/nodes/DataTable/actions/row/get.operation.d.ts +5 -0
- package/dist/nodes/DataTable/actions/row/get.operation.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/row/get.operation.js +32 -0
- package/dist/nodes/DataTable/actions/row/get.operation.js.map +1 -0
- package/dist/nodes/DataTable/actions/row/insert.operation.d.ts +6 -0
- package/dist/nodes/DataTable/actions/row/insert.operation.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/row/insert.operation.js +27 -0
- package/dist/nodes/DataTable/actions/row/insert.operation.js.map +1 -0
- package/dist/nodes/DataTable/actions/row/update.operation.d.ts +5 -0
- package/dist/nodes/DataTable/actions/row/update.operation.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/row/update.operation.js +33 -0
- package/dist/nodes/DataTable/actions/row/update.operation.js.map +1 -0
- package/dist/nodes/DataTable/actions/row/upsert.operation.d.ts +5 -0
- package/dist/nodes/DataTable/actions/row/upsert.operation.d.ts.map +1 -0
- package/dist/nodes/DataTable/actions/row/upsert.operation.js +33 -0
- package/dist/nodes/DataTable/actions/row/upsert.operation.js.map +1 -0
- package/dist/nodes/DataTable/common/addRow.d.ts +30 -0
- package/dist/nodes/DataTable/common/addRow.d.ts.map +1 -0
- package/dist/nodes/DataTable/common/addRow.js +55 -0
- package/dist/nodes/DataTable/common/addRow.js.map +1 -0
- package/dist/nodes/DataTable/common/constants.d.ts +13 -0
- package/dist/nodes/DataTable/common/constants.d.ts.map +1 -0
- package/dist/nodes/DataTable/common/constants.js +6 -0
- package/dist/nodes/DataTable/common/constants.js.map +1 -0
- package/dist/nodes/DataTable/common/fields.d.ts +9 -0
- package/dist/nodes/DataTable/common/fields.d.ts.map +1 -0
- package/dist/nodes/DataTable/common/fields.js +12 -0
- package/dist/nodes/DataTable/common/fields.js.map +1 -0
- package/dist/nodes/DataTable/common/methods.d.ts +8 -0
- package/dist/nodes/DataTable/common/methods.d.ts.map +1 -0
- package/dist/nodes/DataTable/common/methods.js +126 -0
- package/dist/nodes/DataTable/common/methods.js.map +1 -0
- package/dist/nodes/DataTable/common/selectMany.d.ts +7 -0
- package/dist/nodes/DataTable/common/selectMany.d.ts.map +1 -0
- package/dist/nodes/DataTable/common/selectMany.js +139 -0
- package/dist/nodes/DataTable/common/selectMany.js.map +1 -0
- package/dist/nodes/DataTable/common/utils.d.ts +11 -0
- package/dist/nodes/DataTable/common/utils.d.ts.map +1 -0
- package/dist/nodes/DataTable/common/utils.js +112 -0
- package/dist/nodes/DataTable/common/utils.js.map +1 -0
- 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/GithubTrigger.node.js +3 -3
- package/dist/nodes/Github/GithubTrigger.node.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/GoogleCalendar.node.js +2 -2
- package/dist/nodes/Google/Calendar/GoogleCalendar.node.js.map +1 -1
- 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/HttpRequest/V1/HttpRequestV1.node.d.ts.map +1 -1
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js +31 -0
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.d.ts.map +1 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js +46 -0
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.d.ts.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +49 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Hubspot/Hubspot.node.d.ts.map +1 -1
- package/dist/nodes/Hubspot/Hubspot.node.js +2 -1
- package/dist/nodes/Hubspot/Hubspot.node.js.map +1 -1
- package/dist/nodes/Hubspot/V2/EngagementDescription.d.ts.map +1 -1
- package/dist/nodes/Hubspot/V2/EngagementDescription.js +32 -0
- package/dist/nodes/Hubspot/V2/EngagementDescription.js.map +1 -1
- package/dist/nodes/Hubspot/V2/HubspotV2.node.d.ts.map +1 -1
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js +14 -1
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js.map +1 -1
- package/dist/nodes/Hubspot/V2/utils/parseToTimestamp.d.ts +2 -0
- package/dist/nodes/Hubspot/V2/utils/parseToTimestamp.d.ts.map +1 -0
- package/dist/nodes/Hubspot/V2/utils/parseToTimestamp.js +18 -0
- package/dist/nodes/Hubspot/V2/utils/parseToTimestamp.js.map +1 -0
- 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/RenameKeys/RenameKeys.node.d.ts.map +1 -1
- package/dist/nodes/RenameKeys/RenameKeys.node.js +37 -18
- package/dist/nodes/RenameKeys/RenameKeys.node.js.map +1 -1
- 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/SlackTrigger.node.d.ts.map +1 -1
- package/dist/nodes/Slack/SlackTrigger.node.js +2 -1
- package/dist/nodes/Slack/SlackTrigger.node.js.map +1 -1
- 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/Telegram.node.js +1 -1
- package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
- 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 +18 -17
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsTaskRunnerSandbox.js","sourceRoot":"","sources":["../../../nodes/Code/JsTaskRunnerSandbox.ts"],"names":[],"mappings":";;;AAOA,uDAA4E;
|
|
1
|
+
{"version":3,"file":"JsTaskRunnerSandbox.js","sourceRoot":"","sources":["../../../nodes/Code/JsTaskRunnerSandbox.ts"],"names":[],"mappings":";;;AAOA,uDAA4E;AAE5E,2DAAuF;AACvF,mEAA8D;AAE9D,MAAM,YAAY,GAAa;IAC9B,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;CACjD,CAAC;AAEF;;GAEG;AACH,MAAa,mBAAmB;IAEb;IACA;IACA;IACA;IACA;IALlB,YACkB,MAAc,EACd,QAA2B,EAC3B,YAAiC,EACjC,gBAAmC,EACnC,YAAY,IAAI;QAJhB,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,iBAAY,GAAZ,YAAY,CAAqB;QACjC,qBAAgB,GAAhB,gBAAgB,CAAmB;QACnC,cAAS,GAAT,SAAS,CAAO;IAC/B,CAAC;IAEJ,KAAK,CAAC,eAAe;QACpB,MAAM,SAAS,GAAG,CAAC,CAAC;QAEpB,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAC3D,YAAY,EACZ;YACC,IAAI,EAAE,IAAI,CAAC,MAAM;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE;SACtD,EACD,SAAS,CACT,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;YACzB,IAAA,2CAAmB,EAAC,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CA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iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,MAAM,cAAc,CAAC;AAItB,qBAAa,uBAAuB;IAElC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAHhB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,gBAAgB,EAAE,iBAAiB;IAGrD;;;;;;OAMG;IACG,qBAAqB;
|
|
1
|
+
{"version":3,"file":"PythonTaskRunnerSandbox.d.ts","sourceRoot":"","sources":["../../../nodes/Code/PythonTaskRunnerSandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,MAAM,cAAc,CAAC;AAItB,qBAAa,uBAAuB;IAElC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAHhB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,gBAAgB,EAAE,iBAAiB;IAGrD;;;;;;OAMG;IACG,qBAAqB;CA+B3B"}
|
|
@@ -22,12 +22,20 @@ class PythonTaskRunnerSandbox {
|
|
|
22
22
|
*/
|
|
23
23
|
async runUsingIncomingItems() {
|
|
24
24
|
const itemIndex = 0;
|
|
25
|
+
const node = this.executeFunctions.getNode();
|
|
26
|
+
const workflow = this.executeFunctions.getWorkflow();
|
|
25
27
|
const taskSettings = {
|
|
26
28
|
code: this.pythonCode,
|
|
27
29
|
nodeMode: this.nodeMode,
|
|
28
30
|
workflowMode: this.workflowMode,
|
|
29
31
|
continueOnFail: this.executeFunctions.continueOnFail(),
|
|
30
32
|
items: this.executeFunctions.getInputData(),
|
|
33
|
+
nodeId: node.id,
|
|
34
|
+
nodeName: node.name,
|
|
35
|
+
workflowId: workflow.id,
|
|
36
|
+
workflowName: workflow.name,
|
|
37
|
+
/** Whether this task can log to the browser console. */
|
|
38
|
+
canLog: this.executeFunctions.getMode() === 'manual',
|
|
31
39
|
};
|
|
32
40
|
const executionResult = await this.executeFunctions.startJob('python', taskSettings, itemIndex);
|
|
33
41
|
return executionResult.ok
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PythonTaskRunnerSandbox.js","sourceRoot":"","sources":["../../../nodes/Code/PythonTaskRunnerSandbox.ts"],"names":[],"mappings":";;;AAOA,mEAA8D;AAE9D,MAAa,uBAAuB;IAEjB;IACA;IACA;IACA;IAJlB,YACkB,UAAkB,EAClB,QAA2B,EAC3B,YAAiC,EACjC,gBAAmC;QAHnC,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,iBAAY,GAAZ,YAAY,CAAqB;QACjC,qBAAgB,GAAhB,gBAAgB,CAAmB;IAClD,CAAC;IAEJ;;;;;;OAMG;IACH,KAAK,CAAC,qBAAqB;QAC1B,MAAM,SAAS,GAAG,CAAC,CAAC;QAEpB,MAAM,YAAY,GAA4B;YAC7C,IAAI,EAAE,IAAI,CAAC,UAAU;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE;YACtD,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"PythonTaskRunnerSandbox.js","sourceRoot":"","sources":["../../../nodes/Code/PythonTaskRunnerSandbox.ts"],"names":[],"mappings":";;;AA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C,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;CACD;AA9CD,0DA8CC"}
|
|
@@ -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,C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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,IA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,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,E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K,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;YACpC,IAAI,CAAC,IAAA,gBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,MAAM,IAAI,iCAAe,CAAC;oBACzB,OAAO,EAAE,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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getConditionsForColumn, getDataTableColumns, getDataTables, tableSearch } from './common/methods';
|
|
3
|
+
export declare class DataTable implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch: {
|
|
7
|
+
tableSearch: typeof tableSearch;
|
|
8
|
+
};
|
|
9
|
+
loadOptions: {
|
|
10
|
+
getDataTableColumns: typeof getDataTableColumns;
|
|
11
|
+
getConditionsForColumn: typeof getConditionsForColumn;
|
|
12
|
+
};
|
|
13
|
+
resourceMapping: {
|
|
14
|
+
getDataTables: typeof getDataTables;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=DataTable.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.node.d.ts","sourceRoot":"","sources":["../../../nodes/DataTable/DataTable.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAKvF,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,SAAU,YAAW,SAAS;IAC1C,WAAW,EAAE,oBAAoB,CAkC/B;IAEF,OAAO;;;;;;;;;;;MAWL;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB;CAGrC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DataTable = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const router_1 = require("./actions/router");
|
|
39
|
+
const row = __importStar(require("./actions/row/Row.resource"));
|
|
40
|
+
const methods_1 = require("./common/methods");
|
|
41
|
+
class DataTable {
|
|
42
|
+
description = {
|
|
43
|
+
displayName: 'Data table',
|
|
44
|
+
name: 'dataTable',
|
|
45
|
+
icon: 'fa:table',
|
|
46
|
+
iconColor: 'orange-red',
|
|
47
|
+
group: ['input', 'transform'],
|
|
48
|
+
version: 1,
|
|
49
|
+
subtitle: '={{$parameter["action"]}}',
|
|
50
|
+
description: 'Permanently save data across workflow executions in a table',
|
|
51
|
+
defaults: {
|
|
52
|
+
name: 'Data table',
|
|
53
|
+
},
|
|
54
|
+
usableAsTool: true,
|
|
55
|
+
// We have custom logic in the frontend to ignore `hidden` for this
|
|
56
|
+
// particular node type if the data-table module is enabled
|
|
57
|
+
hidden: true,
|
|
58
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
59
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
60
|
+
properties: [
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Resource',
|
|
63
|
+
name: 'resource',
|
|
64
|
+
type: 'options',
|
|
65
|
+
noDataExpression: true,
|
|
66
|
+
options: [
|
|
67
|
+
{
|
|
68
|
+
name: 'Row',
|
|
69
|
+
value: 'row',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
default: 'row',
|
|
73
|
+
},
|
|
74
|
+
...row.description,
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
methods = {
|
|
78
|
+
listSearch: {
|
|
79
|
+
tableSearch: methods_1.tableSearch,
|
|
80
|
+
},
|
|
81
|
+
loadOptions: {
|
|
82
|
+
getDataTableColumns: methods_1.getDataTableColumns,
|
|
83
|
+
getConditionsForColumn: methods_1.getConditionsForColumn,
|
|
84
|
+
},
|
|
85
|
+
resourceMapping: {
|
|
86
|
+
getDataTables: methods_1.getDataTables,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
async execute() {
|
|
90
|
+
return await router_1.router.call(this);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.DataTable = DataTable;
|
|
94
|
+
//# sourceMappingURL=DataTable.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.node.js","sourceRoot":"","sources":["../../../nodes/DataTable/DataTable.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAmD;AAEnD,6CAA0C;AAC1C,gEAAkD;AAClD,8CAK0B;AAE1B,MAAa,SAAS;IACrB,W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
|
+
"categories": ["Core Nodes", "Development"],
|
|
7
|
+
"resources": {
|
|
8
|
+
"primaryDocumentation": [
|
|
9
|
+
{
|
|
10
|
+
"url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.datatable/"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"alias": ["data", "table", "knowledge", "data store", "store", "sheet"],
|
|
15
|
+
"subcategories": {
|
|
16
|
+
"Core Nodes": ["Helpers"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|