@limetech/n8n-nodes-lime 0.4.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/.prettierignore +3 -1
- package/.releaserc.json +2 -1
- package/CHANGELOG.md +215 -0
- package/README.md +2 -9
- package/credentials/LimeCrmApi.credentials.ts +44 -7
- package/credentials/index.ts +2 -0
- package/eslint.config.mjs +2 -1
- package/knip.json +9 -0
- package/nodes/fortnox/Fortnox.node.ts +3 -3
- package/nodes/fortnox/FortnoxTrigger.node.ts +2 -2
- 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 +126 -69
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +86 -53
- package/nodes/lime-crm/index.ts +9 -0
- package/nodes/lime-crm/methods/getLimetypeProperties.ts +110 -0
- package/nodes/lime-crm/methods/getLimetypes.ts +26 -0
- package/nodes/lime-crm/methods/index.ts +7 -3
- 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 +117 -0
- package/nodes/lime-crm/resources/data/operations/createSingleObject.operation.ts +231 -0
- package/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.ts +83 -0
- package/nodes/lime-crm/resources/data/operations/getManyObjects.operation.ts +499 -0
- package/nodes/lime-crm/resources/data/operations/getSingleFile.operation.ts +162 -0
- package/nodes/lime-crm/resources/data/operations/getSingleObject.operation.ts +116 -0
- package/nodes/lime-crm/resources/data/operations/index.ts +24 -0
- package/nodes/lime-crm/resources/{limeObject/operations/update.operation.ts → data/operations/updateSingleObject.operation.ts} +91 -25
- package/nodes/lime-crm/resources/metadata/index.ts +97 -0
- package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +28 -0
- package/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.ts +147 -0
- package/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.ts +58 -0
- package/nodes/lime-crm/resources/metadata/operations/index.ts +12 -0
- package/nodes/lime-crm/transport/commons.ts +97 -27
- package/nodes/lime-crm/transport/files.ts +220 -0
- package/nodes/lime-crm/transport/index.ts +38 -13
- package/nodes/lime-crm/transport/limeQuery.ts +44 -10
- package/nodes/lime-crm/transport/limeobjects.ts +126 -168
- package/nodes/lime-crm/transport/limetypes.ts +169 -57
- package/nodes/lime-crm/transport/users.ts +264 -0
- package/nodes/lime-crm/transport/webhooks.ts +96 -37
- package/nodes/lime-crm/utils/files.ts +198 -0
- 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 +21 -29
- package/restore_script/README +42 -0
- package/restore_script/api_key_download.txt +0 -0
- package/restore_script/api_key_upload.txt +0 -0
- package/restore_script/cli.py +73 -0
- package/restore_script/download.py +73 -0
- package/restore_script/main.py +19 -0
- package/restore_script/poetry.lock +162 -0
- package/restore_script/pyproject.toml +15 -0
- package/restore_script/transfer.py +41 -0
- package/restore_script/upload.py +66 -0
- package/restore_script/utils.py +42 -0
- 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 -46
- package/nodes/lime-crm/commons/constants.ts +0 -10
- package/nodes/lime-crm/commons/hmac.ts +0 -13
- package/nodes/lime-crm/commons/index.ts +0 -10
- package/nodes/lime-crm/commons/limetype.ts +0 -11
- package/nodes/lime-crm/commons/task.ts +0 -55
- package/nodes/lime-crm/commons/webhook.ts +0 -56
- package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +0 -11
- package/nodes/lime-crm/methods/getLimeTypeProperties.ts +0 -27
- package/nodes/lime-crm/methods/getLimeTypes.ts +0 -23
- 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/resources/limeObject/index.ts +0 -64
- package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +0 -152
- package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +0 -55
- package/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.ts +0 -112
- package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +0 -54
- package/nodes/lime-crm/resources/limeQuery/index.ts +0 -40
- package/nodes/lime-crm/resources/limeQuery/operations/query.operation.ts +0 -222
- package/nodes/lime-crm/resources/limeType/index.ts +0 -58
- package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +0 -42
- package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +0 -36
- package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +0 -18
- 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
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IExecuteFunctions,
|
|
3
|
-
INodeProperties,
|
|
4
|
-
NodePropertyTypes,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
|
|
7
|
-
import * as getType from './operations/getType.operation';
|
|
8
|
-
import * as listTypes from './operations/listTypes.operation';
|
|
9
|
-
import * as getProperties from './operations/getProperties.operation';
|
|
10
|
-
import { LIMETYPE_RESOURCE } from '../../commons';
|
|
11
|
-
|
|
12
|
-
export const limeTypeFields: INodeProperties[] = [
|
|
13
|
-
{
|
|
14
|
-
displayName: 'Operation',
|
|
15
|
-
name: 'operation',
|
|
16
|
-
type: 'options' as NodePropertyTypes,
|
|
17
|
-
noDataExpression: true,
|
|
18
|
-
displayOptions: {
|
|
19
|
-
show: {
|
|
20
|
-
resource: [LIMETYPE_RESOURCE],
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
options: [
|
|
24
|
-
{
|
|
25
|
-
...listTypes.description,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
...getType.description,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
...getProperties.description,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
default: 'listTypes',
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
// Operation-specific fields
|
|
38
|
-
...getType.properties,
|
|
39
|
-
...getProperties.properties,
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
// Operations router
|
|
43
|
-
export async function limeTypeOperations(
|
|
44
|
-
this: IExecuteFunctions,
|
|
45
|
-
{ operation, i }: { operation: string; i: number }
|
|
46
|
-
) {
|
|
47
|
-
if (operation === 'listTypes') {
|
|
48
|
-
return await listTypes.execute.call(this);
|
|
49
|
-
}
|
|
50
|
-
if (operation === 'getType') {
|
|
51
|
-
return await getType.execute.call(this, i);
|
|
52
|
-
}
|
|
53
|
-
if (operation === 'getProperties') {
|
|
54
|
-
return await getProperties.execute.call(this, i);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import { getProperties } from '../../../transport';
|
|
4
|
-
import { LIMETYPE_RESOURCE, LimeTypeProperty } from '../../../commons';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
|
-
|
|
7
|
-
export const description = {
|
|
8
|
-
name: 'Get Properties',
|
|
9
|
-
value: 'getProperties',
|
|
10
|
-
description: 'Get all properties for a specific entity type',
|
|
11
|
-
action: 'Get entity type properties',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const properties: INodeProperties[] = [
|
|
15
|
-
// Limetype selection
|
|
16
|
-
{
|
|
17
|
-
displayName: 'Type Name',
|
|
18
|
-
name: 'limeType',
|
|
19
|
-
type: 'options',
|
|
20
|
-
typeOptions: {
|
|
21
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
22
|
-
},
|
|
23
|
-
required: true,
|
|
24
|
-
default: '',
|
|
25
|
-
description: 'The name of the entity type to get properties for',
|
|
26
|
-
displayOptions: {
|
|
27
|
-
show: {
|
|
28
|
-
resource: [LIMETYPE_RESOURCE],
|
|
29
|
-
operation: ['getProperties'],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
export async function execute(
|
|
36
|
-
this: IExecuteFunctions,
|
|
37
|
-
i: number
|
|
38
|
-
): Promise<NodeResponse<LimeTypeProperty[]>> {
|
|
39
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
40
|
-
|
|
41
|
-
return getProperties(this, limeType);
|
|
42
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { getLimeType } from '../../../transport/limetypes';
|
|
3
|
-
import { LIMETYPE_RESOURCE } from '../../../commons';
|
|
4
|
-
|
|
5
|
-
export const description = {
|
|
6
|
-
name: 'Get Type',
|
|
7
|
-
value: 'getType',
|
|
8
|
-
description: 'Get details about a specific entity type',
|
|
9
|
-
action: 'Get entity type details',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const properties: INodeProperties[] = [
|
|
13
|
-
{
|
|
14
|
-
displayName: 'Type Name',
|
|
15
|
-
name: 'limeType',
|
|
16
|
-
type: 'options',
|
|
17
|
-
typeOptions: {
|
|
18
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
19
|
-
},
|
|
20
|
-
required: true,
|
|
21
|
-
default: '',
|
|
22
|
-
description: 'The name of the entity type to get details for',
|
|
23
|
-
displayOptions: {
|
|
24
|
-
show: {
|
|
25
|
-
resource: [LIMETYPE_RESOURCE],
|
|
26
|
-
operation: ['getType'],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
export async function execute(this: IExecuteFunctions, i: number) {
|
|
33
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
34
|
-
|
|
35
|
-
return getLimeType(this, limeType);
|
|
36
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import { getLimeTypesFromApi } from '../../../transport';
|
|
4
|
-
import { LimeType } from '../../../commons';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
|
-
|
|
7
|
-
export const description = {
|
|
8
|
-
name: 'List Types',
|
|
9
|
-
value: 'listTypes',
|
|
10
|
-
description: 'Get a list of all available entity types',
|
|
11
|
-
action: 'List all entity types',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export async function execute(
|
|
15
|
-
this: IExecuteFunctions
|
|
16
|
-
): Promise<NodeResponse<LimeType[]>> {
|
|
17
|
-
return await getLimeTypesFromApi(this);
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { callLimeApi } from './commons';
|
|
2
|
-
import { IAllExecuteFunctions } from 'n8n-workflow';
|
|
3
|
-
import { LimeCrmData } from '../resources/erpConnector/transform';
|
|
4
|
-
import { NodeResponse } from '../../nodeResponse';
|
|
5
|
-
|
|
6
|
-
const ERP_CONNECTOR_URL = '/limepkg-erp-connector/';
|
|
7
|
-
|
|
8
|
-
export interface CreateOrUpdateObjectsTaskResponse {
|
|
9
|
-
id: string;
|
|
10
|
-
status: string;
|
|
11
|
-
result: Record<string, unknown> | null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function startCreateOrUpdateObjectsTask(
|
|
15
|
-
nodeContext: IAllExecuteFunctions,
|
|
16
|
-
data: LimeCrmData
|
|
17
|
-
): Promise<NodeResponse<CreateOrUpdateObjectsTaskResponse>> {
|
|
18
|
-
return await callLimeApi(nodeContext, 'PUT', ERP_CONNECTOR_URL, {
|
|
19
|
-
body: data,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IAllExecuteFunctions } from 'n8n-workflow';
|
|
2
|
-
import { callLimeApi } from './commons';
|
|
3
|
-
|
|
4
|
-
const TASK_URL = '/api/v1/task/';
|
|
5
|
-
|
|
6
|
-
interface Task {
|
|
7
|
-
id: string;
|
|
8
|
-
status: 'PENDING' | 'STARTED' | 'SUCCESS' | 'FAILURE' | 'REVOKED' | 'RETRY';
|
|
9
|
-
result: unknown;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface GetTasksApiResponse {
|
|
13
|
-
_embedded: {
|
|
14
|
-
tasks: Task[];
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export async function getTasks(
|
|
19
|
-
nodeContext: IAllExecuteFunctions,
|
|
20
|
-
taskId: string
|
|
21
|
-
) {
|
|
22
|
-
return await callLimeApi<GetTasksApiResponse>(
|
|
23
|
-
nodeContext,
|
|
24
|
-
'GET',
|
|
25
|
-
TASK_URL,
|
|
26
|
-
{
|
|
27
|
-
qs: {
|
|
28
|
-
id: taskId,
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
}
|
package/nodes/nodeResponse.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type SuccessResponse<T> = {
|
|
2
|
-
success: true;
|
|
3
|
-
data: T;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
type FailureResponse = {
|
|
7
|
-
success: false;
|
|
8
|
-
error: string;
|
|
9
|
-
status?: number;
|
|
10
|
-
metadata?: Record<string, unknown>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type NodeResponse<T> = SuccessResponse<T> | FailureResponse;
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { FortnoxInvoiceData } from '../../nodes/lime-crm/resources/erpConnector/transformers/fortnox';
|
|
2
|
-
|
|
3
|
-
export const invoice = {
|
|
4
|
-
'@url': 'https://api.fortnox.se/3/invoices/1',
|
|
5
|
-
'@urlTaxReductionList':
|
|
6
|
-
'https://api.fortnox.se/3/taxreductions?filter=invoices&referencenumber=1',
|
|
7
|
-
AccountingMethod: 'ACCRUAL',
|
|
8
|
-
Address1: '',
|
|
9
|
-
Address2: '',
|
|
10
|
-
AdministrationFee: 0,
|
|
11
|
-
AdministrationFeeVAT: 0,
|
|
12
|
-
Balance: 1589,
|
|
13
|
-
BasisTaxReduction: 0,
|
|
14
|
-
Booked: true,
|
|
15
|
-
Cancelled: false,
|
|
16
|
-
City: 'Wadowice',
|
|
17
|
-
Comments: '',
|
|
18
|
-
ContractReference: '0',
|
|
19
|
-
ContributionPercent: 100,
|
|
20
|
-
ContributionValue: 1271,
|
|
21
|
-
CostCenter: '',
|
|
22
|
-
Country: '',
|
|
23
|
-
Credit: 'false',
|
|
24
|
-
CreditInvoiceReference: '0',
|
|
25
|
-
Currency: 'SEK',
|
|
26
|
-
CurrencyRate: 1,
|
|
27
|
-
CurrencyUnit: 1,
|
|
28
|
-
CustomerName: 'Vatican Forces',
|
|
29
|
-
CustomerNumber: '3',
|
|
30
|
-
DeliveryAddress1: '',
|
|
31
|
-
DeliveryAddress2: '',
|
|
32
|
-
DeliveryCity: '',
|
|
33
|
-
DeliveryCountry: '',
|
|
34
|
-
DeliveryDate: null,
|
|
35
|
-
DeliveryName: '',
|
|
36
|
-
DeliveryZipCode: '',
|
|
37
|
-
DocumentNumber: '1',
|
|
38
|
-
DueDate: '2025-09-12',
|
|
39
|
-
EDIInformation: {
|
|
40
|
-
EDIGlobalLocationNumber: '',
|
|
41
|
-
EDIGlobalLocationNumberDelivery: '',
|
|
42
|
-
EDIInvoiceExtra1: '',
|
|
43
|
-
EDIInvoiceExtra2: '',
|
|
44
|
-
EDIOurElectronicReference: '',
|
|
45
|
-
EDIYourElectronicReference: '',
|
|
46
|
-
EDIStatus: '',
|
|
47
|
-
},
|
|
48
|
-
EUQuarterlyReport: false,
|
|
49
|
-
EmailInformation: {
|
|
50
|
-
EmailAddressFrom: null,
|
|
51
|
-
EmailAddressTo: null,
|
|
52
|
-
EmailAddressCC: '',
|
|
53
|
-
EmailAddressBCC: '',
|
|
54
|
-
EmailSubject: 'Faktura {no} bifogas',
|
|
55
|
-
EmailBody: ' ',
|
|
56
|
-
},
|
|
57
|
-
ExternalInvoiceReference1: '',
|
|
58
|
-
ExternalInvoiceReference2: '',
|
|
59
|
-
FinalPayDate: null,
|
|
60
|
-
Freight: 0,
|
|
61
|
-
FreightVAT: 0,
|
|
62
|
-
Gross: 1271,
|
|
63
|
-
HouseWork: false,
|
|
64
|
-
InvoiceDate: '2025-08-13',
|
|
65
|
-
InvoicePeriodEnd: '',
|
|
66
|
-
InvoicePeriodStart: '',
|
|
67
|
-
InvoiceReference: '0',
|
|
68
|
-
InvoiceRows: [
|
|
69
|
-
{
|
|
70
|
-
AccountNumber: 3001,
|
|
71
|
-
ArticleNumber: '107',
|
|
72
|
-
ContributionPercent: '100',
|
|
73
|
-
ContributionValue: '500',
|
|
74
|
-
Cost: 0,
|
|
75
|
-
CostCenter: null,
|
|
76
|
-
DeliveredQuantity: '5',
|
|
77
|
-
Description: 'First article',
|
|
78
|
-
Discount: 0,
|
|
79
|
-
DiscountType: 'PERCENT',
|
|
80
|
-
HouseWork: false,
|
|
81
|
-
HouseWorkHoursToReport: null,
|
|
82
|
-
HouseWorkType: null,
|
|
83
|
-
Price: 100,
|
|
84
|
-
PriceExcludingVAT: 100,
|
|
85
|
-
Project: '',
|
|
86
|
-
RowId: 395,
|
|
87
|
-
StockPointCode: null,
|
|
88
|
-
Total: 500,
|
|
89
|
-
TotalExcludingVAT: 500,
|
|
90
|
-
Unit: 'st',
|
|
91
|
-
VAT: 25,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
AccountNumber: 3001,
|
|
95
|
-
ArticleNumber: '108',
|
|
96
|
-
ContributionPercent: '100',
|
|
97
|
-
ContributionValue: '738',
|
|
98
|
-
Cost: 0,
|
|
99
|
-
CostCenter: null,
|
|
100
|
-
DeliveredQuantity: '6',
|
|
101
|
-
Description: 'Second article',
|
|
102
|
-
Discount: 0,
|
|
103
|
-
DiscountType: 'PERCENT',
|
|
104
|
-
HouseWork: false,
|
|
105
|
-
HouseWorkHoursToReport: null,
|
|
106
|
-
HouseWorkType: null,
|
|
107
|
-
Price: 123,
|
|
108
|
-
PriceExcludingVAT: 123,
|
|
109
|
-
Project: '',
|
|
110
|
-
RowId: 396,
|
|
111
|
-
StockPointCode: null,
|
|
112
|
-
Total: 738,
|
|
113
|
-
TotalExcludingVAT: 738,
|
|
114
|
-
Unit: 'st',
|
|
115
|
-
VAT: 25,
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
AccountNumber: 3001,
|
|
119
|
-
ArticleNumber: '109',
|
|
120
|
-
ContributionPercent: '100',
|
|
121
|
-
ContributionValue: '33',
|
|
122
|
-
Cost: 0,
|
|
123
|
-
CostCenter: null,
|
|
124
|
-
DeliveredQuantity: '3',
|
|
125
|
-
Description: 'Third article',
|
|
126
|
-
Discount: 0,
|
|
127
|
-
DiscountType: 'PERCENT',
|
|
128
|
-
HouseWork: false,
|
|
129
|
-
HouseWorkHoursToReport: null,
|
|
130
|
-
HouseWorkType: null,
|
|
131
|
-
Price: 11,
|
|
132
|
-
PriceExcludingVAT: 11,
|
|
133
|
-
Project: '',
|
|
134
|
-
RowId: 397,
|
|
135
|
-
StockPointCode: null,
|
|
136
|
-
Total: 33,
|
|
137
|
-
TotalExcludingVAT: 33,
|
|
138
|
-
Unit: 'st',
|
|
139
|
-
VAT: 25,
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
InvoiceType: 'INVOICE',
|
|
143
|
-
Labels: [],
|
|
144
|
-
Language: 'SV',
|
|
145
|
-
LastRemindDate: null,
|
|
146
|
-
Net: 1271,
|
|
147
|
-
NotCompleted: false,
|
|
148
|
-
NoxFinans: false,
|
|
149
|
-
OCR: '13359',
|
|
150
|
-
OfferReference: '0',
|
|
151
|
-
OrderReference: '0',
|
|
152
|
-
OrganisationNumber: '1298737894',
|
|
153
|
-
OurReference: 'Aspen The Dog',
|
|
154
|
-
OutboundDate: '2025-08-13',
|
|
155
|
-
PaymentWay: '',
|
|
156
|
-
Phone1: '0418459862',
|
|
157
|
-
Phone2: '',
|
|
158
|
-
PriceList: 'A',
|
|
159
|
-
PrintTemplate: 'st',
|
|
160
|
-
Project: '',
|
|
161
|
-
Remarks: '',
|
|
162
|
-
Reminders: 0,
|
|
163
|
-
RoundOff: 0.25,
|
|
164
|
-
Sent: false,
|
|
165
|
-
TaxReduction: null,
|
|
166
|
-
TaxReductionType: 'none',
|
|
167
|
-
TermsOfDelivery: '',
|
|
168
|
-
TermsOfPayment: '30',
|
|
169
|
-
TimeBasisReference: null,
|
|
170
|
-
Total: 1589,
|
|
171
|
-
TotalToPay: 1589,
|
|
172
|
-
TotalVAT: 317.75,
|
|
173
|
-
VATIncluded: false,
|
|
174
|
-
VoucherNumber: 18,
|
|
175
|
-
VoucherSeries: 'B',
|
|
176
|
-
VoucherYear: 8,
|
|
177
|
-
WarehouseReady: true,
|
|
178
|
-
WayOfDelivery: '',
|
|
179
|
-
YourOrderNumber: '',
|
|
180
|
-
YourReference: 'Miki',
|
|
181
|
-
ZipCode: '21114',
|
|
182
|
-
} satisfies FortnoxInvoiceData;
|
package/tests/transform.spec.ts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CustomLimeTypeNames,
|
|
3
|
-
CustomPropertiesNames,
|
|
4
|
-
SearchParameters,
|
|
5
|
-
transform,
|
|
6
|
-
} from '../nodes/lime-crm/resources/erpConnector/transform';
|
|
7
|
-
|
|
8
|
-
import { invoice } from './fixtures/fortnox';
|
|
9
|
-
|
|
10
|
-
describe('Fortnox transformer tests', () => {
|
|
11
|
-
it('should transform invoice for Fortnox', () => {
|
|
12
|
-
const searchParameters: SearchParameters = {};
|
|
13
|
-
const customLimeTipeNames: CustomLimeTypeNames = {};
|
|
14
|
-
const customPropertiesNames: CustomPropertiesNames = {};
|
|
15
|
-
|
|
16
|
-
const result = transform(
|
|
17
|
-
'fortnox',
|
|
18
|
-
'invoice',
|
|
19
|
-
invoice,
|
|
20
|
-
searchParameters,
|
|
21
|
-
customLimeTipeNames,
|
|
22
|
-
customPropertiesNames
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
expect(result).toStrictEqual([
|
|
26
|
-
{
|
|
27
|
-
_limetype: 'invoice',
|
|
28
|
-
_search: {},
|
|
29
|
-
company: {
|
|
30
|
-
_search: { create: false, property: 'erp_id', value: '3' },
|
|
31
|
-
},
|
|
32
|
-
coworker: {
|
|
33
|
-
_search: {
|
|
34
|
-
create: false,
|
|
35
|
-
property: 'name',
|
|
36
|
-
value: 'Aspen The Dog',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
currency: 'SEK',
|
|
40
|
-
customer_reference: 'Miki',
|
|
41
|
-
customerid: '3',
|
|
42
|
-
invoice_balance: 1589,
|
|
43
|
-
invoice_date: '2025-08-13',
|
|
44
|
-
invoice_expires: '2025-09-12',
|
|
45
|
-
invoice_number: '1',
|
|
46
|
-
invoice_shredded: false,
|
|
47
|
-
invoice_sum: 1271,
|
|
48
|
-
invoice_total_sum: 1589,
|
|
49
|
-
invoice_type: 'INVOICE',
|
|
50
|
-
invoice_vat: 317.75,
|
|
51
|
-
paid: false,
|
|
52
|
-
paid_date: null,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
_limetype: 'invoicerow',
|
|
56
|
-
_search: { create: true, property: 'rowid', value: 395 },
|
|
57
|
-
company: {
|
|
58
|
-
_search: { create: false, property: 'erp_id', value: '3' },
|
|
59
|
-
},
|
|
60
|
-
description: 'First article',
|
|
61
|
-
invoice: {
|
|
62
|
-
_search: {
|
|
63
|
-
create: false,
|
|
64
|
-
property: 'invoice_number',
|
|
65
|
-
value: '1',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
item: '107',
|
|
69
|
-
row_margin: 100,
|
|
70
|
-
row_value: 500,
|
|
71
|
-
rowid: 395,
|
|
72
|
-
units: 5,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
_limetype: 'invoicerow',
|
|
76
|
-
_search: { create: true, property: 'rowid', value: 396 },
|
|
77
|
-
company: {
|
|
78
|
-
_search: { create: false, property: 'erp_id', value: '3' },
|
|
79
|
-
},
|
|
80
|
-
description: 'Second article',
|
|
81
|
-
invoice: {
|
|
82
|
-
_search: {
|
|
83
|
-
create: false,
|
|
84
|
-
property: 'invoice_number',
|
|
85
|
-
value: '1',
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
item: '108',
|
|
89
|
-
row_margin: 100,
|
|
90
|
-
row_value: 738,
|
|
91
|
-
rowid: 396,
|
|
92
|
-
units: 6,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
_limetype: 'invoicerow',
|
|
96
|
-
_search: { create: true, property: 'rowid', value: 397 },
|
|
97
|
-
company: {
|
|
98
|
-
_search: { create: false, property: 'erp_id', value: '3' },
|
|
99
|
-
},
|
|
100
|
-
description: 'Third article',
|
|
101
|
-
invoice: {
|
|
102
|
-
_search: {
|
|
103
|
-
create: false,
|
|
104
|
-
property: 'invoice_number',
|
|
105
|
-
value: '1',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
item: '109',
|
|
109
|
-
row_margin: 100,
|
|
110
|
-
row_value: 33,
|
|
111
|
-
rowid: 397,
|
|
112
|
-
units: 3,
|
|
113
|
-
},
|
|
114
|
-
]);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('should transform invoice for Fortnox with search parameters', () => {
|
|
118
|
-
const searchParameters: SearchParameters = {
|
|
119
|
-
create: false,
|
|
120
|
-
property: 'invoice_number',
|
|
121
|
-
value: '2137',
|
|
122
|
-
};
|
|
123
|
-
const customLimeTipeNames: CustomLimeTypeNames = {};
|
|
124
|
-
const customPropertiesNames: CustomPropertiesNames = {};
|
|
125
|
-
|
|
126
|
-
const result = transform(
|
|
127
|
-
'fortnox',
|
|
128
|
-
'invoice',
|
|
129
|
-
invoice,
|
|
130
|
-
searchParameters,
|
|
131
|
-
customLimeTipeNames,
|
|
132
|
-
customPropertiesNames
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
expect(result[0]['_search']).toStrictEqual({
|
|
136
|
-
create: false,
|
|
137
|
-
property: 'invoice_number',
|
|
138
|
-
value: '2137',
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('should transform invoice for Fortnox with custom limeType names', () => {
|
|
143
|
-
const searchParameters: SearchParameters = {};
|
|
144
|
-
const customLimeTipeNames: CustomLimeTypeNames = {
|
|
145
|
-
invoice: 'document',
|
|
146
|
-
invoicerow: 'documentrow',
|
|
147
|
-
};
|
|
148
|
-
const customPropertiesNames: CustomPropertiesNames = {};
|
|
149
|
-
|
|
150
|
-
const result = transform(
|
|
151
|
-
'fortnox',
|
|
152
|
-
'invoice',
|
|
153
|
-
invoice,
|
|
154
|
-
searchParameters,
|
|
155
|
-
customLimeTipeNames,
|
|
156
|
-
customPropertiesNames
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
expect(result[0]['_limetype']).toEqual('document');
|
|
160
|
-
expect(result[1]['_limetype']).toEqual('documentrow');
|
|
161
|
-
expect(result[2]['_limetype']).toEqual('documentrow');
|
|
162
|
-
expect(result[3]['_limetype']).toEqual('documentrow');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('should transform invoice for Fortnox with custom properties names', () => {
|
|
166
|
-
const searchParameters: SearchParameters = {};
|
|
167
|
-
const customLimeTipeNames: CustomLimeTypeNames = {};
|
|
168
|
-
const customPropertiesNames: CustomPropertiesNames = {
|
|
169
|
-
invoice: { paid: 'is_paid' },
|
|
170
|
-
invoicerow: { row_value: 'value' },
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const result = transform(
|
|
174
|
-
'fortnox',
|
|
175
|
-
'invoice',
|
|
176
|
-
invoice,
|
|
177
|
-
searchParameters,
|
|
178
|
-
customLimeTipeNames,
|
|
179
|
-
customPropertiesNames
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
expect(result[0]).toHaveProperty('is_paid');
|
|
183
|
-
expect(result[1]).toHaveProperty('value');
|
|
184
|
-
expect(result[2]).toHaveProperty('value');
|
|
185
|
-
expect(result[3]).toHaveProperty('value');
|
|
186
|
-
});
|
|
187
|
-
});
|