@limetech/n8n-nodes-lime 0.5.0 → 2.3.1-dev.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/.github/workflows/lint.yml +3 -1
- package/.github/workflows/release.yml +2 -49
- package/.github/workflows/test-and-build.yml +1 -1
- package/.releaserc.json +2 -1
- package/CHANGELOG.md +122 -0
- package/README.md +1 -1
- package/credentials/LimeCrmApi.credentials.ts +38 -1
- package/credentials/index.ts +2 -0
- package/eslint.config.mjs +2 -1
- package/knip.json +9 -0
- package/nodes/fortnox/index.ts +6 -0
- package/nodes/fortnox/resources/customers/index.ts +18 -22
- package/nodes/fortnox/resources/customers/operations/create.operation.ts +12 -8
- package/nodes/fortnox/resources/customers/operations/delete.operation.ts +10 -15
- package/nodes/fortnox/resources/customers/operations/get.operation.ts +10 -15
- package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +1 -2
- package/nodes/fortnox/resources/customers/operations/index.ts +5 -0
- package/nodes/fortnox/resources/customers/operations/update.operation.ts +30 -30
- package/nodes/fortnox/resources/invoice/index.ts +16 -18
- package/nodes/fortnox/resources/invoice/model.ts +0 -4
- package/nodes/fortnox/resources/invoice/operations/create.operation.ts +1 -2
- package/nodes/fortnox/resources/invoice/operations/get.operation.ts +10 -15
- package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +1 -2
- package/nodes/fortnox/resources/invoice/operations/index.ts +4 -0
- package/nodes/fortnox/resources/invoice/operations/update.operation.ts +11 -16
- package/nodes/fortnox/transport/index.ts +14 -11
- package/nodes/index.ts +4 -0
- package/nodes/lime-crm/LimeCrmNode.node.ts +81 -11
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +70 -30
- package/nodes/lime-crm/index.ts +9 -0
- package/nodes/lime-crm/methods/getLimetypeProperties.ts +51 -8
- package/nodes/lime-crm/methods/getLimetypes.ts +14 -9
- package/nodes/lime-crm/methods/index.ts +1 -1
- package/nodes/lime-crm/models/constants.ts +73 -0
- package/nodes/lime-crm/models/index.ts +21 -0
- package/nodes/lime-crm/models/limeobject.ts +13 -0
- package/nodes/lime-crm/models/limetype.ts +47 -0
- package/nodes/lime-crm/models/propertyTypes.ts +13 -0
- package/nodes/lime-crm/models/users.ts +46 -0
- package/nodes/lime-crm/models/webhook.ts +61 -0
- package/nodes/lime-crm/resources/admin/index.ts +89 -0
- package/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.ts +166 -0
- package/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.ts +113 -0
- package/nodes/lime-crm/resources/admin/operations/index.ts +8 -0
- package/nodes/lime-crm/resources/data/index.ts +68 -31
- package/nodes/lime-crm/resources/data/operations/{createSingleObject.ts → createSingleObject.operation.ts} +82 -26
- package/nodes/lime-crm/resources/data/operations/{deleteSingleObject.ts → deleteSingleObject.operation.ts} +32 -4
- package/nodes/lime-crm/resources/data/operations/{getManyObjects.ts → getManyObjects.operation.ts} +191 -48
- package/nodes/lime-crm/resources/data/operations/{getSingleFile.ts → getSingleFile.operation.ts} +36 -12
- package/nodes/lime-crm/resources/data/operations/{getSingleObject.ts → getSingleObject.operation.ts} +39 -6
- package/nodes/lime-crm/resources/data/operations/index.ts +24 -0
- package/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.ts +55 -17
- package/nodes/lime-crm/resources/metadata/index.ts +56 -16
- package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +15 -5
- package/nodes/lime-crm/resources/metadata/operations/{getSingleFileMetadata.ts → getSingleFileMetadata.operation.ts} +31 -14
- package/nodes/lime-crm/resources/metadata/operations/{getSingleLimetype.ts → getSingleLimetype.operation.ts} +23 -1
- package/nodes/lime-crm/resources/metadata/operations/index.ts +12 -0
- package/nodes/lime-crm/transport/commons.ts +86 -28
- package/nodes/lime-crm/transport/files.ts +149 -84
- package/nodes/lime-crm/transport/index.ts +35 -17
- package/nodes/lime-crm/transport/limeQuery.ts +42 -6
- package/nodes/lime-crm/transport/limeobjects.ts +102 -179
- package/nodes/lime-crm/transport/limetypes.ts +126 -70
- package/nodes/lime-crm/transport/users.ts +264 -0
- package/nodes/lime-crm/transport/webhooks.ts +96 -37
- package/nodes/lime-crm/{commons → utils}/files.ts +75 -39
- package/nodes/lime-crm/utils/hmac.ts +35 -0
- package/nodes/lime-crm/utils/index.ts +10 -0
- package/nodes/lime-crm/utils/propertyAdapters.ts +75 -0
- package/nodes/lime-crm/utils/webhook.ts +81 -0
- package/nodes/modules.ts +44 -0
- package/nodes/response.ts +16 -0
- package/package.json +18 -27
- package/tests/nodes/lime-crm/utils.spec.ts +238 -0
- package/typedoc.css +9 -0
- package/typedoc.json +19 -0
- package/.dockerignore +0 -1
- package/Dockerfile +0 -21
- package/dist/credentials/FortnoxApi.credentials.d.ts +0 -9
- package/dist/credentials/FortnoxApi.credentials.js +0 -57
- package/dist/credentials/FortnoxApi.credentials.js.map +0 -1
- package/dist/credentials/LimeCrmApi.credentials.d.ts +0 -9
- package/dist/credentials/LimeCrmApi.credentials.js +0 -66
- package/dist/credentials/LimeCrmApi.credentials.js.map +0 -1
- package/dist/nodes/fortnox/Fortnox.node.d.ts +0 -5
- package/dist/nodes/fortnox/Fortnox.node.js +0 -95
- package/dist/nodes/fortnox/Fortnox.node.js.map +0 -1
- package/dist/nodes/fortnox/Fortnox.node.json +0 -18
- package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +0 -5
- package/dist/nodes/fortnox/FortnoxTrigger.node.js +0 -155
- package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +0 -1
- package/dist/nodes/fortnox/FortnoxTrigger.node.json +0 -18
- package/dist/nodes/fortnox/commons.d.ts +0 -25
- package/dist/nodes/fortnox/commons.js +0 -44
- package/dist/nodes/fortnox/commons.js.map +0 -1
- package/dist/nodes/fortnox/fortnoxLogo.svg +0 -15
- package/dist/nodes/fortnox/model.d.ts +0 -20
- package/dist/nodes/fortnox/model.js +0 -3
- package/dist/nodes/fortnox/model.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/customers/filterParameters.js +0 -31
- package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/index.d.ts +0 -20
- package/dist/nodes/fortnox/resources/customers/index.js +0 -87
- package/dist/nodes/fortnox/resources/customers/index.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/model.d.ts +0 -99
- package/dist/nodes/fortnox/resources/customers/model.js +0 -3
- package/dist/nodes/fortnox/resources/customers/model.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +0 -12
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +0 -283
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +0 -10
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +0 -45
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +0 -11
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +0 -45
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +0 -11
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +0 -68
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +0 -12
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +0 -276
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/customers/sortParameters.js +0 -30
- package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js +0 -72
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/index.d.ts +0 -20
- package/dist/nodes/fortnox/resources/invoice/index.js +0 -81
- package/dist/nodes/fortnox/resources/invoice/index.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +0 -2
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +0 -193
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/model.d.ts +0 -150
- package/dist/nodes/fortnox/resources/invoice/model.js +0 -3
- package/dist/nodes/fortnox/resources/invoice/model.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +0 -11
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +0 -64
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +0 -11
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +0 -44
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +0 -11
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +0 -92
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +0 -1
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +0 -11
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +0 -71
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +0 -1
- package/dist/nodes/fortnox/transport/errorCodes.d.ts +0 -1
- package/dist/nodes/fortnox/transport/errorCodes.js +0 -50
- package/dist/nodes/fortnox/transport/errorCodes.js.map +0 -1
- package/dist/nodes/fortnox/transport/index.d.ts +0 -4
- package/dist/nodes/fortnox/transport/index.js +0 -77
- package/dist/nodes/fortnox/transport/index.js.map +0 -1
- package/dist/nodes/lime-crm/LimeCrm.node.json +0 -18
- package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +0 -14
- package/dist/nodes/lime-crm/LimeCrmNode.node.js +0 -126
- package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +0 -1
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +0 -18
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +0 -215
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +0 -1
- package/dist/nodes/lime-crm/assets/lime-crm.svg +0 -1
- package/dist/nodes/lime-crm/commons/constants.d.ts +0 -5
- package/dist/nodes/lime-crm/commons/constants.js +0 -9
- package/dist/nodes/lime-crm/commons/constants.js.map +0 -1
- package/dist/nodes/lime-crm/commons/hmac.d.ts +0 -1
- package/dist/nodes/lime-crm/commons/hmac.js +0 -11
- package/dist/nodes/lime-crm/commons/hmac.js.map +0 -1
- package/dist/nodes/lime-crm/commons/index.d.ts +0 -3
- package/dist/nodes/lime-crm/commons/index.js +0 -12
- package/dist/nodes/lime-crm/commons/index.js.map +0 -1
- package/dist/nodes/lime-crm/commons/limetype.d.ts +0 -10
- package/dist/nodes/lime-crm/commons/limetype.js +0 -3
- package/dist/nodes/lime-crm/commons/limetype.js.map +0 -1
- package/dist/nodes/lime-crm/commons/task.d.ts +0 -14
- package/dist/nodes/lime-crm/commons/task.js +0 -48
- package/dist/nodes/lime-crm/commons/task.js.map +0 -1
- package/dist/nodes/lime-crm/commons/webhook.d.ts +0 -20
- package/dist/nodes/lime-crm/commons/webhook.js +0 -30
- package/dist/nodes/lime-crm/commons/webhook.js.map +0 -1
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +0 -5
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +0 -11
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +0 -1
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +0 -2
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +0 -20
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +0 -1
- package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +0 -2
- package/dist/nodes/lime-crm/methods/getLimeTypes.js +0 -20
- package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +0 -1
- package/dist/nodes/lime-crm/methods/index.d.ts +0 -3
- package/dist/nodes/lime-crm/methods/index.js +0 -10
- package/dist/nodes/lime-crm/methods/index.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +0 -23
- package/dist/nodes/lime-crm/resources/erpConnector/index.js +0 -67
- package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +0 -26
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +0 -65
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +0 -220
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +0 -15
- package/dist/nodes/lime-crm/resources/erpConnector/transform.js +0 -11
- package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +0 -4
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +0 -7
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +0 -37
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +0 -124
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +0 -1
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +0 -6
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +0 -14
- package/dist/nodes/lime-crm/resources/limeObject/index.js +0 -88
- package/dist/nodes/lime-crm/resources/limeObject/index.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +0 -139
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +0 -51
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.js +0 -103
- package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +0 -51
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +0 -103
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +0 -149
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeQuery/index.d.ts +0 -6
- package/dist/nodes/lime-crm/resources/limeQuery/index.js +0 -66
- package/dist/nodes/lime-crm/resources/limeQuery/index.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.js +0 -191
- package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeType/index.d.ts +0 -20
- package/dist/nodes/lime-crm/resources/limeType/index.js +0 -81
- package/dist/nodes/lime-crm/resources/limeType/index.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +0 -11
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +0 -36
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +0 -9
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +0 -36
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +0 -1
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +0 -10
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +0 -15
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +0 -1
- package/dist/nodes/lime-crm/transport/commons.d.ts +0 -5
- package/dist/nodes/lime-crm/transport/commons.js +0 -33
- package/dist/nodes/lime-crm/transport/commons.js.map +0 -1
- package/dist/nodes/lime-crm/transport/erpConnector.d.ts +0 -9
- package/dist/nodes/lime-crm/transport/erpConnector.js +0 -11
- package/dist/nodes/lime-crm/transport/erpConnector.js.map +0 -1
- package/dist/nodes/lime-crm/transport/index.d.ts +0 -6
- package/dist/nodes/lime-crm/transport/index.js +0 -24
- package/dist/nodes/lime-crm/transport/index.js.map +0 -1
- package/dist/nodes/lime-crm/transport/limeQuery.d.ts +0 -10
- package/dist/nodes/lime-crm/transport/limeQuery.js +0 -15
- package/dist/nodes/lime-crm/transport/limeQuery.js.map +0 -1
- package/dist/nodes/lime-crm/transport/limeobjects.d.ts +0 -7
- package/dist/nodes/lime-crm/transport/limeobjects.js +0 -134
- package/dist/nodes/lime-crm/transport/limeobjects.js.map +0 -1
- package/dist/nodes/lime-crm/transport/limetypes.d.ts +0 -6
- package/dist/nodes/lime-crm/transport/limetypes.js +0 -54
- package/dist/nodes/lime-crm/transport/limetypes.js.map +0 -1
- package/dist/nodes/lime-crm/transport/task.d.ts +0 -13
- package/dist/nodes/lime-crm/transport/task.js +0 -13
- package/dist/nodes/lime-crm/transport/task.js.map +0 -1
- package/dist/nodes/lime-crm/transport/webhooks.d.ts +0 -16
- package/dist/nodes/lime-crm/transport/webhooks.js +0 -43
- package/dist/nodes/lime-crm/transport/webhooks.js.map +0 -1
- package/dist/nodes/nodeResponse.d.ts +0 -12
- package/dist/nodes/nodeResponse.js +0 -3
- package/dist/nodes/nodeResponse.js.map +0 -1
- package/dist/package.json +0 -75
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/docker-compose.yml +0 -52
- package/nodes/lime-crm/commons/constants.ts +0 -9
- package/nodes/lime-crm/commons/hmac.ts +0 -13
- package/nodes/lime-crm/commons/index.ts +0 -10
- package/nodes/lime-crm/commons/task.ts +0 -55
- package/nodes/lime-crm/commons/webhook.ts +0 -68
- package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +0 -11
- package/nodes/lime-crm/model.ts +0 -22
- package/nodes/lime-crm/resources/erpConnector/index.ts +0 -43
- package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +0 -69
- package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +0 -274
- package/nodes/lime-crm/resources/erpConnector/transform.ts +0 -49
- package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +0 -18
- package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +0 -201
- package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +0 -1
- package/nodes/lime-crm/transport/erpConnector.ts +0 -21
- package/nodes/lime-crm/transport/task.ts +0 -32
- package/nodes/nodeResponse.ts +0 -13
- package/tests/fixtures/fortnox.ts +0 -182
- package/tests/transform.spec.ts +0 -187
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set of helper functions, classes and types used for adapting the data from
|
|
3
|
+
* N8N's simple fields to Lime CRM format
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LimetypeProperty } from '../models';
|
|
7
|
+
import { YES_NO_PROPERTY_TYPE, PropertyTypeMap } from '../models';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Base inteface for Property Adapter class
|
|
11
|
+
*/
|
|
12
|
+
interface PropertyAdapter<T> {
|
|
13
|
+
adapt(value: string): T | string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Adapter which takes a string from user input and parses it into boolean to
|
|
18
|
+
* conform to Lime CRM's YesNo type
|
|
19
|
+
*/
|
|
20
|
+
class YesNoPropertyAdapter implements PropertyAdapter<boolean> {
|
|
21
|
+
adapt(value: string): boolean | string {
|
|
22
|
+
if (value == 'true') {
|
|
23
|
+
return true;
|
|
24
|
+
} else if (value == 'false') {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Factory class which returns the proper adapter based on data type
|
|
33
|
+
* @param propertyType
|
|
34
|
+
*/
|
|
35
|
+
function getPropertyAdapter(
|
|
36
|
+
propertyType: string
|
|
37
|
+
): PropertyAdapter<PropertyTypeMap[keyof PropertyTypeMap]> | null {
|
|
38
|
+
if (propertyType == YES_NO_PROPERTY_TYPE) {
|
|
39
|
+
return new YesNoPropertyAdapter();
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Main function which takes the value from simple fields mode and the type of
|
|
46
|
+
* property and parses it accordingly to what Lime CRM expects
|
|
47
|
+
* @param propertyValue - user input, always string
|
|
48
|
+
* @param propertyType - type of property from Lime CRM
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @group Utils
|
|
52
|
+
*/
|
|
53
|
+
export function adaptProperty(propertyValue: string, propertyType: string) {
|
|
54
|
+
const adapter = getPropertyAdapter(propertyType);
|
|
55
|
+
return adapter === null ? propertyValue : adapter.adapt(propertyValue);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Given the name of the property and the set of Limetype properties, return the
|
|
60
|
+
* property type
|
|
61
|
+
* @param propertyName - name of the property we want to get the type of
|
|
62
|
+
* @param properties - list of {@link LimetypeProperty} entries
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
* @group Utils
|
|
66
|
+
*/
|
|
67
|
+
export function getPropertyType(
|
|
68
|
+
propertyName: string,
|
|
69
|
+
properties: LimetypeProperty[]
|
|
70
|
+
): string {
|
|
71
|
+
return (
|
|
72
|
+
properties.find((property) => property.name === propertyName)?.type ||
|
|
73
|
+
'string'
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Webhook, WebhookContext, WebhookFunctions } from '../models';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extract and format event identifiers from the node parameters.
|
|
5
|
+
*
|
|
6
|
+
* Builds an array of event strings in the format `<limetype>.<eventType>`
|
|
7
|
+
* based on the selected events.
|
|
8
|
+
*
|
|
9
|
+
* @param hookData - The n8n hook context
|
|
10
|
+
* @returns An array of formatted event strings.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
* @group Utils
|
|
14
|
+
*/
|
|
15
|
+
function getEvents(hookData: WebhookFunctions): string[] {
|
|
16
|
+
const eventData = hookData.getNodeParameter('events', []) as {
|
|
17
|
+
event: Array<{
|
|
18
|
+
limetype: string;
|
|
19
|
+
eventType: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
const eventItems = eventData.event;
|
|
23
|
+
const events: string[] = [];
|
|
24
|
+
for (const eventItem of eventItems) {
|
|
25
|
+
events.push(`${eventItem.limetype}.${eventItem.eventType}`);
|
|
26
|
+
}
|
|
27
|
+
return events;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Generate a unique webhook name based on the selected Lime type and event.
|
|
32
|
+
*
|
|
33
|
+
* The name is constructed using the format:
|
|
34
|
+
* `<limetype>-<eventType>-<timestamp>`, ensuring uniqueness for each webhook.
|
|
35
|
+
*
|
|
36
|
+
* @param hookData - The n8n hook context used to access node parameters
|
|
37
|
+
* @returns A unique webhook name string.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
* @group Utils
|
|
41
|
+
*/
|
|
42
|
+
function createWebhookName(hookData: WebhookFunctions): string {
|
|
43
|
+
interface Events {
|
|
44
|
+
event: Array<{
|
|
45
|
+
limetype: string;
|
|
46
|
+
eventType: string;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const events = hookData.getNodeParameter('events') as Events;
|
|
51
|
+
return `${events.event[0].limetype}-${events.event[0].eventType}-${Date.now()}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Retrieve a fully constructed webhook object from the given node context.
|
|
56
|
+
*
|
|
57
|
+
* @param hookData - The n8n node context
|
|
58
|
+
*
|
|
59
|
+
* @returns A {@link Webhook} object with a generated name
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
* @group Utils
|
|
63
|
+
*/
|
|
64
|
+
export function getWebhook(hookData: WebhookFunctions): Webhook {
|
|
65
|
+
const node = hookData.getNode();
|
|
66
|
+
const workflow = hookData.getWorkflow();
|
|
67
|
+
const context: WebhookContext = {
|
|
68
|
+
nodeId: node.id,
|
|
69
|
+
nodeName: node.name,
|
|
70
|
+
workflowId: workflow.id,
|
|
71
|
+
workflowName: workflow.name,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
data: hookData.getWorkflowStaticData('node'),
|
|
76
|
+
events: getEvents(hookData),
|
|
77
|
+
url: hookData.getNodeWebhookUrl('default'),
|
|
78
|
+
context: context,
|
|
79
|
+
name: createWebhookName(hookData),
|
|
80
|
+
};
|
|
81
|
+
}
|
package/nodes/modules.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helper class describing a typical module for .operation.ts files
|
|
5
|
+
*/
|
|
6
|
+
interface N8NOperationModule {
|
|
7
|
+
description: INodePropertyOptions;
|
|
8
|
+
properties?: INodeProperties[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Utility class used to simplify handling modules in N8N classes and
|
|
13
|
+
* show them in a standardized way
|
|
14
|
+
*/
|
|
15
|
+
export class N8NOperationModuleHandler {
|
|
16
|
+
modules: N8NOperationModule[];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Constructor class
|
|
20
|
+
* @param modules - list of modules for a given resource
|
|
21
|
+
*/
|
|
22
|
+
constructor(modules: N8NOperationModule[]) {
|
|
23
|
+
this.modules = modules.sort((operation1, operation2) =>
|
|
24
|
+
operation1.description.name.localeCompare(
|
|
25
|
+
operation2.description.name,
|
|
26
|
+
'en'
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Return descriptions for all the modules for a given resource
|
|
33
|
+
*/
|
|
34
|
+
getDescriptions(): INodePropertyOptions[] {
|
|
35
|
+
return this.modules.map((operation) => operation.description);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns flatten properties for all modules for a given resource
|
|
40
|
+
*/
|
|
41
|
+
getProperties(): INodeProperties[] {
|
|
42
|
+
return this.modules.flatMap((operation) => operation.properties || []);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBinaryData } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response object that includes both JSON data and optional binary file content.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - The shape of the JSON data returned in the response
|
|
7
|
+
* @property json - The n8n node response, containing structured JSON data.
|
|
8
|
+
* @property binary - An optional record of binary file data
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @group Response
|
|
12
|
+
*/
|
|
13
|
+
export type FileResponse<T> = {
|
|
14
|
+
json: T;
|
|
15
|
+
binary?: Record<string, IBinaryData>;
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/n8n-nodes-lime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.3.1-dev.1",
|
|
4
4
|
"description": "n8n node to connect to Lime CRM",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"main": "index.
|
|
6
|
+
"main": "nodes/index.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc && copyfiles \"nodes/**/*.svg\" dist",
|
|
9
9
|
"dev": "tsc --watch",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"lint:fix": "eslint --max-warnings=0 . --fix",
|
|
14
14
|
"format": "prettier -c .",
|
|
15
15
|
"format:fix": "prettier --write .",
|
|
16
|
-
"test": "jest"
|
|
16
|
+
"test": "jest",
|
|
17
|
+
"docs": "npx typedoc",
|
|
18
|
+
"knip": "knip"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [
|
|
19
21
|
"n8n",
|
|
@@ -36,41 +38,30 @@
|
|
|
36
38
|
]
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
41
|
+
"@limetech/eslint-config": "^4.0.0",
|
|
39
42
|
"@semantic-release/changelog": "^6.0.3",
|
|
40
|
-
"@semantic-release/
|
|
43
|
+
"@semantic-release/exec": "^7.1.0",
|
|
41
44
|
"@semantic-release/git": "^10.0.1",
|
|
42
|
-
"@semantic-release/github": "^11.0.4",
|
|
43
|
-
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
44
45
|
"@types/jest": "^30.0.0",
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"@types/request-promise-native": "^1.0.18",
|
|
46
|
+
"@types/node": "^24.10.1",
|
|
47
47
|
"@types/ws": "^8.18.1",
|
|
48
|
-
"
|
|
49
|
-
"@typescript-eslint/parser": "^8.38.0",
|
|
50
|
-
"concurrently": "^7.0.0",
|
|
48
|
+
"concurrently": "^9.2.1",
|
|
51
49
|
"copyfiles": "^2.4.1",
|
|
52
|
-
"eslint": "^9.
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"install": "^0.13.0",
|
|
57
|
-
"jest": "^30.0.5",
|
|
58
|
-
"nodemon": "^2.0.15",
|
|
59
|
-
"npm": "^11.5.2",
|
|
50
|
+
"eslint": "^9.39.1",
|
|
51
|
+
"jest": "^30.2.0",
|
|
52
|
+
"knip": "^5.69.0",
|
|
53
|
+
"nodemon": "^3.1.11",
|
|
60
54
|
"prettier": "^3.6.2",
|
|
61
|
-
"semantic-release": "^
|
|
62
|
-
"ts-jest": "^29.4.
|
|
63
|
-
"
|
|
55
|
+
"semantic-release": "^25.0.2",
|
|
56
|
+
"ts-jest": "^29.4.5",
|
|
57
|
+
"typedoc": "^0.28.14",
|
|
58
|
+
"typescript": "^5.9.3"
|
|
64
59
|
},
|
|
65
60
|
"dependencies": {
|
|
66
|
-
"@limetech/eslint-config": "^3.0.2",
|
|
67
|
-
"@semantic-release/exec": "^7.1.0",
|
|
68
61
|
"currency-codes": "^2.2.0",
|
|
69
|
-
"request": "^2.88.2",
|
|
70
|
-
"request-promise-native": "^1.0.9",
|
|
71
62
|
"ws": "^8.18.3"
|
|
72
63
|
},
|
|
73
64
|
"peerDependencies": {
|
|
74
65
|
"n8n-workflow": "^1.109.0"
|
|
75
66
|
}
|
|
76
|
-
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
jest.mock('../../../nodes/lime-crm/transport', () => ({
|
|
2
|
+
createFile: jest.fn().mockResolvedValue({
|
|
3
|
+
id: 1,
|
|
4
|
+
}),
|
|
5
|
+
getFileMetadata: jest.fn().mockResolvedValue({
|
|
6
|
+
id: '123',
|
|
7
|
+
name: 'file.txt',
|
|
8
|
+
}),
|
|
9
|
+
getFileContent: jest.fn().mockResolvedValue('some binary data'),
|
|
10
|
+
getTasks: jest.fn(),
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
createFile,
|
|
15
|
+
getFileContent,
|
|
16
|
+
getFileMetadata,
|
|
17
|
+
getFilenameFromHeader,
|
|
18
|
+
getFilePropertiesNames,
|
|
19
|
+
getWebhook,
|
|
20
|
+
processFileResponse,
|
|
21
|
+
setFilename,
|
|
22
|
+
setFileProperties,
|
|
23
|
+
verifyHmac,
|
|
24
|
+
WebhookFunctions,
|
|
25
|
+
} from '../../../nodes';
|
|
26
|
+
|
|
27
|
+
describe('files', () => {
|
|
28
|
+
describe('setFilename', () => {
|
|
29
|
+
it('returns responseFileName if fileName is missing', () => {
|
|
30
|
+
expect(
|
|
31
|
+
setFilename({ fileExtension: 'jpg' } as any, 'default.jpg')
|
|
32
|
+
).toBe('default.jpg');
|
|
33
|
+
});
|
|
34
|
+
it('returns existing fileName if present', () => {
|
|
35
|
+
expect(
|
|
36
|
+
setFilename({ fileName: 'aspen.jpg' } as any, 'default.jpg')
|
|
37
|
+
).toBe('aspen.jpg');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('getFilenameFromHeader', () => {
|
|
42
|
+
it('returns null if header is missing', () => {
|
|
43
|
+
expect(getFilenameFromHeader({})).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('parses standard filename', () => {
|
|
47
|
+
expect(
|
|
48
|
+
getFilenameFromHeader({
|
|
49
|
+
'content-disposition': 'attachment; filename="test.txt"',
|
|
50
|
+
})
|
|
51
|
+
).toBe('test.txt');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('parses RFC 5987 filename*', () => {
|
|
55
|
+
expect(
|
|
56
|
+
getFilenameFromHeader({
|
|
57
|
+
'content-disposition':
|
|
58
|
+
"attachment; filename*=UTF-8''test%20file.txt",
|
|
59
|
+
})
|
|
60
|
+
).toBe('test file.txt');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe('getFilePropertiesNames', () => {
|
|
65
|
+
const limetypes = [
|
|
66
|
+
{ name: 'company', type: 'belongsto', localname: 'company' },
|
|
67
|
+
{ name: 'name', type: 'string', localname: 'name' },
|
|
68
|
+
{ name: 'document', type: 'file', localname: 'document' },
|
|
69
|
+
{ name: 'photo', type: 'file', localname: 'photo' },
|
|
70
|
+
];
|
|
71
|
+
it('returns all file property names', async () => {
|
|
72
|
+
const result = getFilePropertiesNames(limetypes);
|
|
73
|
+
expect(result.has('document')).toBe(true);
|
|
74
|
+
expect(result.has('photo')).toBe(true);
|
|
75
|
+
expect(result.has('name')).toBe(false);
|
|
76
|
+
expect(result.has('company')).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
it('returns allowed file property names', async () => {
|
|
79
|
+
const result = getFilePropertiesNames(
|
|
80
|
+
limetypes,
|
|
81
|
+
new Set(['document'])
|
|
82
|
+
);
|
|
83
|
+
expect(result.has('document')).toBe(true);
|
|
84
|
+
expect(result.has('photo')).toBe(false);
|
|
85
|
+
expect(result.has('name')).toBe(false);
|
|
86
|
+
expect(result.has('company')).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('setFileProperties', () => {
|
|
91
|
+
const mockContext: any = {
|
|
92
|
+
helpers: {
|
|
93
|
+
assertBinaryData: jest.fn(),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const mockBinaryData = { data: 'some binary data' };
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
(createFile as jest.Mock).mockClear();
|
|
100
|
+
mockContext.helpers.assertBinaryData.mockClear();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('sets file properties successfully', async () => {
|
|
104
|
+
mockContext.helpers.assertBinaryData.mockReturnValue(
|
|
105
|
+
mockBinaryData
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const definedProperties = { document: 'some binary data' };
|
|
109
|
+
const result = await setFileProperties(
|
|
110
|
+
mockContext,
|
|
111
|
+
0,
|
|
112
|
+
new Set(['document']),
|
|
113
|
+
definedProperties
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
expect(result.document).toBe(1);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('sets file ID if assertBinaryData throws an error', async () => {
|
|
120
|
+
mockContext.helpers.assertBinaryData.mockImplementation(() => {
|
|
121
|
+
throw new Error('Invalid binary data');
|
|
122
|
+
});
|
|
123
|
+
const definedProperties = { document: 2 };
|
|
124
|
+
const result = await setFileProperties(
|
|
125
|
+
mockContext,
|
|
126
|
+
0,
|
|
127
|
+
new Set(['document']),
|
|
128
|
+
definedProperties
|
|
129
|
+
);
|
|
130
|
+
expect(result.document).toBe(2);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe('processFileResponse', () => {
|
|
135
|
+
const mockNodeContext = {};
|
|
136
|
+
|
|
137
|
+
beforeEach(() => {
|
|
138
|
+
(getFileMetadata as jest.Mock).mockClear();
|
|
139
|
+
(getFileContent as jest.Mock).mockClear();
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('returns file metadata without file content', async () => {
|
|
143
|
+
const data = { document: 1 };
|
|
144
|
+
const result = await processFileResponse(
|
|
145
|
+
mockNodeContext as any,
|
|
146
|
+
new Set(['document']),
|
|
147
|
+
data
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
expect(result.json.document).toEqual({
|
|
151
|
+
id: '123',
|
|
152
|
+
name: 'file.txt',
|
|
153
|
+
});
|
|
154
|
+
expect(result.binary).toEqual({});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('returns file metadata with file content', async () => {
|
|
158
|
+
const data = { document: 1 };
|
|
159
|
+
const result = await processFileResponse(
|
|
160
|
+
mockNodeContext as any,
|
|
161
|
+
new Set(['document']),
|
|
162
|
+
data,
|
|
163
|
+
true
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
expect(result.json.document).toEqual({
|
|
167
|
+
id: '123',
|
|
168
|
+
name: 'file.txt',
|
|
169
|
+
});
|
|
170
|
+
expect(result.binary?.document).toEqual('some binary data');
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
describe('hmac', () => {
|
|
176
|
+
describe('verifyHmac', () => {
|
|
177
|
+
const key = 'my-secret-key';
|
|
178
|
+
const data = Buffer.from('hello world');
|
|
179
|
+
const correctHmac =
|
|
180
|
+
'sha256=90eb182d8396f16d4341d582047f45c0a97d73388c5377d9ced478a2212295ad';
|
|
181
|
+
|
|
182
|
+
it('returns true when the HMAC matches', () => {
|
|
183
|
+
expect(verifyHmac(key, data, correctHmac)).toBe(true);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('returns false when the HMAC does not match', () => {
|
|
187
|
+
expect(verifyHmac(key, data, 'wrongHmac')).toBe(false);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
describe('webhook', () => {
|
|
193
|
+
describe('getWebhhok', () => {
|
|
194
|
+
let mockHookData: jest.Mocked<WebhookFunctions>;
|
|
195
|
+
|
|
196
|
+
beforeEach(() => {
|
|
197
|
+
jest.useFakeTimers().setSystemTime(
|
|
198
|
+
new Date('2025-11-12T12:00:00Z')
|
|
199
|
+
);
|
|
200
|
+
mockHookData = {
|
|
201
|
+
getNode: jest.fn().mockReturnValue({ id: '1', name: 'MyNode' }),
|
|
202
|
+
getWorkflow: jest
|
|
203
|
+
.fn()
|
|
204
|
+
.mockReturnValue({ id: '2', name: 'MyWorkflow' }),
|
|
205
|
+
getWorkflowStaticData: jest
|
|
206
|
+
.fn()
|
|
207
|
+
.mockReturnValue({ key: 'value' }),
|
|
208
|
+
getNodeWebhookUrl: jest
|
|
209
|
+
.fn()
|
|
210
|
+
.mockReturnValue('https://example.com/hook'),
|
|
211
|
+
getNodeParameter: jest.fn().mockReturnValue({
|
|
212
|
+
event: [{ limetype: 'company', eventType: 'new' }],
|
|
213
|
+
}),
|
|
214
|
+
} as unknown as jest.Mocked<WebhookFunctions>;
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
afterEach(() => {
|
|
218
|
+
jest.useRealTimers();
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it('constructs a full webhook object correctly', () => {
|
|
222
|
+
const result = getWebhook(mockHookData);
|
|
223
|
+
|
|
224
|
+
expect(result).toEqual({
|
|
225
|
+
data: { key: 'value' },
|
|
226
|
+
events: ['company.new'],
|
|
227
|
+
url: 'https://example.com/hook',
|
|
228
|
+
context: {
|
|
229
|
+
nodeId: '1',
|
|
230
|
+
nodeName: 'MyNode',
|
|
231
|
+
workflowId: '2',
|
|
232
|
+
workflowName: 'MyWorkflow',
|
|
233
|
+
},
|
|
234
|
+
name: 'company-new-1762948800000',
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
});
|
package/typedoc.css
ADDED
package/typedoc.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://typedoc.org/schema.json",
|
|
3
|
+
"entryPoints": [
|
|
4
|
+
"./nodes/lime-crm/index.ts",
|
|
5
|
+
"./nodes/response.ts",
|
|
6
|
+
"./credentials/index.ts"
|
|
7
|
+
],
|
|
8
|
+
"entryPointStrategy": "expand",
|
|
9
|
+
"name": "Lime N8N Documentation",
|
|
10
|
+
"customCss": "typedoc.css",
|
|
11
|
+
"out": "docs",
|
|
12
|
+
"includeVersion": true,
|
|
13
|
+
"readme": "README.md",
|
|
14
|
+
"tsconfig": "tsconfig.json",
|
|
15
|
+
"disableSources": true,
|
|
16
|
+
"hideGenerator": true,
|
|
17
|
+
"categorizeByGroup": true,
|
|
18
|
+
"cleanOutputDir": true
|
|
19
|
+
}
|
package/.dockerignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.git
|
package/Dockerfile
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# ----------- Stage 1: Build -----------
|
|
2
|
-
FROM node:18 AS builder
|
|
3
|
-
|
|
4
|
-
RUN mkdir /source
|
|
5
|
-
WORKDIR /source
|
|
6
|
-
COPY . .
|
|
7
|
-
RUN npm install -g typescript@5.3.2
|
|
8
|
-
RUN npm install --include=dev
|
|
9
|
-
RUN npm run build
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# ----------- Stage 2: Production -----------
|
|
13
|
-
FROM n8nio/n8n:1.113.2
|
|
14
|
-
|
|
15
|
-
ENV N8N_CUSTOM_EXTENSIONS=/home/node/.n8n/custom
|
|
16
|
-
|
|
17
|
-
USER root
|
|
18
|
-
COPY --from=builder /source/dist /home/node/.n8n/custom
|
|
19
|
-
|
|
20
|
-
USER node
|
|
21
|
-
WORKDIR /home/node
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties, IAuthenticate, ICredentialTestRequest } from 'n8n-workflow';
|
|
2
|
-
export declare class FortnoxApi implements ICredentialType {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
documentationUrl: string;
|
|
6
|
-
properties: INodeProperties[];
|
|
7
|
-
authenticate: IAuthenticate;
|
|
8
|
-
test: ICredentialTestRequest;
|
|
9
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FortnoxApi = void 0;
|
|
4
|
-
const commons_1 = require("../nodes/fortnox/commons");
|
|
5
|
-
const transport_1 = require("../nodes/fortnox/transport");
|
|
6
|
-
class FortnoxApi {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.name = commons_1.FORTNOX_API_CREDENTIAL_KEY;
|
|
9
|
-
this.displayName = 'Fortnox API';
|
|
10
|
-
this.documentationUrl = 'https://www.fortnox.se/developer';
|
|
11
|
-
this.properties = [
|
|
12
|
-
{
|
|
13
|
-
displayName: 'Token',
|
|
14
|
-
name: 'token',
|
|
15
|
-
type: 'string',
|
|
16
|
-
typeOptions: {
|
|
17
|
-
password: true,
|
|
18
|
-
},
|
|
19
|
-
default: '',
|
|
20
|
-
required: true,
|
|
21
|
-
description: 'Token for authentication with the Fortnox API',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
displayName: 'Client Secret',
|
|
25
|
-
name: 'clientSecret',
|
|
26
|
-
type: 'string',
|
|
27
|
-
typeOptions: {
|
|
28
|
-
password: true,
|
|
29
|
-
},
|
|
30
|
-
default: '',
|
|
31
|
-
description: 'Unique key provided when you register your Fortnox integration',
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
this.authenticate = {
|
|
35
|
-
type: 'generic',
|
|
36
|
-
properties: {
|
|
37
|
-
headers: {
|
|
38
|
-
Authorization: '=Bearer {{$credentials.token}}',
|
|
39
|
-
Accept: 'application/json',
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
this.test = {
|
|
45
|
-
request: {
|
|
46
|
-
baseURL: transport_1.FORTNOX_BASE_URL,
|
|
47
|
-
url: 'invoices',
|
|
48
|
-
method: 'GET',
|
|
49
|
-
headers: {
|
|
50
|
-
Authorization: '=Bearer {{$credentials.token}}',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.FortnoxApi = FortnoxApi;
|
|
57
|
-
//# sourceMappingURL=FortnoxApi.credentials.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FortnoxApi.credentials.js","sourceRoot":"","sources":["../../credentials/FortnoxApi.credentials.ts"],"names":[],"mappings":";;;AAOA,sDAAsE;AACtE,0DAA8D;AAE9D,MAAa,UAAU;IAAvB;QACI,SAAI,GAAG,oCAA0B,CAAC;QAClC,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,kCAAkC,CAAC;QACtD,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,+CAA+C;aAC/D;YACD;gBACI,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EACP,gEAAgE;aACvE;SACJ,CAAC;QAEF,iBAAY,GAAkB;YAC1B,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,gCAAgC;oBAC/C,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBACrC;aACJ;SACJ,CAAC;QAEF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,4BAAgB;gBACzB,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,KAA4B;gBACpC,OAAO,EAAE;oBACL,aAAa,EAAE,gCAAgC;iBAClD;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAlDD,gCAkDC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties, IAuthenticate, ICredentialTestRequest } from 'n8n-workflow';
|
|
2
|
-
export declare class LimeCrmApi implements ICredentialType {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
documentationUrl: string;
|
|
6
|
-
properties: INodeProperties[];
|
|
7
|
-
authenticate: IAuthenticate;
|
|
8
|
-
test: ICredentialTestRequest;
|
|
9
|
-
}
|