@thegraphitelab/n8n-nodes-toolbox 1.0.0 → 1.1.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/core/handlers/execHandler.js +6 -7
- package/dist/core/handlers/execHandler.js.map +1 -1
- package/dist/core/handlers/pollHandler.js +6 -7
- package/dist/core/handlers/pollHandler.js.map +1 -1
- package/dist/core/handlers/utils.d.ts +6 -6
- package/dist/core/handlers/utils.js +11 -11
- package/dist/core/handlers/utils.js.map +1 -1
- package/dist/core/handlers/webhookHandler.d.ts +14 -0
- package/dist/core/handlers/webhookHandler.js +57 -0
- package/dist/core/handlers/webhookHandler.js.map +1 -0
- package/dist/core/parameters/utils.d.ts +14 -3
- package/dist/core/parameters/utils.js +63 -1
- package/dist/core/parameters/utils.js.map +1 -1
- package/dist/core/transport/index.d.ts +1 -12
- package/dist/core/transport/index.js +3 -42
- package/dist/core/transport/index.js.map +1 -1
- package/dist/core/transport/jerboa.d.ts +14 -0
- package/dist/core/transport/jerboa.js +89 -0
- package/dist/core/transport/jerboa.js.map +1 -0
- package/dist/core/transport/toolbox.d.ts +12 -0
- package/dist/core/transport/toolbox.js +18 -0
- package/dist/core/transport/toolbox.js.map +1 -0
- package/dist/core/transport/utils.d.ts +2 -0
- package/dist/core/transport/utils.js +31 -0
- package/dist/core/transport/utils.js.map +1 -0
- package/dist/core/utils/array.d.ts +1 -0
- package/dist/core/utils/array.js +9 -0
- package/dist/core/utils/array.js.map +1 -0
- package/dist/core/utils/file.d.ts +5 -0
- package/dist/core/utils/file.js +25 -0
- package/dist/core/utils/file.js.map +1 -0
- package/dist/core/utils/string.d.ts +2 -0
- package/dist/core/utils/string.js +10 -0
- package/dist/core/utils/string.js.map +1 -0
- package/dist/credentials/JerboaApi.credentials.d.ts +10 -0
- package/dist/credentials/JerboaApi.credentials.js +28 -0
- package/dist/credentials/JerboaApi.credentials.js.map +1 -0
- package/dist/nodes/CallIQ/v1/CallIqPollTriggerV1.node.js +0 -1
- package/dist/nodes/CallIQ/v1/CallIqPollTriggerV1.node.js.map +1 -1
- package/dist/nodes/CallIQ/v1/actions/call/get/description.js +1 -1
- package/dist/nodes/CallIQ/v1/actions/call/get/execution.js +2 -2
- package/dist/nodes/CallIQ/v1/actions/call/get/execution.js.map +1 -1
- package/dist/nodes/CallIQ/v1/triggers/poll/onCallCompletion/description.js +1 -1
- package/dist/nodes/CallIQ/v1/triggers/poll/onCallCompletion/polling.js +1 -1
- package/dist/nodes/CallIQ/v1/triggers/poll/onCallCompletion/polling.js.map +1 -1
- package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.d.ts +4 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.js +24 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.json +18 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.d.ts +4 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.js +24 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.json +18 -0
- package/dist/nodes/PurchasingAssistant/eli.svg +106 -0
- package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantV1.node.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantV1.node.js +68 -0
- package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantV1.node.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.d.ts +13 -0
- package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.js +66 -0
- package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/index.d.ts +20 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/index.js +30 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/index.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/const.d.ts +2 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/const.js +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/const.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/description.js +20 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/execution.js +39 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/description.js +19 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/execution.js +16 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.js +19 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.js +23 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/index.d.ts +13 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/index.js +51 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/index.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/description.js +23 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/execution.js +35 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/utils.d.ts +10 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/utils.js +21 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transaction/utils.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/const.d.ts +2 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/const.js +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/const.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/description.js +23 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/execution.js +24 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/description.js +19 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/execution.js +23 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/description.js +27 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/execution.js +23 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/index.d.ts +13 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/index.js +51 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/index.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/description.d.ts +29 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/description.js +19 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/execution.d.ts +6 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/execution.js +22 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/execution.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/utils.d.ts +1 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/utils.js +7 -0
- package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/utils.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/index.d.ts +3 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/index.js +68 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/index.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/options.d.ts +22 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/options.js +34 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/options.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/types.d.ts +1 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/types.js +3 -0
- package/dist/nodes/PurchasingAssistant/v1/parameters/types.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/index.d.ts +8 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/index.js +26 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/index.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/index.d.ts +3 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/index.js +23 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/index.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/description.d.ts +3 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/description.js +15 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/webhookMethods.d.ts +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/webhookMethods.js +10 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/webhookMethods.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/description.d.ts +3 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/description.js +16 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/description.js.map +1 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/webhookMethods.d.ts +3 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/webhookMethods.js +14 -0
- package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/webhookMethods.js.map +1 -0
- package/dist/nodes/Toolbox/eli.svg +51 -106
- package/dist/nodes/Toolbox/v1/transport/index.js +0 -2
- package/dist/nodes/Toolbox/v1/transport/index.js.map +1 -1
- package/dist/nodes/Webhooks/v1/WebhooksV1.node.js +0 -1
- package/dist/nodes/Webhooks/v1/WebhooksV1.node.js.map +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/create/description.js +2 -2
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/create/description.js.map +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/create/execution.js +3 -3
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/create/execution.js.map +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/deactivate/description.js +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/deactivate/execution.js +2 -2
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/deactivate/execution.js.map +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/get/description.js +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/get/execution.js +3 -3
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/get/execution.js.map +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/update/description.js +1 -1
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/update/execution.js +3 -3
- package/dist/nodes/Webhooks/v1/actions/webhookInstance/update/execution.js.map +1 -1
- package/dist/nodes/Webhooks/v1/methods/loadOptions.js +1 -1
- package/dist/nodes/Webhooks/v1/methods/loadOptions.js.map +1 -1
- package/dist/nodes/Webhooks/v1/methods/resourceMapping.js +1 -1
- package/dist/nodes/Webhooks/v1/methods/resourceMapping.js.map +1 -1
- package/dist/nodes/Webhooks/v1/triggers/webhook/onWebhookEvent/description.js +1 -1
- package/dist/nodes/Webhooks/v1/triggers/webhook/onWebhookEvent/webhookMethods.js +2 -2
- package/dist/nodes/Webhooks/v1/triggers/webhook/onWebhookEvent/webhookMethods.js.map +1 -1
- package/dist/package.json +8 -2
- package/package.json +8 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PurchasingAssistantWhTriggerV1 = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const triggers_1 = require("./triggers");
|
|
6
|
+
const purchasingAssistantWhV1TriggerDescription = {
|
|
7
|
+
displayName: "TGL Purchasing Assistant Trigger",
|
|
8
|
+
name: "purchasingAssistantWhTrigger",
|
|
9
|
+
group: ["trigger"],
|
|
10
|
+
// Icon is inherited from the base wrapper's description (merged in via the
|
|
11
|
+
// constructor). Do NOT set a `file:` icon here: when installed from npm, n8n
|
|
12
|
+
// resolves it relative to the registered base node file's directory, so a
|
|
13
|
+
// `../` path would 404. See PurchasingAssistantWhTrigger.node.ts.
|
|
14
|
+
version: 1,
|
|
15
|
+
subtitle: '={{$parameter["event"]}}',
|
|
16
|
+
description: "Interact with TGL's Purchasing Assistant",
|
|
17
|
+
defaults: {
|
|
18
|
+
name: "TGL Purchasing Assistant Trigger",
|
|
19
|
+
},
|
|
20
|
+
inputs: [],
|
|
21
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
22
|
+
credentials: [
|
|
23
|
+
{
|
|
24
|
+
name: "jerboaApi",
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
properties: triggers_1.properties,
|
|
29
|
+
webhooks: [
|
|
30
|
+
{
|
|
31
|
+
name: "default",
|
|
32
|
+
httpMethod: "POST",
|
|
33
|
+
responseMode: "onReceived",
|
|
34
|
+
path: "webhook",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
/* eslint-disable @n8n/community-nodes/icon-validation --
|
|
39
|
+
Icon lives on the versioned wrapper's description/baseDescription and is merged
|
|
40
|
+
in via the constructor; this static rule can't see spreads, so it false-positives. */
|
|
41
|
+
class PurchasingAssistantWhTriggerV1 {
|
|
42
|
+
description;
|
|
43
|
+
constructor(baseDescription) {
|
|
44
|
+
this.description = {
|
|
45
|
+
...baseDescription,
|
|
46
|
+
...purchasingAssistantWhV1TriggerDescription,
|
|
47
|
+
// Clone per instance: n8n mutates description.properties in place
|
|
48
|
+
// (e.g. unshift), so a shared module-level array would accumulate
|
|
49
|
+
// duplicates across reloads.
|
|
50
|
+
properties: [
|
|
51
|
+
...purchasingAssistantWhV1TriggerDescription.properties,
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
webhookMethods = triggers_1.webhookMethods;
|
|
56
|
+
async webhook() {
|
|
57
|
+
const req = this.getRequestObject();
|
|
58
|
+
return {
|
|
59
|
+
workflowData: [
|
|
60
|
+
this.helpers.returnJsonArray(JSON.parse(req.body)),
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.PurchasingAssistantWhTriggerV1 = PurchasingAssistantWhTriggerV1;
|
|
66
|
+
//# sourceMappingURL=PurchasingAssistantWhTriggerV1.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PurchasingAssistantWhTriggerV1.node.js","sourceRoot":"","sources":["../../../../nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.ts"],"names":[],"mappings":";;;AAQA,+CAAmD;AAEnD,yCAAwD;AAExD,MAAM,yCAAyC,GAAyB;IACpE,WAAW,EAAE,kCAAkC;IAC/C,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,2EAA2E;IAC3E,6EAA6E;IAC7E,0EAA0E;IAC1E,kEAAkE;IAClE,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,0BAA0B;IACpC,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE;QACN,IAAI,EAAE,kCAAkC;KAC3C;IACD,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;IACnC,WAAW,EAAE;QACT;YACI,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,UAAU,EAAV,qBAAU;IACV,QAAQ,EAAE;QACN;YACI,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,MAAM;YAClB,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,SAAS;SAClB;KACJ;CACJ,CAAC;AAEF;;0FAE0F;AAC1F,MAAa,8BAA8B;IACvC,WAAW,CAAuB;IAElC,YAAY,eAAyC;QACjD,IAAI,CAAC,WAAW,GAAG;YACf,GAAG,eAAe;YAClB,GAAG,yCAAyC;YAC5C,kEAAkE;YAClE,kEAAkE;YAClE,6BAA6B;YAC7B,UAAU,EAAE;gBACR,GAAG,yCAAyC,CAAC,UAAU;aAC1D;SACJ,CAAC;IACN,CAAC;IAED,cAAc,GAAG,yBAAc,CAAC;IAEhC,KAAK,CAAC,OAAO;QACT,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpC,OAAO;YACH,YAAY,EAAE;gBACV,IAAI,CAAC,OAAO,CAAC,eAAe,CACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAgB,CACtC;aACJ;SACJ,CAAC;IACN,CAAC;CACJ;AA5BD,wEA4BC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { INodeProperties } from "n8n-workflow";
|
|
2
|
+
export declare const executionMap: {
|
|
3
|
+
transactionNote: {
|
|
4
|
+
create: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
5
|
+
getMany: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
6
|
+
get: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
7
|
+
};
|
|
8
|
+
transaction: {
|
|
9
|
+
update: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
10
|
+
getMany: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
11
|
+
get: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type ExecMap = typeof executionMap;
|
|
15
|
+
export type Resource = keyof ExecMap;
|
|
16
|
+
export type Operation = keyof ExecMap[Resource];
|
|
17
|
+
export declare const ResourceList: Resource[];
|
|
18
|
+
export declare function getOperationList(resource: Resource): Operation[];
|
|
19
|
+
declare const properties: INodeProperties[];
|
|
20
|
+
export { properties };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO: turn this into a function or template or something
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.properties = exports.ResourceList = exports.executionMap = void 0;
|
|
5
|
+
exports.getOperationList = getOperationList;
|
|
6
|
+
const transaction_1 = require("./transaction");
|
|
7
|
+
const transactionNote_1 = require("./transactionNote");
|
|
8
|
+
exports.executionMap = {
|
|
9
|
+
...transaction_1.transactionOperations,
|
|
10
|
+
...transactionNote_1.transactionNoteOperations,
|
|
11
|
+
};
|
|
12
|
+
exports.ResourceList = Object.keys(exports.executionMap);
|
|
13
|
+
function getOperationList(resource) {
|
|
14
|
+
return Object.keys(exports.executionMap[resource]);
|
|
15
|
+
}
|
|
16
|
+
const options = [transaction_1.transactionOptions, transactionNote_1.transactionNoteOptions];
|
|
17
|
+
const properties = [
|
|
18
|
+
{
|
|
19
|
+
displayName: "Resource",
|
|
20
|
+
name: "resource",
|
|
21
|
+
type: "options",
|
|
22
|
+
noDataExpression: true,
|
|
23
|
+
default: "transaction",
|
|
24
|
+
options,
|
|
25
|
+
},
|
|
26
|
+
...transaction_1.transactionDescription,
|
|
27
|
+
...transactionNote_1.transactionNoteDescription,
|
|
28
|
+
];
|
|
29
|
+
exports.properties = properties;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/PurchasingAssistant/v1/actions/index.ts"],"names":[],"mappings":";AAAA,2DAA2D;;;AA2B3D,4CAEC;AAzBD,+CAIuB;AAEvB,uDAI2B;AAEd,QAAA,YAAY,GAAG;IACxB,GAAG,mCAAqB;IACxB,GAAG,2CAAyB;CAC/B,CAAC;AAOW,QAAA,YAAY,GAAe,MAAM,CAAC,IAAI,CAAC,oBAAY,CAAe,CAAC;AAChF,SAAgB,gBAAgB,CAAC,QAAkB;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,oBAAY,CAAC,QAAQ,CAAC,CAAgB,CAAC;AAC9D,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,gCAAkB,EAAE,wCAAsB,CAAC,CAAC;AAE7D,MAAM,UAAU,GAAsB;IAClC;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,aAAa;QACtB,OAAO;KACV;IACD,GAAG,oCAAsB;IACzB,GAAG,4CAA0B;CAChC,CAAC;AAEO,gCAAU"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RESOURCE_VALUE = exports.RESOURCE_DISPLAY_NAME = void 0;
|
|
4
|
+
exports.RESOURCE_DISPLAY_NAME = "Transaction";
|
|
5
|
+
exports.RESOURCE_VALUE = "transaction";
|
|
6
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,aAAa,CAAC;AACtC,QAAA,cAAc,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { INodePropertyOptions } from "n8n-workflow";
|
|
2
|
+
export declare const descriptionCreate: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow/dist/esm/interfaces").INodePropertyOptions | import("n8n-workflow").INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare const optionsCreate: INodePropertyOptions;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionsCreate = exports.descriptionCreate = void 0;
|
|
4
|
+
const utils_1 = require("../../../../../../core/parameters/utils");
|
|
5
|
+
const parameters_1 = require("../../../parameters");
|
|
6
|
+
const const_1 = require("../const");
|
|
7
|
+
exports.descriptionCreate = (0, utils_1.getDescription)({
|
|
8
|
+
mainParameters: [parameters_1.params.transactionFileName],
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: { resource: [const_1.RESOURCE_VALUE], operation: ["create"] },
|
|
11
|
+
},
|
|
12
|
+
advancedParameters: [parameters_1.params.transactionFileKey],
|
|
13
|
+
});
|
|
14
|
+
exports.optionsCreate = {
|
|
15
|
+
name: "Create",
|
|
16
|
+
value: "create",
|
|
17
|
+
description: "Create a transaction in Purchasing Assistant",
|
|
18
|
+
action: "Create a transaction",
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/create/description.ts"],"names":[],"mappings":";;;AACA,mEAAyE;AACzE,oDAA6C;AAC7C,oCAA0C;AAE7B,QAAA,iBAAiB,GAAG,IAAA,sBAAc,EAAC;IAC5C,cAAc,EAAE,CAAC,mBAAM,CAAC,mBAAmB,CAAC;IAC5C,cAAc,EAAE;QACZ,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,sBAAc,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;KAC9D;IACD,kBAAkB,EAAE,CAAC,mBAAM,CAAC,kBAAkB,CAAC;CAClD,CAAC,CAAC;AAEU,QAAA,aAAa,GAAyB;IAC/C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,8CAA8C;IAC3D,MAAM,EAAE,sBAAsB;CACjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, NodeExecutionWithMetadata } from "n8n-workflow";
|
|
2
|
+
declare function createExec(this: IExecuteFunctions, index: number): Promise<NodeExecutionWithMetadata[]>;
|
|
3
|
+
export declare const operationCreate: {
|
|
4
|
+
create: typeof createExec;
|
|
5
|
+
};
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.operationCreate = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const utils_1 = require("../../../../../../core/handlers/utils");
|
|
6
|
+
const transport_1 = require("../../../../../../core/transport");
|
|
7
|
+
const file_1 = require("../../../../../../core/utils/file");
|
|
8
|
+
function assertValidMimeType(mimeType) {
|
|
9
|
+
const validMimeTypes = [
|
|
10
|
+
"application/pdf",
|
|
11
|
+
"image/jpg",
|
|
12
|
+
"image/jpeg",
|
|
13
|
+
"image/png",
|
|
14
|
+
];
|
|
15
|
+
if (!validMimeTypes.includes(mimeType))
|
|
16
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Invalid file type, only pdf, jpg, jpeg, or png is supported");
|
|
17
|
+
}
|
|
18
|
+
async function createExec(index) {
|
|
19
|
+
const name = this.getNodeParameter("transactionFileName", index);
|
|
20
|
+
const { transactionFileKey } = this.getNodeParameter("additionalFields", index);
|
|
21
|
+
const fileKey = transactionFileKey ?? "data";
|
|
22
|
+
const { base64: file, binaryData } = await file_1.getFileAsBase64.call(this, index, fileKey);
|
|
23
|
+
if (!file || file.length === 0) {
|
|
24
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${name}'s file content not found.`);
|
|
25
|
+
}
|
|
26
|
+
assertValidMimeType.call(this, binaryData.mimeType);
|
|
27
|
+
const fileSuffix = binaryData.mimeType.split("/")[1];
|
|
28
|
+
const result = await (0, transport_1.toolboxApiRequest)(this, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
endpoint: `invoicefromfile`,
|
|
31
|
+
body: {
|
|
32
|
+
file,
|
|
33
|
+
name: `${name}.${fileSuffix}`,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return (0, utils_1.constructExecutionMetaData)(this, index, result);
|
|
37
|
+
}
|
|
38
|
+
exports.operationCreate = { create: createExec };
|
|
39
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/create/execution.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AACtB,iEAAmF;AACnF,gEAAqE;AACrE,4DAAoE;AAEpE,SAAS,mBAAmB,CAExB,QAAgB;IAMhB,MAAM,cAAc,GAAG;QACnB,iBAAiB;QACjB,WAAW;QACX,YAAY;QACZ,WAAW;KACd,CAAC;IACF,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAClC,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,6DAA6D,CAChE,CAAC;AACV,CAAC;AAED,KAAK,UAAU,UAAU,CAErB,KAAa;IAEb,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,KAAK,CAAW,CAAC;IAE3E,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAChD,kBAAkB,EAClB,KAAK,CACsC,CAAC;IAEhD,MAAM,OAAO,GAAG,kBAAkB,IAAI,MAAM,CAAC;IAE7C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,sBAAe,CAAC,IAAI,CAC3D,IAAI,EACJ,KAAK,EACL,OAAO,CACV,CAAC;IAEF,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,GAAG,IAAI,4BAA4B,CACtC,CAAC;IACN,CAAC;IAED,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAiB,EAAC,IAAI,EAAE;QACzC,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,iBAAiB;QAC3B,IAAI,EAAE;YACF,IAAI;YACJ,IAAI,EAAE,GAAG,IAAI,IAAI,UAAU,EAAE;SAChC;KACJ,CAAC,CAAC;IAEH,OAAO,IAAA,kCAA0B,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAEY,QAAA,eAAe,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { INodePropertyOptions } from "n8n-workflow";
|
|
2
|
+
export declare const descriptionGet: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow/dist/esm/interfaces").INodePropertyOptions | import("n8n-workflow").INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare const optionsGet: INodePropertyOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionsGet = exports.descriptionGet = void 0;
|
|
4
|
+
const utils_1 = require("../../../../../../core/parameters/utils");
|
|
5
|
+
const parameters_1 = require("../../../parameters");
|
|
6
|
+
const const_1 = require("../const");
|
|
7
|
+
exports.descriptionGet = (0, utils_1.getDescription)({
|
|
8
|
+
mainParameters: [parameters_1.params.transactionID],
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: { resource: [const_1.RESOURCE_VALUE], operation: ["get"] },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
exports.optionsGet = {
|
|
14
|
+
name: "Get",
|
|
15
|
+
value: "get",
|
|
16
|
+
description: "Retrieve a transaction from Purchasing Assistant",
|
|
17
|
+
action: "Get a transaction",
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/get/description.ts"],"names":[],"mappings":";;;AACA,mEAAyE;AACzE,oDAA6C;AAC7C,oCAA0C;AAE7B,QAAA,cAAc,GAAG,IAAA,sBAAc,EAAC;IACzC,cAAc,EAAE,CAAC,mBAAM,CAAC,aAAa,CAAC;IACtC,cAAc,EAAE;QACZ,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,sBAAc,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE;KAC3D;CACJ,CAAC,CAAC;AAEU,QAAA,UAAU,GAAyB;IAC5C,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE,mBAAmB;CAC9B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.operationGet = void 0;
|
|
4
|
+
const utils_1 = require("../../../../../../core/handlers/utils");
|
|
5
|
+
const transport_1 = require("../../../../../../core/transport");
|
|
6
|
+
const utils_2 = require("../utils");
|
|
7
|
+
async function getExec(index) {
|
|
8
|
+
const transactionID = utils_2.getParamTransactionID.call(this, index);
|
|
9
|
+
const result = await (0, transport_1.toolboxApiRequest)(this, {
|
|
10
|
+
method: "GET",
|
|
11
|
+
endpoint: `invoicefromfile/${transactionID}`,
|
|
12
|
+
});
|
|
13
|
+
return (0, utils_1.constructExecutionMetaData)(this, index, result);
|
|
14
|
+
}
|
|
15
|
+
exports.operationGet = { get: getExec };
|
|
16
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/get/execution.ts"],"names":[],"mappings":";;;AACA,iEAAmF;AACnF,gEAAqE;AACrE,oCAAiD;AAEjD,KAAK,UAAU,OAAO,CAElB,KAAa;IAEb,MAAM,aAAa,GAAG,6BAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAiB,EAAC,IAAI,EAAE;QACzC,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,mBAAmB,aAAa,EAAE;KAC/C,CAAC,CAAC;IAEH,OAAO,IAAA,kCAA0B,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAEY,QAAA,YAAY,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { INodePropertyOptions } from "n8n-workflow";
|
|
2
|
+
export declare const descriptionGetMany: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow/dist/esm/interfaces").INodePropertyOptions | import("n8n-workflow").INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare const optionsGetMany: INodePropertyOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionsGetMany = exports.descriptionGetMany = void 0;
|
|
4
|
+
const utils_1 = require("../../../../../../core/parameters/utils");
|
|
5
|
+
const parameters_1 = require("../../../parameters");
|
|
6
|
+
const const_1 = require("../const");
|
|
7
|
+
exports.descriptionGetMany = (0, utils_1.getDescription)({
|
|
8
|
+
mainParameters: [parameters_1.params.transactionStatusMultiOptional],
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: { resource: [const_1.RESOURCE_VALUE], operation: ["getMany"] },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
exports.optionsGetMany = {
|
|
14
|
+
name: "Get Many",
|
|
15
|
+
value: "getMany",
|
|
16
|
+
description: "Retrieves all transactions from Purchasing Assistant, with an optional status filter",
|
|
17
|
+
action: "Get many transactions",
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.ts"],"names":[],"mappings":";;;AACA,mEAAyE;AACzE,oDAA6C;AAC7C,oCAA0C;AAE7B,QAAA,kBAAkB,GAAG,IAAA,sBAAc,EAAC;IAC7C,cAAc,EAAE,CAAC,mBAAM,CAAC,8BAA8B,CAAC;IACvD,cAAc,EAAE;QACZ,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,sBAAc,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE;KAC/D;CACJ,CAAC,CAAC;AAEU,QAAA,cAAc,GAAyB;IAChD,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;IAChB,WAAW,EACP,sFAAsF;IAC1F,MAAM,EAAE,uBAAuB;CAClC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, NodeExecutionWithMetadata } from "n8n-workflow";
|
|
2
|
+
declare function getManyExec(this: IExecuteFunctions, index: number): Promise<NodeExecutionWithMetadata[]>;
|
|
3
|
+
export declare const operationGetMany: {
|
|
4
|
+
getMany: typeof getManyExec;
|
|
5
|
+
};
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.operationGetMany = void 0;
|
|
4
|
+
const utils_1 = require("../../../../../../core/handlers/utils");
|
|
5
|
+
const transport_1 = require("../../../../../../core/transport");
|
|
6
|
+
const utils_2 = require("../utils");
|
|
7
|
+
async function getByStatus(status) {
|
|
8
|
+
return await (0, transport_1.toolboxApiRequest)(this, {
|
|
9
|
+
method: "GET",
|
|
10
|
+
endpoint: `invoicefromfile`,
|
|
11
|
+
qs: { status },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
async function getManyExec(index) {
|
|
15
|
+
const statuses = utils_2.getParamStatusMultiOptional.call(this, index);
|
|
16
|
+
const statusFetches = statuses.map((status) => async () => {
|
|
17
|
+
return await getByStatus.call(this, status);
|
|
18
|
+
});
|
|
19
|
+
const allTransactions = (await Promise.all(statusFetches.map((fn) => fn()))).flat();
|
|
20
|
+
return (0, utils_1.constructExecutionMetaData)(this, index, allTransactions);
|
|
21
|
+
}
|
|
22
|
+
exports.operationGetMany = { getMany: getManyExec };
|
|
23
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.ts"],"names":[],"mappings":";;;AACA,iEAAmF;AACnF,gEAAqE;AACrE,oCAAuD;AAGvD,KAAK,UAAU,WAAW,CAEtB,MAA8B;IAE9B,OAAO,MAAM,IAAA,6BAAiB,EAAC,IAAI,EAAE;QACjC,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,iBAAiB;QAC3B,EAAE,EAAE,EAAE,MAAM,EAAE;KACjB,CAAC,CAAC;AACP,CAAC;AAED,KAAK,UAAU,WAAW,CAEtB,KAAa;IAEb,MAAM,QAAQ,GAAG,mCAA2B,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE/D,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE;QACtD,OAAO,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,CACpB,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CACrD,CAAC,IAAI,EAAE,CAAC;IAET,OAAO,IAAA,kCAA0B,EAAC,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;AACpE,CAAC;AAEY,QAAA,gBAAgB,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { INodeProperties } from "n8n-workflow";
|
|
2
|
+
export declare const transactionDescription: INodeProperties[];
|
|
3
|
+
export declare const transactionOperations: {
|
|
4
|
+
transaction: {
|
|
5
|
+
update: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
6
|
+
getMany: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
7
|
+
get: (this: import("n8n-workflow").IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const transactionOptions: {
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transactionOptions = exports.transactionOperations = exports.transactionDescription = void 0;
|
|
4
|
+
const const_1 = require("./const");
|
|
5
|
+
const execution_1 = require("./get/execution");
|
|
6
|
+
const execution_2 = require("./update/execution");
|
|
7
|
+
const execution_3 = require("./getMany/execution");
|
|
8
|
+
// import { operationCreate } from "./create/execution";
|
|
9
|
+
const description_1 = require("./get/description");
|
|
10
|
+
const description_2 = require("./update/description");
|
|
11
|
+
const description_3 = require("./getMany/description");
|
|
12
|
+
// import { descriptionCreate, optionsCreate } from "./create/description";
|
|
13
|
+
const options = [
|
|
14
|
+
description_1.optionsGet,
|
|
15
|
+
description_3.optionsGetMany,
|
|
16
|
+
description_2.optionsUpdate,
|
|
17
|
+
// optionsCreate
|
|
18
|
+
];
|
|
19
|
+
const operation = {
|
|
20
|
+
displayName: "Operation",
|
|
21
|
+
name: "operation",
|
|
22
|
+
type: "options",
|
|
23
|
+
noDataExpression: true,
|
|
24
|
+
displayOptions: {
|
|
25
|
+
show: {
|
|
26
|
+
resource: [const_1.RESOURCE_VALUE],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
options,
|
|
30
|
+
default: "get",
|
|
31
|
+
};
|
|
32
|
+
exports.transactionDescription = [
|
|
33
|
+
operation,
|
|
34
|
+
...description_1.descriptionGet,
|
|
35
|
+
...description_3.descriptionGetMany,
|
|
36
|
+
// ...descriptionCreate,
|
|
37
|
+
...description_2.descriptionUpdate,
|
|
38
|
+
];
|
|
39
|
+
exports.transactionOperations = {
|
|
40
|
+
transaction: {
|
|
41
|
+
...execution_1.operationGet,
|
|
42
|
+
...execution_3.operationGetMany,
|
|
43
|
+
//...operationCreate,
|
|
44
|
+
...execution_2.operationUpdate,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.transactionOptions = {
|
|
48
|
+
name: const_1.RESOURCE_DISPLAY_NAME,
|
|
49
|
+
value: const_1.RESOURCE_VALUE,
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/index.ts"],"names":[],"mappings":";;;AACA,mCAAgE;AAEhE,+CAA+C;AAC/C,kDAAqD;AACrD,mDAAuD;AACvD,wDAAwD;AAExD,mDAA+D;AAC/D,sDAAwE;AACxE,uDAA2E;AAC3E,2EAA2E;AAE3E,MAAM,OAAO,GAAG;IACZ,wBAAU;IACV,4BAAc;IACd,2BAAa;IACb,gBAAgB;CACnB,CAAC;AAEF,MAAM,SAAS,GAAoB;IAC/B,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACZ,IAAI,EAAE;YACF,QAAQ,EAAE,CAAC,sBAAc,CAAC;SAC7B;KACJ;IACD,OAAO;IACP,OAAO,EAAE,KAAK;CACjB,CAAC;AAEW,QAAA,sBAAsB,GAAG;IAClC,SAAS;IACT,GAAG,4BAAc;IACjB,GAAG,gCAAkB;IACrB,wBAAwB;IACxB,GAAG,+BAAiB;CACvB,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACjC,WAAW,EAAE;QACT,GAAG,wBAAY;QACf,GAAG,4BAAgB;QACnB,qBAAqB;QACrB,GAAG,2BAAe;KACrB;CACJ,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAC9B,IAAI,EAAE,6BAAqB;IAC3B,KAAK,EAAE,sBAAc;CACxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { INodePropertyOptions } from "n8n-workflow";
|
|
2
|
+
export declare const descriptionUpdate: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
options?: Array<import("n8n-workflow/dist/esm/interfaces").INodePropertyOptions | import("n8n-workflow").INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isNodeSetting?: boolean;
|
|
16
|
+
noDataExpression?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
19
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
20
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
21
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
22
|
+
requiresDataPath?: "single" | "multiple";
|
|
23
|
+
doNotInherit?: boolean;
|
|
24
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
25
|
+
ignoreValidationDuringExecution?: boolean;
|
|
26
|
+
allowArbitraryValues?: boolean;
|
|
27
|
+
resolvableField?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
export declare const optionsUpdate: INodePropertyOptions;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionsUpdate = exports.descriptionUpdate = void 0;
|
|
4
|
+
const utils_1 = require("../../../../../../core/parameters/utils");
|
|
5
|
+
const parameters_1 = require("../../../parameters");
|
|
6
|
+
const const_1 = require("../const");
|
|
7
|
+
exports.descriptionUpdate = (0, utils_1.getDescription)({
|
|
8
|
+
mainParameters: [
|
|
9
|
+
parameters_1.params.transactionID,
|
|
10
|
+
parameters_1.params.transactionGroupID,
|
|
11
|
+
parameters_1.params.transactionStatusOptional,
|
|
12
|
+
],
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: { resource: [const_1.RESOURCE_VALUE], operation: ["update"] },
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
exports.optionsUpdate = {
|
|
18
|
+
name: "Update",
|
|
19
|
+
value: "update",
|
|
20
|
+
description: "Update a transaction in Purchasing Assistant",
|
|
21
|
+
action: "Update a transaction",
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/update/description.ts"],"names":[],"mappings":";;;AACA,mEAAyE;AACzE,oDAA6C;AAC7C,oCAA0C;AAE7B,QAAA,iBAAiB,GAAG,IAAA,sBAAc,EAAC;IAC5C,cAAc,EAAE;QACZ,mBAAM,CAAC,aAAa;QACpB,mBAAM,CAAC,kBAAkB;QACzB,mBAAM,CAAC,yBAAyB;KACnC;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,sBAAc,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;KAC9D;CACJ,CAAC,CAAC;AAEU,QAAA,aAAa,GAAyB;IAC/C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,8CAA8C;IAC3D,MAAM,EAAE,sBAAsB;CACjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, NodeExecutionWithMetadata } from "n8n-workflow";
|
|
2
|
+
declare function updateExec(this: IExecuteFunctions, index: number): Promise<NodeExecutionWithMetadata[]>;
|
|
3
|
+
export declare const operationUpdate: {
|
|
4
|
+
update: typeof updateExec;
|
|
5
|
+
};
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.operationUpdate = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const utils_1 = require("../../../../../../core/handlers/utils");
|
|
6
|
+
const transport_1 = require("../../../../../../core/transport");
|
|
7
|
+
const utils_2 = require("../utils");
|
|
8
|
+
async function updateExec(index) {
|
|
9
|
+
function getParamUpdateTransaction(index) {
|
|
10
|
+
const transactionID = utils_2.getParamTransactionID.call(this, index);
|
|
11
|
+
const transactionStatus = this.getNodeParameter("transactionStatusOptional", index, null);
|
|
12
|
+
const transactionGroupID = this.getNodeParameter("transactionGroupID", index, null);
|
|
13
|
+
if (!transactionStatus && !transactionGroupID) {
|
|
14
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please provide a value to update for transaction ${transactionID}`);
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
transactionID,
|
|
18
|
+
transactionStatus: transactionStatus
|
|
19
|
+
? transactionStatus
|
|
20
|
+
: undefined,
|
|
21
|
+
transactionGroupID: transactionGroupID
|
|
22
|
+
? transactionGroupID
|
|
23
|
+
: undefined,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const { transactionID, transactionGroupID, transactionStatus } = getParamUpdateTransaction.call(this, index);
|
|
27
|
+
const result = await (0, transport_1.toolboxApiRequest)(this, {
|
|
28
|
+
method: "PATCH",
|
|
29
|
+
endpoint: `invoicefromfile/${transactionID}`,
|
|
30
|
+
body: { groupID: transactionGroupID, status: transactionStatus },
|
|
31
|
+
});
|
|
32
|
+
return (0, utils_1.constructExecutionMetaData)(this, index, result);
|
|
33
|
+
}
|
|
34
|
+
exports.operationUpdate = { update: updateExec };
|
|
35
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../../../../nodes/PurchasingAssistant/v1/actions/transaction/update/execution.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AACtB,iEAAmF;AACnF,gEAAqE;AAErE,oCAAiD;AAEjD,KAAK,UAAU,UAAU,CAErB,KAAa;IAEb,SAAS,yBAAyB,CAA0B,KAAa;QACrE,MAAM,aAAa,GAAG,6BAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE9D,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAC3C,2BAA2B,EAC3B,KAAK,EACL,IAAI,CACG,CAAC;QAEZ,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAC5C,oBAAoB,EACpB,KAAK,EACL,IAAI,CACU,CAAC;QAEnB,IAAI,CAAC,iBAAiB,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5C,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,oDAAoD,aAAa,EAAE,CACtE,CAAC;QACN,CAAC;QAED,OAAO;YACH,aAAa;YACb,iBAAiB,EAAE,iBAAiB;gBAChC,CAAC,CAAC,iBAAiB;gBACnB,CAAC,CAAC,SAAS;YACf,kBAAkB,EAAE,kBAAkB;gBAClC,CAAC,CAAC,kBAAkB;gBACpB,CAAC,CAAC,SAAS;SAClB,CAAC;IACN,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAC1D,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEhD,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAiB,EAAC,IAAI,EAAE;QACzC,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,mBAAmB,aAAa,EAAE;QAC5C,IAAI,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,iBAAiB,EAAE;KACnE,CAAC,CAAC;IACH,OAAO,IAAA,kCAA0B,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAEY,QAAA,eAAe,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IExecuteFunctions } from "n8n-workflow";
|
|
2
|
+
import { TransactionStatusValue } from "../../parameters/options";
|
|
3
|
+
export declare function getParamTransactionID(this: IExecuteFunctions, index: number): string | number | true | object | import("n8n-workflow").INodeParameters | import("n8n-workflow").INodeParameterResourceLocator | import("n8n-workflow").ResourceMapperValue | import("n8n-workflow").FilterValue | import("n8n-workflow").AssignmentCollectionValue | {
|
|
4
|
+
type: "icon";
|
|
5
|
+
value: string;
|
|
6
|
+
} | {
|
|
7
|
+
type: "emoji";
|
|
8
|
+
value: string;
|
|
9
|
+
} | import("n8n-workflow").NodeParameterValue[] | import("n8n-workflow").INodeParameters[] | import("n8n-workflow").INodeParameterResourceLocator[] | import("n8n-workflow").ResourceMapperValue[];
|
|
10
|
+
export declare function getParamStatusMultiOptional(this: IExecuteFunctions, index: number): TransactionStatusValue[];
|