@limetech/n8n-nodes-lime 0.5.0 → 2.5.0-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 +4 -2
- package/.github/workflows/release.yml +8 -41
- package/.github/workflows/test-and-build.yml +1 -16
- package/.releaserc.json +2 -1
- package/CHANGELOG.md +155 -0
- package/Dockerfile +0 -21
- 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/errorHandling.ts +60 -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 +89 -11
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +75 -21
- package/nodes/lime-crm/index.ts +9 -0
- package/nodes/lime-crm/methods/getLimetypeProperties.ts +53 -8
- package/nodes/lime-crm/methods/getLimetypes.ts +15 -9
- package/nodes/lime-crm/methods/index.ts +6 -1
- package/nodes/lime-crm/methods/resourceMapping.ts +141 -0
- 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 +65 -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 +94 -0
- package/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.ts +174 -0
- package/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.ts +112 -0
- package/nodes/lime-crm/resources/admin/operations/index.ts +8 -0
- package/nodes/lime-crm/resources/data/index.ts +77 -31
- package/nodes/lime-crm/resources/data/operations/{createSingleObject.ts → createSingleObject.operation.ts} +64 -54
- package/nodes/lime-crm/resources/data/operations/{deleteSingleObject.ts → deleteSingleObject.operation.ts} +39 -6
- package/nodes/lime-crm/resources/data/operations/{getManyObjects.ts → getManyObjects.operation.ts} +195 -48
- package/nodes/lime-crm/resources/data/operations/{getSingleFile.ts → getSingleFile.operation.ts} +47 -11
- package/nodes/lime-crm/resources/data/operations/{getSingleObject.ts → getSingleObject.operation.ts} +50 -8
- package/nodes/lime-crm/resources/data/operations/index.ts +24 -0
- package/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.ts +83 -61
- package/nodes/lime-crm/resources/metadata/index.ts +60 -16
- package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +18 -4
- package/nodes/lime-crm/resources/metadata/operations/{getSingleFileMetadata.ts → getSingleFileMetadata.operation.ts} +46 -26
- package/nodes/lime-crm/resources/metadata/operations/{getSingleLimetype.ts → getSingleLimetype.operation.ts} +30 -3
- package/nodes/lime-crm/resources/metadata/operations/index.ts +12 -0
- package/nodes/lime-crm/transport/commons.ts +90 -18
- package/nodes/lime-crm/transport/files.ts +161 -71
- package/nodes/lime-crm/transport/index.ts +35 -17
- package/nodes/lime-crm/transport/limeQuery.ts +43 -7
- package/nodes/lime-crm/transport/limeobjects.ts +113 -178
- package/nodes/lime-crm/transport/limetypes.ts +125 -48
- package/nodes/lime-crm/transport/users.ts +300 -0
- package/nodes/lime-crm/transport/webhooks.ts +97 -37
- package/nodes/lime-crm/{commons → utils}/files.ts +79 -26
- package/nodes/lime-crm/utils/hmac.ts +35 -0
- package/nodes/lime-crm/utils/index.ts +10 -0
- package/nodes/lime-crm/utils/webhook.ts +81 -0
- package/nodes/modules.ts +44 -0
- package/nodes/response.ts +54 -0
- package/package.json +21 -28
- package/tests/nodes/lime-crm/methods.spec.ts +91 -0
- package/tests/nodes/lime-crm/utils.spec.ts +273 -0
- package/typedoc.css +9 -0
- package/typedoc.json +19 -0
- package/.dockerignore +0 -1
- 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/restore_script/README +0 -42
- package/restore_script/api_key_download.txt +0 -0
- package/restore_script/api_key_upload.txt +0 -0
- package/restore_script/cli.py +0 -73
- package/restore_script/download.py +0 -73
- package/restore_script/main.py +0 -19
- package/restore_script/poetry.lock +0 -162
- package/restore_script/pyproject.toml +0 -15
- package/restore_script/transfer.py +0 -41
- package/restore_script/upload.py +0 -66
- package/restore_script/utils.py +0 -42
- package/tests/fixtures/fortnox.ts +0 -182
- package/tests/transform.spec.ts +0 -187
|
@@ -3,7 +3,6 @@ import { apiRequest } from '../../../transport';
|
|
|
3
3
|
import { filterParameters } from '../filterParameters';
|
|
4
4
|
import { sortParameters } from '../sortParameters';
|
|
5
5
|
import { CustomersResponse } from '../model';
|
|
6
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
7
6
|
|
|
8
7
|
export const description = {
|
|
9
8
|
name: 'Get All Customers',
|
|
@@ -46,7 +45,7 @@ export const properties: INodeProperties[] = [
|
|
|
46
45
|
export async function execute(
|
|
47
46
|
this: IExecuteFunctions,
|
|
48
47
|
i: number
|
|
49
|
-
): Promise<
|
|
48
|
+
): Promise<CustomersResponse> {
|
|
50
49
|
const filterParameters = this.getNodeParameter('filterParameters', i, {});
|
|
51
50
|
const sortParameters = this.getNodeParameter(
|
|
52
51
|
'sortParameters',
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as createSingleCustomer from './create.operation';
|
|
2
|
+
export * as deleteSingleCustomer from './delete.operation';
|
|
3
|
+
export * as getSingleCustomer from './get.operation';
|
|
4
|
+
export * as getManyCustomers from './getAll.operation';
|
|
5
|
+
export * as updateSingleCustomer from './update.operation';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
IExecuteFunctions,
|
|
3
|
+
INodeProperties,
|
|
4
|
+
IDataObject,
|
|
5
|
+
NodeOperationError,
|
|
6
|
+
} from 'n8n-workflow';
|
|
2
7
|
import { apiRequest } from '../../../transport';
|
|
3
8
|
import { CustomerResponse } from '../model';
|
|
4
9
|
import { code as currencyCode } from 'currency-codes';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
10
|
|
|
7
11
|
export const description = {
|
|
8
12
|
name: 'Update Customer',
|
|
@@ -11,7 +15,7 @@ export const description = {
|
|
|
11
15
|
action: 'Update a customer',
|
|
12
16
|
};
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
const updateProperties: INodeProperties[] = [
|
|
15
19
|
{
|
|
16
20
|
displayName: 'Name',
|
|
17
21
|
name: 'Name',
|
|
@@ -234,31 +238,31 @@ export const properties: INodeProperties[] = [
|
|
|
234
238
|
export async function execute(
|
|
235
239
|
this: IExecuteFunctions,
|
|
236
240
|
i: number
|
|
237
|
-
): Promise<
|
|
241
|
+
): Promise<CustomerResponse> {
|
|
238
242
|
const customerNumber = this.getNodeParameter('customerNumber', i) as string;
|
|
239
243
|
const fields = this.getNodeParameter('fields', i, {}) as IDataObject;
|
|
240
244
|
|
|
241
245
|
if (Object.keys(fields).length === 0) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
+
throw new NodeOperationError(
|
|
247
|
+
this.getNode(),
|
|
248
|
+
'At least one field must be provided for update'
|
|
249
|
+
);
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
if (fields.name && fields.name === '') {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
+
throw new NodeOperationError(
|
|
254
|
+
this.getNode(),
|
|
255
|
+
'Customer name cannot be empty'
|
|
256
|
+
);
|
|
253
257
|
}
|
|
254
258
|
|
|
255
259
|
if (fields.Currency) {
|
|
256
260
|
fields.Currency = String(fields.Currency).toUpperCase();
|
|
257
261
|
if (currencyCode(fields.Currency) === undefined) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
+
throw new NodeOperationError(
|
|
263
|
+
this.getNode(),
|
|
264
|
+
`Invalid currency code: ${fields.Currency}. Use ISO 4217 currency code.`
|
|
265
|
+
);
|
|
262
266
|
}
|
|
263
267
|
}
|
|
264
268
|
|
|
@@ -270,19 +274,15 @@ export async function execute(
|
|
|
270
274
|
|
|
271
275
|
const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
|
|
272
276
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (response.success) return response;
|
|
280
|
-
|
|
281
|
-
return {
|
|
282
|
-
...response,
|
|
283
|
-
metadata: {
|
|
284
|
-
...response.metadata,
|
|
285
|
-
id: customerNumber,
|
|
277
|
+
return await apiRequest<CustomerResponse>(
|
|
278
|
+
this,
|
|
279
|
+
{
|
|
280
|
+
method: 'PUT',
|
|
281
|
+
endpoint: endpoint,
|
|
282
|
+
body: body,
|
|
286
283
|
},
|
|
287
|
-
|
|
284
|
+
{
|
|
285
|
+
id: customerNumber,
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
288
|
}
|
|
@@ -4,10 +4,15 @@ import {
|
|
|
4
4
|
NodePropertyTypes,
|
|
5
5
|
} from 'n8n-workflow';
|
|
6
6
|
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import * as operations from './operations';
|
|
8
|
+
import { N8NOperationModuleHandler } from '../../../modules';
|
|
9
|
+
|
|
10
|
+
const moduleHandler = new N8NOperationModuleHandler([
|
|
11
|
+
operations.createSingleInvoice,
|
|
12
|
+
operations.getManyInvoices,
|
|
13
|
+
operations.getSingleInvoice,
|
|
14
|
+
operations.updateSingleInvoice,
|
|
15
|
+
]);
|
|
11
16
|
|
|
12
17
|
export const invoiceProperties: INodeProperties[] = [
|
|
13
18
|
{
|
|
@@ -20,18 +25,10 @@ export const invoiceProperties: INodeProperties[] = [
|
|
|
20
25
|
resource: ['invoice'],
|
|
21
26
|
},
|
|
22
27
|
},
|
|
23
|
-
options:
|
|
24
|
-
create.description,
|
|
25
|
-
get.description,
|
|
26
|
-
getAll.description,
|
|
27
|
-
update.description,
|
|
28
|
-
],
|
|
28
|
+
options: moduleHandler.getDescriptions(),
|
|
29
29
|
default: 'getAll',
|
|
30
30
|
},
|
|
31
|
-
...
|
|
32
|
-
...get.properties,
|
|
33
|
-
...getAll.properties,
|
|
34
|
-
...update.properties,
|
|
31
|
+
...moduleHandler.getProperties(),
|
|
35
32
|
];
|
|
36
33
|
|
|
37
34
|
export async function invoiceOperations(
|
|
@@ -39,13 +36,14 @@ export async function invoiceOperations(
|
|
|
39
36
|
{ operation, i }: { operation: string; i: number }
|
|
40
37
|
) {
|
|
41
38
|
if (operation === 'create') {
|
|
42
|
-
return await
|
|
39
|
+
return await operations.createSingleInvoice.execute.call(this, i);
|
|
43
40
|
} else if (operation === 'get') {
|
|
44
|
-
return await
|
|
41
|
+
return await operations.getSingleInvoice.execute.call(this, i);
|
|
45
42
|
} else if (operation === 'getAll') {
|
|
46
|
-
return await
|
|
43
|
+
return await operations.getManyInvoices.execute.call(this, i);
|
|
47
44
|
} else if (operation === 'update') {
|
|
48
|
-
return await
|
|
45
|
+
return await operations.updateSingleInvoice.execute.call(this, i);
|
|
49
46
|
}
|
|
50
47
|
return null;
|
|
51
48
|
}
|
|
49
|
+
export * from './operations';
|
|
@@ -2,7 +2,6 @@ import { IExecuteFunctions, INodeProperties, IDataObject } from 'n8n-workflow';
|
|
|
2
2
|
import { apiRequest } from '../../../transport';
|
|
3
3
|
import { CreateInvoiceResponse } from '../model';
|
|
4
4
|
import { invoiceParameters } from '../invoiceParameters';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
5
|
|
|
7
6
|
export const description = {
|
|
8
7
|
name: 'Create',
|
|
@@ -44,7 +43,7 @@ export const properties: INodeProperties[] = [
|
|
|
44
43
|
export async function execute(
|
|
45
44
|
this: IExecuteFunctions,
|
|
46
45
|
i: number
|
|
47
|
-
): Promise<
|
|
46
|
+
): Promise<CreateInvoiceResponse> {
|
|
48
47
|
const customerNumber = this.getNodeParameter('customerNumber', i, {});
|
|
49
48
|
const createParameters = this.getNodeParameter('createParameters', i, {});
|
|
50
49
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
import { apiRequest } from '../../../transport';
|
|
3
3
|
import { GetInvoiceResponse } from '../model';
|
|
4
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
5
4
|
|
|
6
5
|
export const description = {
|
|
7
6
|
name: 'Get',
|
|
@@ -29,7 +28,7 @@ export const properties: INodeProperties[] = [
|
|
|
29
28
|
export async function execute(
|
|
30
29
|
this: IExecuteFunctions,
|
|
31
30
|
i: number
|
|
32
|
-
): Promise<
|
|
31
|
+
): Promise<GetInvoiceResponse> {
|
|
33
32
|
const documentNumber = this.getNodeParameter(
|
|
34
33
|
'documentNumber',
|
|
35
34
|
i,
|
|
@@ -38,18 +37,14 @@ export async function execute(
|
|
|
38
37
|
|
|
39
38
|
const endpoint = `invoices/${encodeURIComponent(documentNumber)}`;
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (response.success) return response;
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
...response,
|
|
50
|
-
metadata: {
|
|
51
|
-
...response.metadata,
|
|
52
|
-
id: documentNumber,
|
|
40
|
+
return await apiRequest<GetInvoiceResponse>(
|
|
41
|
+
this,
|
|
42
|
+
{
|
|
43
|
+
method: 'GET',
|
|
44
|
+
endpoint: endpoint,
|
|
53
45
|
},
|
|
54
|
-
|
|
46
|
+
{
|
|
47
|
+
id: documentNumber,
|
|
48
|
+
}
|
|
49
|
+
);
|
|
55
50
|
}
|
|
@@ -2,7 +2,6 @@ import { IExecuteFunctions, INodeProperties, IDataObject } from 'n8n-workflow';
|
|
|
2
2
|
import { apiRequest } from '../../../transport';
|
|
3
3
|
import { filterParameters } from '../filterParameters';
|
|
4
4
|
import { GetAllInvoicesResponse } from '../model';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
5
|
|
|
7
6
|
export const description = {
|
|
8
7
|
name: 'Get Many',
|
|
@@ -73,7 +72,7 @@ export const properties: INodeProperties[] = [
|
|
|
73
72
|
export async function execute(
|
|
74
73
|
this: IExecuteFunctions,
|
|
75
74
|
i: number
|
|
76
|
-
): Promise<
|
|
75
|
+
): Promise<GetAllInvoicesResponse> {
|
|
77
76
|
const filterParameters = this.getNodeParameter('filterParameters', i, {});
|
|
78
77
|
const sortParameters = this.getNodeParameter('sortParameters', i, '');
|
|
79
78
|
|
|
@@ -2,7 +2,6 @@ import { IExecuteFunctions, INodeProperties, IDataObject } from 'n8n-workflow';
|
|
|
2
2
|
import { apiRequest } from '../../../transport';
|
|
3
3
|
import { CreateInvoiceResponse } from '../model';
|
|
4
4
|
import { invoiceParameters } from '../invoiceParameters';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
5
|
|
|
7
6
|
export const description = {
|
|
8
7
|
name: 'Update',
|
|
@@ -44,7 +43,7 @@ export const properties: INodeProperties[] = [
|
|
|
44
43
|
export async function execute(
|
|
45
44
|
this: IExecuteFunctions,
|
|
46
45
|
i: number
|
|
47
|
-
): Promise<
|
|
46
|
+
): Promise<CreateInvoiceResponse> {
|
|
48
47
|
const documentNumber = this.getNodeParameter(
|
|
49
48
|
'documentNumber',
|
|
50
49
|
i,
|
|
@@ -66,19 +65,15 @@ export async function execute(
|
|
|
66
65
|
|
|
67
66
|
const endpoint = `invoices/${encodeURIComponent(documentNumber)}`;
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (response.success) return response;
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
...response,
|
|
79
|
-
metadata: {
|
|
80
|
-
...response.metadata,
|
|
81
|
-
id: documentNumber,
|
|
68
|
+
return await apiRequest<CreateInvoiceResponse>(
|
|
69
|
+
this,
|
|
70
|
+
{
|
|
71
|
+
method: 'PUT',
|
|
72
|
+
endpoint: endpoint,
|
|
73
|
+
body: body,
|
|
82
74
|
},
|
|
83
|
-
|
|
75
|
+
{
|
|
76
|
+
id: documentNumber,
|
|
77
|
+
}
|
|
78
|
+
);
|
|
84
79
|
}
|
|
@@ -5,18 +5,19 @@ import {
|
|
|
5
5
|
IRequestOptions,
|
|
6
6
|
LoggerProxy as Logger,
|
|
7
7
|
IHttpRequestMethods,
|
|
8
|
+
NodeOperationError,
|
|
8
9
|
} from 'n8n-workflow';
|
|
9
10
|
import { translateErrorCode } from './errorCodes';
|
|
10
11
|
import { ErrorResponseModel } from '../model';
|
|
11
12
|
import { FORTNOX_API_CREDENTIAL_KEY } from '../commons';
|
|
12
|
-
import { NodeResponse } from '../../nodeResponse';
|
|
13
13
|
|
|
14
14
|
export const FORTNOX_BASE_URL = 'https://api.fortnox.se/3/';
|
|
15
15
|
|
|
16
16
|
export async function apiRequest<T>(
|
|
17
17
|
nodeContext: IExecuteFunctions | ILoadOptionsFunctions,
|
|
18
|
-
options: IDataObject
|
|
19
|
-
|
|
18
|
+
options: IDataObject,
|
|
19
|
+
errorMetadata?: Record<string, unknown>
|
|
20
|
+
): Promise<T> {
|
|
20
21
|
const endpoint = options.endpoint;
|
|
21
22
|
const method = options.method as IHttpRequestMethods;
|
|
22
23
|
const credentials = await nodeContext.getCredentials(
|
|
@@ -52,17 +53,15 @@ export async function apiRequest<T>(
|
|
|
52
53
|
// use request instead of requestWithAuthentication cause in the requestWithAuthentication
|
|
53
54
|
// error.error is not set, so we cannot access error.error.ErrorInformation
|
|
54
55
|
// and we cannot translate the error code
|
|
55
|
-
|
|
56
|
+
return await nodeContext.helpers.request.call(
|
|
56
57
|
nodeContext,
|
|
57
58
|
FORTNOX_API_CREDENTIAL_KEY,
|
|
58
59
|
requestOptions
|
|
59
60
|
);
|
|
60
|
-
return {
|
|
61
|
-
success: true,
|
|
62
|
-
data: response,
|
|
63
|
-
};
|
|
64
61
|
} catch (error) {
|
|
65
|
-
const errorResponse: ErrorResponseModel = error.error || {
|
|
62
|
+
const errorResponse: ErrorResponseModel = error.error || {
|
|
63
|
+
ErrorInformation: {},
|
|
64
|
+
};
|
|
66
65
|
// fields in ErrorInformationModel can start with lowercase or uppercase,
|
|
67
66
|
// so we normalize them to lowercase for consistency
|
|
68
67
|
const errorInformation = errorResponse?.ErrorInformation && {
|
|
@@ -89,15 +88,19 @@ export async function apiRequest<T>(
|
|
|
89
88
|
} else {
|
|
90
89
|
message = `API request failed [URL: ${fullUrl}][Method: ${method}]: ${error.message}`;
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
success: false,
|
|
91
|
+
const errorContext = {
|
|
94
92
|
error: message,
|
|
95
93
|
status: error?.cause?.status,
|
|
96
94
|
metadata: {
|
|
97
95
|
qs: options?.qs,
|
|
98
96
|
body: options?.body,
|
|
99
97
|
timeout: options?.timeout,
|
|
98
|
+
...errorMetadata,
|
|
100
99
|
},
|
|
101
100
|
};
|
|
101
|
+
throw new NodeOperationError(
|
|
102
|
+
nodeContext.getNode(),
|
|
103
|
+
JSON.stringify(errorContext)
|
|
104
|
+
);
|
|
102
105
|
}
|
|
103
106
|
}
|
package/nodes/index.ts
ADDED
|
@@ -9,28 +9,71 @@ import {
|
|
|
9
9
|
} from 'n8n-workflow';
|
|
10
10
|
|
|
11
11
|
import { metadataFields, metadataOperations } from './resources/metadata';
|
|
12
|
+
import { adminFields, adminOperations } from './resources/admin';
|
|
12
13
|
import { dataFields, dataOperations } from './resources/data';
|
|
13
14
|
|
|
14
15
|
import {
|
|
16
|
+
ADMIN_RESOURCE,
|
|
15
17
|
DATA_RESOURCE,
|
|
16
18
|
METADATA_RESOURCE,
|
|
17
19
|
LIME_CRM_API_CREDENTIAL_KEY,
|
|
18
|
-
} from './
|
|
20
|
+
} from './models';
|
|
19
21
|
|
|
20
22
|
import {
|
|
21
|
-
getEntitiesForErpSystem,
|
|
22
23
|
getFileProperties,
|
|
23
24
|
getLimetypeProperties,
|
|
24
25
|
getLimetypes,
|
|
25
26
|
getNoHasManyProperties,
|
|
27
|
+
getCreateMappingColumns,
|
|
28
|
+
getUpdateMappingColumns,
|
|
26
29
|
} from './methods';
|
|
27
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Representation of a function that executes a specific Lime CRM operation.
|
|
33
|
+
*
|
|
34
|
+
* This function type is used by the Lime CRM node to dynamically invoke
|
|
35
|
+
* the appropriate handler (e.g., metadata or data operations) during node execution.
|
|
36
|
+
*
|
|
37
|
+
* @param this - The n8n {@link IExecuteFunctions} context, providing access to
|
|
38
|
+
* node parameters, credentials, and helper methods.
|
|
39
|
+
* @param args - The arguments used for the operation.
|
|
40
|
+
* @param args.operation - The name of the operation to execute (e.g., "getAll", "create").
|
|
41
|
+
* @param args.i - The index of the current item being processed in the n8n execution loop.
|
|
42
|
+
*
|
|
43
|
+
* @returns A promise that resolves with the result of the operation.
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
* @group Node Definition
|
|
47
|
+
*/
|
|
28
48
|
type OperationFn = (
|
|
29
49
|
this: IExecuteFunctions,
|
|
30
50
|
args: { operation: string; i: number }
|
|
31
51
|
) => Promise<unknown>;
|
|
32
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The main n8n node for interacting with the Lime CRM API.
|
|
55
|
+
*
|
|
56
|
+
* Provides two resource groups:
|
|
57
|
+
* - **Metadata**: Allows interaction with the structure of available Limetypes and their properties.
|
|
58
|
+
* - **Data**: Enables operations on Lime CRM data objects.
|
|
59
|
+
*
|
|
60
|
+
* The node dynamically loads available Lime CRM resources and properties and routes
|
|
61
|
+
* executions to the appropriate operation handlers.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* This node uses {@link metadataOperations} and {@link dataOperations} to process workflow executions
|
|
65
|
+
* based on the selected resource and operation.
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
* @group Node Definition
|
|
69
|
+
*/
|
|
33
70
|
export class LimeCrmNode implements INodeType {
|
|
71
|
+
/**
|
|
72
|
+
* Node configuration and metadata, defining available resources, operations, and credentials.
|
|
73
|
+
* Describes how the Lime CRM node appears and behaves in the n8n editor.
|
|
74
|
+
*
|
|
75
|
+
* @see {@link https://docs.n8n.io/integrations/creating-nodes/#node-description}
|
|
76
|
+
*/
|
|
34
77
|
description: INodeTypeDescription = {
|
|
35
78
|
displayName: 'Lime CRM',
|
|
36
79
|
name: 'limeCrm',
|
|
@@ -51,6 +94,7 @@ export class LimeCrmNode implements INodeType {
|
|
|
51
94
|
required: true,
|
|
52
95
|
},
|
|
53
96
|
],
|
|
97
|
+
usableAsTool: true,
|
|
54
98
|
properties: [
|
|
55
99
|
{
|
|
56
100
|
displayName: 'Resource',
|
|
@@ -70,28 +114,60 @@ export class LimeCrmNode implements INodeType {
|
|
|
70
114
|
value: DATA_RESOURCE,
|
|
71
115
|
description: 'Work with CRM data',
|
|
72
116
|
},
|
|
117
|
+
{
|
|
118
|
+
name: 'Admin',
|
|
119
|
+
value: ADMIN_RESOURCE,
|
|
120
|
+
description: 'Work with administrative data',
|
|
121
|
+
},
|
|
73
122
|
],
|
|
74
123
|
default: DATA_RESOURCE,
|
|
75
124
|
},
|
|
76
125
|
|
|
77
126
|
...(metadataFields as INodeProperties[]),
|
|
78
127
|
...(dataFields as INodeProperties[]),
|
|
128
|
+
...(adminFields as INodeProperties[]),
|
|
79
129
|
],
|
|
80
130
|
};
|
|
81
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Methods used by the Lime CRM node to load dynamic options in the n8n UI.
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* These functions are used to populate dropdowns and lists in the node's
|
|
137
|
+
* parameter editor. For details, see:
|
|
138
|
+
* - {@link getLimetypes}
|
|
139
|
+
* - {@link getFileProperties}
|
|
140
|
+
* - {@link getLimetypeProperties}
|
|
141
|
+
* - {@link getNoHasManyProperties}
|
|
142
|
+
* - {@link getUpdateMappingColumns}
|
|
143
|
+
* - {@link getCreateMappingColumns}
|
|
144
|
+
*/
|
|
82
145
|
methods = {
|
|
83
146
|
loadOptions: {
|
|
84
|
-
getEntitiesForErpSystem,
|
|
85
147
|
getLimetypes,
|
|
86
|
-
getFileProperties,
|
|
87
148
|
getLimetypeProperties,
|
|
149
|
+
getFileProperties,
|
|
88
150
|
getNoHasManyProperties,
|
|
89
151
|
},
|
|
152
|
+
resourceMapping: {
|
|
153
|
+
getUpdateMappingColumns,
|
|
154
|
+
getCreateMappingColumns,
|
|
155
|
+
},
|
|
90
156
|
};
|
|
91
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Execute the selected operation for the configured resource.
|
|
160
|
+
*
|
|
161
|
+
* Routes the execution to either {@link metadataOperations} or {@link dataOperations},
|
|
162
|
+
* based on the user’s selection in the n8n UI.
|
|
163
|
+
*
|
|
164
|
+
* @returns A two-dimensional array of execution data for downstream nodes.
|
|
165
|
+
*
|
|
166
|
+
* @throws Error - Will throw an error if execution fails and `continueOnFail` is not enabled
|
|
167
|
+
*/
|
|
92
168
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
93
169
|
const items = this.getInputData();
|
|
94
|
-
|
|
170
|
+
let returnData: INodeExecutionData[] = [];
|
|
95
171
|
|
|
96
172
|
const resource = this.getNodeParameter('resource', 0) as string;
|
|
97
173
|
const operation = this.getNodeParameter('operation', 0) as string;
|
|
@@ -106,23 +182,25 @@ export class LimeCrmNode implements INodeType {
|
|
|
106
182
|
operationFn = dataOperations;
|
|
107
183
|
break;
|
|
108
184
|
}
|
|
185
|
+
case ADMIN_RESOURCE: {
|
|
186
|
+
operationFn = adminOperations;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
109
189
|
}
|
|
110
190
|
|
|
111
191
|
for (let i = 0; i < items.length; i++) {
|
|
112
192
|
if (!operationFn) continue;
|
|
113
193
|
try {
|
|
114
|
-
const responseData = await operationFn.call(this, {
|
|
194
|
+
const responseData = (await operationFn.call(this, {
|
|
115
195
|
operation,
|
|
116
196
|
i,
|
|
117
|
-
});
|
|
197
|
+
})) as INodeExecutionData | INodeExecutionData[] | undefined;
|
|
118
198
|
if (responseData !== undefined) {
|
|
119
|
-
returnData.
|
|
120
|
-
responseData as unknown as INodeExecutionData
|
|
121
|
-
);
|
|
199
|
+
returnData = returnData.concat(responseData);
|
|
122
200
|
}
|
|
123
201
|
} catch (error) {
|
|
124
202
|
if (this.continueOnFail()) {
|
|
125
|
-
returnData.push({ error: error.message });
|
|
203
|
+
returnData.push({ json: {}, error: error.message });
|
|
126
204
|
continue;
|
|
127
205
|
}
|
|
128
206
|
throw error;
|