n8n-nodes-base 2.46.0 → 3.0.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/cjs/build.tsbuildinfo +1 -1
- package/dist/credentials/SlackApi.credentials.d.ts.map +1 -1
- package/dist/credentials/SlackApi.credentials.js +1 -11
- package/dist/credentials/SlackApi.credentials.js.map +1 -1
- package/dist/credentials/WebflowOAuth2Api.credentials.js +1 -1
- package/dist/credentials/WebflowOAuth2Api.credentials.js.map +1 -1
- package/dist/known/credentials.json +1 -11
- package/dist/known/nodes.json +0 -64
- package/dist/methods/defined.json +0 -4
- package/dist/methods/referenced.json +0 -4
- package/dist/node-definitions/.nodes-hash +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/code/v1/mode_run_once_for_all_items.ts +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/code/v1/mode_run_once_for_each_item.ts +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/code/v2/mode_run_once_for_all_items.ts +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/code/v2/mode_run_once_for_each_item.ts +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/convertToFile/v1.ts +13 -14
- package/dist/node-definitions/nodes/n8n-nodes-base/convertToFile/v11.ts +13 -14
- package/dist/node-definitions/nodes/n8n-nodes-base/convertToFile/v12.ts +13 -14
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v1.schema.js +1 -3
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v1.ts +1 -13
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v11.schema.js +1 -3
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v11.ts +1 -13
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v12.schema.js +0 -2
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v12.ts +0 -12
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v13.schema.js +0 -2
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v13.ts +0 -12
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v14.schema.js +0 -2
- package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v14.ts +0 -12
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v1.schema.js +1 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v1.ts +5 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v11.schema.js +1 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v11.ts +5 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v12.schema.js +1 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v12.ts +5 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v13.schema.js +1 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/gmailTrigger/v13.ts +5 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/microsoftOutlook/v2/resource_event/operation_create.ts +2 -2
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.js +1 -1
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.js.map +1 -1
- package/dist/nodes/Crypto/v1/CryptoV1.node.d.ts.map +1 -1
- package/dist/nodes/Crypto/v1/CryptoV1.node.js +0 -1
- package/dist/nodes/Crypto/v1/CryptoV1.node.js.map +1 -1
- package/dist/nodes/Crypto/v2/CryptoV2.node.d.ts.map +1 -1
- package/dist/nodes/Crypto/v2/CryptoV2.node.js +0 -1
- package/dist/nodes/Crypto/v2/CryptoV2.node.js.map +1 -1
- package/dist/nodes/DateTime/V1/DateTimeV1.node.js +1 -1
- package/dist/nodes/DateTime/V1/DateTimeV1.node.js.map +1 -1
- package/dist/nodes/DateTime/V2/DateTimeV2.node.js +1 -1
- package/dist/nodes/DateTime/V2/DateTimeV2.node.js.map +1 -1
- package/dist/nodes/EditImage/EditImage.node.d.ts +2 -3
- package/dist/nodes/EditImage/EditImage.node.d.ts.map +1 -1
- package/dist/nodes/EditImage/EditImage.node.js +4 -349
- package/dist/nodes/EditImage/EditImage.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +1 -1
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.d.ts.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +0 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
- package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js +1 -1
- package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js.map +1 -1
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +1 -1
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.d.ts.map +1 -1
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.js +0 -56
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.js.map +1 -1
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/GenericFunctions.js +3 -33
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/GenericFunctions.js.map +1 -1
- package/dist/nodes/Filter/V1/FilterV1.node.js +1 -1
- package/dist/nodes/Filter/V1/FilterV1.node.js.map +1 -1
- package/dist/nodes/Filter/V2/FilterV2.node.js +1 -1
- package/dist/nodes/Filter/V2/FilterV2.node.js.map +1 -1
- package/dist/nodes/Form/v1/FormTriggerV1.node.d.ts +1 -1
- package/dist/nodes/Form/v2/FormTriggerV2.node.d.ts +1 -1
- package/dist/nodes/Google/Gmail/GmailTrigger.node.d.ts.map +1 -1
- package/dist/nodes/Google/Gmail/GmailTrigger.node.js +43 -48
- package/dist/nodes/Google/Gmail/GmailTrigger.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js +1 -1
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js +1 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/ICalendar/createEvent.operation.d.ts.map +1 -1
- package/dist/nodes/ICalendar/createEvent.operation.js +31 -177
- package/dist/nodes/ICalendar/createEvent.operation.js.map +1 -1
- package/dist/nodes/If/V1/IfV1.node.js +1 -1
- package/dist/nodes/If/V1/IfV1.node.js.map +1 -1
- package/dist/nodes/If/V2/IfV2.node.js +1 -1
- package/dist/nodes/If/V2/IfV2.node.js.map +1 -1
- package/dist/nodes/Merge/v1/MergeV1.node.js +1 -1
- package/dist/nodes/Merge/v1/MergeV1.node.js.map +1 -1
- package/dist/nodes/Notion/shared/GenericFunctions.d.ts +3 -3
- package/dist/nodes/Notion/shared/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/Set/v1/SetV1.node.js +1 -1
- package/dist/nodes/Set/v1/SetV1.node.js.map +1 -1
- package/dist/nodes/Simulate/Simulate.node.js +1 -1
- package/dist/nodes/Simulate/Simulate.node.js.map +1 -1
- package/dist/nodes/Simulate/SimulateTrigger.node.js +1 -1
- package/dist/nodes/Simulate/SimulateTrigger.node.js.map +1 -1
- package/dist/nodes/Slack/SlackTrigger.node.d.ts.map +1 -1
- package/dist/nodes/Slack/SlackTrigger.node.js +8 -0
- package/dist/nodes/Slack/SlackTrigger.node.js.map +1 -1
- package/dist/nodes/Slack/SlackTriggerHelpers.d.ts.map +1 -1
- package/dist/nodes/Slack/SlackTriggerHelpers.js +6 -2
- package/dist/nodes/Slack/SlackTriggerHelpers.js.map +1 -1
- package/dist/nodes/Slack/V2/SlackHitlWebhook.d.ts +1 -1
- package/dist/nodes/SplitInBatches/v1/SplitInBatchesV1.node.js +1 -1
- package/dist/nodes/SplitInBatches/v1/SplitInBatchesV1.node.js.map +1 -1
- package/dist/nodes/SplitInBatches/v2/SplitInBatchesV2.node.js +1 -1
- package/dist/nodes/SplitInBatches/v2/SplitInBatchesV2.node.js.map +1 -1
- package/dist/nodes/SpreadsheetFile/v1/SpreadsheetFileV1.node.js +1 -1
- package/dist/nodes/SpreadsheetFile/v1/SpreadsheetFileV1.node.js.map +1 -1
- package/dist/nodes/SpreadsheetFile/v2/SpreadsheetFileV2.node.js +1 -1
- package/dist/nodes/SpreadsheetFile/v2/SpreadsheetFileV2.node.js.map +1 -1
- package/dist/nodes/StickyNote/StickyNote.node.js +1 -1
- package/dist/nodes/StickyNote/StickyNote.node.js.map +1 -1
- package/dist/nodes/Switch/V1/SwitchV1.node.js +1 -1
- package/dist/nodes/Switch/V1/SwitchV1.node.js.map +1 -1
- package/dist/nodes/Switch/V2/SwitchV2.node.js +1 -1
- package/dist/nodes/Switch/V2/SwitchV2.node.js.map +1 -1
- package/dist/nodes/Switch/V3/SwitchV3.node.js +1 -1
- package/dist/nodes/Switch/V3/SwitchV3.node.js.map +1 -1
- package/dist/types/credentials.json +3 -4
- package/dist/types/nodes.json +33 -51
- package/package.json +13 -32
- package/dist/credentials/OrbitApi.credentials.d.ts +0 -8
- package/dist/credentials/OrbitApi.credentials.d.ts.map +0 -1
- package/dist/credentials/OrbitApi.credentials.js +0 -25
- package/dist/credentials/OrbitApi.credentials.js.map +0 -1
- package/dist/nodes/AiTransform/AiTransform.node.d.ts +0 -6
- package/dist/nodes/AiTransform/AiTransform.node.d.ts.map +0 -1
- package/dist/nodes/AiTransform/AiTransform.node.js +0 -101
- package/dist/nodes/AiTransform/AiTransform.node.js.map +0 -1
- package/dist/nodes/AiTransform/AiTransform.node.json +0 -18
- package/dist/nodes/AiTransform/aitransform.svg +0 -10
- package/dist/nodes/Cron/Cron.node.d.ts +0 -6
- package/dist/nodes/Cron/Cron.node.d.ts.map +0 -1
- package/dist/nodes/Cron/Cron.node.js +0 -64
- package/dist/nodes/Cron/Cron.node.js.map +0 -1
- package/dist/nodes/Cron/Cron.node.json +0 -135
- package/dist/nodes/Function/Function.node.d.ts +0 -6
- package/dist/nodes/Function/Function.node.d.ts.map +0 -1
- package/dist/nodes/Function/Function.node.js +0 -184
- package/dist/nodes/Function/Function.node.js.map +0 -1
- package/dist/nodes/Function/Function.node.json +0 -129
- package/dist/nodes/FunctionItem/FunctionItem.node.d.ts +0 -6
- package/dist/nodes/FunctionItem/FunctionItem.node.d.ts.map +0 -1
- package/dist/nodes/FunctionItem/FunctionItem.node.js +0 -206
- package/dist/nodes/FunctionItem/FunctionItem.node.js.map +0 -1
- package/dist/nodes/FunctionItem/FunctionItem.node.json +0 -28
- package/dist/nodes/HtmlExtract/HtmlExtract.node.d.ts +0 -6
- package/dist/nodes/HtmlExtract/HtmlExtract.node.d.ts.map +0 -1
- package/dist/nodes/HtmlExtract/HtmlExtract.node.js +0 -300
- package/dist/nodes/HtmlExtract/HtmlExtract.node.js.map +0 -1
- package/dist/nodes/HtmlExtract/HtmlExtract.node.json +0 -38
- package/dist/nodes/ICalendar/ICalendar.node.d.ts +0 -6
- package/dist/nodes/ICalendar/ICalendar.node.d.ts.map +0 -1
- package/dist/nodes/ICalendar/ICalendar.node.js +0 -84
- package/dist/nodes/ICalendar/ICalendar.node.js.map +0 -1
- package/dist/nodes/ICalendar/ICalendar.node.json +0 -17
- package/dist/nodes/Interval/Interval.node.d.ts +0 -6
- package/dist/nodes/Interval/Interval.node.d.ts.map +0 -1
- package/dist/nodes/Interval/Interval.node.js +0 -97
- package/dist/nodes/Interval/Interval.node.js.map +0 -1
- package/dist/nodes/Interval/Interval.node.json +0 -29
- package/dist/nodes/ItemLists/ItemLists.node.d.ts +0 -5
- package/dist/nodes/ItemLists/ItemLists.node.d.ts.map +0 -1
- package/dist/nodes/ItemLists/ItemLists.node.js +0 -32
- package/dist/nodes/ItemLists/ItemLists.node.js.map +0 -1
- package/dist/nodes/ItemLists/ItemLists.node.json +0 -48
- package/dist/nodes/ItemLists/V1/ItemListsV1.node.d.ts +0 -7
- package/dist/nodes/ItemLists/V1/ItemListsV1.node.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V1/ItemListsV1.node.js +0 -1254
- package/dist/nodes/ItemLists/V1/ItemListsV1.node.js.map +0 -1
- package/dist/nodes/ItemLists/V1/summarize.operation.d.ts +0 -4
- package/dist/nodes/ItemLists/V1/summarize.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V1/summarize.operation.js +0 -468
- package/dist/nodes/ItemLists/V1/summarize.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V2/ItemListsV2.node.d.ts +0 -7
- package/dist/nodes/ItemLists/V2/ItemListsV2.node.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V2/ItemListsV2.node.js +0 -1287
- package/dist/nodes/ItemLists/V2/ItemListsV2.node.js.map +0 -1
- package/dist/nodes/ItemLists/V2/summarize.operation.d.ts +0 -4
- package/dist/nodes/ItemLists/V2/summarize.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V2/summarize.operation.js +0 -502
- package/dist/nodes/ItemLists/V2/summarize.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.d.ts +0 -7
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.js +0 -19
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.d.ts +0 -3
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.js +0 -11
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.d.ts +0 -31
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.js +0 -351
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/index.d.ts +0 -10
- package/dist/nodes/ItemLists/V3/actions/itemList/index.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/index.js +0 -107
- package/dist/nodes/ItemLists/V3/actions/itemList/index.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.d.ts +0 -31
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.js +0 -57
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.d.ts +0 -31
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.js +0 -207
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.d.ts +0 -31
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.js +0 -240
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.d.ts +0 -31
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.js +0 -207
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.d.ts +0 -32
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.js +0 -502
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/node.type.d.ts +0 -7
- package/dist/nodes/ItemLists/V3/actions/node.type.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/node.type.js +0 -3
- package/dist/nodes/ItemLists/V3/actions/node.type.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/router.d.ts +0 -3
- package/dist/nodes/ItemLists/V3/actions/router.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/router.js +0 -57
- package/dist/nodes/ItemLists/V3/actions/router.js.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/versionDescription.d.ts +0 -3
- package/dist/nodes/ItemLists/V3/actions/versionDescription.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/actions/versionDescription.js +0 -70
- package/dist/nodes/ItemLists/V3/actions/versionDescription.js.map +0 -1
- package/dist/nodes/ItemLists/V3/helpers/utils.d.ts +0 -6
- package/dist/nodes/ItemLists/V3/helpers/utils.d.ts.map +0 -1
- package/dist/nodes/ItemLists/V3/helpers/utils.js +0 -100
- package/dist/nodes/ItemLists/V3/helpers/utils.js.map +0 -1
- package/dist/nodes/ItemLists/__schema__/v3.0.0/itemList/limit.json +0 -9
- package/dist/nodes/ItemLists/__schema__/v3.1.0/itemList/limit.json +0 -8
- package/dist/nodes/ItemLists/__schema__/v3.1.0/itemList/removeDuplicates.json +0 -77
- package/dist/nodes/ItemLists/__schema__/v3.1.0/itemList/sort.json +0 -45
- package/dist/nodes/ItemLists/__schema__/v3.1.0/itemList/summarize.json +0 -15
- package/dist/nodes/ItemLists/itemLists.svg +0 -1
- package/dist/nodes/MoveBinaryData/MoveBinaryData.node.d.ts +0 -6
- package/dist/nodes/MoveBinaryData/MoveBinaryData.node.d.ts.map +0 -1
- package/dist/nodes/MoveBinaryData/MoveBinaryData.node.js +0 -443
- package/dist/nodes/MoveBinaryData/MoveBinaryData.node.js.map +0 -1
- package/dist/nodes/MoveBinaryData/MoveBinaryData.node.json +0 -17
- package/dist/nodes/OpenAi/ChatDescription.d.ts +0 -4
- package/dist/nodes/OpenAi/ChatDescription.d.ts.map +0 -1
- package/dist/nodes/OpenAi/ChatDescription.js +0 -396
- package/dist/nodes/OpenAi/ChatDescription.js.map +0 -1
- package/dist/nodes/OpenAi/GenericFunctions.d.ts +0 -3
- package/dist/nodes/OpenAi/GenericFunctions.d.ts.map +0 -1
- package/dist/nodes/OpenAi/GenericFunctions.js +0 -11
- package/dist/nodes/OpenAi/GenericFunctions.js.map +0 -1
- package/dist/nodes/OpenAi/ImageDescription.d.ts +0 -4
- package/dist/nodes/OpenAi/ImageDescription.d.ts.map +0 -1
- package/dist/nodes/OpenAi/ImageDescription.js +0 -392
- package/dist/nodes/OpenAi/ImageDescription.js.map +0 -1
- package/dist/nodes/OpenAi/OpenAi.node.d.ts +0 -5
- package/dist/nodes/OpenAi/OpenAi.node.d.ts.map +0 -1
- package/dist/nodes/OpenAi/OpenAi.node.js +0 -79
- package/dist/nodes/OpenAi/OpenAi.node.js.map +0 -1
- package/dist/nodes/OpenAi/OpenAi.node.json +0 -19
- package/dist/nodes/OpenAi/TextDescription.d.ts +0 -4
- package/dist/nodes/OpenAi/TextDescription.d.ts.map +0 -1
- package/dist/nodes/OpenAi/TextDescription.js +0 -488
- package/dist/nodes/OpenAi/TextDescription.js.map +0 -1
- package/dist/nodes/OpenAi/__schema__/v1.0.0/chat/chat.json +0 -9
- package/dist/nodes/OpenAi/__schema__/v1.0.0/image/create.json +0 -9
- package/dist/nodes/OpenAi/__schema__/v1.1.0/chat/complete.json +0 -57
- package/dist/nodes/OpenAi/__schema__/v1.1.0/text/chat.json +0 -9
- package/dist/nodes/OpenAi/__schema__/v1.1.0/text/complete.json +0 -15
- package/dist/nodes/OpenAi/openAi.dark.svg +0 -3
- package/dist/nodes/OpenAi/openAi.svg +0 -1
- package/dist/nodes/Orbit/ActivityDescription.d.ts +0 -4
- package/dist/nodes/Orbit/ActivityDescription.d.ts.map +0 -1
- package/dist/nodes/Orbit/ActivityDescription.js +0 -213
- package/dist/nodes/Orbit/ActivityDescription.js.map +0 -1
- package/dist/nodes/Orbit/GenericFunctions.d.ts +0 -11
- package/dist/nodes/Orbit/GenericFunctions.d.ts.map +0 -1
- package/dist/nodes/Orbit/GenericFunctions.js +0 -84
- package/dist/nodes/Orbit/GenericFunctions.js.map +0 -1
- package/dist/nodes/Orbit/Interfaces.d.ts +0 -20
- package/dist/nodes/Orbit/Interfaces.d.ts.map +0 -1
- package/dist/nodes/Orbit/Interfaces.js +0 -3
- package/dist/nodes/Orbit/Interfaces.js.map +0 -1
- package/dist/nodes/Orbit/MemberDescription.d.ts +0 -4
- package/dist/nodes/Orbit/MemberDescription.d.ts.map +0 -1
- package/dist/nodes/Orbit/MemberDescription.js +0 -747
- package/dist/nodes/Orbit/MemberDescription.js.map +0 -1
- package/dist/nodes/Orbit/NoteDescription.d.ts +0 -4
- package/dist/nodes/Orbit/NoteDescription.d.ts.map +0 -1
- package/dist/nodes/Orbit/NoteDescription.js +0 -221
- package/dist/nodes/Orbit/NoteDescription.js.map +0 -1
- package/dist/nodes/Orbit/Orbit.node.d.ts +0 -12
- package/dist/nodes/Orbit/Orbit.node.d.ts.map +0 -1
- package/dist/nodes/Orbit/Orbit.node.js +0 -94
- package/dist/nodes/Orbit/Orbit.node.js.map +0 -1
- package/dist/nodes/Orbit/Orbit.node.json +0 -25
- package/dist/nodes/Orbit/PostDescription.d.ts +0 -4
- package/dist/nodes/Orbit/PostDescription.d.ts.map +0 -1
- package/dist/nodes/Orbit/PostDescription.js +0 -227
- package/dist/nodes/Orbit/PostDescription.js.map +0 -1
- package/dist/nodes/Orbit/orbit.dark.svg +0 -7
- package/dist/nodes/Orbit/orbit.svg +0 -7
- package/dist/nodes/ReadBinaryFile/ReadBinaryFile.node.d.ts +0 -6
- package/dist/nodes/ReadBinaryFile/ReadBinaryFile.node.d.ts.map +0 -1
- package/dist/nodes/ReadBinaryFile/ReadBinaryFile.node.js +0 -86
- package/dist/nodes/ReadBinaryFile/ReadBinaryFile.node.js.map +0 -1
- package/dist/nodes/ReadBinaryFile/ReadBinaryFile.node.json +0 -34
- package/dist/nodes/ReadBinaryFiles/ReadBinaryFiles.node.d.ts +0 -6
- package/dist/nodes/ReadBinaryFiles/ReadBinaryFiles.node.d.ts.map +0 -1
- package/dist/nodes/ReadBinaryFiles/ReadBinaryFiles.node.js +0 -62
- package/dist/nodes/ReadBinaryFiles/ReadBinaryFiles.node.js.map +0 -1
- package/dist/nodes/ReadBinaryFiles/ReadBinaryFiles.node.json +0 -17
- package/dist/nodes/ReadPdf/ReadPDF.node.d.ts +0 -6
- package/dist/nodes/ReadPdf/ReadPDF.node.d.ts.map +0 -1
- package/dist/nodes/ReadPdf/ReadPDF.node.js +0 -89
- package/dist/nodes/ReadPdf/ReadPDF.node.js.map +0 -1
- package/dist/nodes/ReadPdf/ReadPDF.node.json +0 -16
- package/dist/nodes/WorkflowTrigger/WorkflowTrigger.node.d.ts +0 -6
- package/dist/nodes/WorkflowTrigger/WorkflowTrigger.node.d.ts.map +0 -1
- package/dist/nodes/WorkflowTrigger/WorkflowTrigger.node.js +0 -91
- package/dist/nodes/WorkflowTrigger/WorkflowTrigger.node.js.map +0 -1
- package/dist/nodes/WorkflowTrigger/WorkflowTrigger.node.json +0 -16
- package/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.d.ts +0 -6
- package/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.d.ts.map +0 -1
- package/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.js +0 -118
- package/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.js.map +0 -1
- package/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.json +0 -24
|
@@ -1,1254 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ItemListsV1 = void 0;
|
|
40
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
41
|
-
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
42
|
-
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
43
|
-
const lt_1 = __importDefault(require("lodash/lt"));
|
|
44
|
-
const pick_1 = __importDefault(require("lodash/pick"));
|
|
45
|
-
const set_1 = __importDefault(require("lodash/set"));
|
|
46
|
-
const unset_1 = __importDefault(require("lodash/unset"));
|
|
47
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
48
|
-
const utilities_1 = require("../../../utils/utilities");
|
|
49
|
-
const summarize = __importStar(require("./summarize.operation"));
|
|
50
|
-
const utils_1 = require("../V3/helpers/utils");
|
|
51
|
-
class ItemListsV1 {
|
|
52
|
-
description;
|
|
53
|
-
constructor(baseDescription) {
|
|
54
|
-
this.description = {
|
|
55
|
-
...baseDescription,
|
|
56
|
-
version: 1,
|
|
57
|
-
defaults: {
|
|
58
|
-
name: 'Item Lists',
|
|
59
|
-
},
|
|
60
|
-
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
61
|
-
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
62
|
-
credentials: [],
|
|
63
|
-
properties: [
|
|
64
|
-
{
|
|
65
|
-
displayName: 'Resource',
|
|
66
|
-
name: 'resource',
|
|
67
|
-
type: 'hidden',
|
|
68
|
-
options: [
|
|
69
|
-
{
|
|
70
|
-
name: 'Item List',
|
|
71
|
-
value: 'itemList',
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
default: 'itemList',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
displayName: 'Operation',
|
|
78
|
-
name: 'operation',
|
|
79
|
-
type: 'options',
|
|
80
|
-
noDataExpression: true,
|
|
81
|
-
options: [
|
|
82
|
-
{
|
|
83
|
-
name: 'Concatenate Items',
|
|
84
|
-
value: 'aggregateItems',
|
|
85
|
-
description: 'Combine fields into a list in a single new item',
|
|
86
|
-
action: 'Combine fields into a list in a single new item',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: 'Limit',
|
|
90
|
-
value: 'limit',
|
|
91
|
-
description: 'Remove items if there are too many',
|
|
92
|
-
action: 'Remove items if there are too many',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: 'Remove Duplicates',
|
|
96
|
-
value: 'removeDuplicates',
|
|
97
|
-
description: 'Remove extra items that are similar',
|
|
98
|
-
action: 'Remove extra items that are similar',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'Sort',
|
|
102
|
-
value: 'sort',
|
|
103
|
-
description: 'Change the item order',
|
|
104
|
-
action: 'Change the item order',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'Split Out Items',
|
|
108
|
-
value: 'splitOutItems',
|
|
109
|
-
description: 'Turn a list inside item(s) into separate items',
|
|
110
|
-
action: 'Turn a list inside item(s) into separate items',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'Summarize',
|
|
114
|
-
value: 'summarize',
|
|
115
|
-
description: 'Aggregate items together (pivot table)',
|
|
116
|
-
action: 'Aggregate items together (pivot table)',
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
default: 'splitOutItems',
|
|
120
|
-
},
|
|
121
|
-
// Split out items - Fields
|
|
122
|
-
{
|
|
123
|
-
displayName: 'Field To Split Out',
|
|
124
|
-
name: 'fieldToSplitOut',
|
|
125
|
-
type: 'string',
|
|
126
|
-
default: '',
|
|
127
|
-
required: true,
|
|
128
|
-
displayOptions: {
|
|
129
|
-
show: {
|
|
130
|
-
resource: ['itemList'],
|
|
131
|
-
operation: ['splitOutItems'],
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
description: 'The name of the input field to break out into separate items',
|
|
135
|
-
requiresDataPath: 'single',
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
displayName: 'Include',
|
|
139
|
-
name: 'include',
|
|
140
|
-
type: 'options',
|
|
141
|
-
options: [
|
|
142
|
-
{
|
|
143
|
-
name: 'No Other Fields',
|
|
144
|
-
value: 'noOtherFields',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: 'All Other Fields',
|
|
148
|
-
value: 'allOtherFields',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'Selected Other Fields',
|
|
152
|
-
value: 'selectedOtherFields',
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
default: 'noOtherFields',
|
|
156
|
-
description: 'Whether to copy any other fields into the new items',
|
|
157
|
-
displayOptions: {
|
|
158
|
-
show: {
|
|
159
|
-
resource: ['itemList'],
|
|
160
|
-
operation: ['splitOutItems'],
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
displayName: 'Fields To Include',
|
|
166
|
-
name: 'fieldsToInclude',
|
|
167
|
-
type: 'fixedCollection',
|
|
168
|
-
typeOptions: {
|
|
169
|
-
multipleValues: true,
|
|
170
|
-
},
|
|
171
|
-
placeholder: 'Add Field To Include',
|
|
172
|
-
default: {},
|
|
173
|
-
displayOptions: {
|
|
174
|
-
show: {
|
|
175
|
-
resource: ['itemList'],
|
|
176
|
-
operation: ['splitOutItems'],
|
|
177
|
-
include: ['selectedOtherFields'],
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
options: [
|
|
181
|
-
{
|
|
182
|
-
displayName: '',
|
|
183
|
-
name: 'fields',
|
|
184
|
-
values: [
|
|
185
|
-
{
|
|
186
|
-
displayName: 'Field Name',
|
|
187
|
-
name: 'fieldName',
|
|
188
|
-
type: 'string',
|
|
189
|
-
default: '',
|
|
190
|
-
description: 'A field in the input items to aggregate together',
|
|
191
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
192
|
-
placeholder: 'e.g. id',
|
|
193
|
-
hint: ' Enter the field name as text',
|
|
194
|
-
requiresDataPath: 'single',
|
|
195
|
-
},
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
},
|
|
200
|
-
// Aggregate Items
|
|
201
|
-
{
|
|
202
|
-
displayName: 'Aggregate',
|
|
203
|
-
name: 'aggregate',
|
|
204
|
-
type: 'options',
|
|
205
|
-
default: 'aggregateIndividualFields',
|
|
206
|
-
options: [
|
|
207
|
-
{
|
|
208
|
-
name: 'Individual Fields',
|
|
209
|
-
value: 'aggregateIndividualFields',
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: 'All Item Data (Into a Single List)',
|
|
213
|
-
value: 'aggregateAllItemData',
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
displayOptions: {
|
|
217
|
-
show: {
|
|
218
|
-
resource: ['itemList'],
|
|
219
|
-
operation: ['aggregateItems'],
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
// Aggregate Individual Fields
|
|
224
|
-
{
|
|
225
|
-
displayName: 'Fields To Aggregate',
|
|
226
|
-
name: 'fieldsToAggregate',
|
|
227
|
-
type: 'fixedCollection',
|
|
228
|
-
typeOptions: {
|
|
229
|
-
multipleValues: true,
|
|
230
|
-
},
|
|
231
|
-
placeholder: 'Add Field To Aggregate',
|
|
232
|
-
default: { fieldToAggregate: [{ fieldToAggregate: '', renameField: false }] },
|
|
233
|
-
displayOptions: {
|
|
234
|
-
show: {
|
|
235
|
-
resource: ['itemList'],
|
|
236
|
-
operation: ['aggregateItems'],
|
|
237
|
-
aggregate: ['aggregateIndividualFields'],
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
options: [
|
|
241
|
-
{
|
|
242
|
-
displayName: '',
|
|
243
|
-
name: 'fieldToAggregate',
|
|
244
|
-
values: [
|
|
245
|
-
{
|
|
246
|
-
displayName: 'Input Field Name',
|
|
247
|
-
name: 'fieldToAggregate',
|
|
248
|
-
type: 'string',
|
|
249
|
-
default: '',
|
|
250
|
-
description: 'The name of a field in the input items to aggregate together',
|
|
251
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
252
|
-
placeholder: 'e.g. id',
|
|
253
|
-
hint: ' Enter the field name as text',
|
|
254
|
-
requiresDataPath: 'single',
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
displayName: 'Rename Field',
|
|
258
|
-
name: 'renameField',
|
|
259
|
-
type: 'boolean',
|
|
260
|
-
default: false,
|
|
261
|
-
description: 'Whether to give the field a different name in the output',
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
displayName: 'Output Field Name',
|
|
265
|
-
name: 'outputFieldName',
|
|
266
|
-
displayOptions: {
|
|
267
|
-
show: {
|
|
268
|
-
renameField: [true],
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
type: 'string',
|
|
272
|
-
default: '',
|
|
273
|
-
description: 'The name of the field to put the aggregated data in. Leave blank to use the input field name.',
|
|
274
|
-
requiresDataPath: 'single',
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
},
|
|
278
|
-
],
|
|
279
|
-
},
|
|
280
|
-
// Aggregate All Item Data
|
|
281
|
-
{
|
|
282
|
-
displayName: 'Put Output in Field',
|
|
283
|
-
name: 'destinationFieldName',
|
|
284
|
-
type: 'string',
|
|
285
|
-
displayOptions: {
|
|
286
|
-
show: {
|
|
287
|
-
resource: ['itemList'],
|
|
288
|
-
operation: ['aggregateItems'],
|
|
289
|
-
aggregate: ['aggregateAllItemData'],
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
default: 'data',
|
|
293
|
-
description: 'The name of the output field to put the data in',
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
displayName: 'Include',
|
|
297
|
-
name: 'include',
|
|
298
|
-
type: 'options',
|
|
299
|
-
default: 'allFields',
|
|
300
|
-
options: [
|
|
301
|
-
{
|
|
302
|
-
name: 'All Fields',
|
|
303
|
-
value: 'allFields',
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
name: 'Specified Fields',
|
|
307
|
-
value: 'specifiedFields',
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
name: 'All Fields Except',
|
|
311
|
-
value: 'allFieldsExcept',
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
|
-
displayOptions: {
|
|
315
|
-
show: {
|
|
316
|
-
resource: ['itemList'],
|
|
317
|
-
operation: ['aggregateItems'],
|
|
318
|
-
aggregate: ['aggregateAllItemData'],
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
displayName: 'Fields To Exclude',
|
|
324
|
-
name: 'fieldsToExclude',
|
|
325
|
-
type: 'fixedCollection',
|
|
326
|
-
typeOptions: {
|
|
327
|
-
multipleValues: true,
|
|
328
|
-
},
|
|
329
|
-
placeholder: 'Add Field To Exclude',
|
|
330
|
-
default: {},
|
|
331
|
-
options: [
|
|
332
|
-
{
|
|
333
|
-
displayName: '',
|
|
334
|
-
name: 'fields',
|
|
335
|
-
values: [
|
|
336
|
-
{
|
|
337
|
-
displayName: 'Field Name',
|
|
338
|
-
name: 'fieldName',
|
|
339
|
-
type: 'string',
|
|
340
|
-
default: '',
|
|
341
|
-
description: 'A field in the input to exclude from the object in output array',
|
|
342
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
343
|
-
placeholder: 'e.g. id',
|
|
344
|
-
hint: ' Enter the field name as text',
|
|
345
|
-
requiresDataPath: 'single',
|
|
346
|
-
},
|
|
347
|
-
],
|
|
348
|
-
},
|
|
349
|
-
],
|
|
350
|
-
displayOptions: {
|
|
351
|
-
show: {
|
|
352
|
-
resource: ['itemList'],
|
|
353
|
-
operation: ['aggregateItems'],
|
|
354
|
-
aggregate: ['aggregateAllItemData'],
|
|
355
|
-
include: ['allFieldsExcept'],
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
displayName: 'Fields To Include',
|
|
361
|
-
name: 'fieldsToInclude',
|
|
362
|
-
type: 'fixedCollection',
|
|
363
|
-
typeOptions: {
|
|
364
|
-
multipleValues: true,
|
|
365
|
-
},
|
|
366
|
-
placeholder: 'Add Field To Include',
|
|
367
|
-
default: {},
|
|
368
|
-
options: [
|
|
369
|
-
{
|
|
370
|
-
displayName: '',
|
|
371
|
-
name: 'fields',
|
|
372
|
-
values: [
|
|
373
|
-
{
|
|
374
|
-
displayName: 'Field Name',
|
|
375
|
-
name: 'fieldName',
|
|
376
|
-
type: 'string',
|
|
377
|
-
default: '',
|
|
378
|
-
description: 'Specify fields that will be included in output array',
|
|
379
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
380
|
-
placeholder: 'e.g. id',
|
|
381
|
-
hint: ' Enter the field name as text',
|
|
382
|
-
requiresDataPath: 'single',
|
|
383
|
-
},
|
|
384
|
-
],
|
|
385
|
-
},
|
|
386
|
-
],
|
|
387
|
-
displayOptions: {
|
|
388
|
-
show: {
|
|
389
|
-
resource: ['itemList'],
|
|
390
|
-
operation: ['aggregateItems'],
|
|
391
|
-
aggregate: ['aggregateAllItemData'],
|
|
392
|
-
include: ['specifiedFields'],
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
},
|
|
396
|
-
// Remove duplicates - Fields
|
|
397
|
-
{
|
|
398
|
-
displayName: 'Compare',
|
|
399
|
-
name: 'compare',
|
|
400
|
-
type: 'options',
|
|
401
|
-
options: [
|
|
402
|
-
{
|
|
403
|
-
name: 'All Fields',
|
|
404
|
-
value: 'allFields',
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
name: 'All Fields Except',
|
|
408
|
-
value: 'allFieldsExcept',
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
name: 'Selected Fields',
|
|
412
|
-
value: 'selectedFields',
|
|
413
|
-
},
|
|
414
|
-
],
|
|
415
|
-
default: 'allFields',
|
|
416
|
-
description: 'The fields of the input items to compare to see if they are the same',
|
|
417
|
-
displayOptions: {
|
|
418
|
-
show: {
|
|
419
|
-
resource: ['itemList'],
|
|
420
|
-
operation: ['removeDuplicates'],
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
displayName: 'Fields To Exclude',
|
|
426
|
-
name: 'fieldsToExclude',
|
|
427
|
-
type: 'fixedCollection',
|
|
428
|
-
typeOptions: {
|
|
429
|
-
multipleValues: true,
|
|
430
|
-
},
|
|
431
|
-
placeholder: 'Add Field To Exclude',
|
|
432
|
-
default: {},
|
|
433
|
-
displayOptions: {
|
|
434
|
-
show: {
|
|
435
|
-
resource: ['itemList'],
|
|
436
|
-
operation: ['removeDuplicates'],
|
|
437
|
-
compare: ['allFieldsExcept'],
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
options: [
|
|
441
|
-
{
|
|
442
|
-
displayName: '',
|
|
443
|
-
name: 'fields',
|
|
444
|
-
values: [
|
|
445
|
-
{
|
|
446
|
-
displayName: 'Field Name',
|
|
447
|
-
name: 'fieldName',
|
|
448
|
-
type: 'string',
|
|
449
|
-
default: '',
|
|
450
|
-
description: 'A field in the input to exclude from the comparison',
|
|
451
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
452
|
-
placeholder: 'e.g. id',
|
|
453
|
-
hint: ' Enter the field name as text',
|
|
454
|
-
requiresDataPath: 'single',
|
|
455
|
-
},
|
|
456
|
-
],
|
|
457
|
-
},
|
|
458
|
-
],
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
displayName: 'Fields To Compare',
|
|
462
|
-
name: 'fieldsToCompare',
|
|
463
|
-
type: 'fixedCollection',
|
|
464
|
-
typeOptions: {
|
|
465
|
-
multipleValues: true,
|
|
466
|
-
},
|
|
467
|
-
placeholder: 'Add Field To Compare',
|
|
468
|
-
default: {},
|
|
469
|
-
displayOptions: {
|
|
470
|
-
show: {
|
|
471
|
-
resource: ['itemList'],
|
|
472
|
-
operation: ['removeDuplicates'],
|
|
473
|
-
compare: ['selectedFields'],
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
options: [
|
|
477
|
-
{
|
|
478
|
-
displayName: '',
|
|
479
|
-
name: 'fields',
|
|
480
|
-
values: [
|
|
481
|
-
{
|
|
482
|
-
displayName: 'Field Name',
|
|
483
|
-
name: 'fieldName',
|
|
484
|
-
type: 'string',
|
|
485
|
-
default: '',
|
|
486
|
-
description: 'A field in the input to add to the comparison',
|
|
487
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
488
|
-
placeholder: 'e.g. id',
|
|
489
|
-
hint: ' Enter the field name as text',
|
|
490
|
-
requiresDataPath: 'single',
|
|
491
|
-
},
|
|
492
|
-
],
|
|
493
|
-
},
|
|
494
|
-
],
|
|
495
|
-
},
|
|
496
|
-
// Sort - Fields
|
|
497
|
-
{
|
|
498
|
-
displayName: 'Type',
|
|
499
|
-
name: 'type',
|
|
500
|
-
type: 'options',
|
|
501
|
-
options: [
|
|
502
|
-
{
|
|
503
|
-
name: 'Simple',
|
|
504
|
-
value: 'simple',
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
name: 'Random',
|
|
508
|
-
value: 'random',
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
name: 'Code',
|
|
512
|
-
value: 'code',
|
|
513
|
-
},
|
|
514
|
-
],
|
|
515
|
-
default: 'simple',
|
|
516
|
-
description: 'The fields of the input items to compare to see if they are the same',
|
|
517
|
-
displayOptions: {
|
|
518
|
-
show: {
|
|
519
|
-
resource: ['itemList'],
|
|
520
|
-
operation: ['sort'],
|
|
521
|
-
},
|
|
522
|
-
},
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
displayName: 'Fields To Sort By',
|
|
526
|
-
name: 'sortFieldsUi',
|
|
527
|
-
type: 'fixedCollection',
|
|
528
|
-
typeOptions: {
|
|
529
|
-
multipleValues: true,
|
|
530
|
-
},
|
|
531
|
-
placeholder: 'Add Field To Sort By',
|
|
532
|
-
options: [
|
|
533
|
-
{
|
|
534
|
-
displayName: '',
|
|
535
|
-
name: 'sortField',
|
|
536
|
-
values: [
|
|
537
|
-
{
|
|
538
|
-
displayName: 'Field Name',
|
|
539
|
-
name: 'fieldName',
|
|
540
|
-
type: 'string',
|
|
541
|
-
required: true,
|
|
542
|
-
default: '',
|
|
543
|
-
description: 'The field to sort by',
|
|
544
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
545
|
-
placeholder: 'e.g. id',
|
|
546
|
-
hint: ' Enter the field name as text',
|
|
547
|
-
requiresDataPath: 'single',
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
displayName: 'Order',
|
|
551
|
-
name: 'order',
|
|
552
|
-
type: 'options',
|
|
553
|
-
options: [
|
|
554
|
-
{
|
|
555
|
-
name: 'Ascending',
|
|
556
|
-
value: 'ascending',
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
name: 'Descending',
|
|
560
|
-
value: 'descending',
|
|
561
|
-
},
|
|
562
|
-
],
|
|
563
|
-
default: 'ascending',
|
|
564
|
-
description: 'The order to sort by',
|
|
565
|
-
},
|
|
566
|
-
],
|
|
567
|
-
},
|
|
568
|
-
],
|
|
569
|
-
default: {},
|
|
570
|
-
description: 'The fields of the input items to compare to see if they are the same',
|
|
571
|
-
displayOptions: {
|
|
572
|
-
show: {
|
|
573
|
-
resource: ['itemList'],
|
|
574
|
-
operation: ['sort'],
|
|
575
|
-
type: ['simple'],
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
displayName: 'Code',
|
|
581
|
-
name: 'code',
|
|
582
|
-
type: 'string',
|
|
583
|
-
typeOptions: {
|
|
584
|
-
alwaysOpenEditWindow: true,
|
|
585
|
-
editor: 'jsEditor',
|
|
586
|
-
rows: 10,
|
|
587
|
-
},
|
|
588
|
-
default: `// The two items to compare are in the variables a and b
|
|
589
|
-
// Access the fields in a.json and b.json
|
|
590
|
-
// Return -1 if a should go before b
|
|
591
|
-
// Return 1 if b should go before a
|
|
592
|
-
// Return 0 if there's no difference
|
|
593
|
-
|
|
594
|
-
fieldName = 'myField';
|
|
595
|
-
|
|
596
|
-
if (a.json[fieldName] < b.json[fieldName]) {
|
|
597
|
-
return -1;
|
|
598
|
-
}
|
|
599
|
-
if (a.json[fieldName] > b.json[fieldName]) {
|
|
600
|
-
return 1;
|
|
601
|
-
}
|
|
602
|
-
return 0;`,
|
|
603
|
-
description: 'Javascript code to determine the order of any two items',
|
|
604
|
-
displayOptions: {
|
|
605
|
-
show: {
|
|
606
|
-
resource: ['itemList'],
|
|
607
|
-
operation: ['sort'],
|
|
608
|
-
type: ['code'],
|
|
609
|
-
},
|
|
610
|
-
},
|
|
611
|
-
},
|
|
612
|
-
// Limit - Fields
|
|
613
|
-
{
|
|
614
|
-
displayName: 'Max Items',
|
|
615
|
-
name: 'maxItems',
|
|
616
|
-
type: 'number',
|
|
617
|
-
typeOptions: {
|
|
618
|
-
minValue: 1,
|
|
619
|
-
},
|
|
620
|
-
default: 1,
|
|
621
|
-
description: 'If there are more items than this number, some are removed',
|
|
622
|
-
displayOptions: {
|
|
623
|
-
show: {
|
|
624
|
-
resource: ['itemList'],
|
|
625
|
-
operation: ['limit'],
|
|
626
|
-
},
|
|
627
|
-
},
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
displayName: 'Keep',
|
|
631
|
-
name: 'keep',
|
|
632
|
-
type: 'options',
|
|
633
|
-
options: [
|
|
634
|
-
{
|
|
635
|
-
name: 'First Items',
|
|
636
|
-
value: 'firstItems',
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
name: 'Last Items',
|
|
640
|
-
value: 'lastItems',
|
|
641
|
-
},
|
|
642
|
-
],
|
|
643
|
-
default: 'firstItems',
|
|
644
|
-
description: 'When removing items, whether to keep the ones at the start or the ending',
|
|
645
|
-
displayOptions: {
|
|
646
|
-
show: {
|
|
647
|
-
resource: ['itemList'],
|
|
648
|
-
operation: ['limit'],
|
|
649
|
-
},
|
|
650
|
-
},
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
displayName: 'Options',
|
|
654
|
-
name: 'options',
|
|
655
|
-
type: 'collection',
|
|
656
|
-
placeholder: 'Add Field',
|
|
657
|
-
default: {},
|
|
658
|
-
displayOptions: {
|
|
659
|
-
show: {
|
|
660
|
-
resource: ['itemList'],
|
|
661
|
-
operation: ['removeDuplicates'],
|
|
662
|
-
compare: ['allFieldsExcept', 'selectedFields'],
|
|
663
|
-
},
|
|
664
|
-
},
|
|
665
|
-
options: [
|
|
666
|
-
{
|
|
667
|
-
displayName: 'Remove Other Fields',
|
|
668
|
-
name: 'removeOtherFields',
|
|
669
|
-
type: 'boolean',
|
|
670
|
-
default: false,
|
|
671
|
-
description: 'Whether to remove any fields that are not being compared. If disabled, will keep the values from the first of the duplicates.',
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
displayName: 'Disable Dot Notation',
|
|
675
|
-
name: 'disableDotNotation',
|
|
676
|
-
type: 'boolean',
|
|
677
|
-
default: false,
|
|
678
|
-
description: 'Whether to disallow referencing child fields using `parent.child` in the field name',
|
|
679
|
-
},
|
|
680
|
-
],
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
displayName: 'Options',
|
|
684
|
-
name: 'options',
|
|
685
|
-
type: 'collection',
|
|
686
|
-
placeholder: 'Add Field',
|
|
687
|
-
default: {},
|
|
688
|
-
displayOptions: {
|
|
689
|
-
show: {
|
|
690
|
-
resource: ['itemList'],
|
|
691
|
-
operation: ['sort'],
|
|
692
|
-
type: ['simple'],
|
|
693
|
-
},
|
|
694
|
-
},
|
|
695
|
-
options: [
|
|
696
|
-
{
|
|
697
|
-
displayName: 'Disable Dot Notation',
|
|
698
|
-
name: 'disableDotNotation',
|
|
699
|
-
type: 'boolean',
|
|
700
|
-
default: false,
|
|
701
|
-
description: 'Whether to disallow referencing child fields using `parent.child` in the field name',
|
|
702
|
-
},
|
|
703
|
-
],
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
displayName: 'Options',
|
|
707
|
-
name: 'options',
|
|
708
|
-
type: 'collection',
|
|
709
|
-
placeholder: 'Add Field',
|
|
710
|
-
default: {},
|
|
711
|
-
displayOptions: {
|
|
712
|
-
show: {
|
|
713
|
-
resource: ['itemList'],
|
|
714
|
-
operation: ['splitOutItems', 'aggregateItems'],
|
|
715
|
-
},
|
|
716
|
-
hide: {
|
|
717
|
-
aggregate: ['aggregateAllItemData'],
|
|
718
|
-
},
|
|
719
|
-
},
|
|
720
|
-
options: [
|
|
721
|
-
{
|
|
722
|
-
displayName: 'Disable Dot Notation',
|
|
723
|
-
name: 'disableDotNotation',
|
|
724
|
-
type: 'boolean',
|
|
725
|
-
displayOptions: {
|
|
726
|
-
show: {
|
|
727
|
-
'/operation': ['splitOutItems', 'aggregateItems'],
|
|
728
|
-
},
|
|
729
|
-
},
|
|
730
|
-
default: false,
|
|
731
|
-
description: 'Whether to disallow referencing child fields using `parent.child` in the field name',
|
|
732
|
-
},
|
|
733
|
-
{
|
|
734
|
-
displayName: 'Destination Field Name',
|
|
735
|
-
name: 'destinationFieldName',
|
|
736
|
-
type: 'string',
|
|
737
|
-
displayOptions: {
|
|
738
|
-
show: {
|
|
739
|
-
'/operation': ['splitOutItems'],
|
|
740
|
-
},
|
|
741
|
-
},
|
|
742
|
-
default: '',
|
|
743
|
-
description: 'The field in the output under which to put the split field contents',
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
displayName: 'Merge Lists',
|
|
747
|
-
name: 'mergeLists',
|
|
748
|
-
type: 'boolean',
|
|
749
|
-
displayOptions: {
|
|
750
|
-
show: {
|
|
751
|
-
'/operation': ['aggregateItems'],
|
|
752
|
-
},
|
|
753
|
-
},
|
|
754
|
-
default: false,
|
|
755
|
-
description: 'Whether to merge the output into a single flat list (rather than a list of lists), if the field to aggregate is a list',
|
|
756
|
-
},
|
|
757
|
-
{
|
|
758
|
-
displayName: 'Keep Missing And Null Values',
|
|
759
|
-
name: 'keepMissing',
|
|
760
|
-
type: 'boolean',
|
|
761
|
-
displayOptions: {
|
|
762
|
-
show: {
|
|
763
|
-
'/operation': ['aggregateItems'],
|
|
764
|
-
},
|
|
765
|
-
},
|
|
766
|
-
default: false,
|
|
767
|
-
description: 'Whether to add a null entry to the aggregated list when there is a missing or null value',
|
|
768
|
-
},
|
|
769
|
-
],
|
|
770
|
-
},
|
|
771
|
-
// Remove duplicates - Fields
|
|
772
|
-
...summarize.description,
|
|
773
|
-
],
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
async execute() {
|
|
777
|
-
const items = this.getInputData();
|
|
778
|
-
const length = items.length;
|
|
779
|
-
const returnData = [];
|
|
780
|
-
const resource = this.getNodeParameter('resource', 0);
|
|
781
|
-
const operation = this.getNodeParameter('operation', 0);
|
|
782
|
-
if (resource === 'itemList') {
|
|
783
|
-
if (operation === 'splitOutItems') {
|
|
784
|
-
for (let i = 0; i < length; i++) {
|
|
785
|
-
const fieldToSplitOut = this.getNodeParameter('fieldToSplitOut', i);
|
|
786
|
-
const disableDotNotation = this.getNodeParameter('options.disableDotNotation', 0, false);
|
|
787
|
-
const destinationFieldName = this.getNodeParameter('options.destinationFieldName', i, '');
|
|
788
|
-
const include = this.getNodeParameter('include', i);
|
|
789
|
-
let arrayToSplit;
|
|
790
|
-
if (!disableDotNotation) {
|
|
791
|
-
arrayToSplit = (0, get_1.default)(items[i].json, fieldToSplitOut);
|
|
792
|
-
}
|
|
793
|
-
else {
|
|
794
|
-
arrayToSplit = items[i].json[fieldToSplitOut];
|
|
795
|
-
}
|
|
796
|
-
if (arrayToSplit === undefined) {
|
|
797
|
-
if (fieldToSplitOut.includes('.') && disableDotNotation) {
|
|
798
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Couldn't find the field '${fieldToSplitOut}' in the input data`, {
|
|
799
|
-
description: "If you're trying to use a nested field, make sure you turn off 'disable dot notation' in the node options",
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
else {
|
|
803
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Couldn't find the field '${fieldToSplitOut}' in the input data`, { itemIndex: i });
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
if (!Array.isArray(arrayToSplit)) {
|
|
807
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The provided field '${fieldToSplitOut}' is not an array`, { itemIndex: i });
|
|
808
|
-
}
|
|
809
|
-
else {
|
|
810
|
-
for (const element of arrayToSplit) {
|
|
811
|
-
let newItem = {};
|
|
812
|
-
if (include === 'selectedOtherFields') {
|
|
813
|
-
const fieldsToInclude = this.getNodeParameter('fieldsToInclude.fields', i, []).map((field) => field.fieldName);
|
|
814
|
-
if (!fieldsToInclude.length) {
|
|
815
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No fields specified', {
|
|
816
|
-
description: 'Please add a field to include',
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
newItem = {
|
|
820
|
-
...fieldsToInclude.reduce((prev, field) => {
|
|
821
|
-
if (field === fieldToSplitOut) {
|
|
822
|
-
return prev;
|
|
823
|
-
}
|
|
824
|
-
let value;
|
|
825
|
-
if (!disableDotNotation) {
|
|
826
|
-
value = (0, get_1.default)(items[i].json, field);
|
|
827
|
-
}
|
|
828
|
-
else {
|
|
829
|
-
value = items[i].json[field];
|
|
830
|
-
}
|
|
831
|
-
prev = { ...prev, [field]: value };
|
|
832
|
-
return prev;
|
|
833
|
-
}, {}),
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
else if (include === 'allOtherFields') {
|
|
837
|
-
const keys = Object.keys(items[i].json);
|
|
838
|
-
newItem = {
|
|
839
|
-
...keys.reduce((prev, field) => {
|
|
840
|
-
let value;
|
|
841
|
-
if (!disableDotNotation) {
|
|
842
|
-
value = (0, get_1.default)(items[i].json, field);
|
|
843
|
-
}
|
|
844
|
-
else {
|
|
845
|
-
value = items[i].json[field];
|
|
846
|
-
}
|
|
847
|
-
prev = { ...prev, [field]: value };
|
|
848
|
-
return prev;
|
|
849
|
-
}, {}),
|
|
850
|
-
};
|
|
851
|
-
(0, unset_1.default)(newItem, fieldToSplitOut);
|
|
852
|
-
}
|
|
853
|
-
if (typeof element === 'object' &&
|
|
854
|
-
include === 'noOtherFields' &&
|
|
855
|
-
destinationFieldName === '') {
|
|
856
|
-
newItem = { ...newItem, ...element };
|
|
857
|
-
}
|
|
858
|
-
else {
|
|
859
|
-
newItem = {
|
|
860
|
-
...newItem,
|
|
861
|
-
[destinationFieldName || fieldToSplitOut]: element,
|
|
862
|
-
};
|
|
863
|
-
}
|
|
864
|
-
returnData.push({
|
|
865
|
-
json: newItem,
|
|
866
|
-
pairedItem: {
|
|
867
|
-
item: i,
|
|
868
|
-
},
|
|
869
|
-
});
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
return [returnData];
|
|
874
|
-
}
|
|
875
|
-
else if (operation === 'aggregateItems') {
|
|
876
|
-
const aggregate = this.getNodeParameter('aggregate', 0, '');
|
|
877
|
-
if (aggregate === 'aggregateIndividualFields') {
|
|
878
|
-
const disableDotNotation = this.getNodeParameter('options.disableDotNotation', 0, false);
|
|
879
|
-
const mergeLists = this.getNodeParameter('options.mergeLists', 0, false);
|
|
880
|
-
const fieldsToAggregate = this.getNodeParameter('fieldsToAggregate.fieldToAggregate', 0, []);
|
|
881
|
-
const keepMissing = this.getNodeParameter('options.keepMissing', 0, false);
|
|
882
|
-
if (!fieldsToAggregate.length) {
|
|
883
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No fields specified', {
|
|
884
|
-
description: 'Please add a field to aggregate',
|
|
885
|
-
});
|
|
886
|
-
}
|
|
887
|
-
for (const { fieldToAggregate } of fieldsToAggregate) {
|
|
888
|
-
let found = false;
|
|
889
|
-
for (const item of items) {
|
|
890
|
-
if (fieldToAggregate === '') {
|
|
891
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Field to aggregate is blank', {
|
|
892
|
-
description: 'Please add a field to aggregate',
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
if (!disableDotNotation) {
|
|
896
|
-
if ((0, get_1.default)(item.json, fieldToAggregate) !== undefined) {
|
|
897
|
-
found = true;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
else if (item.json.hasOwnProperty(fieldToAggregate)) {
|
|
901
|
-
found = true;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
if (!found && disableDotNotation && fieldToAggregate.includes('.')) {
|
|
905
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Couldn't find the field '${fieldToAggregate}' in the input data`, {
|
|
906
|
-
description: "If you're trying to use a nested field, make sure you turn off 'disable dot notation' in the node options",
|
|
907
|
-
});
|
|
908
|
-
}
|
|
909
|
-
else if (!found && !keepMissing) {
|
|
910
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Couldn't find the field '${fieldToAggregate}' in the input data`);
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
const newItem = {
|
|
914
|
-
json: {},
|
|
915
|
-
pairedItem: Array.from({ length }, (_, i) => i).map((index) => {
|
|
916
|
-
return {
|
|
917
|
-
item: index,
|
|
918
|
-
};
|
|
919
|
-
}),
|
|
920
|
-
};
|
|
921
|
-
const values = {};
|
|
922
|
-
const outputFields = [];
|
|
923
|
-
for (const { fieldToAggregate, outputFieldName, renameField } of fieldsToAggregate) {
|
|
924
|
-
const field = renameField ? outputFieldName : fieldToAggregate;
|
|
925
|
-
if (outputFields.includes(field)) {
|
|
926
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The '${field}' output field is used more than once`, { description: 'Please make sure each output field name is unique' });
|
|
927
|
-
}
|
|
928
|
-
else {
|
|
929
|
-
outputFields.push(field);
|
|
930
|
-
}
|
|
931
|
-
const getFieldToAggregate = () => !disableDotNotation && fieldToAggregate.includes('.')
|
|
932
|
-
? fieldToAggregate.split('.').pop()
|
|
933
|
-
: fieldToAggregate;
|
|
934
|
-
const _outputFieldName = outputFieldName
|
|
935
|
-
? outputFieldName
|
|
936
|
-
: getFieldToAggregate();
|
|
937
|
-
if (fieldToAggregate !== '') {
|
|
938
|
-
values[_outputFieldName] = [];
|
|
939
|
-
for (let i = 0; i < length; i++) {
|
|
940
|
-
if (!disableDotNotation) {
|
|
941
|
-
let value = (0, get_1.default)(items[i].json, fieldToAggregate);
|
|
942
|
-
if (!keepMissing) {
|
|
943
|
-
if (Array.isArray(value)) {
|
|
944
|
-
value = value.filter((entry) => entry !== null);
|
|
945
|
-
}
|
|
946
|
-
else if (value === null || value === undefined) {
|
|
947
|
-
continue;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
if (Array.isArray(value) && mergeLists) {
|
|
951
|
-
values[_outputFieldName].push(...value);
|
|
952
|
-
}
|
|
953
|
-
else {
|
|
954
|
-
values[_outputFieldName].push(value);
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
else {
|
|
958
|
-
let value = items[i].json[fieldToAggregate];
|
|
959
|
-
if (!keepMissing) {
|
|
960
|
-
if (Array.isArray(value)) {
|
|
961
|
-
value = value.filter((entry) => entry !== null);
|
|
962
|
-
}
|
|
963
|
-
else if (value === null || value === undefined) {
|
|
964
|
-
continue;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
if (Array.isArray(value) && mergeLists) {
|
|
968
|
-
values[_outputFieldName].push(...value);
|
|
969
|
-
}
|
|
970
|
-
else {
|
|
971
|
-
values[_outputFieldName].push(value);
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
for (const key of Object.keys(values)) {
|
|
978
|
-
if (!disableDotNotation) {
|
|
979
|
-
(0, set_1.default)(newItem.json, key, values[key]);
|
|
980
|
-
}
|
|
981
|
-
else {
|
|
982
|
-
newItem.json[key] = values[key];
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
returnData.push(newItem);
|
|
986
|
-
return [returnData];
|
|
987
|
-
}
|
|
988
|
-
else {
|
|
989
|
-
let newItems = items.map((item) => item.json);
|
|
990
|
-
const destinationFieldName = this.getNodeParameter('destinationFieldName', 0);
|
|
991
|
-
const fieldsToExclude = this.getNodeParameter('fieldsToExclude.fields', 0, []).map((entry) => entry.fieldName);
|
|
992
|
-
const fieldsToInclude = this.getNodeParameter('fieldsToInclude.fields', 0, []).map((entry) => entry.fieldName);
|
|
993
|
-
if (fieldsToExclude.length || fieldsToInclude.length) {
|
|
994
|
-
newItems = newItems.reduce((acc, item) => {
|
|
995
|
-
const newItem = {};
|
|
996
|
-
let outputFields = Object.keys(item);
|
|
997
|
-
if (fieldsToExclude.length) {
|
|
998
|
-
outputFields = outputFields.filter((key) => !fieldsToExclude.includes(key));
|
|
999
|
-
}
|
|
1000
|
-
if (fieldsToInclude.length) {
|
|
1001
|
-
outputFields = outputFields.filter((key) => fieldsToInclude.length ? fieldsToInclude.includes(key) : true);
|
|
1002
|
-
}
|
|
1003
|
-
outputFields.forEach((key) => {
|
|
1004
|
-
newItem[key] = item[key];
|
|
1005
|
-
});
|
|
1006
|
-
if ((0, isEmpty_1.default)(newItem)) {
|
|
1007
|
-
return acc;
|
|
1008
|
-
}
|
|
1009
|
-
return acc.concat([newItem]);
|
|
1010
|
-
}, []);
|
|
1011
|
-
}
|
|
1012
|
-
return [[{ json: { [destinationFieldName]: newItems } }]];
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
else if (operation === 'removeDuplicates') {
|
|
1016
|
-
const compare = this.getNodeParameter('compare', 0);
|
|
1017
|
-
const disableDotNotation = this.getNodeParameter('options.disableDotNotation', 0, false);
|
|
1018
|
-
const removeOtherFields = this.getNodeParameter('options.removeOtherFields', 0, false);
|
|
1019
|
-
let keys = disableDotNotation
|
|
1020
|
-
? Object.keys(items[0].json)
|
|
1021
|
-
: Object.keys((0, utilities_1.flattenKeys)(items[0].json));
|
|
1022
|
-
for (const item of items) {
|
|
1023
|
-
for (const key of disableDotNotation
|
|
1024
|
-
? Object.keys(item.json)
|
|
1025
|
-
: Object.keys((0, utilities_1.flattenKeys)(item.json))) {
|
|
1026
|
-
if (!keys.includes(key)) {
|
|
1027
|
-
keys.push(key);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
if (compare === 'allFieldsExcept') {
|
|
1032
|
-
const fieldsToExclude = this.getNodeParameter('fieldsToExclude.fields', 0, []).map((field) => field.fieldName);
|
|
1033
|
-
if (!fieldsToExclude.length) {
|
|
1034
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No fields specified. Please add a field to exclude from comparison');
|
|
1035
|
-
}
|
|
1036
|
-
if (!disableDotNotation) {
|
|
1037
|
-
keys = Object.keys((0, utilities_1.flattenKeys)(items[0].json));
|
|
1038
|
-
}
|
|
1039
|
-
keys = keys.filter((key) => !fieldsToExclude.includes(key));
|
|
1040
|
-
}
|
|
1041
|
-
if (compare === 'selectedFields') {
|
|
1042
|
-
const fieldsToCompare = this.getNodeParameter('fieldsToCompare.fields', 0, []).map((field) => field.fieldName);
|
|
1043
|
-
if (!fieldsToCompare.length) {
|
|
1044
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No fields specified. Please add a field to compare on');
|
|
1045
|
-
}
|
|
1046
|
-
if (!disableDotNotation) {
|
|
1047
|
-
keys = Object.keys((0, utilities_1.flattenKeys)(items[0].json));
|
|
1048
|
-
}
|
|
1049
|
-
keys = fieldsToCompare.map((key) => key.trim());
|
|
1050
|
-
}
|
|
1051
|
-
// This solution is O(nlogn)
|
|
1052
|
-
// add original index to the items
|
|
1053
|
-
const newItems = items.map((item, index) => ({
|
|
1054
|
-
json: { ...item.json, __INDEX: index },
|
|
1055
|
-
pairedItem: { item: index },
|
|
1056
|
-
}));
|
|
1057
|
-
//sort items using the compare keys
|
|
1058
|
-
newItems.sort((a, b) => {
|
|
1059
|
-
let result = 0;
|
|
1060
|
-
for (const key of keys) {
|
|
1061
|
-
let equal;
|
|
1062
|
-
if (!disableDotNotation) {
|
|
1063
|
-
equal = (0, isEqual_1.default)((0, get_1.default)(a.json, key), (0, get_1.default)(b.json, key));
|
|
1064
|
-
}
|
|
1065
|
-
else {
|
|
1066
|
-
equal = (0, isEqual_1.default)(a.json[key], b.json[key]);
|
|
1067
|
-
}
|
|
1068
|
-
if (!equal) {
|
|
1069
|
-
let lessThan;
|
|
1070
|
-
if (!disableDotNotation) {
|
|
1071
|
-
lessThan = (0, lt_1.default)((0, get_1.default)(a.json, key), (0, get_1.default)(b.json, key));
|
|
1072
|
-
}
|
|
1073
|
-
else {
|
|
1074
|
-
lessThan = (0, lt_1.default)(a.json[key], b.json[key]);
|
|
1075
|
-
}
|
|
1076
|
-
result = lessThan ? -1 : 1;
|
|
1077
|
-
break;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
return result;
|
|
1081
|
-
});
|
|
1082
|
-
for (const key of keys) {
|
|
1083
|
-
let type = undefined;
|
|
1084
|
-
for (const item of newItems) {
|
|
1085
|
-
if (key === '') {
|
|
1086
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Name of field to compare is blank');
|
|
1087
|
-
}
|
|
1088
|
-
const value = !disableDotNotation ? (0, get_1.default)(item.json, key) : item.json[key];
|
|
1089
|
-
if (value === undefined && disableDotNotation && key.includes('.')) {
|
|
1090
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `'${key}' field is missing from some input items`, {
|
|
1091
|
-
description: "If you're trying to use a nested field, make sure you turn off 'disable dot notation' in the node options",
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
else if (value === undefined) {
|
|
1095
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `'${key}' field is missing from some input items`);
|
|
1096
|
-
}
|
|
1097
|
-
if (type !== undefined && value !== undefined && type !== typeof value) {
|
|
1098
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `'${key}' isn't always the same type`, {
|
|
1099
|
-
description: 'The type of this field varies between items',
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
else {
|
|
1103
|
-
type = typeof value;
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
// collect the original indexes of items to be removed
|
|
1108
|
-
const removedIndexes = [];
|
|
1109
|
-
let temp = newItems[0];
|
|
1110
|
-
for (let index = 1; index < newItems.length; index++) {
|
|
1111
|
-
if ((0, utilities_1.compareItems)(newItems[index], temp, keys, disableDotNotation)) {
|
|
1112
|
-
removedIndexes.push(newItems[index].json.__INDEX);
|
|
1113
|
-
}
|
|
1114
|
-
else {
|
|
1115
|
-
temp = newItems[index];
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
let data = items.filter((_, index) => !removedIndexes.includes(index));
|
|
1119
|
-
if (removeOtherFields) {
|
|
1120
|
-
data = data.map((item, index) => ({
|
|
1121
|
-
json: (0, pick_1.default)(item.json, ...keys),
|
|
1122
|
-
pairedItem: { item: index },
|
|
1123
|
-
}));
|
|
1124
|
-
}
|
|
1125
|
-
// return the filtered items
|
|
1126
|
-
return [data];
|
|
1127
|
-
}
|
|
1128
|
-
else if (operation === 'sort') {
|
|
1129
|
-
let newItems = [...items];
|
|
1130
|
-
const type = this.getNodeParameter('type', 0);
|
|
1131
|
-
const disableDotNotation = this.getNodeParameter('options.disableDotNotation', 0, false);
|
|
1132
|
-
if (type === 'random') {
|
|
1133
|
-
(0, utilities_1.shuffleArray)(newItems);
|
|
1134
|
-
return [newItems];
|
|
1135
|
-
}
|
|
1136
|
-
if (type === 'simple') {
|
|
1137
|
-
const sortFieldsUi = this.getNodeParameter('sortFieldsUi', 0);
|
|
1138
|
-
const sortFields = sortFieldsUi.sortField;
|
|
1139
|
-
if (!sortFields?.length) {
|
|
1140
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No sorting specified. Please add a field to sort by');
|
|
1141
|
-
}
|
|
1142
|
-
for (const { fieldName } of sortFields) {
|
|
1143
|
-
let found = false;
|
|
1144
|
-
for (const item of items) {
|
|
1145
|
-
if (!disableDotNotation) {
|
|
1146
|
-
if ((0, get_1.default)(item.json, fieldName) !== undefined) {
|
|
1147
|
-
found = true;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
else if (item.json.hasOwnProperty(fieldName)) {
|
|
1151
|
-
found = true;
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
if (!found && disableDotNotation && fieldName.includes('.')) {
|
|
1155
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Couldn't find the field '${fieldName}' in the input data`, {
|
|
1156
|
-
description: "If you're trying to use a nested field, make sure you turn off 'disable dot notation' in the node options",
|
|
1157
|
-
});
|
|
1158
|
-
}
|
|
1159
|
-
else if (!found) {
|
|
1160
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Couldn't find the field '${fieldName}' in the input data`);
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
const sortFieldsWithDirection = sortFields.map((field) => ({
|
|
1164
|
-
name: field.fieldName,
|
|
1165
|
-
dir: field.order === 'ascending' ? 1 : -1,
|
|
1166
|
-
}));
|
|
1167
|
-
newItems.sort((a, b) => {
|
|
1168
|
-
let result = 0;
|
|
1169
|
-
for (const field of sortFieldsWithDirection) {
|
|
1170
|
-
let equal;
|
|
1171
|
-
if (!disableDotNotation) {
|
|
1172
|
-
const _a = typeof (0, get_1.default)(a.json, field.name) === 'string'
|
|
1173
|
-
? (0, get_1.default)(a.json, field.name).toLowerCase()
|
|
1174
|
-
: (0, get_1.default)(a.json, field.name);
|
|
1175
|
-
const _b = typeof (0, get_1.default)(b.json, field.name) === 'string'
|
|
1176
|
-
? (0, get_1.default)(b.json, field.name).toLowerCase()
|
|
1177
|
-
: (0, get_1.default)(b.json, field.name);
|
|
1178
|
-
equal = (0, isEqual_1.default)(_a, _b);
|
|
1179
|
-
}
|
|
1180
|
-
else {
|
|
1181
|
-
const _a = typeof a.json[field.name] === 'string'
|
|
1182
|
-
? a.json[field.name].toLowerCase()
|
|
1183
|
-
: a.json[field.name];
|
|
1184
|
-
const _b = typeof b.json[field.name] === 'string'
|
|
1185
|
-
? b.json[field.name].toLowerCase()
|
|
1186
|
-
: b.json[field.name];
|
|
1187
|
-
equal = (0, isEqual_1.default)(_a, _b);
|
|
1188
|
-
}
|
|
1189
|
-
if (!equal) {
|
|
1190
|
-
let lessThan;
|
|
1191
|
-
if (!disableDotNotation) {
|
|
1192
|
-
const _a = typeof (0, get_1.default)(a.json, field.name) === 'string'
|
|
1193
|
-
? (0, get_1.default)(a.json, field.name).toLowerCase()
|
|
1194
|
-
: (0, get_1.default)(a.json, field.name);
|
|
1195
|
-
const _b = typeof (0, get_1.default)(b.json, field.name) === 'string'
|
|
1196
|
-
? (0, get_1.default)(b.json, field.name).toLowerCase()
|
|
1197
|
-
: (0, get_1.default)(b.json, field.name);
|
|
1198
|
-
lessThan = (0, lt_1.default)(_a, _b);
|
|
1199
|
-
}
|
|
1200
|
-
else {
|
|
1201
|
-
const _a = typeof a.json[field.name] === 'string'
|
|
1202
|
-
? a.json[field.name].toLowerCase()
|
|
1203
|
-
: a.json[field.name];
|
|
1204
|
-
const _b = typeof b.json[field.name] === 'string'
|
|
1205
|
-
? b.json[field.name].toLowerCase()
|
|
1206
|
-
: b.json[field.name];
|
|
1207
|
-
lessThan = (0, lt_1.default)(_a, _b);
|
|
1208
|
-
}
|
|
1209
|
-
if (lessThan) {
|
|
1210
|
-
result = -1 * field.dir;
|
|
1211
|
-
}
|
|
1212
|
-
else {
|
|
1213
|
-
result = 1 * field.dir;
|
|
1214
|
-
}
|
|
1215
|
-
break;
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
return result;
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
else {
|
|
1222
|
-
newItems = await utils_1.sortByCode.call(this, newItems);
|
|
1223
|
-
}
|
|
1224
|
-
return [newItems];
|
|
1225
|
-
}
|
|
1226
|
-
else if (operation === 'limit') {
|
|
1227
|
-
let newItems = items;
|
|
1228
|
-
const maxItems = this.getNodeParameter('maxItems', 0);
|
|
1229
|
-
const keep = this.getNodeParameter('keep', 0);
|
|
1230
|
-
if (maxItems > items.length) {
|
|
1231
|
-
return [newItems];
|
|
1232
|
-
}
|
|
1233
|
-
if (keep === 'firstItems') {
|
|
1234
|
-
newItems = items.slice(0, maxItems);
|
|
1235
|
-
}
|
|
1236
|
-
else {
|
|
1237
|
-
newItems = items.slice(items.length - maxItems, items.length);
|
|
1238
|
-
}
|
|
1239
|
-
return [newItems];
|
|
1240
|
-
}
|
|
1241
|
-
else if (operation === 'summarize') {
|
|
1242
|
-
return await summarize.execute.call(this, items);
|
|
1243
|
-
}
|
|
1244
|
-
else {
|
|
1245
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation '${operation}' is not recognized`);
|
|
1246
|
-
}
|
|
1247
|
-
}
|
|
1248
|
-
else {
|
|
1249
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Resource '${resource}' is not recognized`);
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
exports.ItemListsV1 = ItemListsV1;
|
|
1254
|
-
//# sourceMappingURL=ItemListsV1.node.js.map
|