@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,62 @@
|
|
|
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 invoiceParameters_1 = require("../invoiceParameters");
|
|
6
|
+
exports.description = {
|
|
7
|
+
name: 'Update',
|
|
8
|
+
value: 'update',
|
|
9
|
+
description: 'Update the invoice',
|
|
10
|
+
action: 'Update the document',
|
|
11
|
+
};
|
|
12
|
+
exports.properties = [
|
|
13
|
+
{
|
|
14
|
+
displayName: 'Document Number',
|
|
15
|
+
name: 'documentNumber',
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: true,
|
|
18
|
+
default: '',
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: {
|
|
21
|
+
resource: ['invoice'],
|
|
22
|
+
operation: ['update'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Add Parameters',
|
|
28
|
+
name: 'createParameters',
|
|
29
|
+
type: 'collection',
|
|
30
|
+
placeholder: 'Add Parameter',
|
|
31
|
+
default: {},
|
|
32
|
+
displayOptions: {
|
|
33
|
+
show: {
|
|
34
|
+
resource: ['invoice'],
|
|
35
|
+
operation: ['update'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
options: invoiceParameters_1.invoiceParameters,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
async function execute(i) {
|
|
42
|
+
const documentNumber = this.getNodeParameter('documentNumber', i, {});
|
|
43
|
+
const updateParameters = this.getNodeParameter('invoiceParameters', i, {});
|
|
44
|
+
const body = {
|
|
45
|
+
Invoice: {},
|
|
46
|
+
};
|
|
47
|
+
if (updateParameters) {
|
|
48
|
+
for (const [key, value] of Object.entries(updateParameters)) {
|
|
49
|
+
if (value !== '' && value !== undefined && value !== null) {
|
|
50
|
+
body['Invoice'][key] = value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const endpoint = `invoices/${encodeURIComponent(documentNumber)}`;
|
|
55
|
+
return await (0, transport_1.apiRequest)(this, {
|
|
56
|
+
method: 'PUT',
|
|
57
|
+
endpoint: endpoint,
|
|
58
|
+
body: body,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.execute = execute;
|
|
62
|
+
//# sourceMappingURL=update.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/invoice/operations/update.operation.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAEhD,4DAAyD;AAG5C,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,oBAAoB;IACjC,MAAM,EAAE,qBAAqB;CAChC,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACxB;SACJ;KACJ;IACD;QACI,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACxB;SACJ;QACD,OAAO,EAAE,qCAAiB;KAC7B;CACJ,CAAC;AAEK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CACxC,gBAAgB,EAChB,CAAC,EACD,EAAE,CACK,CAAC;IACZ,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3E,MAAM,IAAI,GAAgB;QACtB,OAAO,EAAE,EAAE;KACd,CAAC;IAEF,IAAI,gBAAgB,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1D,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACvD,IAAI,CAAC,SAAS,CAAiB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAClD,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,YAAY,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC;IAElE,OAAO,MAAM,IAAA,sBAAU,EAAwB,IAAI,EAAE;QACjD,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;KACb,CAAC,CAAC;AACP,CAAC;AA9BD,0BA8BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function translateErrorCode(errorCode: number): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translateErrorCode = void 0;
|
|
4
|
+
const errorMessages = {
|
|
5
|
+
1000003: 'System exception: Something went wrong on our end, please contact our support',
|
|
6
|
+
1000030: 'Invalid response type: The provided response type(Accept) was invalid.',
|
|
7
|
+
1000031: 'Invalid content type: The provided content type was invalid.',
|
|
8
|
+
2000106: 'The value needs to be alphanumeric.',
|
|
9
|
+
2000108: 'The value needs to be numeric.',
|
|
10
|
+
2000134: 'The value needs to be boolean',
|
|
11
|
+
2000310: 'The Client-Secret or the Access-Token is either missing or is incorrect.',
|
|
12
|
+
2000311: 'The Client-Secret or the Access-Token is either missing or is incorrect.',
|
|
13
|
+
2000359: 'The value contains invalid characters.',
|
|
14
|
+
2000588: 'A parameter is invalid. Read more about parameters in the Parameters page.',
|
|
15
|
+
2000637: 'Customer number 1 is/has already been used and is reserved even if it has been deleted.',
|
|
16
|
+
2000729: 'A valid identifier was not provided.',
|
|
17
|
+
2001103: 'The requested Fortnox account does not have a license to use the API.',
|
|
18
|
+
2001392: 'The request body was empty or contained incorrect data.',
|
|
19
|
+
2001740: 'The XML object contained an error.',
|
|
20
|
+
2002115: 'The JSON object contained an error.',
|
|
21
|
+
2001304: 'Could not find Account used in the request/attached to an element.',
|
|
22
|
+
2001399: 'Invalid Field name',
|
|
23
|
+
2001101: 'There is no active licens for the desired scope.',
|
|
24
|
+
2000663: 'No access to the current scope.',
|
|
25
|
+
2003095: 'Account is missing for Purchase SE reversed tax liability, in predefined accounts.',
|
|
26
|
+
2000755: 'Supplier invoice debit and credit does not balance',
|
|
27
|
+
2003115: 'Tax Rows for VAT type REVERSE must be marked with CODE',
|
|
28
|
+
2003124: 'Only order that has been delivered can be marked as warehouseready',
|
|
29
|
+
2003125: 'A document that has been set to warehouseready can not be modified.',
|
|
30
|
+
2003126: 'Delviered date can not be later than todays date.',
|
|
31
|
+
2003241: 'Migration has allready been started or finished.',
|
|
32
|
+
2003275: 'Not authorized',
|
|
33
|
+
2003277: 'Was not found in the warehouse module.',
|
|
34
|
+
2003399: 'The document is voided in the warehouse module',
|
|
35
|
+
2003127: 'An error has occured in the warehouse module',
|
|
36
|
+
2000204: 'The customer in the request is not available in the customer resource.',
|
|
37
|
+
2000433: 'The customer in the request is not available in the customer resource.',
|
|
38
|
+
2001302: 'Could not find article used in request',
|
|
39
|
+
2000428: 'Could not find article used in request',
|
|
40
|
+
2000865: 'An incorrect sort field has been used.',
|
|
41
|
+
2000587: 'An invalid filter has been used.',
|
|
42
|
+
2001422: 'Invalid currency.',
|
|
43
|
+
2004195: 'VAT number must be entered for selected VAT type.',
|
|
44
|
+
2004194: 'Invalid VAT number.',
|
|
45
|
+
2001314: 'Invalid cost center.',
|
|
46
|
+
};
|
|
47
|
+
function translateErrorCode(errorCode) {
|
|
48
|
+
return errorMessages[errorCode] || 'Unknown error code';
|
|
49
|
+
}
|
|
50
|
+
exports.translateErrorCode = translateErrorCode;
|
|
51
|
+
//# sourceMappingURL=errorCodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorCodes.js","sourceRoot":"","sources":["../../../../nodes/fortnox/transport/errorCodes.ts"],"names":[],"mappings":";;;AAEA,MAAM,aAAa,GAA8B;IAC7C,OAAO,EACH,+EAA+E;IACnF,OAAO,EACH,wEAAwE;IAC5E,OAAO,EAAE,8DAA8D;IACvE,OAAO,EAAE,qCAAqC;IAC9C,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,+BAA+B;IACxC,OAAO,EACH,0EAA0E;IAC9E,OAAO,EACH,0EAA0E;IAC9E,OAAO,EAAE,wCAAwC;IACjD,OAAO,EACH,4EAA4E;IAChF,OAAO,EACH,yFAAyF;IAC7F,OAAO,EAAE,sCAAsC;IAC/C,OAAO,EACH,uEAAuE;IAC3E,OAAO,EAAE,yDAAyD;IAClE,OAAO,EAAE,oCAAoC;IAC7C,OAAO,EAAE,qCAAqC;IAC9C,OAAO,EACH,oEAAoE;IACxE,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EACH,oFAAoF;IACxF,OAAO,EAAE,oDAAoD;IAC7D,OAAO,EAAE,wDAAwD;IACjE,OAAO,EACH,oEAAoE;IACxE,OAAO,EACH,qEAAqE;IACzE,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,8CAA8C;IACvD,OAAO,EACH,wEAAwE;IAC5E,OAAO,EACH,wEAAwE;IAC5E,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,wCAAwC;IACjD,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,sBAAsB;CAClC,CAAC;AAEF,SAAgB,kBAAkB,CAAC,SAAiB;IAChD,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,oBAAoB,CAAC;AAC5D,CAAC;AAFD,gDAEC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IExecuteFunctions, ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
|
|
2
|
+
import { NodeResponse } from '../../nodeResponse';
|
|
3
|
+
export declare const FORTNOX_BASE_URL = "https://api.fortnox.se/3/";
|
|
4
|
+
export declare function apiRequest<T>(nodeContext: IExecuteFunctions | ILoadOptionsFunctions, options: IDataObject): Promise<NodeResponse<T>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiRequest = exports.FORTNOX_BASE_URL = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const errorCodes_1 = require("./errorCodes");
|
|
6
|
+
const commons_1 = require("../commons");
|
|
7
|
+
exports.FORTNOX_BASE_URL = 'https://api.fortnox.se/3/';
|
|
8
|
+
async function apiRequest(nodeContext, options) {
|
|
9
|
+
var _a;
|
|
10
|
+
const endpoint = options.endpoint;
|
|
11
|
+
const method = options.method;
|
|
12
|
+
const credentials = await nodeContext.getCredentials(commons_1.FORTNOX_API_CREDENTIAL_KEY);
|
|
13
|
+
const requestOptions = {
|
|
14
|
+
method: method,
|
|
15
|
+
uri: `${exports.FORTNOX_BASE_URL}${endpoint}`,
|
|
16
|
+
json: true,
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${credentials.token}`,
|
|
19
|
+
Accept: 'application/json',
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
if (options.qs && Object.keys(options.qs).length > 0) {
|
|
24
|
+
requestOptions.qs = options.qs;
|
|
25
|
+
}
|
|
26
|
+
if (options.body) {
|
|
27
|
+
requestOptions.body = options.body;
|
|
28
|
+
}
|
|
29
|
+
if (options.timeout) {
|
|
30
|
+
requestOptions.timeout = options.timeout;
|
|
31
|
+
}
|
|
32
|
+
const fullUrl = `${requestOptions.uri}${requestOptions.qs ? '?' + new URLSearchParams(requestOptions.qs).toString() : ''}`;
|
|
33
|
+
n8n_workflow_1.LoggerProxy.info(`URL: ${fullUrl}`);
|
|
34
|
+
try {
|
|
35
|
+
const response = await nodeContext.helpers.request.call(nodeContext, commons_1.FORTNOX_API_CREDENTIAL_KEY, requestOptions);
|
|
36
|
+
return {
|
|
37
|
+
success: true,
|
|
38
|
+
data: response,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const errorResponse = error.error || {};
|
|
43
|
+
const errorInformation = (errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.ErrorInformation) && {
|
|
44
|
+
error: errorResponse.ErrorInformation.error ||
|
|
45
|
+
errorResponse.ErrorInformation.Error,
|
|
46
|
+
message: errorResponse.ErrorInformation.message ||
|
|
47
|
+
errorResponse.ErrorInformation.Message,
|
|
48
|
+
code: errorResponse.ErrorInformation.code ||
|
|
49
|
+
errorResponse.ErrorInformation.Code,
|
|
50
|
+
};
|
|
51
|
+
let message;
|
|
52
|
+
if (errorInformation) {
|
|
53
|
+
message = `API request failed [URL: ${fullUrl}][Method: ${method}]\n
|
|
54
|
+
[Error Information:\n
|
|
55
|
+
- Error: ${errorInformation.error || 'Unknown error'}\n
|
|
56
|
+
- Message: ${errorInformation.message || 'No message provided'}\n
|
|
57
|
+
- Code: ${errorInformation.code || 'No code provided'}\n
|
|
58
|
+
- Code Translation: ${(0, errorCodes_1.translateErrorCode)(errorInformation.code) || 'No translation available'}\n
|
|
59
|
+
]`;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
message = `API request failed [URL: ${fullUrl}][Method: ${method}]: ${error.message}`;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
error: message,
|
|
67
|
+
status: (_a = error === null || error === void 0 ? void 0 : error.cause) === null || _a === void 0 ? void 0 : _a.status,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.apiRequest = apiRequest;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/fortnox/transport/index.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AACtB,6CAAkD;AAElD,wCAAwD;AAG3C,QAAA,gBAAgB,GAAG,2BAA2B,CAAC;AAErD,KAAK,UAAU,UAAU,CAC5B,WAAsD,EACtD,OAAoB;;IAEpB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAA6B,CAAC;IACrD,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,cAAc,CAChD,oCAA0B,CAC7B,CAAC;IAEF,MAAM,cAAc,GAAoB;QACpC,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,GAAG,wBAAgB,GAAG,QAAQ,EAAE;QACrC,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;YACL,aAAa,EAAE,UAAU,WAAW,CAAC,KAAK,EAAE;YAC5C,MAAM,EAAE,kBAAkB;YAC1B,cAAc,EAAE,kBAAkB;SACrC;KACJ,CAAC;IAEF,IAAI,OAAO,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnD,cAAc,CA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C;QACpB,IAAI,gBAAgB,EAAE,CAAC;YACnB,OAAO,GAAG,4BAA4B,OAAO,aAAa,MAAM;;+BAE7C,gBAAgB,CAAC,KAAK,IAAI,eAAe;iCACvC,gBAAgB,CAAC,OAAO,IAAI,qBAAqB;8BACpD,gBAAgB,CAAC,IAAI,IAAI,kBAAkB;0CAC/B,IAAA,+BAAkB,EAAC,gBAAgB,CAAC,IAAc,CAAC,IAAI,0BAA0B;kBACzG,CAAC;QACX,CAAC;aAAM,CAAC;YACJ,OAAO,GAAG,4BAA4B,OAAO,aAAa,MAAM,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QAC1F,CAAC;QACD,OAAO;YACH,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,0CAAE,MAAM;SAC/B,CAAC;IACN,CAAC;AACL,CAAC;AAlFD,gCAkFC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.limeCrm",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["CRM"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://lime-crm.com/api-docs/"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://lime-crm.com/api-docs/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getEntitiesForErpSystem, getLimeTypeProperties, getLimeTypes } from './methods';
|
|
3
|
+
export declare class LimeCrmNode implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getEntitiesForErpSystem: typeof getEntitiesForErpSystem;
|
|
8
|
+
getLimeTypes: typeof getLimeTypes;
|
|
9
|
+
getLimeTypeProperties: typeof getLimeTypeProperties;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
13
|
+
}
|
|
14
|
+
export { LimeCrmTrigger } from './LimeCrmTrigger.node';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LimeCrmTrigger = exports.LimeCrmNode = void 0;
|
|
4
|
+
const erpConnector_1 = require("./resources/erpConnector");
|
|
5
|
+
const limeType_1 = require("./resources/limeType");
|
|
6
|
+
const limeObject_1 = require("./resources/limeObject");
|
|
7
|
+
const commons_1 = require("./commons");
|
|
8
|
+
const methods_1 = require("./methods");
|
|
9
|
+
class LimeCrmNode {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Lime CRM',
|
|
13
|
+
name: 'limeCrm',
|
|
14
|
+
icon: 'file:assets/lime-crm.svg',
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
18
|
+
description: 'Consume the Lime CRM API',
|
|
19
|
+
defaults: {
|
|
20
|
+
name: 'Lime CRM',
|
|
21
|
+
},
|
|
22
|
+
inputs: ["main"],
|
|
23
|
+
outputs: ["main"],
|
|
24
|
+
credentials: [
|
|
25
|
+
{
|
|
26
|
+
name: commons_1.LIME_CRM_API_CREDENTIAL_KEY,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
properties: [
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Resource',
|
|
33
|
+
name: 'resource',
|
|
34
|
+
type: 'options',
|
|
35
|
+
noDataExpression: true,
|
|
36
|
+
options: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Lime Type',
|
|
39
|
+
value: commons_1.LIMETYPE_RESOURCE,
|
|
40
|
+
description: 'Work with entity type definitions',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Lime Object',
|
|
44
|
+
value: commons_1.LIMEOBJECT_RESOURCE,
|
|
45
|
+
description: 'Work with actual data records',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'ERP Connector',
|
|
49
|
+
value: commons_1.ERP_CONNECTOR_RESOURCE,
|
|
50
|
+
description: 'Integrate data between ERP and Lime CRM',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
default: commons_1.LIMEOBJECT_RESOURCE,
|
|
54
|
+
},
|
|
55
|
+
...limeType_1.limeTypeFields,
|
|
56
|
+
...limeObject_1.limeObjectFields,
|
|
57
|
+
...erpConnector_1.erpConnectorFields,
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
this.methods = {
|
|
61
|
+
loadOptions: {
|
|
62
|
+
getEntitiesForErpSystem: methods_1.getEntitiesForErpSystem,
|
|
63
|
+
getLimeTypes: methods_1.getLimeTypes,
|
|
64
|
+
getLimeTypeProperties: methods_1.getLimeTypeProperties,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async execute() {
|
|
69
|
+
const items = this.getInputData();
|
|
70
|
+
const returnData = [];
|
|
71
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
72
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
73
|
+
for (let i = 0; i < items.length; i++) {
|
|
74
|
+
let responseData;
|
|
75
|
+
try {
|
|
76
|
+
if (resource === commons_1.LIMETYPE_RESOURCE) {
|
|
77
|
+
responseData = await limeType_1.limeTypeOperations.call(this, {
|
|
78
|
+
operation,
|
|
79
|
+
i,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else if (resource === commons_1.LIMEOBJECT_RESOURCE) {
|
|
83
|
+
responseData = await limeObject_1.limeObjectOperations.call(this, {
|
|
84
|
+
operation,
|
|
85
|
+
i,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else if (resource === commons_1.ERP_CONNECTOR_RESOURCE) {
|
|
89
|
+
responseData = await erpConnector_1.erpConnectorOperations.call(this, {
|
|
90
|
+
operation,
|
|
91
|
+
i,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
returnData.push({ json: responseData });
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
if (this.continueOnFail()) {
|
|
98
|
+
returnData.push({
|
|
99
|
+
error: error.message,
|
|
100
|
+
json: { error: error.message },
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.LimeCrmNode = LimeCrmNode;
|
|
111
|
+
var LimeCrmTrigger_node_1 = require("./LimeCrmTrigger.node");
|
|
112
|
+
Object.defineProperty(exports, "LimeCrmTrigger", { enumerable: true, get: function () { return LimeCrmTrigger_node_1.LimeCrmTrigger; } });
|
|
113
|
+
//# sourceMappingURL=LimeCrmNode.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LimeCrmNode.node.js","sourceRoot":"","sources":["../../../nodes/lime-crm/LimeCrmNode.node.ts"],"names":[],"mappings":";;;AAUA,2DAGkC;AAClC,mDAA0E;AAC1E,uDAAgF;AAEhF,uCAKmB;AAEnB,uCAImB;AAEnB,MAAa,WAAW;IAAxB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAA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ions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
import { getLimeTypes } from './methods';
|
|
3
|
+
export declare class LimeCrmTrigger implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getLimeTypes: typeof getLimeTypes;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
webhookMethods: {
|
|
11
|
+
default: {
|
|
12
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
13
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
14
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LimeCrmTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const commons_1 = require("./commons");
|
|
6
|
+
const methods_1 = require("./methods");
|
|
7
|
+
const transport_1 = require("./transport");
|
|
8
|
+
class LimeCrmTrigger {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'Lime CRM Trigger',
|
|
12
|
+
name: 'limeCrmTrigger',
|
|
13
|
+
icon: 'file:assets/lime-crm.svg',
|
|
14
|
+
group: ['trigger'],
|
|
15
|
+
version: 1,
|
|
16
|
+
description: 'Trigger which handles webhooks coming from Lime, e.g when ' +
|
|
17
|
+
'LimeObject is updated',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Lime CRM Trigger',
|
|
20
|
+
},
|
|
21
|
+
inputs: [],
|
|
22
|
+
outputs: ["main"],
|
|
23
|
+
credentials: [
|
|
24
|
+
{
|
|
25
|
+
name: commons_1.LIME_CRM_API_CREDENTIAL_KEY,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
webhooks: [
|
|
30
|
+
{
|
|
31
|
+
name: 'default',
|
|
32
|
+
httpMethod: 'POST',
|
|
33
|
+
responseMode: 'onReceived',
|
|
34
|
+
path: 'webhook',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Events',
|
|
40
|
+
name: 'events',
|
|
41
|
+
type: 'fixedCollection',
|
|
42
|
+
typeOptions: {
|
|
43
|
+
multipleValues: true,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
default: {},
|
|
47
|
+
placeholder: 'Add Event',
|
|
48
|
+
description: 'Events to subscribe to',
|
|
49
|
+
options: [
|
|
50
|
+
{
|
|
51
|
+
name: 'event',
|
|
52
|
+
displayName: 'Event',
|
|
53
|
+
values: [
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Lime Type',
|
|
56
|
+
name: 'limeType',
|
|
57
|
+
type: 'options',
|
|
58
|
+
typeOptions: {
|
|
59
|
+
loadOptionsMethod: 'getLimeTypes',
|
|
60
|
+
},
|
|
61
|
+
default: '',
|
|
62
|
+
description: 'Lime Type to subscribe to events for',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Event Type',
|
|
66
|
+
name: 'eventType',
|
|
67
|
+
type: 'options',
|
|
68
|
+
options: [
|
|
69
|
+
{
|
|
70
|
+
name: 'New',
|
|
71
|
+
value: 'new',
|
|
72
|
+
description: 'When a new record is created',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Update',
|
|
76
|
+
value: 'update',
|
|
77
|
+
description: 'When a record is updated',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'Delete',
|
|
81
|
+
value: 'delete',
|
|
82
|
+
description: 'When a record is deleted',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
default: 'new',
|
|
86
|
+
description: 'Type of event to subscribe to',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Name',
|
|
94
|
+
name: 'name',
|
|
95
|
+
type: 'string',
|
|
96
|
+
default: '',
|
|
97
|
+
placeholder: 'my-lime-webhook',
|
|
98
|
+
required: true,
|
|
99
|
+
description: 'Name for this webhook subscription',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
};
|
|
103
|
+
this.methods = {
|
|
104
|
+
loadOptions: {
|
|
105
|
+
getLimeTypes: methods_1.getLimeTypes,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
this.webhookMethods = {
|
|
109
|
+
default: {
|
|
110
|
+
async checkExists() {
|
|
111
|
+
const webhook = (0, commons_1.getWebhook)(this);
|
|
112
|
+
if (!webhook.data.webhookId) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
const response = await (0, transport_1.getSubscription)(this, webhook);
|
|
116
|
+
if (!response.success) {
|
|
117
|
+
if (response.status === 404) {
|
|
118
|
+
delete webhook.data.webhookId;
|
|
119
|
+
delete webhook.data.webhookEvents;
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
n8n_workflow_1.LoggerProxy.warn(`There was en error while getting a webhook from Lime CRM: ${response.error}`);
|
|
123
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), response.error);
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
},
|
|
127
|
+
async create() {
|
|
128
|
+
const webhook = (0, commons_1.getWebhook)(this);
|
|
129
|
+
const webhookUrl = webhook.url;
|
|
130
|
+
if (!webhookUrl) {
|
|
131
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid Webhook URL. Please make sure that it is not localhost!');
|
|
132
|
+
}
|
|
133
|
+
const existingSubscriptionResponse = await (0, transport_1.listSubscriptionsWithExistingData)(this, webhook);
|
|
134
|
+
if (!existingSubscriptionResponse.success) {
|
|
135
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), existingSubscriptionResponse.error);
|
|
136
|
+
}
|
|
137
|
+
if (existingSubscriptionResponse.data.length === 0) {
|
|
138
|
+
const createSubscriptionResponse = await (0, transport_1.createSubscription)(this, webhook);
|
|
139
|
+
if (!createSubscriptionResponse.success) {
|
|
140
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), createSubscriptionResponse.error);
|
|
141
|
+
}
|
|
142
|
+
const subscriptionId = createSubscriptionResponse.data.id;
|
|
143
|
+
const events = createSubscriptionResponse.data.events;
|
|
144
|
+
webhook.data.webhookId = subscriptionId;
|
|
145
|
+
webhook.data.webhookEvents = events;
|
|
146
|
+
n8n_workflow_1.LoggerProxy.info(`Webhook with URL ${webhook.url}, ID ${subscriptionId} and events ${events} created!`);
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const limeWebhook = existingSubscriptionResponse.data[0];
|
|
151
|
+
webhook.data.webhookId = limeWebhook.id;
|
|
152
|
+
webhook.data.webhookEvents = limeWebhook.events;
|
|
153
|
+
n8n_workflow_1.LoggerProxy.info(`Webhook with URL ${webhook.url}, and events ${webhook.events} exists in Lime.
|
|
154
|
+
ID ${limeWebhook.id} set up to the N8N data.`);
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
async delete() {
|
|
159
|
+
const webhook = (0, commons_1.getWebhook)(this);
|
|
160
|
+
n8n_workflow_1.LoggerProxy.info(`Deleting webhook with ID: ${webhook.data.webhookId}`, { ...webhook });
|
|
161
|
+
if (webhook.data.webhookId !== undefined) {
|
|
162
|
+
const response = await (0, transport_1.deleteSubscription)(this, webhook);
|
|
163
|
+
if (!response.success) {
|
|
164
|
+
n8n_workflow_1.LoggerProxy.error(`Failed to delete webhook with ID: ${webhook.data.webhookId}`, {
|
|
165
|
+
...webhook,
|
|
166
|
+
});
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
delete webhook.data.webhookId;
|
|
170
|
+
n8n_workflow_1.LoggerProxy.info('Webhook deleted successfully', { ...webhook });
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
async webhook() {
|
|
179
|
+
const webhook = (0, commons_1.getWebhook)(this);
|
|
180
|
+
n8n_workflow_1.LoggerProxy.info('Webhook received. Starting webhook processing...', {
|
|
181
|
+
...webhook.context,
|
|
182
|
+
});
|
|
183
|
+
const bodyData = this.getBodyData();
|
|
184
|
+
if (!bodyData || !bodyData.event || !bodyData.body) {
|
|
185
|
+
n8n_workflow_1.LoggerProxy.warn('Webhook data is invalid. Missing event or body', {
|
|
186
|
+
...webhook.context,
|
|
187
|
+
});
|
|
188
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Webhook data is invalid');
|
|
189
|
+
}
|
|
190
|
+
const returnData = [];
|
|
191
|
+
returnData.push({
|
|
192
|
+
body: bodyData,
|
|
193
|
+
headers: this.getHeaderData(),
|
|
194
|
+
query: this.getQueryData(),
|
|
195
|
+
});
|
|
196
|
+
return { workflowData: [this.helpers.returnJsonArray(returnData)] };
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.LimeCrmTrigger = LimeCrmTrigger;
|
|
200
|
+
//# sourceMappingURL=LimeCrmTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LimeCrmTrigger.node.js","sourceRoot":"","sources":["../../../nodes/lime-crm/LimeCrmTrigger.node.ts"],"names":[],"mappings":";;;AAAA,+CAUsB;AAEtB,uCAAoE;AACpE,uCAAyC;AACzC,2CAKqB;AAErB,MAAa,cAAc;IAA3B;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,CAAC,SAAS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AAI,CAAC,CAAC;QACjC,0BAAM,CAAC,IAAI,CAAC,kDAAkD,EAAE;YAC5D,GAAG,OAAO,CAAC,OAAO;SACrB,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEpC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACjD,0BAAM,CAAC,IAAI,CAAC,gDAAgD,EAAE;gBAC1D,GAAG,OAAO,CAAC,OAAO;aACrB,CAAC,CAAC;YACH,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,yBAAyB,CAC5B,CAAC;QACN,CAAC;QAED,MAAM,UAAU,GAAkB,EAAE,CAAC;QAErC,UAAU,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;YAC7B,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE;SAC7B,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC;CACJ;AAjPD,wCAiPC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERP_CONNECTOR_RESOURCE = exports.LIMETYPE_RESOURCE = exports.LIMEOBJECT_RESOURCE = exports.LIME_CRM_API_CREDENTIAL_KEY = void 0;
|
|
4
|
+
exports.LIME_CRM_API_CREDENTIAL_KEY = 'limeCrmApi';
|
|
5
|
+
exports.LIMEOBJECT_RESOURCE = 'limeObject';
|
|
6
|
+
exports.LIMETYPE_RESOURCE = 'limeType';
|
|
7
|
+
exports.ERP_CONNECTOR_RESOURCE = 'erpConnector';
|
|
8
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/commons/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAI3C,QAAA,mBAAmB,GAAG,YAAY,CAAC;AACnC,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAC/B,QAAA,sBAAsB,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWebhook = exports.ERP_CONNECTOR_RESOURCE = exports.LIMETYPE_RESOURCE = exports.LIMEOBJECT_RESOURCE = exports.LIME_CRM_API_CREDENTIAL_KEY = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
Object.defineProperty(exports, "LIME_CRM_API_CREDENTIAL_KEY", { enumerable: true, get: function () { return constants_1.LIME_CRM_API_CREDENTIAL_KEY; } });
|
|
6
|
+
Object.defineProperty(exports, "LIMEOBJECT_RESOURCE", { enumerable: true, get: function () { return constants_1.LIMEOBJECT_RESOURCE; } });
|
|
7
|
+
Object.defineProperty(exports, "LIMETYPE_RESOURCE", { enumerable: true, get: function () { return constants_1.LIMETYPE_RESOURCE; } });
|
|
8
|
+
Object.defineProperty(exports, "ERP_CONNECTOR_RESOURCE", { enumerable: true, get: function () { return constants_1.ERP_CONNECTOR_RESOURCE; } });
|
|
9
|
+
var webhook_1 = require("./webhook");
|
|
10
|
+
Object.defineProperty(exports, "getWebhook", { enumerable: true, get: function () { return webhook_1.getWebhook; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/commons/index.ts"],"names":[],"mappings":";;;AAAA,yCAKqB;AAJjB,wHAAA,2BAA2B,OAAA;AAC3B,gHAAA,mBAAmB,OAAA;AACnB,8GAAA,iBAAiB,OAAA;AACjB,mHAAA,sBAAsB,OAAA;AAE1B,qCAAgD;AAA9B,qGAAA,UAAU,OAAA"}
|