@thegraphitelab/n8n-nodes-toolbox 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/core/handlers/utils.d.ts +1 -1
  2. package/dist/core/handlers/utils.js.map +1 -1
  3. package/dist/core/handlers/webhookHandler.d.ts +14 -0
  4. package/dist/core/handlers/webhookHandler.js +57 -0
  5. package/dist/core/handlers/webhookHandler.js.map +1 -0
  6. package/dist/core/parameters/utils.d.ts +14 -3
  7. package/dist/core/parameters/utils.js +63 -1
  8. package/dist/core/parameters/utils.js.map +1 -1
  9. package/dist/core/transport/index.d.ts +1 -12
  10. package/dist/core/transport/index.js +3 -40
  11. package/dist/core/transport/index.js.map +1 -1
  12. package/dist/core/transport/jerboa.d.ts +14 -0
  13. package/dist/core/transport/jerboa.js +89 -0
  14. package/dist/core/transport/jerboa.js.map +1 -0
  15. package/dist/core/transport/toolbox.d.ts +12 -0
  16. package/dist/core/transport/toolbox.js +18 -0
  17. package/dist/core/transport/toolbox.js.map +1 -0
  18. package/dist/core/transport/utils.d.ts +2 -0
  19. package/dist/core/transport/utils.js +31 -0
  20. package/dist/core/transport/utils.js.map +1 -0
  21. package/dist/core/utils/array.d.ts +1 -0
  22. package/dist/core/utils/array.js +9 -0
  23. package/dist/core/utils/array.js.map +1 -0
  24. package/dist/core/utils/file.d.ts +5 -0
  25. package/dist/core/utils/file.js +25 -0
  26. package/dist/core/utils/file.js.map +1 -0
  27. package/dist/core/utils/string.d.ts +2 -0
  28. package/dist/core/utils/string.js +10 -0
  29. package/dist/core/utils/string.js.map +1 -0
  30. package/dist/credentials/JerboaApi.credentials.d.ts +10 -0
  31. package/dist/credentials/JerboaApi.credentials.js +28 -0
  32. package/dist/credentials/JerboaApi.credentials.js.map +1 -0
  33. package/dist/nodes/CallIQ/v1/actions/call/get/description.js +1 -1
  34. package/dist/nodes/CallIQ/v1/triggers/poll/onCallCompletion/description.js +1 -1
  35. package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.d.ts +4 -0
  36. package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.js +24 -0
  37. package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.js.map +1 -0
  38. package/dist/nodes/PurchasingAssistant/PurchasingAssistant.node.json +18 -0
  39. package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.d.ts +4 -0
  40. package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.js +24 -0
  41. package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.js.map +1 -0
  42. package/dist/nodes/PurchasingAssistant/PurchasingAssistantWhTrigger.node.json +18 -0
  43. package/dist/nodes/PurchasingAssistant/eli.svg +106 -0
  44. package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantV1.node.d.ts +6 -0
  45. package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantV1.node.js +68 -0
  46. package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantV1.node.js.map +1 -0
  47. package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.d.ts +13 -0
  48. package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.js +66 -0
  49. package/dist/nodes/PurchasingAssistant/v1/PurchasingAssistantWhTriggerV1.node.js.map +1 -0
  50. package/dist/nodes/PurchasingAssistant/v1/actions/index.d.ts +20 -0
  51. package/dist/nodes/PurchasingAssistant/v1/actions/index.js +30 -0
  52. package/dist/nodes/PurchasingAssistant/v1/actions/index.js.map +1 -0
  53. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/const.d.ts +2 -0
  54. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/const.js +6 -0
  55. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/const.js.map +1 -0
  56. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/description.d.ts +29 -0
  57. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/description.js +20 -0
  58. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/description.js.map +1 -0
  59. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/execution.d.ts +6 -0
  60. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/execution.js +39 -0
  61. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/create/execution.js.map +1 -0
  62. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/description.d.ts +29 -0
  63. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/description.js +19 -0
  64. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/description.js.map +1 -0
  65. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/execution.d.ts +6 -0
  66. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/execution.js +16 -0
  67. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/get/execution.js.map +1 -0
  68. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.d.ts +29 -0
  69. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.js +19 -0
  70. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/description.js.map +1 -0
  71. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.d.ts +6 -0
  72. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.js +23 -0
  73. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/getMany/execution.js.map +1 -0
  74. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/index.d.ts +13 -0
  75. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/index.js +51 -0
  76. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/index.js.map +1 -0
  77. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/description.d.ts +29 -0
  78. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/description.js +23 -0
  79. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/description.js.map +1 -0
  80. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/execution.d.ts +6 -0
  81. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/execution.js +35 -0
  82. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/update/execution.js.map +1 -0
  83. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/utils.d.ts +10 -0
  84. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/utils.js +21 -0
  85. package/dist/nodes/PurchasingAssistant/v1/actions/transaction/utils.js.map +1 -0
  86. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/const.d.ts +2 -0
  87. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/const.js +6 -0
  88. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/const.js.map +1 -0
  89. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/description.d.ts +29 -0
  90. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/description.js +23 -0
  91. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/description.js.map +1 -0
  92. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/execution.d.ts +6 -0
  93. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/execution.js +24 -0
  94. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/create/execution.js.map +1 -0
  95. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/description.d.ts +29 -0
  96. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/description.js +19 -0
  97. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/description.js.map +1 -0
  98. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/execution.d.ts +6 -0
  99. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/execution.js +23 -0
  100. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/get/execution.js.map +1 -0
  101. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/description.d.ts +29 -0
  102. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/description.js +27 -0
  103. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/description.js.map +1 -0
  104. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/execution.d.ts +6 -0
  105. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/execution.js +23 -0
  106. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/getMany/execution.js.map +1 -0
  107. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/index.d.ts +13 -0
  108. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/index.js +51 -0
  109. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/index.js.map +1 -0
  110. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/description.d.ts +29 -0
  111. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/description.js +19 -0
  112. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/description.js.map +1 -0
  113. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/execution.d.ts +6 -0
  114. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/execution.js +22 -0
  115. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/update/execution.js.map +1 -0
  116. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/utils.d.ts +1 -0
  117. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/utils.js +7 -0
  118. package/dist/nodes/PurchasingAssistant/v1/actions/transactionNote/utils.js.map +1 -0
  119. package/dist/nodes/PurchasingAssistant/v1/parameters/index.d.ts +3 -0
  120. package/dist/nodes/PurchasingAssistant/v1/parameters/index.js +68 -0
  121. package/dist/nodes/PurchasingAssistant/v1/parameters/index.js.map +1 -0
  122. package/dist/nodes/PurchasingAssistant/v1/parameters/options.d.ts +22 -0
  123. package/dist/nodes/PurchasingAssistant/v1/parameters/options.js +34 -0
  124. package/dist/nodes/PurchasingAssistant/v1/parameters/options.js.map +1 -0
  125. package/dist/nodes/PurchasingAssistant/v1/parameters/types.d.ts +1 -0
  126. package/dist/nodes/PurchasingAssistant/v1/parameters/types.js +3 -0
  127. package/dist/nodes/PurchasingAssistant/v1/parameters/types.js.map +1 -0
  128. package/dist/nodes/PurchasingAssistant/v1/triggers/index.d.ts +8 -0
  129. package/dist/nodes/PurchasingAssistant/v1/triggers/index.js +26 -0
  130. package/dist/nodes/PurchasingAssistant/v1/triggers/index.js.map +1 -0
  131. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/index.d.ts +3 -0
  132. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/index.js +23 -0
  133. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/index.js.map +1 -0
  134. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/description.d.ts +3 -0
  135. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/description.js +15 -0
  136. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/description.js.map +1 -0
  137. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/webhookMethods.d.ts +1 -0
  138. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/webhookMethods.js +10 -0
  139. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionCreation/webhookMethods.js.map +1 -0
  140. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/description.d.ts +3 -0
  141. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/description.js +16 -0
  142. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/description.js.map +1 -0
  143. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/webhookMethods.d.ts +3 -0
  144. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/webhookMethods.js +14 -0
  145. package/dist/nodes/PurchasingAssistant/v1/triggers/webhook/onTransactionStatusChange/webhookMethods.js.map +1 -0
  146. package/dist/nodes/Toolbox/eli.svg +51 -106
  147. package/dist/nodes/Webhooks/v1/actions/webhookInstance/create/description.js +2 -2
  148. package/dist/nodes/Webhooks/v1/actions/webhookInstance/create/description.js.map +1 -1
  149. package/dist/nodes/Webhooks/v1/actions/webhookInstance/deactivate/description.js +1 -1
  150. package/dist/nodes/Webhooks/v1/actions/webhookInstance/get/description.js +1 -1
  151. package/dist/nodes/Webhooks/v1/actions/webhookInstance/update/description.js +1 -1
  152. package/dist/nodes/Webhooks/v1/triggers/webhook/onWebhookEvent/description.js +1 -1
  153. package/dist/package.json +8 -2
  154. package/package.json +8 -2
