@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,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execute = exports.properties = exports.updateProperties = exports.description = void 0;
|
|
4
|
+
const transport_1 = require("../../../transport");
|
|
5
|
+
const currency_codes_1 = require("currency-codes");
|
|
6
|
+
exports.description = {
|
|
7
|
+
name: 'Update Customer',
|
|
8
|
+
value: 'update',
|
|
9
|
+
description: 'Update an existing customer',
|
|
10
|
+
action: 'Update a customer',
|
|
11
|
+
};
|
|
12
|
+
exports.updateProperties = [
|
|
13
|
+
{
|
|
14
|
+
displayName: 'Name',
|
|
15
|
+
name: 'Name',
|
|
16
|
+
type: 'string',
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'Customer name',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Active',
|
|
22
|
+
name: 'Active',
|
|
23
|
+
type: 'boolean',
|
|
24
|
+
default: true,
|
|
25
|
+
description: 'Whether the customer is active',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Address 1',
|
|
29
|
+
name: 'Address1',
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: '',
|
|
32
|
+
description: "Customer's primary address",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Address 2',
|
|
36
|
+
name: 'Address2',
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: '',
|
|
39
|
+
description: "Customer's secondary address",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'City',
|
|
43
|
+
name: 'City',
|
|
44
|
+
type: 'string',
|
|
45
|
+
default: '',
|
|
46
|
+
description: "Customer's city",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Comments',
|
|
50
|
+
name: 'Comments',
|
|
51
|
+
type: 'string',
|
|
52
|
+
default: '',
|
|
53
|
+
description: 'Comments about the customer',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
displayName: 'Currency',
|
|
57
|
+
name: 'Currency',
|
|
58
|
+
type: 'string',
|
|
59
|
+
default: '',
|
|
60
|
+
description: "Customer's currency code, e.g., SEK, EUR",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Cost Center',
|
|
64
|
+
name: 'CostCenter',
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: '',
|
|
67
|
+
description: "Customer's cost center",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Country',
|
|
71
|
+
name: 'Country',
|
|
72
|
+
type: 'string',
|
|
73
|
+
default: '',
|
|
74
|
+
description: "Customer's country",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Country Code',
|
|
78
|
+
name: 'CountryCode',
|
|
79
|
+
type: 'string',
|
|
80
|
+
default: '',
|
|
81
|
+
description: "Customer's country code",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
displayName: 'Email',
|
|
85
|
+
name: 'Email',
|
|
86
|
+
type: 'string',
|
|
87
|
+
default: '',
|
|
88
|
+
description: "Customer's email address",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'External Reference',
|
|
92
|
+
name: 'ExternalReference',
|
|
93
|
+
type: 'string',
|
|
94
|
+
default: '',
|
|
95
|
+
description: 'External reference for the customer',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Fax',
|
|
99
|
+
name: 'Fax',
|
|
100
|
+
type: 'string',
|
|
101
|
+
default: '',
|
|
102
|
+
description: "Customer's fax number",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'GLN',
|
|
106
|
+
name: 'GLN',
|
|
107
|
+
type: 'string',
|
|
108
|
+
default: '',
|
|
109
|
+
description: 'Global Location Number',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
displayName: 'Organisation Number',
|
|
113
|
+
name: 'OrganisationNumber',
|
|
114
|
+
type: 'string',
|
|
115
|
+
default: '',
|
|
116
|
+
description: "Customer's organisation number",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
displayName: 'Phone 1',
|
|
120
|
+
name: 'Phone1',
|
|
121
|
+
type: 'string',
|
|
122
|
+
default: '',
|
|
123
|
+
description: "Customer's primary phone number",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Phone 2',
|
|
127
|
+
name: 'Phone2',
|
|
128
|
+
type: 'string',
|
|
129
|
+
default: '',
|
|
130
|
+
description: "Customer's secondary phone number",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
displayName: 'Type',
|
|
134
|
+
name: 'Type',
|
|
135
|
+
type: 'options',
|
|
136
|
+
options: [
|
|
137
|
+
{
|
|
138
|
+
name: 'Private',
|
|
139
|
+
value: 'PRIVATE',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'Company',
|
|
143
|
+
value: 'COMPANY',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
default: 'COMPANY',
|
|
147
|
+
description: 'Type of customer',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: 'VAT Number',
|
|
151
|
+
name: 'VATNumber',
|
|
152
|
+
type: 'string',
|
|
153
|
+
default: '',
|
|
154
|
+
description: "Customer's VAT number",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
displayName: 'VAT Type',
|
|
158
|
+
name: 'VATType',
|
|
159
|
+
type: 'options',
|
|
160
|
+
options: [
|
|
161
|
+
{
|
|
162
|
+
name: 'SE VAT',
|
|
163
|
+
value: 'SEVAT',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'SE Reversed VAT',
|
|
167
|
+
value: 'SEREVERSEDVAT',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'EU Reversed VAT',
|
|
171
|
+
value: 'EUREVERSEDVAT',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'EU VAT',
|
|
175
|
+
value: 'EUVAT',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'Export',
|
|
179
|
+
value: 'EXPORT',
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
default: 'SEVAT',
|
|
183
|
+
description: 'Type of VAT applied',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
displayName: 'Website',
|
|
187
|
+
name: 'WWW',
|
|
188
|
+
type: 'string',
|
|
189
|
+
default: '',
|
|
190
|
+
description: "Customer's website URL",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
displayName: 'ZIP Code',
|
|
194
|
+
name: 'ZipCode',
|
|
195
|
+
type: 'string',
|
|
196
|
+
default: '',
|
|
197
|
+
description: "Customer's ZIP/postal code",
|
|
198
|
+
},
|
|
199
|
+
];
|
|
200
|
+
exports.properties = [
|
|
201
|
+
{
|
|
202
|
+
displayName: 'Customer Number',
|
|
203
|
+
name: 'customerNumber',
|
|
204
|
+
type: 'string',
|
|
205
|
+
required: true,
|
|
206
|
+
default: '',
|
|
207
|
+
description: 'Unique identifier for customer',
|
|
208
|
+
displayOptions: {
|
|
209
|
+
show: {
|
|
210
|
+
resource: ['customer'],
|
|
211
|
+
operation: ['update'],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
displayName: 'Fields',
|
|
217
|
+
name: 'fields',
|
|
218
|
+
type: 'collection',
|
|
219
|
+
placeholder: 'Add Field',
|
|
220
|
+
default: {},
|
|
221
|
+
displayOptions: {
|
|
222
|
+
show: {
|
|
223
|
+
resource: ['customer'],
|
|
224
|
+
operation: ['update'],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
options: [...exports.updateProperties],
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
async function execute(i) {
|
|
231
|
+
const customerNumber = this.getNodeParameter('customerNumber', i);
|
|
232
|
+
const fields = this.getNodeParameter('fields', i, {});
|
|
233
|
+
if (Object.keys(fields).length === 0) {
|
|
234
|
+
return {
|
|
235
|
+
success: false,
|
|
236
|
+
error: 'At least one field must be provided for update',
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
if (fields.name && fields.name === '') {
|
|
240
|
+
return {
|
|
241
|
+
success: false,
|
|
242
|
+
error: 'Customer name cannot be empty',
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
if (fields.Currency) {
|
|
246
|
+
fields.Currency = String(fields.Currency).toUpperCase();
|
|
247
|
+
if ((0, currency_codes_1.code)(fields.Currency) === undefined) {
|
|
248
|
+
return {
|
|
249
|
+
success: false,
|
|
250
|
+
error: `Invalid currency code: ${fields.Currency}. Use ISO 4217 currency code.`,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const body = {
|
|
255
|
+
Customer: {
|
|
256
|
+
...fields,
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
|
|
260
|
+
return await (0, transport_1.apiRequest)(this, {
|
|
261
|
+
method: 'PUT',
|
|
262
|
+
endpoint: endpoint,
|
|
263
|
+
body: body,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
exports.execute = execute;
|
|
267
|
+
//# sourceMappingURL=update.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/customers/operations/update.operation.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAEhD,mDAAsD;AAGzC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,6BAA6B;IAC1C,MAAM,EAAE,mBAAmB;CAC9B,CAAC;AAEW,QAAA,gBAAgB,GAAsB;IAC/C;QACI,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,eAAe;KAC/B;IACD;QACI,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QA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QACb,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;KACb,CAAC,CAAC;AACP,CAAC;AA5CD,0BA4CC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sortParameters = void 0;
|
|
4
|
+
const sortByDefinitions = [
|
|
5
|
+
['Customer Number', 'customernumber'],
|
|
6
|
+
['Name', 'name'],
|
|
7
|
+
];
|
|
8
|
+
function createSortProperties(parameters) {
|
|
9
|
+
const options = parameters.map(([displayName, fieldName]) => {
|
|
10
|
+
return {
|
|
11
|
+
name: displayName,
|
|
12
|
+
value: fieldName,
|
|
13
|
+
description: `Sort by ${displayName.toLowerCase()}`,
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Sort by',
|
|
19
|
+
name: 'sortby',
|
|
20
|
+
type: 'options',
|
|
21
|
+
noDataExpression: true,
|
|
22
|
+
options: options,
|
|
23
|
+
default: options[0].value,
|
|
24
|
+
placeholder: 'Select a field to sort by',
|
|
25
|
+
description: 'Select a field to sort by',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
exports.sortParameters = createSortProperties(sortByDefinitions);
|
|
30
|
+
//# sourceMappingURL=sortParameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortParameters.js","sourceRoot":"","sources":["../../../../../nodes/fortnox/resources/customers/sortParameters.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAG;IACtB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;IACrC,CAAC,MAAM,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,SAAS,oBAAoB,CAAC,UAAsB;IAChD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE;QACxD,OAAO;YACH,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,WAAW,WAAW,CAAC,WAAW,EAAE,EAAE;SACtD,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO;QACH;YACI,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,SAA8B;YACpC,gBAAgB,EAAE,IAAI;YACtB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK;YACzB,WAAW,EAAE,2BAA2B;YACxC,WAAW,EAAE,2BAA2B;SAC3C;KACJ,CAAC;AACN,CAAC;AAEY,QAAA,cAAc,GACvB,oBAAoB,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterParameters = void 0;
|
|
4
|
+
const commons_1 = require("../../commons");
|
|
5
|
+
const optionParametersDefinitions = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Invoice Status',
|
|
8
|
+
name: 'filter',
|
|
9
|
+
parameters: [
|
|
10
|
+
['Cancelled', 'cancelled'],
|
|
11
|
+
['Fully Paid', 'fullypaid'],
|
|
12
|
+
['Unbooked', 'unbooked'],
|
|
13
|
+
['Unpaid', 'unpaid'],
|
|
14
|
+
['Unpaid And Overdue', 'unpaidoverdue'],
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Invoice Type',
|
|
19
|
+
name: 'InvoiceType',
|
|
20
|
+
parameters: [
|
|
21
|
+
['Invoice', 'invoice'],
|
|
22
|
+
['Agreement Invoice', 'agreementinvoice'],
|
|
23
|
+
['Intrest Invoice', 'intrestinvoice'],
|
|
24
|
+
['Summery Invoice', 'summaryinvoice'],
|
|
25
|
+
['Cash Invoice', 'cashinvoice'],
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
const parametersDefinitions = [
|
|
30
|
+
['Account Number From', 'accountnumberfrom', 'string', '', {}],
|
|
31
|
+
['Account Number To', 'accountnumberto', 'string', '', {}],
|
|
32
|
+
['Article Description', 'articledescription', 'string', '', {}],
|
|
33
|
+
['Article Number', 'articlenumber', 'string', '', {}],
|
|
34
|
+
['Cost Center', 'costcenter', 'string', '', {}],
|
|
35
|
+
['Credit', 'credit', 'string', '', {}],
|
|
36
|
+
['Currency', 'currency', 'string', '', {}],
|
|
37
|
+
['Customer Name', 'customername', 'string', '', {}],
|
|
38
|
+
['Customer Number', 'customernumber', 'string', '', {}],
|
|
39
|
+
['Document Number', 'documentnumber', 'string', '', {}],
|
|
40
|
+
[
|
|
41
|
+
'External Invoice Reference 1',
|
|
42
|
+
'externalinvoicereference1',
|
|
43
|
+
'string',
|
|
44
|
+
'',
|
|
45
|
+
{},
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
'External Invoice Reference 2',
|
|
49
|
+
'externalinvoicereference2',
|
|
50
|
+
'string',
|
|
51
|
+
'',
|
|
52
|
+
{},
|
|
53
|
+
],
|
|
54
|
+
['From Date', 'fromdate', 'string', '', {}],
|
|
55
|
+
['From Final Pay Date', 'fromfinalpaydate', 'string', '', {}],
|
|
56
|
+
['Label', 'label', 'string', '', {}],
|
|
57
|
+
['Last Modified', 'lastmodified', 'string', '', {}],
|
|
58
|
+
['Not Completed', 'notcomplete', 'string', '', {}],
|
|
59
|
+
['OCR', 'ocr', 'string', '', {}],
|
|
60
|
+
['Our Reference', 'ourreference', 'string', '', {}],
|
|
61
|
+
['Project', 'project', 'string', '', {}],
|
|
62
|
+
['Sent', 'sent', 'boolean', false, {}],
|
|
63
|
+
['To Date', 'todate', 'string', '', {}],
|
|
64
|
+
['To Final Pay Date', 'tofinalpaydate', 'string', '', {}],
|
|
65
|
+
['Your Order Number', 'yourordernumber', 'string', '', {}],
|
|
66
|
+
['Your Reference', 'yourreference', 'string', '', {}],
|
|
67
|
+
];
|
|
68
|
+
exports.filterParameters = [
|
|
69
|
+
...optionParametersDefinitions.map((option) => (0, commons_1.createOptionParameter)(option)),
|
|
70
|
+
...parametersDefinitions.map(([displayName, name, filterType, defaultValue, typeOptions]) => (0, commons_1.createParameter)(displayName, name, filterType, defaultValue, typeOptions)),
|
|
71
|
+
];
|
|
72
|
+
//# sourceMappingURL=filterParameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterParameters.js","sourceRoot":"","sources":["../../../../../nodes/fortnox/resources/invoice/filterParameters.ts"],"names":[],"mappings":";;;AACA,2CAKuB;AAEvB,MAAM,2BAA2B,GAAgC;IAC7D;QACI,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,CAAC,WAAW,EAAE,WAAW,CAAC;YAC1B,CAAC,YAAY,EAAE,WAAW,CAAC;YAC3B,CAAC,UAAU,EAAE,UAAU,CAAC;YACxB,CAAC,QAAQ,EAAE,QAAQ,CAAC;YACpB,CAAC,oBAAoB,EAAE,eAAe,CAAC;SAC1C;KACJ;IACD;QACI,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE;YACR,CAAC,SAAS,EAAE,SAAS,CAAC;YACtB,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;YACzC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;YACrC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;YACrC,CAAC,cAAc,EAAE,aAAa,CAAC;SAClC;KACJ;CACJ,CAAC;AAEF,MAAM,qBAAqB,GAA0B;IACjD,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC9D,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC1D,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE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,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACxC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;IACtC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACvC,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACzD,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC1D,CAAC,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;CACxD,CAAC;AAEW,QAAA,gBAAgB,GAAsB;IAC/C,GAAG,2BAA2B,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1C,IAAA,+BAAqB,EAAC,MAAM,CAAC,CAChC;IACD,GAAG,qBAAqB,CAAC,GAAG,CACxB,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,EAAE,CAC3D,IAAA,yBAAe,EACX,WAAW,EACX,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,WAAW,CACd,CACR;CACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const invoiceProperties: INodeProperties[];
|
|
3
|
+
export declare function invoiceOperations(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: true;
|
|
13
|
+
data: import("./model").CreateInvoiceResponse;
|
|
14
|
+
} | {
|
|
15
|
+
success: true;
|
|
16
|
+
data: import("./model").GetInvoiceResponse;
|
|
17
|
+
} | {
|
|
18
|
+
success: true;
|
|
19
|
+
data: import("./model").GetAllInvoicesResponse;
|
|
20
|
+
} | null>;
|
|
@@ -0,0 +1,71 @@
|
|
|
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.invoiceOperations = exports.invoiceProperties = void 0;
|
|
27
|
+
const create = __importStar(require("./operations/create.operation"));
|
|
28
|
+
const get = __importStar(require("./operations/get.operation"));
|
|
29
|
+
const getAll = __importStar(require("./operations/getAll.operation"));
|
|
30
|
+
const update = __importStar(require("./operations/update.operation"));
|
|
31
|
+
exports.invoiceProperties = [
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Operation',
|
|
34
|
+
name: 'operation',
|
|
35
|
+
type: 'options',
|
|
36
|
+
noDataExpression: true,
|
|
37
|
+
displayOptions: {
|
|
38
|
+
show: {
|
|
39
|
+
resource: ['invoice'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
options: [
|
|
43
|
+
create.description,
|
|
44
|
+
get.description,
|
|
45
|
+
getAll.description,
|
|
46
|
+
update.description,
|
|
47
|
+
],
|
|
48
|
+
default: 'getAll',
|
|
49
|
+
},
|
|
50
|
+
...create.properties,
|
|
51
|
+
...get.properties,
|
|
52
|
+
...getAll.properties,
|
|
53
|
+
...update.properties,
|
|
54
|
+
];
|
|
55
|
+
async function invoiceOperations({ operation, i }) {
|
|
56
|
+
if (operation === 'create') {
|
|
57
|
+
return await create.execute.call(this, i);
|
|
58
|
+
}
|
|
59
|
+
else if (operation === 'get') {
|
|
60
|
+
return await get.execute.call(this, i);
|
|
61
|
+
}
|
|
62
|
+
else if (operation === 'getAll') {
|
|
63
|
+
return await getAll.execute.call(this, i);
|
|
64
|
+
}
|
|
65
|
+
else if (operation === 'update') {
|
|
66
|
+
return await update.execute.call(this, i);
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
exports.invoiceOperations = invoiceOperations;
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/fortnox/resources/invoice/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sEAAwD;AACxD,gEAAkD;AAClD,sEAAwD;AACxD,sEAAwD;AAE3C,QAAA,iBAAiB,GAAsB;IAChD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAA8B;QACpC,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ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