@limetech/n8n-nodes-lime 0.2.9 → 0.3.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.
- package/.dockerignore +1 -0
- package/.github/workflows/lint.yml +21 -0
- package/.github/workflows/release.yml +82 -0
- package/.github/workflows/test-and-build.yml +47 -0
- package/.prettierignore +4 -0
- package/.prettierrc.mjs +1 -0
- package/.releaserc.json +34 -0
- package/CHANGELOG.md +74 -0
- package/Dockerfile +21 -0
- package/README.md +4 -0
- package/credentials/FortnoxApi.credentials.ts +61 -0
- package/credentials/LimeCrmApi.credentials.ts +60 -0
- package/dist/credentials/FortnoxApi.credentials.d.ts +9 -0
- package/dist/credentials/FortnoxApi.credentials.js +57 -0
- package/dist/credentials/FortnoxApi.credentials.js.map +1 -0
- package/dist/credentials/LimeCrmApi.credentials.js +3 -2
- package/dist/credentials/LimeCrmApi.credentials.js.map +1 -1
- package/dist/nodes/fortnox/Fortnox.node.d.ts +5 -0
- package/dist/nodes/fortnox/Fortnox.node.js +95 -0
- package/dist/nodes/fortnox/Fortnox.node.js.map +1 -0
- package/dist/nodes/fortnox/Fortnox.node.json +18 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +5 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.js +155 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +1 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.json +18 -0
- package/dist/nodes/fortnox/commons.d.ts +25 -0
- package/dist/nodes/fortnox/commons.js +44 -0
- package/dist/nodes/fortnox/commons.js.map +1 -0
- package/dist/nodes/fortnox/model.d.ts +20 -0
- package/dist/nodes/fortnox/model.js +3 -0
- package/dist/nodes/fortnox/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.js +31 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/index.d.ts +20 -0
- package/dist/nodes/fortnox/resources/customers/index.js +77 -0
- package/dist/nodes/fortnox/resources/customers/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/model.d.ts +99 -0
- package/dist/nodes/fortnox/resources/customers/model.js +3 -0
- package/dist/nodes/fortnox/resources/customers/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +12 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +283 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +36 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +36 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +68 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +12 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +267 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.js +30 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js +72 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/index.d.ts +20 -0
- package/dist/nodes/fortnox/resources/invoice/index.js +71 -0
- package/dist/nodes/fortnox/resources/invoice/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +193 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/model.d.ts +150 -0
- package/dist/nodes/fortnox/resources/invoice/model.js +3 -0
- package/dist/nodes/fortnox/resources/invoice/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +64 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +35 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +92 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +62 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -0
- package/dist/nodes/fortnox/transport/errorCodes.d.ts +1 -0
- package/dist/nodes/fortnox/transport/errorCodes.js +51 -0
- package/dist/nodes/fortnox/transport/errorCodes.js.map +1 -0
- package/dist/nodes/fortnox/transport/index.d.ts +4 -0
- package/dist/nodes/fortnox/transport/index.js +72 -0
- package/dist/nodes/fortnox/transport/index.js.map +1 -0
- package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +14 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.js +113 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +18 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +200 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
- package/dist/nodes/lime-crm/commons/constants.d.ts +4 -0
- package/dist/nodes/lime-crm/commons/constants.js +8 -0
- package/dist/nodes/lime-crm/commons/constants.js.map +1 -0
- package/dist/nodes/lime-crm/commons/index.d.ts +3 -0
- package/dist/nodes/lime-crm/commons/index.js +11 -0
- package/dist/nodes/lime-crm/commons/index.js.map +1 -0
- package/dist/nodes/lime-crm/commons/limetype.d.ts +10 -0
- package/dist/nodes/lime-crm/commons/limetype.js +3 -0
- package/dist/nodes/lime-crm/commons/limetype.js.map +1 -0
- package/dist/nodes/lime-crm/commons/task.d.ts +14 -0
- package/dist/nodes/lime-crm/commons/task.js +49 -0
- package/dist/nodes/lime-crm/commons/task.js.map +1 -0
- package/dist/nodes/lime-crm/commons/webhook.d.ts +16 -0
- package/dist/nodes/lime-crm/commons/webhook.js +30 -0
- package/dist/nodes/lime-crm/commons/webhook.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +5 -0
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +12 -0
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +2 -0
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +21 -0
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +2 -0
- package/dist/nodes/lime-crm/methods/getLimeTypes.js +21 -0
- package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +1 -0
- package/dist/nodes/lime-crm/methods/index.d.ts +3 -0
- package/dist/nodes/lime-crm/methods/index.js +10 -0
- package/dist/nodes/lime-crm/methods/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +23 -0
- package/dist/nodes/lime-crm/resources/erpConnector/index.js +57 -0
- package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +26 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +65 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +220 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +15 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transform.js +12 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +4 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +7 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +37 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +124 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +6 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +14 -0
- package/dist/nodes/lime-crm/resources/limeObject/index.js +78 -0
- package/dist/nodes/lime-crm/resources/limeObject/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +139 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +51 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +51 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +86 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +149 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/index.d.ts +20 -0
- package/dist/nodes/lime-crm/resources/limeType/index.js +71 -0
- package/dist/nodes/lime-crm/resources/limeType/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +36 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +36 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +10 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +15 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +1 -0
- package/dist/nodes/lime-crm/transport/commons.d.ts +5 -0
- package/dist/nodes/lime-crm/transport/commons.js +33 -0
- package/dist/nodes/lime-crm/transport/commons.js.map +1 -0
- package/dist/nodes/lime-crm/transport/erpConnector.d.ts +9 -0
- package/dist/nodes/lime-crm/transport/erpConnector.js +12 -0
- package/dist/nodes/lime-crm/transport/erpConnector.js.map +1 -0
- package/dist/nodes/lime-crm/transport/index.d.ts +5 -0
- package/dist/nodes/lime-crm/transport/index.js +22 -0
- package/dist/nodes/lime-crm/transport/index.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limeobjects.d.ts +7 -0
- package/dist/nodes/lime-crm/transport/limeobjects.js +49 -0
- package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limetypes.d.ts +6 -0
- package/dist/nodes/lime-crm/transport/limetypes.js +40 -0
- package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -0
- package/dist/nodes/lime-crm/transport/task.d.ts +13 -0
- package/dist/nodes/lime-crm/transport/task.js +14 -0
- package/dist/nodes/lime-crm/transport/task.js.map +1 -0
- package/dist/nodes/lime-crm/transport/webhooks.d.ts +15 -0
- package/dist/nodes/lime-crm/transport/webhooks.js +33 -0
- package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -0
- package/dist/nodes/nodeResponse.d.ts +12 -0
- package/dist/nodes/nodeResponse.js +3 -0
- package/dist/nodes/nodeResponse.js.map +1 -0
- package/dist/package.json +36 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docker-compose.yml +46 -0
- package/eslint.config.mjs +27 -0
- package/jest.config.js +11 -0
- package/nodes/fortnox/Fortnox.node.json +18 -0
- package/nodes/fortnox/Fortnox.node.ts +102 -0
- package/nodes/fortnox/FortnoxTrigger.node.json +18 -0
- package/nodes/fortnox/FortnoxTrigger.node.ts +196 -0
- package/nodes/fortnox/commons.ts +94 -0
- package/nodes/fortnox/fortnoxLogo.svg +15 -0
- package/nodes/fortnox/model.ts +25 -0
- package/nodes/fortnox/resources/customers/filterParameters.ts +47 -0
- package/nodes/fortnox/resources/customers/index.ts +57 -0
- package/nodes/fortnox/resources/customers/model.ts +107 -0
- package/nodes/fortnox/resources/customers/operations/create.operation.ts +303 -0
- package/nodes/fortnox/resources/customers/operations/delete.operation.ts +44 -0
- package/nodes/fortnox/resources/customers/operations/get.operation.ts +45 -0
- package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +80 -0
- package/nodes/fortnox/resources/customers/operations/update.operation.ts +278 -0
- package/nodes/fortnox/resources/customers/sortParameters.ts +32 -0
- package/nodes/fortnox/resources/invoice/filterParameters.ts +88 -0
- package/nodes/fortnox/resources/invoice/index.ts +51 -0
- package/nodes/fortnox/resources/invoice/invoiceParameters.ts +214 -0
- package/nodes/fortnox/resources/invoice/model.ts +160 -0
- package/nodes/fortnox/resources/invoice/operations/create.operation.ts +72 -0
- package/nodes/fortnox/resources/invoice/operations/get.operation.ts +45 -0
- package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +101 -0
- package/nodes/fortnox/resources/invoice/operations/update.operation.ts +74 -0
- package/nodes/fortnox/transport/errorCodes.ts +62 -0
- package/nodes/fortnox/transport/index.ts +98 -0
- package/nodes/lime-crm/LimeCrm.node.json +18 -0
- package/nodes/lime-crm/LimeCrmNode.node.ts +135 -0
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +263 -0
- package/nodes/lime-crm/assets/lime-crm.svg +1 -0
- package/nodes/lime-crm/commons/constants.ts +9 -0
- package/nodes/lime-crm/commons/index.ts +9 -0
- package/nodes/lime-crm/commons/limetype.ts +11 -0
- package/nodes/lime-crm/commons/task.ts +55 -0
- package/nodes/lime-crm/commons/webhook.ts +50 -0
- package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +11 -0
- package/nodes/lime-crm/methods/getLimeTypeProperties.ts +27 -0
- package/nodes/lime-crm/methods/getLimeTypes.ts +23 -0
- package/nodes/lime-crm/methods/index.ts +3 -0
- package/nodes/lime-crm/resources/erpConnector/index.ts +43 -0
- package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +69 -0
- package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +274 -0
- package/nodes/lime-crm/resources/erpConnector/transform.ts +49 -0
- package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +18 -0
- package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +201 -0
- package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +1 -0
- package/nodes/lime-crm/resources/limeObject/index.ts +64 -0
- package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +152 -0
- package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +55 -0
- package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +54 -0
- package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +99 -0
- package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +157 -0
- package/nodes/lime-crm/resources/limeType/index.ts +58 -0
- package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +42 -0
- package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +36 -0
- package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +18 -0
- package/nodes/lime-crm/transport/commons.ts +44 -0
- package/nodes/lime-crm/transport/erpConnector.ts +21 -0
- package/nodes/lime-crm/transport/index.ts +17 -0
- package/nodes/lime-crm/transport/limeobjects.ts +83 -0
- package/nodes/lime-crm/transport/limetypes.ts +68 -0
- package/nodes/lime-crm/transport/task.ts +32 -0
- package/nodes/lime-crm/transport/webhooks.ts +61 -0
- package/nodes/nodeResponse.ts +13 -0
- package/package.json +36 -16
- package/tests/fixtures/fortnox.ts +182 -0
- package/tests/transform.spec.ts +187 -0
- package/tsconfig.json +30 -0
- package/index.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limetype.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/commons/limetype.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function waitForTaskCompletion(nodeContext: IExecuteFunctions, taskId: string, pollInterval: number, timeout: number): Promise<{
|
|
3
|
+
success: boolean;
|
|
4
|
+
error: string;
|
|
5
|
+
metadata: {
|
|
6
|
+
taskId: string;
|
|
7
|
+
};
|
|
8
|
+
data?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
success: boolean;
|
|
11
|
+
data: unknown;
|
|
12
|
+
error?: undefined;
|
|
13
|
+
metadata?: undefined;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitForTaskCompletion = void 0;
|
|
4
|
+
const task_1 = require("../transport/task");
|
|
5
|
+
async function waitForTaskCompletion(nodeContext, taskId, pollInterval, timeout) {
|
|
6
|
+
const startTime = Date.now();
|
|
7
|
+
while (Date.now() - startTime <= timeout) {
|
|
8
|
+
const taskResponse = await (0, task_1.getTasks)(nodeContext, taskId);
|
|
9
|
+
if (!taskResponse.success)
|
|
10
|
+
continue;
|
|
11
|
+
const task = taskResponse.data._embedded.tasks[0];
|
|
12
|
+
switch (task.status) {
|
|
13
|
+
case 'FAILURE': {
|
|
14
|
+
return {
|
|
15
|
+
success: false,
|
|
16
|
+
error: `Task ${taskId} failed: ${task.result}`,
|
|
17
|
+
metadata: {
|
|
18
|
+
taskId: taskId,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
case 'REVOKED': {
|
|
23
|
+
return {
|
|
24
|
+
success: false,
|
|
25
|
+
error: `Task ${taskId} was revoked`,
|
|
26
|
+
metadata: {
|
|
27
|
+
taskId: taskId,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
case 'SUCCESS': {
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
data: task.result,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
error: `Task ${taskId} did not complete within ${timeout / 1000}s`,
|
|
43
|
+
metadata: {
|
|
44
|
+
taskId: taskId,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.waitForTaskCompletion = waitForTaskCompletion;
|
|
49
|
+
//# sourceMappingURL=task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/commons/task.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAGtC,KAAK,UAAU,qBAAqB,CACvC,WAA8B,EAC9B,MAAc,EACd,YAAoB,EACpB,OAAe;IAEf,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,IAAA,eAAQ,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAEzD,IAAI,CAAC,YAAY,CAAC,OAAO;YAAE,SAAS;QAEpC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClD,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YAClB,KAAK,SAAS,CAAC,CAAC,CAAC;gBACb,OAAO;oBACH,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,QAAQ,MAAM,YAAY,IAAI,CAAC,MAAM,EAAE;oBAC9C,QAAQ,EAAE;wBACN,MAAM,EAAE,MAAM;qBACjB;iBACJ,CAAC;YACN,CAAC;YACD,KAAK,SAAS,CAAC,CAAC,CAAC;gBACb,OAAO;oBACH,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,QAAQ,MAAM,cAAc;oBACnC,QAAQ,EAAE;wBACN,MAAM,EAAE,MAAM;qBACjB;iBACJ,CAAC;YACN,CAAC;YACD,KAAK,SAAS,CAAC,CAAC,CAAC;gBACb,OAAO;oBACH,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,IAAI,CAAC,MAAM;iBACpB,CAAC;YACN,CAAC;QACL,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO;QACH,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,QAAQ,MAAM,4BAA4B,OAAO,GAAG,IAAI,GAAG;QAClE,QAAQ,EAAE;YACN,MAAM,EAAE,MAAM;SACjB;KACJ,CAAC;AACN,CAAC;AAnDD,sDAmDC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDataObject, IHookFunctions, IWebhookFunctions } from 'n8n-workflow';
|
|
2
|
+
type WebhookFunctions = IHookFunctions | IWebhookFunctions;
|
|
3
|
+
interface WebhookContext {
|
|
4
|
+
nodeId: string;
|
|
5
|
+
nodeName?: string;
|
|
6
|
+
workflowId?: string;
|
|
7
|
+
workflowName?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Webhook {
|
|
10
|
+
data: IDataObject;
|
|
11
|
+
events: string[];
|
|
12
|
+
url?: string;
|
|
13
|
+
context: WebhookContext;
|
|
14
|
+
}
|
|
15
|
+
export declare function getWebhook(hookData: WebhookFunctions): Webhook;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWebhook = void 0;
|
|
4
|
+
function _getEvents(hookData) {
|
|
5
|
+
const eventData = hookData.getNodeParameter('events', []);
|
|
6
|
+
const eventItems = eventData.event;
|
|
7
|
+
const events = [];
|
|
8
|
+
for (const eventItem of eventItems) {
|
|
9
|
+
events.push(`${eventItem.limeType}.${eventItem.eventType}`);
|
|
10
|
+
}
|
|
11
|
+
return events;
|
|
12
|
+
}
|
|
13
|
+
function getWebhook(hookData) {
|
|
14
|
+
const node = hookData.getNode();
|
|
15
|
+
const workflow = hookData.getWorkflow();
|
|
16
|
+
const context = {
|
|
17
|
+
nodeId: node.id,
|
|
18
|
+
nodeName: node.name,
|
|
19
|
+
workflowId: workflow.id,
|
|
20
|
+
workflowName: workflow.name,
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
data: hookData.getWorkflowStaticData('node'),
|
|
24
|
+
events: _getEvents(hookData),
|
|
25
|
+
url: hookData.getNodeWebhookUrl('default'),
|
|
26
|
+
context: context,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.getWebhook = getWebhook;
|
|
30
|
+
//# sourceMappingURL=webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/commons/webhook.ts"],"names":[],"mappings":";;;AAkBA,SAAS,UAAU,CAAC,QAA0B;IAC1C,MAAM,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,EAAE,CAKvD,CAAC;IACF,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC;IACnC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAgB,UAAU,CAAC,QAA0B;IACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;IAChC,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACxC,MAAM,OAAO,GAAmB;QAC5B,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,QAAQ,EAAE,IAAI,CAAC,IAAI;QACnB,UAAU,EAAE,QAAQ,CAAC,EAAE;QACvB,YAAY,EAAE,QAAQ,CAAC,IAAI;KAC9B,CAAC;IAEF,OAAO;QACH,IAAI,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC;QAC5C,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC;QAC5B,GAAG,EAAE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC;QAC1C,OAAO,EAAE,OAAO;KACnB,CAAC;AACN,CAAC;AAhBD,gCAgBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEntitiesForErpSystem = void 0;
|
|
4
|
+
async function getEntitiesForErpSystem() {
|
|
5
|
+
const erpSystem = this.getCurrentNodeParameter('erpSystem');
|
|
6
|
+
if (erpSystem === 'fortnox') {
|
|
7
|
+
return [{ name: 'Invoice', value: 'invoice' }];
|
|
8
|
+
}
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
exports.getEntitiesForErpSystem = getEntitiesForErpSystem;
|
|
12
|
+
//# sourceMappingURL=getEntitiesForErpSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntitiesForErpSystem.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/methods/getEntitiesForErpSystem.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,uBAAuB;IACzC,MAAM,SAAS,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAW,CAAC;IAEtE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AARD,0DAQC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLimeTypeProperties = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const transport_1 = require("../transport/");
|
|
6
|
+
async function getLimeTypeProperties() {
|
|
7
|
+
const limeType = this.getNodeParameter('limeType', '');
|
|
8
|
+
n8n_workflow_1.LoggerProxy.info(`Fetching properties for Lime type: ${limeType}`);
|
|
9
|
+
if (!limeType)
|
|
10
|
+
return [];
|
|
11
|
+
const response = await (0, transport_1.getProperties)(this, limeType);
|
|
12
|
+
if (!response.success)
|
|
13
|
+
return [];
|
|
14
|
+
return response.data.map((property) => ({
|
|
15
|
+
name: property.localname || property.name,
|
|
16
|
+
value: property.name,
|
|
17
|
+
description: `Type: ${property.type}${property.required ? ' (Required)' : ''}`,
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
exports.getLimeTypeProperties = getLimeTypeProperties;
|
|
21
|
+
//# sourceMappingURL=getLimeTypeProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLimeTypeProperties.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/methods/getLimeTypeProperties.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AACtB,6CAA8C;AAKvC,KAAK,UAAU,qBAAqB;IAGvC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAW,CAAC;IACjE,0BAAM,CAAC,IAAI,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;IAC9D,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAa,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAErD,IAAI,CAAC,QAAQ,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAEjC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpC,IAAI,EAAG,QAAQ,CAAC,SAAoB,IAAK,QAAQ,CAAC,IAAe;QACjE,KAAK,EAAE,QAAQ,CAAC,IAAc;QAC9B,WAAW,EAAE,SAAS,QAAQ,CAAC,IAAc,GAAI,QAAQ,CAAC,QAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE;KACxG,CAAC,CAAC,CAAC;AACR,CAAC;AAhBD,sDAgBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLimeTypes = void 0;
|
|
4
|
+
const transport_1 = require("../transport");
|
|
5
|
+
async function getLimeTypes() {
|
|
6
|
+
const data = [];
|
|
7
|
+
const response = await (0, transport_1.getLimeTypesFromApi)(this);
|
|
8
|
+
if (response.success && response.data) {
|
|
9
|
+
for (const limeType of response.data) {
|
|
10
|
+
if (limeType.name) {
|
|
11
|
+
data.push({
|
|
12
|
+
name: limeType.name,
|
|
13
|
+
value: limeType.name,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
exports.getLimeTypes = getLimeTypes;
|
|
21
|
+
//# sourceMappingURL=getLimeTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLimeTypes.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/methods/getLimeTypes.ts"],"names":[],"mappings":";;;AACA,4CAAmD;AAK5C,KAAK,UAAU,YAAY;IAG9B,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,IAAA,+BAAmB,EAAC,IAAI,CAAC,CAAC;IACjD,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpC,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC;oBACN,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,KAAK,EAAE,QAAQ,CAAC,IAAI;iBACvB,CAAC,CAAC;YACP,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAhBD,oCAgBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLimeTypeProperties = exports.getLimeTypes = exports.getEntitiesForErpSystem = void 0;
|
|
4
|
+
var getEntitiesForErpSystem_1 = require("./getEntitiesForErpSystem");
|
|
5
|
+
Object.defineProperty(exports, "getEntitiesForErpSystem", { enumerable: true, get: function () { return getEntitiesForErpSystem_1.getEntitiesForErpSystem; } });
|
|
6
|
+
var getLimeTypes_1 = require("./getLimeTypes");
|
|
7
|
+
Object.defineProperty(exports, "getLimeTypes", { enumerable: true, get: function () { return getLimeTypes_1.getLimeTypes; } });
|
|
8
|
+
var getLimeTypeProperties_1 = require("./getLimeTypeProperties");
|
|
9
|
+
Object.defineProperty(exports, "getLimeTypeProperties", { enumerable: true, get: function () { return getLimeTypeProperties_1.getLimeTypeProperties; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/methods/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const erpConnectorFields: INodeProperties[];
|
|
3
|
+
export declare function erpConnectorOperations(this: IExecuteFunctions, { operation, i }: {
|
|
4
|
+
operation: string;
|
|
5
|
+
i: number;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
success: false;
|
|
8
|
+
error: string;
|
|
9
|
+
status?: number | undefined;
|
|
10
|
+
metadata?: Record<string, unknown> | undefined;
|
|
11
|
+
} | {
|
|
12
|
+
success: boolean;
|
|
13
|
+
error: string;
|
|
14
|
+
metadata: {
|
|
15
|
+
taskId: string;
|
|
16
|
+
};
|
|
17
|
+
data?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
success: boolean;
|
|
20
|
+
data: unknown;
|
|
21
|
+
error?: undefined;
|
|
22
|
+
metadata?: undefined;
|
|
23
|
+
} | import("./transform").LimeCrmData | null>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.erpConnectorOperations = exports.erpConnectorFields = void 0;
|
|
27
|
+
const createOrUpdateObjects = __importStar(require("./operations/createOrUpdateObjects.operation"));
|
|
28
|
+
const transform = __importStar(require("./operations/transform.operation"));
|
|
29
|
+
const commons_1 = require("../../commons");
|
|
30
|
+
exports.erpConnectorFields = [
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Operation',
|
|
33
|
+
name: 'operation',
|
|
34
|
+
type: 'options',
|
|
35
|
+
noDataExpression: true,
|
|
36
|
+
displayOptions: {
|
|
37
|
+
show: {
|
|
38
|
+
resource: [commons_1.ERP_CONNECTOR_RESOURCE],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
options: [createOrUpdateObjects.description, transform.description],
|
|
42
|
+
default: 'transformErpData',
|
|
43
|
+
},
|
|
44
|
+
...createOrUpdateObjects.properties,
|
|
45
|
+
...transform.properties,
|
|
46
|
+
];
|
|
47
|
+
async function erpConnectorOperations({ operation, i }) {
|
|
48
|
+
if (operation === 'createOrUpdateObjects') {
|
|
49
|
+
return await createOrUpdateObjects.execute.call(this, i);
|
|
50
|
+
}
|
|
51
|
+
if (operation === 'transformErpData') {
|
|
52
|
+
return await transform.execute.call(this, i);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
exports.erpConnectorOperations = erpConnectorOperations;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/lime-crm/resources/erpConnector/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,oGAAsF;AACtF,4EAA8D;AAE9D,2CAAuD;AAE1C,QAAA,kBAAkB,GAAsB;IACjD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAA8B;QACpC,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,gCAAsB,CAAC;aACrC;SACJ;QACD,OAAO,EAAE,CAAC,qBAAqB,CAAC,WAAW,EAAE,SAAS,CAAC,WAAW,CAAC;QACnE,OAAO,EAAE,kBAAkB;KAC9B;IAED,GAAG,qBAAqB,CAAC,UAAU;IACnC,GAAG,SAAS,CAAC,UAAU;CAC1B,CAAC;AAEK,KAAK,UAAU,sBAAsB,CAExC,EAAE,SAAS,EAAE,CAAC,EAAoC;IAElD,IAAI,SAAS,KAAK,uBAAuB,EAAE,CAAC;QACxC,OAAO,MAAM,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,SAAS,KAAK,kBAAkB,EAAE,CAAC;QACnC,OAAO,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAZD,wDAYC"}
|
package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description: string;
|
|
6
|
+
action: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const properties: INodeProperties[];
|
|
9
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<{
|
|
10
|
+
success: false;
|
|
11
|
+
error: string;
|
|
12
|
+
status?: number | undefined;
|
|
13
|
+
metadata?: Record<string, unknown> | undefined;
|
|
14
|
+
} | {
|
|
15
|
+
success: boolean;
|
|
16
|
+
error: string;
|
|
17
|
+
metadata: {
|
|
18
|
+
taskId: string;
|
|
19
|
+
};
|
|
20
|
+
data?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
success: boolean;
|
|
23
|
+
data: unknown;
|
|
24
|
+
error?: undefined;
|
|
25
|
+
metadata?: undefined;
|
|
26
|
+
}>;
|
package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execute = exports.properties = exports.description = void 0;
|
|
4
|
+
const transport_1 = require("../../../transport");
|
|
5
|
+
const commons_1 = require("../../../commons");
|
|
6
|
+
const task_1 = require("../../../commons/task");
|
|
7
|
+
exports.description = {
|
|
8
|
+
name: 'Create Or Update Objects Task',
|
|
9
|
+
value: 'createOrUpdateObjects',
|
|
10
|
+
description: 'Sync data between ERP and Lime CRM',
|
|
11
|
+
action: 'Create or Update Objects',
|
|
12
|
+
};
|
|
13
|
+
exports.properties = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Data',
|
|
16
|
+
name: 'data',
|
|
17
|
+
type: 'json',
|
|
18
|
+
default: '',
|
|
19
|
+
description: 'Provide payload',
|
|
20
|
+
displayOptions: {
|
|
21
|
+
show: {
|
|
22
|
+
resource: [commons_1.ERP_CONNECTOR_RESOURCE],
|
|
23
|
+
operation: ['createOrUpdateObjects'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Poll Interval',
|
|
29
|
+
name: 'pollInterval',
|
|
30
|
+
type: 'number',
|
|
31
|
+
default: 2,
|
|
32
|
+
description: 'Seconds between polls',
|
|
33
|
+
displayOptions: {
|
|
34
|
+
show: {
|
|
35
|
+
resource: [commons_1.ERP_CONNECTOR_RESOURCE],
|
|
36
|
+
operation: ['createOrUpdateObjects'],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Timeout',
|
|
42
|
+
name: 'timeout',
|
|
43
|
+
type: 'number',
|
|
44
|
+
default: 60,
|
|
45
|
+
description: 'Max total wait time in seconds',
|
|
46
|
+
displayOptions: {
|
|
47
|
+
show: {
|
|
48
|
+
resource: [commons_1.ERP_CONNECTOR_RESOURCE],
|
|
49
|
+
operation: ['createOrUpdateObjects'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
async function execute(i) {
|
|
55
|
+
const data = this.getNodeParameter('data', i);
|
|
56
|
+
const pollInterval = this.getNodeParameter('pollInterval', i) * 1000;
|
|
57
|
+
const timeout = this.getNodeParameter('timeout', i) * 1000;
|
|
58
|
+
const response = await (0, transport_1.startCreateOrUpdateObjectsTask)(this, data);
|
|
59
|
+
if (!response.success)
|
|
60
|
+
return response;
|
|
61
|
+
const taskId = response.data.id;
|
|
62
|
+
return await (0, task_1.waitForTaskCompletion)(this, taskId, pollInterval, timeout);
|
|
63
|
+
}
|
|
64
|
+
exports.execute = execute;
|
|
65
|
+
//# sourceMappingURL=createOrUpdateObjects.operation.js.map
|
package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOrUpdateObjects.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts"],"names":[],"mappings":";;;AAEA,kDAAoE;AACpE,8CAA0D;AAE1D,gDAA8D;AAEjD,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,+BAA+B;IACrC,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,oCAAoC;IACjD,MAAM,EAAE,0BAA0B;CACrC,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,iBAAiB;QAC9B,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,gCAAsB,CAAC;gBAClC,SAAS,EAAE,CAAC,uBAAuB,CAAC;aACvC;SACJ;KACJ;IACD;QACI,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,uBAAuB;QACpC,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,gCAAsB,CAAC;gBAClC,SAAS,EAAE,CAAC,uBAAuB,CAAC;aACvC;SACJ;KACJ;IACD;QACI,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,gCAAgC;QAC7C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,gCAAsB,CAAC;gBAClC,SAAS,EAAE,CAAC,uBAAuB,CAAC;aACvC;SACJ;KACJ;CACJ,CAAC;AAEK,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAgB,CAAC;IAC7D,MAAM,YAAY,GACb,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAY,GAAG,IAAI,CAAC;IAChE,MAAM,OAAO,GAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAY,GAAG,IAAI,CAAC;IAEvE,MAAM,QAAQ,GAAG,MAAM,IAAA,0CAA8B,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAElE,IAAI,CAAC,QAAQ,CAAC,OAAO;QAAE,OAAO,QAAQ,CAAC;IAEvC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IAChC,OAAO,MAAM,IAAA,4BAAqB,EAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAC5E,CAAC;AAZD,0BAYC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description: string;
|
|
6
|
+
action: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const properties: INodeProperties[];
|
|
9
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<import("../transform").LimeCrmData>;
|