@@ -1,5 +1,5 @@
1
1
  import { IDataObject, IExecuteFunctions, IPollFunctions, NodeApiError, NodeExecutionWithMetadata, NodeOperationError } from "n8n-workflow";
2
- export declare function constructExecutionMetaData(ctx: IExecuteFunctions, index: number, responseData: IDataObject): NodeExecutionWithMetadata[];
2
+ export declare function constructExecutionMetaData(ctx: IExecuteFunctions, index: number, responseData: IDataObject | IDataObject[]): NodeExecutionWithMetadata[];
3
3
  export declare function constructErrorExecutionMetaData(ctx: IExecuteFunctions, index: number, error: Error): NodeExecutionWithMetadata[];
4
4
  export declare function normalizeError(ctx: IExecuteFunctions | IPollFunctions, err: unknown): NodeOperationError | NodeApiError;
5
5
  export type ExecFunction = (ctx: IExecuteFunctions, index: number) => Promise<NodeExecutionWithMetadata[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../core/handlers/utils.ts"],"names":[],"mappings":";;AAUA,gEAWC;AAED,0EASC;AAID,wCAcC;AAYD,wCAsBC;AAED,kDAOC;AAED,0CAWC;AA1GD,+CAOsB;AACtB,0CAAuD;AAEvD,SAAgB,0BAA0B,CACtC,GAAsB,EACtB,KAAa,EACb,YAAyB;IAEzB,OAAO,GAAG,CAAC,OAAO,CAAC,0BAA0B,CACzC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,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G,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { IHookFunctions } from "n8n-workflow";
2
+ type ClientSetting<T> = T & {
3
+ clientID: string;
4
+ };
5
+ export declare function webhookHandler<T>({ getFilterCriteria, }: {
6
+ getFilterCriteria: (clientSettings: ClientSetting<T>[]) => Record<string, object>;
7
+ }): {
8
+ default: {
9
+ checkExists(this: IHookFunctions): Promise<boolean>;
10
+ create(this: IHookFunctions): Promise<boolean>;
11
+ delete(this: IHookFunctions): Promise<boolean>;
12
+ };
13
+ };
14
+ export {};
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.webhookHandler = webhookHandler;
4
+ const crypto_1 = require("crypto");
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const jerboa_1 = require("../transport/jerboa");
7
+ const array_1 = require("../utils/array");
8
+ function getWebhookSubscriptionID(ctx) {
9
+ const webhookData = ctx.getWorkflowStaticData("node");
10
+ return webhookData.webhookSubscriptionID;
11
+ }
12
+ function setWebhookSubscriptionID(ctx, webhookSubscriptionID) {
13
+ const webhookData = ctx.getWorkflowStaticData("node");
14
+ webhookData.webhookSubscriptionID = webhookSubscriptionID;
15
+ }
16
+ function deleteWebhookSubscriptionID(ctx) {
17
+ const webhookData = ctx.getWorkflowStaticData("node");
18
+ delete webhookData.webhookSubscriptionID;
19
+ }
20
+ function getClientSettings(ctx) {
21
+ const { clientSettings = [] } = ctx.getNodeParameter("clientSettingsUI", {});
22
+ return clientSettings;
23
+ }
24
+ async function checkExists() {
25
+ const webhookSubscriptionID = getWebhookSubscriptionID(this);
26
+ if (!webhookSubscriptionID)
27
+ return false;
28
+ return await (0, jerboa_1.requestWebhookSubscriptionExistence)(this, webhookSubscriptionID);
29
+ }
30
+ async function deletion() {
31
+ const webhookSubscriptionID = getWebhookSubscriptionID(this);
32
+ if (!webhookSubscriptionID)
33
+ return true;
34
+ await (0, jerboa_1.requestWebhookSubscriptionDeletion)(this, webhookSubscriptionID);
35
+ deleteWebhookSubscriptionID(this);
36
+ return true;
37
+ }
38
+ // TODO: fix type
39
+ function webhookHandler({ getFilterCriteria, }) {
40
+ async function create() {
41
+ const webhookURL = this.getNodeWebhookUrl("default");
42
+ const webhookSubscriptionID = (0, crypto_1.randomUUID)();
43
+ const clientSettings = getClientSettings(this);
44
+ if (clientSettings.length === 0) {
45
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Add at least one client under Client Settings.");
46
+ }
47
+ if (!(0, array_1.allElementsUnique)(clientSettings.map(({ clientID }) => clientID))) {
48
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Ensure all clientIDs are unique in your Client Settings.");
49
+ }
50
+ const webhookFilterCriteria = getFilterCriteria(clientSettings);
51
+ await (0, jerboa_1.requestWebhookSubscription)(this, webhookSubscriptionID, webhookURL, webhookFilterCriteria, "AIBPA:onTransactionStatusChange");
52
+ setWebhookSubscriptionID(this, webhookSubscriptionID);
53
+ return true;
54
+ }
55
+ return { default: { checkExists, delete: deletion, create } };
56
+ }
57
+ //# sourceMappingURL=webhookHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhookHandler.js","sourceRoot":"","sources":["../../../core/handlers/webhookHandler.ts"],"names":[],"mappings":";;AAwDA,wCAmDC;AA3GD,mCAA0C;AAC1C,+CAAkE;AAClE,gDAI6B;AAC7B,0CAAmD;AAEnD,SAAS,wBAAwB,CAAC,GAAmB;IACjD,MAAM,WAAW,GAAG,GAAG,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACtD,OAAO,WAAW,CAAC,qBAA2C,CAAC;AACnE,CAAC;AACD,SAAS,wBAAwB,CAC7B,GAAmB,EACnB,qBAA2B;IAE3B,MAAM,WAAW,GAAG,GAAG,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACtD,WAAW,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;AAC9D,CAA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N,CAAC;QAED,IACI,CAAC,IAAA,yBAAiB,EAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EACpE,CAAC;YACC,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,0DAA0D,CAC7D,CAAC;QACN,CAAC;QAED,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;QAEhE,MAAM,IAAA,mCAA0B,EAC5B,IAAI,EACJ,qBAAqB,EACrB,UAAU,EACV,qBAAqB,EACrB,iCAAiC,CACpC,CAAC;QAEF,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAEtD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;AAClE,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { INodeProperties, IDisplayOptions } from "n8n-workflow";
2
2
  export declare function wrapOptionsInAdditionalFields(optionalInputs: INodeProperties[], displayOptions: IDisplayOptions): INodeProperties;
3
3
  interface DescriptionConstructor {
4
- requiredInputs?: INodeProperties[];
5
- optionalInputs?: INodeProperties[];
4
+ mainParameters?: INodeProperties[];
5
+ advancedParameters?: INodeProperties[];
6
6
  displayOptions: IDisplayOptions;
7
7
  hints?: INodeProperties[];
8
8
  }
9
- export declare function getDescription({ requiredInputs, optionalInputs, displayOptions, hints, }: DescriptionConstructor): {
9
+ export declare function getDescription({ mainParameters: requiredInputs, advancedParameters: optionalInputs, displayOptions, hints, }: DescriptionConstructor): {
10
10
  displayOptions: IDisplayOptions;
11
11
  displayName: string;
12
12
  name: string;
@@ -33,4 +33,15 @@ export declare function getDescription({ requiredInputs, optionalInputs, display
33
33
  allowArbitraryValues?: boolean;
34
34
  resolvableField?: boolean;
35
35
  }[];
36
+ export declare function getWebhookDescription({ mainParameters: requiredInputs, advancedParameters: optionalInputs, displayOptions, hints, }: DescriptionConstructor): INodeProperties[];
37
+ type Option = {
38
+ name: string;
39
+ value: string;
40
+ };
41
+ export declare function deriveAllOptionTypes(displayName: string, name: string, optionChoices: Option[], defaultOptionChoice?: string): {
42
+ options: INodeProperties;
43
+ optionalOptions: INodeProperties;
44
+ multiOptions: INodeProperties;
45
+ multiOptionalOptions: INodeProperties;
46
+ };
36
47
  export {};
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.wrapOptionsInAdditionalFields = wrapOptionsInAdditionalFields;
4
4
  exports.getDescription = getDescription;
5
+ exports.getWebhookDescription = getWebhookDescription;
6
+ exports.deriveAllOptionTypes = deriveAllOptionTypes;
5
7
  const n8n_workflow_1 = require("n8n-workflow");
6
8
  function wrapOptionsInAdditionalFields(optionalInputs, displayOptions) {
7
9
  return {
@@ -14,7 +16,7 @@ function wrapOptionsInAdditionalFields(optionalInputs, displayOptions) {
14
16
  displayOptions,
15
17
  };
16
18
  }
17
- function getDescription({ requiredInputs = [], optionalInputs = [], displayOptions, hints, }) {
19
+ function getDescription({ mainParameters: requiredInputs = [], advancedParameters: optionalInputs = [], displayOptions, hints, }) {
18
20
  const optionalInputsWrapped = wrapOptionsInAdditionalFields(optionalInputs, displayOptions);
19
21
  const properties = [
20
22
  ...requiredInputs,
@@ -23,4 +25,64 @@ function getDescription({ requiredInputs = [], optionalInputs = [], displayOptio
23
25
  ];
24
26
  return (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
25
27
  }
28
+ function getWebhookDescription({ mainParameters: requiredInputs = [], advancedParameters: optionalInputs = [], displayOptions, hints, }) {
29
+ // TODO: make helper between this and getWebhook()
30
+ const optionalInputsWrapped = wrapOptionsInAdditionalFields(optionalInputs, displayOptions);
31
+ const properties = [
32
+ {
33
+ displayName: "Client ID",
34
+ name: "clientID",
35
+ type: "string",
36
+ default: "",
37
+ required: true,
38
+ },
39
+ ...requiredInputs,
40
+ ...(optionalInputs.length > 0 ? [optionalInputsWrapped] : []),
41
+ ...(hints ?? []),
42
+ ];
43
+ const wrappedByClient = [
44
+ {
45
+ displayName: "Client Settings",
46
+ name: "clientSettingsUI",
47
+ type: "fixedCollection",
48
+ default: {},
49
+ options: [
50
+ {
51
+ displayName: "Client Settings",
52
+ name: "clientSettings",
53
+ values: properties,
54
+ },
55
+ ],
56
+ typeOptions: { multipleValues: true },
57
+ },
58
+ ];
59
+ return wrappedByClient;
60
+ }
61
+ function deriveAllOptionTypes(displayName, name, optionChoices, defaultOptionChoice = "") {
62
+ const options = {
63
+ displayName,
64
+ name,
65
+ type: "options",
66
+ options: optionChoices,
67
+ default: defaultOptionChoice,
68
+ };
69
+ const optionalOptions = {
70
+ ...options,
71
+ options: [...optionChoices, { name: "(None of the Above)", value: "" }],
72
+ name: options.name + "Optional",
73
+ };
74
+ const multiOptions = {
75
+ ...options,
76
+ type: "multiOptions",
77
+ default: [],
78
+ name: options.name + "Multi",
79
+ };
80
+ const multiOptionalOptions = {
81
+ ...options,
82
+ type: "multiOptions",
83
+ default: [],
84
+ name: options.name + "MultiOptional",
85
+ };
86
+ return { options, optionalOptions, multiOptions, multiOptionalOptions };
87
+ }
26
88
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../core/parameters/utils.ts"],"names":[],"mappings":";;AAMA,sEAaC;AAQD,wCAgBC;AA3CD,+CAIsB;AAEtB,SAAgB,6BAA6B,CACzC,cAAiC,EACjC,cAA+B;IAE/B,OAAO;QACH,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,cAAc;QACvB,cAAc;KACjB,CAAC;AACN,CAAC;AAQD,SAAgB,cAAc,CAAC,EAC3B,cAAc,GAAG,EAAE,EACnB,cAAc,GAAG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AO,EAAE,CAAC,GAAG,aAAa,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACvE,IAAI,EAAE,OAAO,CAAC,IAAI,GAAG,UAAU;KAClC,CAAC;IAEF,MAAM,YAAY,GAAoB;QAClC,GAAG,OAAO;QACV,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,OAAO,CAAC,IAAI,GAAG,OAAO;KAC/B,CAAC;IAEF,MAAM,oBAAoB,GAAoB;QAC1C,GAAG,OAAO;QACV,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,OAAO,CAAC,IAAI,GAAG,eAAe;KACvC,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAC5E,CAAC"}
@@ -1,12 +1 @@
1
- import { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions, IPollFunctions } from "n8n-workflow";
2
- type Caller = IExecuteFunctions | IPollFunctions | ILoadOptionsFunctions | IHookFunctions;
3
- export interface IToolboxApiRequest {
4
- method: IHttpRequestMethods;
5
- endpoint: string;
6
- body?: IDataObject;
7
- qs?: IDataObject;
8
- headers?: IDataObject;
9
- option?: IDataObject;
10
- }
11
- export declare function toolboxApiRequest(ctx: Caller, { method, endpoint, body, qs, headers, option }: IToolboxApiRequest): Promise<any>;
12
- export {};
1
+ export { toolboxApiRequest, IToolboxApiRequest } from "./toolbox";
@@ -1,43 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toolboxApiRequest = toolboxApiRequest;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const object_1 = require("../utils/object");
6
- const pipe_1 = require("../utils/pipe");
7
- function populateOptions(method, apiUrl, body = {}, qs = {}, headers = {}, option = { json: true }) {
8
- const withPopulatedOptions = (option) => (options) => (0, object_1.copyInto)(options, option);
9
- const withPopulatedHeaders = (headers) => (options) => {
10
- if (Object.keys(headers).length > 0) {
11
- options.headers = Object.assign({}, options.headers, headers);
12
- }
13
- return options;
14
- };
15
- const withSanitizedBody = (body) => (options) => {
16
- if (Object.keys(body).length === 0) {
17
- return (0, object_1.omit)(options, "body");
18
- }
19
- return options;
20
- };
21
- const baseOptions = {
22
- headers: {
23
- "Content-Type": "application/json",
24
- },
25
- method,
26
- body,
27
- qs,
28
- url: apiUrl,
29
- };
30
- return (0, pipe_1.pipe)(withPopulatedOptions(option), withPopulatedHeaders(headers), withSanitizedBody(body))(baseOptions);
31
- }
32
- async function toolboxApiRequest(ctx, { method, endpoint, body, qs, headers, option }) {
33
- const baseUrl = "https://api.thegraphitelab.com";
34
- const apiUrl = `${baseUrl}/${endpoint}`;
35
- const options = populateOptions(method, apiUrl, body, qs, headers, option);
36
- try {
37
- return await ctx.helpers.httpRequestWithAuthentication.call(ctx, "toolboxApi", options);
38
- }
39
- catch (e) {
40
- throw new n8n_workflow_1.NodeApiError(ctx.getNode(), e);
41
- }
42
- }
3
+ exports.toolboxApiRequest = void 0;
4
+ var toolbox_1 = require("./toolbox");
5
+ Object.defineProperty(exports, "toolboxApiRequest", { enumerable: true, get: function () { return toolbox_1.toolboxApiRequest; } });
43
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/transport/index.ts"],"names":[],"mappings":";;AAwEA,8CAiBC;AAzFD,+CASsB;AAEtB,4CAAiD;AACjD,wCAAqC;AAQrC,SAAS,eAAe,CACpB,MAA2B,EAC3B,MAAc,EACd,OAAoB,EAAE,EACtB,KAAkB,EAAE,EACpB,UAAuB,EAAE,EACzB,SAAsB,EAAE,IAAI,EAAE,IAAI,EAAE;IAEpC,MAAM,oBAAoB,GACtB,CAAC,MAAmB,EAAE,EAAE,CAAC,CAAC,OAA4B,EAAE,EAAE,CACtD,IAAA,iBAAQ,EAAC,OAAO,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EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE3E,IAAI,CAAC;QACD,OAAO,MAAM,GAAG,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CACvD,GAAG,EACH,YAAY,EACZ,OAAO,CACV,CAAC;IACN,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,2BAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/transport/index.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAAzD,4GAAA,iBAAiB,OAAA"}
@@ -0,0 +1,14 @@
1
+ import { IDataObject, IHttpRequestMethods } from "n8n-workflow";
2
+ import { Caller } from "../../nodes/Toolbox/v1/types";
3
+ export interface IJerboaApiRequest {
4
+ method: IHttpRequestMethods;
5
+ endpoint: string;
6
+ body?: IDataObject;
7
+ qs?: IDataObject;
8
+ headers?: IDataObject;
9
+ option?: IDataObject;
10
+ }
11
+ export declare function requestWebhookSubscriptionExistence(ctx: Caller, webhookSubscriptionID: string): Promise<any>;
12
+ export declare function requestWebhookSubscription(ctx: Caller, webhookSubscriptionID: string, webhookURL: string, webhookFilterCriteria: Record<string, object>, // TODO: fix type
13
+ webhookType: string): Promise<void>;
14
+ export declare function requestWebhookSubscriptionDeletion(ctx: Caller, webhookSubscriptionID: string): Promise<void>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestWebhookSubscriptionExistence = requestWebhookSubscriptionExistence;
4
+ exports.requestWebhookSubscription = requestWebhookSubscription;
5
+ exports.requestWebhookSubscriptionDeletion = requestWebhookSubscriptionDeletion;
6
+ const n8n_workflow_1 = require("n8n-workflow");
7
+ const utils_1 = require("./utils");
8
+ async function jerboaRequest(ctx, { endpoint, body, method }) {
9
+ const url = `https://api.trigger.dev/api/v1/${endpoint}`;
10
+ const options = (0, utils_1.populateOptions)(method, url, body);
11
+ try {
12
+ return await ctx.helpers.httpRequestWithAuthentication.call(ctx, "jerboaApi", options);
13
+ }
14
+ catch (e) {
15
+ throw new n8n_workflow_1.NodeApiError(ctx.getNode(), e);
16
+ }
17
+ }
18
+ async function sleep(seconds) {
19
+ return new Promise((resolve) => {
20
+ // TODO: figure out a better way to poll here
21
+ /* eslint-disable @n8n/community-nodes/no-restricted-globals */
22
+ setTimeout(resolve, seconds * 1000);
23
+ });
24
+ }
25
+ async function pollWebhookSubscriptionExistence(ctx, runID, attempts = 1) {
26
+ // TODO: make this less bad
27
+ try {
28
+ const res = await jerboaRequest(ctx, {
29
+ endpoint: `runs/${runID}`,
30
+ method: "GET",
31
+ });
32
+ if (res.status === "COMPLETED")
33
+ return res.output;
34
+ if (res.status === "FAILED" ||
35
+ res.status === "CANCELED" ||
36
+ res.status === "CRASHED" ||
37
+ res.status === "SYSTEM_FAILURE") {
38
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Run ${runID} ended with status ${res.status}`);
39
+ }
40
+ // Any other status (QUEUED / EXECUTING / …) means keep polling.
41
+ }
42
+ catch (e) {
43
+ const message = e instanceof Error ? e.message : e;
44
+ if (!message.includes("found"))
45
+ throw e;
46
+ }
47
+ await sleep((attempts * attempts) / 2);
48
+ if (attempts > 5) {
49
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Existence cannot be confirmed nor denied");
50
+ }
51
+ return pollWebhookSubscriptionExistence(ctx, runID, attempts + 1);
52
+ }
53
+ async function requestWebhookSubscriptionExistence(ctx, webhookSubscriptionID) {
54
+ const run = await jerboaRequest(ctx, {
55
+ method: "POST",
56
+ endpoint: "tasks/webhook-subscription-check-exists/trigger",
57
+ body: { payload: { webhookSubscriptionID } },
58
+ });
59
+ if (!run?.id)
60
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Run ID not found");
61
+ return await pollWebhookSubscriptionExistence(ctx, run.id);
62
+ }
63
+ // TODO: add check to make sure webhook subscription successfully happened
64
+ async function requestWebhookSubscription(ctx, webhookSubscriptionID, webhookURL, webhookFilterCriteria, // TODO: fix type
65
+ webhookType) {
66
+ const body = {
67
+ webhookSubscriptionID,
68
+ webhookURL,
69
+ webhookFilterCriteria,
70
+ webhookType,
71
+ };
72
+ await jerboaRequest(ctx, {
73
+ method: "POST",
74
+ endpoint: `tasks/webhook-subscription-register/trigger`,
75
+ body: { payload: body },
76
+ });
77
+ }
78
+ async function requestWebhookSubscriptionDeletion(ctx, webhookSubscriptionID) {
79
+ await jerboaRequest(ctx, {
80
+ method: "POST",
81
+ endpoint: "tasks/webhook-subscription-unsubscribe/trigger",
82
+ body: {
83
+ payload: {
84
+ webhookSubscriptionID,
85
+ },
86
+ },
87
+ });
88
+ }
89
+ //# sourceMappingURL=jerboa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jerboa.js","sourceRoot":"","sources":["../../../core/transport/jerboa.ts"],"names":[],"mappings":";;AAmFA,kFAYC;AAGD,gEAkBC;AAED,gFAaC;AAnID,+CAKsB;AAGtB,mCAA0C;AAU1C,KAAK,UAAU,aAAa,CACxB,GAAW,EACX,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAqB;IAE7C,MAAM,GAAG,GAAG,kCAAkC,QAAQ,EAAE,CAAC;IAEzD,MAAM,OAAO,GAAG,IAAA,uBAAe,EAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC;QACD,OAAO,MAAM,GAAG,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CACvD,GAAG,EACH,WAAW,EACX,OAAO,CACV,CAAC;IACN,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,2BAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;AACL,CAAC;AAED,KAAK,UAAU,KAAK,CAAC,OAAe;IAChC,OAAO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ods, ILoadOptionsFunctions, IPollFunctions } from "n8n-workflow";
2
+ type Caller = IExecuteFunctions | IPollFunctions | ILoadOptionsFunctions | IHookFunctions;
3
+ export interface IToolboxApiRequest {
4
+ method: IHttpRequestMethods;
5
+ endpoint: string;
6
+ body?: IDataObject;
7
+ qs?: IDataObject;
8
+ headers?: IDataObject;
9
+ option?: IDataObject;
10
+ }
11
+ export declare function toolboxApiRequest(ctx: Caller, { method, endpoint, body, qs, headers, option }: IToolboxApiRequest): Promise<any>;
12
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toolboxApiRequest = toolboxApiRequest;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const utils_1 = require("./utils");
6
+ async function toolboxApiRequest(ctx, { method, endpoint, body, qs, headers, option }) {
7
+ const baseUrl = "https://api.thegraphitelab.com";
8
+ const apiUrl = `${baseUrl}/${endpoint}`;
9
+ const options = (0, utils_1.populateOptions)(method, apiUrl, body, qs, headers, option);
10
+ try {
11
+ // TODO: add {message: string} handler and throw as NodeApiError
12
+ return await ctx.helpers.httpRequestWithAuthentication.call(ctx, "toolboxApi", options);
13
+ }
14
+ catch (e) {
15
+ throw new n8n_workflow_1.NodeApiError(ctx.getNode(), e);
16
+ }
17
+ }
18
+ //# sourceMappingURL=toolbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbox.js","sourceRoot":"","sources":["../../../core/transport/toolbox.ts"],"names":[],"mappings":";;AA0BA,8CAkBC;AA5CD,+CAQsB;AAEtB,mCAA0C;AAgBnC,KAAK,UAAU,iBAAiB,CACnC,GAAW,EACX,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAsB;IAEnE,MAAM,OAAO,GAAG,gCAAgC,CAAC;IACjD,MAAM,MAAM,GAAG,GAAG,OAAO,IAAI,QAAQ,EAAE,CAAC;IACxC,MAAM,OAAO,GAAG,IAAA,uBAAe,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE3E,IAAI,CAAC;QACD,gEAAgE;QAChE,OAAO,MAAM,GAAG,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CACvD,GAAG,EACH,YAAY,EACZ,OAAO,CACV,CAAC;IACN,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,2BAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { IHttpRequestMethods, IDataObject, IHttpRequestOptions } from "n8n-workflow";
2
+ export declare function populateOptions(method: IHttpRequestMethods, apiUrl: string, body?: IDataObject, qs?: IDataObject, headers?: IDataObject, option?: IDataObject): IHttpRequestOptions;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.populateOptions = populateOptions;
4
+ const object_1 = require("../utils/object");
5
+ const pipe_1 = require("../utils/pipe");
6
+ function populateOptions(method, apiUrl, body = {}, qs = {}, headers = {}, option = { json: true }) {
7
+ const withPopulatedOptions = (option) => (options) => (0, object_1.copyInto)(options, option);
8
+ const withPopulatedHeaders = (headers) => (options) => {
9
+ if (Object.keys(headers).length > 0) {
10
+ options.headers = Object.assign({}, options.headers, headers);
11
+ }
12
+ return options;
13
+ };
14
+ const withSanitizedBody = (body) => (options) => {
15
+ if (Object.keys(body).length === 0) {
16
+ return (0, object_1.omit)(options, "body");
17
+ }
18
+ return options;
19
+ };
20
+ const baseOptions = {
21
+ headers: {
22
+ "Content-Type": "application/json",
23
+ },
24
+ method,
25
+ body,
26
+ qs,
27
+ url: apiUrl,
28
+ };
29
+ return (0, pipe_1.pipe)(withPopulatedOptions(option), withPopulatedHeaders(headers), withSanitizedBody(body))(baseOptions);
30
+ }
31
+ //# sourceMappingURL=ut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C,EAC5B,oBAAoB,CAAC,OAAO,CAAC,EAC7B,iBAAiB,CAAC,IAAI,CAAC,CAC1B,CAAC,WAAW,CAAC,CAAC;AACnB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function allElementsUnique<T>(arr: T[]): boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allElementsUnique = allElementsUnique;
4
+ function allElementsUnique(arr) {
5
+ const set = new Set(arr);
6
+ const setArr = [...set];
7
+ return setArr.length === arr.length;
8
+ }
9
+ //# sourceMappingURL=array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../core/utils/array.ts"],"names":[],"mappings":";;AAAA,8CAKC;AALD,SAAgB,iBAAiB,CAAI,GAAQ;IACzC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,MAAM,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC;AACxC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { IBinaryData, IExecuteFunctions } from "n8n-workflow";
2
+ export declare function getFileAsBase64(this: IExecuteFunctions, index: number, fileKey: string): Promise<{
3
+ base64: string;
4
+ binaryData: IBinaryData;
5
+ }>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileAsBase64 = getFileAsBase64;
4
+ async function getFileAsBase64(index, fileKey) {
5
+ const binaryData = this.helpers.assertBinaryData(index, fileKey);
6
+ if (binaryData.id) {
7
+ // Filesystem mode
8
+ const chunks = [];
9
+ const readable = await this.helpers.getBinaryStream(binaryData.id);
10
+ for await (const chunk of readable)
11
+ chunks.push(chunk);
12
+ return {
13
+ binaryData,
14
+ base64: Buffer.concat(chunks).toString("base64"),
15
+ };
16
+ }
17
+ else {
18
+ // In-memory mode
19
+ return {
20
+ binaryData,
21
+ base64: Buffer.from(binaryData.data, "base64").toString(),
22
+ };
23
+ }
24
+ }
25
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","sourceRoot":"","sources":["../../../core/utils/file.ts"],"names":[],"mappings":";;AAEA,0CAuBC;AAvBM,KAAK,UAAU,eAAe,CAEjC,KAAa,EACb,OAAe;IAEf,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAEjE,IAAI,UAAU,CAAC,EAAE,EAAE,CAAC;QAChB,kBAAkB;QAClB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACnE,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvD,OAAO;YACH,UAAU;YACV,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;SACnD,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,iBAAiB;QACjB,OAAO;YACH,UAAU;YACV,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE;SAC5D,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions, IPollFunctions } from "n8n-workflow";
2
+ export declare function assertValidString(ctx: IExecuteFunctions | IPollFunctions, str: string | undefined, errMessage: string): asserts str is string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertValidString = assertValidString;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ function assertValidString(ctx, str, errMessage) {
6
+ if (!str || str === "") {
7
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), errMessage);
8
+ }
9
+ }
10
+ //# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["../../../core/utils/string.ts"],"names":[],"mappings":";;AAMA,8CAQC;AAdD,+CAIsB;AAEtB,SAAgB,iBAAiB,CAC7B,GAAuC,EACvC,GAAuB,EACvB,UAAkB;IAElB,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACrB,MAAM,IAAI,iCAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType } from "n8n-workflow";
2
+ export declare class JerboaApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: "file:../nodes/PurchasingAssistant/eli.svg";
6
+ documentationUrl: string;
7
+ properties: never[];
8
+ authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JerboaApi = void 0;
4
+ class JerboaApi {
5
+ name = "jerboaApi";
6
+ displayName = "Jerboa API";
7
+ icon = "file:../nodes/PurchasingAssistant/eli.svg";
8
+ documentationUrl = "https://thegraphitelab.com/";
9
+ properties = [];
10
+ authenticate = {
11
+ type: "generic",
12
+ properties: {
13
+ headers: {
14
+ // eslint-disable-next-line @n8n/community-nodes/no-restricted-globals
15
+ Authorization: `Bearer ${process.env.TRIGGER_DEV_KEY}`,
16
+ },
17
+ },
18
+ };
19
+ test = {
20
+ request: {
21
+ baseURL: "=https://api.trigger.dev/api/v1",
22
+ url: "/runs?filter[status]=COMPLETED",
23
+ method: "GET",
24
+ },
25
+ };
26
+ }
27
+ exports.JerboaApi = JerboaApi;
28
+ //# sourceMappingURL=JerboaApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JerboaApi.credentials.js","sourceRoot":"","sources":["../../credentials/JerboaApi.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,SAAS;IAClB,IAAI,GAAG,WAAW,CAAC;IAEnB,WAAW,GAAG,YAAY,CAAC;IAE3B,IAAI,GAAG,2CAAoD,CAAC;IAE5D,gBAAgB,GAAG,6BAA6B,CAAC;IAEjD,UAAU,GAAG,EAAE,CAAC;IAEhB,YAAY,GAAyB;QACjC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE;YACR,OAAO,EAAE;gBACL,sEAAsE;gBACtE,aAAa,EAAE,UAAU,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE;aACzD;SACJ;KACJ,CAAC;IAEF,IAAI,GAA2B;QAC3B,OAAO,EAAE;YACL,OAAO,EAAE,iCAAiC;YAC1C,GAAG,EAAE,gCAAgC;YACrC,MAAM,EAAE,KAAK;SAChB;KACJ,CAAC;CACL;AA5BD,8BA4BC"}
@@ -5,7 +5,7 @@ const utils_1 = require("../../../../../../core/parameters/utils");
5
5
  const const_1 = require("../const");
6
6
  const parameters_1 = require("../../../parameters");
7
7
  exports.descriptionGet = (0, utils_1.getDescription)({
8
- requiredInputs: [
8
+ mainParameters: [
9
9
  parameters_1.params.useExternalCallID,
10
10
  parameters_1.params.callID,
11
11
  parameters_1.params.externalCallID,
@@ -4,7 +4,7 @@ exports.eventOptions = exports.eventDesc = void 0;
4
4
  const utils_1 = require("../../../../../../core/parameters/utils");
5
5
  const parameters_1 = require("../../../parameters");
6
6
  exports.eventDesc = (0, utils_1.getDescription)({
7
- requiredInputs: [parameters_1.params.createdOnOrAfter, parameters_1.params.createdBefore],
7
+ mainParameters: [parameters_1.params.createdOnOrAfter, parameters_1.params.createdBefore],
8
8
  displayOptions: { show: { event: ["onCallCompletion"] } },
9
9
  });
10
10
  exports.eventOptions = {
@@ -0,0 +1,4 @@
1
+ import { VersionedNodeType } from "n8n-workflow";
2
+ export declare class PurchasingAssistant extends VersionedNodeType {
3
+ constructor();
4
+ }