@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
package/nodes/lime-crm/resources/data/operations/{getSingleObject.ts → getSingleObject.operation.ts}
RENAMED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
|
|
3
|
-
import { getLimeobject } from '../../../transport';
|
|
4
|
-
import { DATA_RESOURCE } from '../../../
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { getLimeobject, getProperties } from '../../../transport';
|
|
4
|
+
import { DATA_RESOURCE, Limeobject } from '../../../models';
|
|
5
|
+
import { getFilePropertiesNames, processFileResponse } from '../../../utils';
|
|
6
|
+
import { WorkflowFileResponse } from '../../../../response';
|
|
7
|
+
/**
|
|
8
|
+
* Description and metadata for the "Get Single Object" operation in Lime CRM.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
7
12
|
export const description = {
|
|
8
13
|
name: 'Get Single Object',
|
|
9
14
|
value: 'getSingleObject',
|
|
@@ -11,6 +16,15 @@ export const description = {
|
|
|
11
16
|
action: 'Get single object',
|
|
12
17
|
};
|
|
13
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Node properties for the "Get Single Object" operation.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} limetype - The type of entity to retrieve. Loaded from available Limetypes
|
|
23
|
+
* @param {string} objectId - The ID of the object to retrieve
|
|
24
|
+
* @param {boolean} includeFileContent - Whether to include file binary data for Limetypes that have file properties. Ignored for Limetypes without file properties
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
14
28
|
export const properties: INodeProperties[] = [
|
|
15
29
|
{
|
|
16
30
|
displayName: 'Limetype',
|
|
@@ -62,7 +76,28 @@ export const properties: INodeProperties[] = [
|
|
|
62
76
|
},
|
|
63
77
|
];
|
|
64
78
|
|
|
65
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Execute the "Get Single Object" operation for Lime CRM.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This method retrieves a single Lime CRM object identified by its object ID and Limetype.
|
|
84
|
+
* If `includeFileContent` is true, it also retrieves binary data for any file properties of the object.
|
|
85
|
+
*
|
|
86
|
+
* The method performs the following steps:
|
|
87
|
+
* 1. Retrieves the `limetype`, `objectId`, and `includeFileContent` from {@link properties}.
|
|
88
|
+
* 2. Calls {@link getLimeobject} to fetch the object from Lime CRM.
|
|
89
|
+
* 3. If the object has file properties and `includeFileContent` is true, it retrieves file data using {@link getFilePropertiesNames} and {@link processFileResponse}.
|
|
90
|
+
*
|
|
91
|
+
* @param i - The index of the current item in the workflow execution
|
|
92
|
+
*
|
|
93
|
+
* @returns The Lime object data, optionally including file binary content.
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
export async function execute(
|
|
98
|
+
this: IExecuteFunctions,
|
|
99
|
+
i: number
|
|
100
|
+
): Promise<WorkflowFileResponse<Limeobject>> {
|
|
66
101
|
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
67
102
|
const objectId = this.getNodeParameter('objectId', i) as string;
|
|
68
103
|
const includeFileContent = this.getNodeParameter(
|
|
@@ -71,13 +106,20 @@ export async function execute(this: IExecuteFunctions, i: number) {
|
|
|
71
106
|
) as boolean;
|
|
72
107
|
|
|
73
108
|
const limeObjectResponse = await getLimeobject(this, limetype, objectId);
|
|
74
|
-
if (!limeObjectResponse.success) return { json: limeObjectResponse };
|
|
109
|
+
if (!limeObjectResponse.success) return { json: limeObjectResponse.data };
|
|
110
|
+
|
|
111
|
+
const propertiesResponse = await getProperties(this, limetype);
|
|
112
|
+
if (!propertiesResponse.success) return { json: propertiesResponse.data };
|
|
75
113
|
|
|
76
|
-
const fileProperties =
|
|
77
|
-
|
|
114
|
+
const fileProperties = getFilePropertiesNames(propertiesResponse.data);
|
|
115
|
+
const fileResponse = await processFileResponse<Limeobject>(
|
|
78
116
|
this,
|
|
79
117
|
fileProperties,
|
|
80
118
|
limeObjectResponse.data,
|
|
81
119
|
includeFileContent
|
|
82
120
|
);
|
|
121
|
+
return {
|
|
122
|
+
json: fileResponse.json.data,
|
|
123
|
+
binary: fileResponse.binary,
|
|
124
|
+
};
|
|
83
125
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @group Resources
|
|
3
|
+
*/
|
|
4
|
+
export * as createSingleObject from './createSingleObject.operation';
|
|
5
|
+
/**
|
|
6
|
+
* @group Resources
|
|
7
|
+
*/
|
|
8
|
+
export * as getSingleObject from './getSingleObject.operation';
|
|
9
|
+
/**
|
|
10
|
+
* @group Resources
|
|
11
|
+
*/
|
|
12
|
+
export * as updateSingleObject from './updateSingleObject.operation';
|
|
13
|
+
/**
|
|
14
|
+
* @group Resources
|
|
15
|
+
*/
|
|
16
|
+
export * as deleteSingleObject from './deleteSingleObject.operation';
|
|
17
|
+
/**
|
|
18
|
+
* @group Resources
|
|
19
|
+
*/
|
|
20
|
+
export * as getManyObjects from './getManyObjects.operation';
|
|
21
|
+
/**
|
|
22
|
+
* @group Resources
|
|
23
|
+
*/
|
|
24
|
+
export * as getSingleFile from './getSingleFile.operation';
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { updateLimeobject } from '../../../transport';
|
|
3
|
-
import { DATA_RESOURCE } from '../../../
|
|
2
|
+
import { getProperties, updateLimeobject } from '../../../transport';
|
|
3
|
+
import { DATA_RESOURCE, Limeobject } from '../../../models';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
getFilePropertiesNames,
|
|
6
6
|
processFileResponse,
|
|
7
7
|
setFileProperties,
|
|
8
|
-
} from '../../../
|
|
8
|
+
} from '../../../utils';
|
|
9
|
+
import { WorkflowFileResponse } from '../../../../response';
|
|
10
|
+
import { parseResourceMapperFields } from '../../../methods';
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Description and metadata for the "Update Single Object" operation in Lime CRM.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
11
17
|
export const description = {
|
|
12
18
|
name: 'Update Single Object',
|
|
13
19
|
value: 'updateSingleObject',
|
|
@@ -15,6 +21,17 @@ export const description = {
|
|
|
15
21
|
action: 'Update single object',
|
|
16
22
|
};
|
|
17
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Node properties for the "Update Single Object" operation.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} limetype - The type of entity to update. Loaded from available Limetypes
|
|
28
|
+
* @param {string} id - The ID of the object to update
|
|
29
|
+
* @param {'simple' | 'json'} inputType - How the object data is provided: 'simple' for form inputs, 'json' for raw JSON
|
|
30
|
+
* @param {IDataObject} simpleFields - Used if `inputType` is 'simple'. List of field name/value pairs to update
|
|
31
|
+
* @param {string} jsonData - Used if `inputType` is 'json'. Full object data in JSON format
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
18
35
|
export const properties: INodeProperties[] = [
|
|
19
36
|
{
|
|
20
37
|
displayName: 'Limetype',
|
|
@@ -54,7 +71,7 @@ export const properties: INodeProperties[] = [
|
|
|
54
71
|
options: [
|
|
55
72
|
{
|
|
56
73
|
name: 'Simple Fields',
|
|
57
|
-
value: '
|
|
74
|
+
value: 'fields',
|
|
58
75
|
description: 'Define fields using the UI',
|
|
59
76
|
},
|
|
60
77
|
{
|
|
@@ -63,7 +80,7 @@ export const properties: INodeProperties[] = [
|
|
|
63
80
|
description: 'Define fields using JSON',
|
|
64
81
|
},
|
|
65
82
|
],
|
|
66
|
-
default: '
|
|
83
|
+
default: 'fields',
|
|
67
84
|
description: 'How to input the data',
|
|
68
85
|
displayOptions: {
|
|
69
86
|
show: {
|
|
@@ -92,81 +109,80 @@ export const properties: INodeProperties[] = [
|
|
|
92
109
|
},
|
|
93
110
|
},
|
|
94
111
|
{
|
|
95
|
-
displayName: '
|
|
96
|
-
name: '
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
displayName: 'Properties',
|
|
113
|
+
name: 'properties',
|
|
114
|
+
type: 'resourceMapper',
|
|
115
|
+
placeholder: 'Add Property',
|
|
99
116
|
typeOptions: {
|
|
100
|
-
|
|
101
|
-
|
|
117
|
+
resourceMapper: {
|
|
118
|
+
resourceMapperMethod: 'getUpdateMappingColumns',
|
|
119
|
+
mode: 'add',
|
|
120
|
+
addAllFields: false,
|
|
121
|
+
supportAutoMap: false,
|
|
122
|
+
},
|
|
123
|
+
loadOptionsDependsOn: ['limetype'],
|
|
124
|
+
},
|
|
125
|
+
default: {
|
|
126
|
+
value: null,
|
|
102
127
|
},
|
|
103
|
-
default: {},
|
|
104
128
|
displayOptions: {
|
|
105
129
|
show: {
|
|
106
130
|
resource: [DATA_RESOURCE],
|
|
107
131
|
operation: ['updateSingleObject'],
|
|
108
|
-
inputType: ['
|
|
132
|
+
inputType: ['fields'],
|
|
109
133
|
},
|
|
110
134
|
},
|
|
111
|
-
options: [
|
|
112
|
-
{
|
|
113
|
-
name: 'field',
|
|
114
|
-
displayName: 'Field',
|
|
115
|
-
values: [
|
|
116
|
-
{
|
|
117
|
-
displayName: 'Field Name',
|
|
118
|
-
name: 'fieldName',
|
|
119
|
-
type: 'options',
|
|
120
|
-
typeOptions: {
|
|
121
|
-
loadOptionsMethod: 'getLimetypeProperties',
|
|
122
|
-
loadOptionsDependsOn: ['limetype'],
|
|
123
|
-
},
|
|
124
|
-
default: '',
|
|
125
|
-
description: 'The name of the field',
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
displayName: 'Field Value',
|
|
129
|
-
name: 'fieldValue',
|
|
130
|
-
type: 'string',
|
|
131
|
-
default: '',
|
|
132
|
-
description: 'The value of the field',
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
135
|
},
|
|
138
136
|
];
|
|
139
137
|
|
|
140
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Execute the "Update Single Object" operation for Lime CRM.
|
|
140
|
+
*
|
|
141
|
+
* @remarks
|
|
142
|
+
* This method updates a single Lime CRM object identified by its ID and Limetype.
|
|
143
|
+
* It supports two input methods:
|
|
144
|
+
* - 'simple': key-value pairs provided via the UI
|
|
145
|
+
* - 'json': full object data in JSON format
|
|
146
|
+
*
|
|
147
|
+
* The method performs the following steps:
|
|
148
|
+
* 1. Retrieves the `limetype`, `id`, and input data from {@link properties}.
|
|
149
|
+
* 2. Collects and prepares any file properties using {@link getFilePropertiesNames} and {@link setFileProperties}.
|
|
150
|
+
* 3. Calls {@link updateLimeobject} to update the object in Lime CRM.
|
|
151
|
+
* 4. Processes the response, including file properties, using {@link processFileResponse}.
|
|
152
|
+
*
|
|
153
|
+
* @param i - The index of the current item in the workflow execution
|
|
154
|
+
*
|
|
155
|
+
* @returns The updated Lime object data, optionally including file binary content.
|
|
156
|
+
*
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
export async function execute(
|
|
160
|
+
this: IExecuteFunctions,
|
|
161
|
+
i: number
|
|
162
|
+
): Promise<WorkflowFileResponse<Limeobject>> {
|
|
141
163
|
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
142
164
|
const id = this.getNodeParameter('id', i) as string;
|
|
143
165
|
const inputType = this.getNodeParameter('inputType', i) as string;
|
|
144
166
|
|
|
145
167
|
let body: IDataObject = {};
|
|
146
168
|
|
|
169
|
+
const propertiesResponse = await getProperties(this, limetype);
|
|
170
|
+
if (!propertiesResponse.success)
|
|
171
|
+
return {
|
|
172
|
+
json: propertiesResponse.data,
|
|
173
|
+
};
|
|
174
|
+
const properties = propertiesResponse.data;
|
|
175
|
+
|
|
147
176
|
if (inputType === 'json') {
|
|
148
177
|
const jsonData = this.getNodeParameter('jsonData', i) as string;
|
|
149
178
|
body = JSON.parse(jsonData);
|
|
150
179
|
} else {
|
|
151
|
-
|
|
152
|
-
'simpleFields.field',
|
|
153
|
-
i,
|
|
154
|
-
[]
|
|
155
|
-
) as IDataObject[];
|
|
156
|
-
for (const field of simpleFields) {
|
|
157
|
-
body[field.fieldName as string] = field.fieldValue;
|
|
158
|
-
}
|
|
180
|
+
body = parseResourceMapperFields(this, i, 'properties');
|
|
159
181
|
}
|
|
160
182
|
|
|
161
|
-
const fileProperties =
|
|
183
|
+
const fileProperties = getFilePropertiesNames(properties);
|
|
162
184
|
|
|
163
|
-
|
|
164
|
-
this,
|
|
165
|
-
i,
|
|
166
|
-
fileProperties,
|
|
167
|
-
body
|
|
168
|
-
);
|
|
169
|
-
if (!setFilePropertiesResponse.success) return setFilePropertiesResponse;
|
|
185
|
+
await setFileProperties(this, i, fileProperties, body);
|
|
170
186
|
|
|
171
187
|
const updateLimeobjectResponse = await updateLimeobject(
|
|
172
188
|
this,
|
|
@@ -174,12 +190,18 @@ export async function execute(this: IExecuteFunctions, i: number) {
|
|
|
174
190
|
id,
|
|
175
191
|
body
|
|
176
192
|
);
|
|
177
|
-
if (!updateLimeobjectResponse.success)
|
|
193
|
+
if (!updateLimeobjectResponse.success)
|
|
194
|
+
return {
|
|
195
|
+
json: updateLimeobjectResponse.data,
|
|
196
|
+
};
|
|
178
197
|
|
|
179
|
-
const response = await processFileResponse(
|
|
198
|
+
const response = await processFileResponse<Limeobject>(
|
|
180
199
|
this,
|
|
181
200
|
fileProperties,
|
|
182
201
|
updateLimeobjectResponse.data
|
|
183
202
|
);
|
|
184
|
-
return
|
|
203
|
+
return {
|
|
204
|
+
json: response.json.data,
|
|
205
|
+
binary: response.binary,
|
|
206
|
+
};
|
|
185
207
|
}
|
|
@@ -6,11 +6,30 @@ import {
|
|
|
6
6
|
NodeOperationError,
|
|
7
7
|
} from 'n8n-workflow';
|
|
8
8
|
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { METADATA_RESOURCE } from '../../commons';
|
|
9
|
+
import * as operations from './operations';
|
|
10
|
+
import { METADATA_RESOURCE } from '../../models';
|
|
11
|
+
import { N8NOperationModuleHandler } from '../../../modules';
|
|
13
12
|
|
|
13
|
+
const moduleHandler = new N8NOperationModuleHandler([
|
|
14
|
+
operations.getAllLimetypes,
|
|
15
|
+
operations.getSingleLimetype,
|
|
16
|
+
operations.getSingleFileMetadata,
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Fields and operations for the **Metadata** resource in Lime CRM.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* - These fields are displayed in the n8n node UI when the resource is set to `Metadata`.
|
|
24
|
+
* - Each operation corresponds to fetching or inspecting metadata in Lime CRM.
|
|
25
|
+
*
|
|
26
|
+
* @group Resources
|
|
27
|
+
* @public
|
|
28
|
+
*
|
|
29
|
+
* @see {@link getAllLimetypes} - Operation to retrieve a list of all available Limetypes
|
|
30
|
+
* @see {@link getSingleLimetype} - Operation to retrieve details about a specific Limetype
|
|
31
|
+
* @see {@link getSingleFileMetadata} - Operation to fetch metadata for a specific file
|
|
32
|
+
*/
|
|
14
33
|
export const metadataFields: INodeProperties[] = [
|
|
15
34
|
{
|
|
16
35
|
displayName: 'Operation',
|
|
@@ -22,31 +41,54 @@ export const metadataFields: INodeProperties[] = [
|
|
|
22
41
|
resource: [METADATA_RESOURCE],
|
|
23
42
|
},
|
|
24
43
|
},
|
|
25
|
-
options:
|
|
26
|
-
|
|
27
|
-
getSingleLimetype.description,
|
|
28
|
-
getSingleFileMetadata.description,
|
|
29
|
-
],
|
|
30
|
-
default: 'listTypes',
|
|
44
|
+
options: moduleHandler.getDescriptions(),
|
|
45
|
+
default: 'getAllLimetypes',
|
|
31
46
|
},
|
|
32
47
|
|
|
33
|
-
...
|
|
34
|
-
...getSingleFileMetadata.properties,
|
|
48
|
+
...moduleHandler.getProperties(),
|
|
35
49
|
];
|
|
36
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Execute a specific **Metadata** operation on Lime CRM.
|
|
53
|
+
*
|
|
54
|
+
* @param args - Contextual parameters for the operation being executed
|
|
55
|
+
* @param args.operation - The operation to perform (e.g., `getAllLimetypes`, `getSingleLimetype`)
|
|
56
|
+
* @param args.i - The index of the input item to process
|
|
57
|
+
*
|
|
58
|
+
* @returns A promise resolving to the n8n object containing the result of the operation.
|
|
59
|
+
*
|
|
60
|
+
* @throws NodeOperationError if the operation is unsupported or fails.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
* @group Resources
|
|
64
|
+
*/
|
|
37
65
|
export async function metadataOperations(
|
|
38
66
|
this: IExecuteFunctions,
|
|
39
67
|
{ operation, i }: { operation: string; i: number }
|
|
40
|
-
): Promise<INodeExecutionData> {
|
|
68
|
+
): Promise<INodeExecutionData | INodeExecutionData[]> {
|
|
41
69
|
switch (operation) {
|
|
42
70
|
case 'getAllLimetypes': {
|
|
43
|
-
|
|
71
|
+
const results = await operations.getAllLimetypes.execute.call(this);
|
|
72
|
+
if (Array.isArray(results)) {
|
|
73
|
+
return results.map((limetype) => ({
|
|
74
|
+
json: limetype,
|
|
75
|
+
}));
|
|
76
|
+
} else {
|
|
77
|
+
return { json: results };
|
|
78
|
+
}
|
|
44
79
|
}
|
|
45
80
|
case 'getSingleLimetype': {
|
|
46
|
-
return {
|
|
81
|
+
return {
|
|
82
|
+
json: await operations.getSingleLimetype.execute.call(this, i),
|
|
83
|
+
};
|
|
47
84
|
}
|
|
48
85
|
case 'getSingleFileMetadata': {
|
|
49
|
-
return {
|
|
86
|
+
return {
|
|
87
|
+
json: await operations.getSingleFileMetadata.execute.call(
|
|
88
|
+
this,
|
|
89
|
+
i
|
|
90
|
+
),
|
|
91
|
+
};
|
|
50
92
|
}
|
|
51
93
|
}
|
|
52
94
|
|
|
@@ -55,3 +97,5 @@ export async function metadataOperations(
|
|
|
55
97
|
`The operation "${operation}" is not supported!`
|
|
56
98
|
);
|
|
57
99
|
}
|
|
100
|
+
|
|
101
|
+
export * from './operations';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
2
|
|
|
3
3
|
import { getLimetypesFromApi } from '../../../transport';
|
|
4
|
-
import { Limetype } from '../../../
|
|
5
|
-
import {
|
|
4
|
+
import { Limetype } from '../../../models';
|
|
5
|
+
import { WorkflowResponse } from '../../../../response';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Description and metadata for the "Get All Limetypes" operation in Lime CRM.
|
|
9
|
+
*/
|
|
7
10
|
export const description = {
|
|
8
11
|
name: 'Get all Limetypes',
|
|
9
12
|
value: 'getAllLimetypes',
|
|
@@ -11,8 +14,19 @@ export const description = {
|
|
|
11
14
|
action: 'Get all Limetypes',
|
|
12
15
|
};
|
|
13
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a list of all available Limetypes from Lime CRM.
|
|
19
|
+
*
|
|
20
|
+
* This operation queries the Lime CRM API for all accessible Limetypes,
|
|
21
|
+
* such as company, person, deal, etc.
|
|
22
|
+
*
|
|
23
|
+
* @returns An array of Limetype objects
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
14
27
|
export async function execute(
|
|
15
28
|
this: IExecuteFunctions
|
|
16
|
-
): Promise<
|
|
17
|
-
|
|
29
|
+
): Promise<WorkflowResponse<Limetype[]>> {
|
|
30
|
+
const response = await getLimetypesFromApi(this);
|
|
31
|
+
return response.data;
|
|
18
32
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
INodeProperties,
|
|
4
|
-
INodeExecutionData,
|
|
5
|
-
NodeOperationError,
|
|
6
|
-
} from 'n8n-workflow';
|
|
7
|
-
import {
|
|
3
|
+
FileMetadata,
|
|
8
4
|
getFileMetadata,
|
|
9
5
|
getFileMetadataByLimeobject,
|
|
10
6
|
} from '../../../transport';
|
|
11
|
-
import { METADATA_RESOURCE } from '../../../
|
|
7
|
+
import { METADATA_RESOURCE } from '../../../models';
|
|
8
|
+
import { APIResponse, WorkflowResponse } from '../../../../response';
|
|
9
|
+
import { handleWorkflowError } from '../../../../errorHandling';
|
|
12
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Description and metadata for the "Get Single File Metadata" operation in Lime CRM.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
13
16
|
export const description = {
|
|
14
17
|
name: 'Get Single File Metadata',
|
|
15
18
|
value: 'getSingleFileMetadata',
|
|
@@ -17,6 +20,16 @@ export const description = {
|
|
|
17
20
|
action: 'Get single file metadata',
|
|
18
21
|
};
|
|
19
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Node parameter definitions for the "Get Single File Metadata" operation.
|
|
25
|
+
*
|
|
26
|
+
* @param source - Determines whether the file is retrieved by its ID or by its associated Limeobject ID
|
|
27
|
+
* @param limetype - The Lime CRM entity type associated with the file (required when `source` is `byLimeobject`)
|
|
28
|
+
* @param identifier - The unique identifier of the file or Limeobject to retrieve metadata for
|
|
29
|
+
* @param property - The file property in the Limeobject containing the file reference (used when `source` is `byLimeobject`)
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
20
33
|
export const properties: INodeProperties[] = [
|
|
21
34
|
{
|
|
22
35
|
displayName: 'Get by',
|
|
@@ -98,33 +111,40 @@ export const properties: INodeProperties[] = [
|
|
|
98
111
|
},
|
|
99
112
|
];
|
|
100
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Execute the "Get Single File Metadata" operation.
|
|
116
|
+
*
|
|
117
|
+
* Retrieves file metadata either directly via its file ID, or through its associated Limeobject.
|
|
118
|
+
* The function dynamically calls the correct method depending on user configuration.
|
|
119
|
+
*
|
|
120
|
+
* @param i - The index of the current item being processed within the n8n execution loop.
|
|
121
|
+
* @returns File metadata
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
101
125
|
export async function execute(
|
|
102
126
|
this: IExecuteFunctions,
|
|
103
127
|
i: number
|
|
104
|
-
): Promise<
|
|
128
|
+
): Promise<WorkflowResponse<FileMetadata>> {
|
|
105
129
|
const source = this.getNodeParameter('source', i) as string;
|
|
106
130
|
const id = this.getNodeParameter('identifier', i) as string;
|
|
131
|
+
let response: APIResponse<FileMetadata>;
|
|
107
132
|
|
|
108
133
|
if (source == 'byFile') {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
if (source == 'byLimeobject') {
|
|
134
|
+
response = await getFileMetadata(this, id);
|
|
135
|
+
} else if (source == 'byLimeobject') {
|
|
114
136
|
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
115
137
|
const property = this.getNodeParameter('property', i) as string;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
138
|
+
response = await getFileMetadataByLimeobject(
|
|
139
|
+
this,
|
|
140
|
+
limetype,
|
|
141
|
+
id,
|
|
142
|
+
property
|
|
143
|
+
);
|
|
144
|
+
} else {
|
|
145
|
+
response = handleWorkflowError(this, {
|
|
146
|
+
message: `The source "${source} is not supported`,
|
|
147
|
+
});
|
|
124
148
|
}
|
|
125
|
-
|
|
126
|
-
throw new NodeOperationError(
|
|
127
|
-
this.getNode(),
|
|
128
|
-
`The source "${source}" is not supported!`
|
|
129
|
-
);
|
|
149
|
+
return response.data;
|
|
130
150
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
import { getLimetype } from '../../../transport/limetypes';
|
|
3
|
-
import { METADATA_RESOURCE } from '../../../
|
|
3
|
+
import { Limetype, METADATA_RESOURCE } from '../../../models';
|
|
4
|
+
import { WorkflowResponse } from '../../../../response';
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Description and metadata for the "Get Single Limetype" operation in Lime CRM.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
5
11
|
export const description = {
|
|
6
12
|
name: 'Get Single Limetype',
|
|
7
13
|
value: 'getSingleLimetype',
|
|
@@ -9,6 +15,13 @@ export const description = {
|
|
|
9
15
|
action: 'Get single Limetype',
|
|
10
16
|
};
|
|
11
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Node parameter definitions for the "Get Single Limetype" operation.
|
|
20
|
+
*
|
|
21
|
+
* @param limetype - The name of the entity type (Limetype) to retrieve details for
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
12
25
|
export const properties: INodeProperties[] = [
|
|
13
26
|
{
|
|
14
27
|
displayName: 'Limetype',
|
|
@@ -29,8 +42,22 @@ export const properties: INodeProperties[] = [
|
|
|
29
42
|
},
|
|
30
43
|
];
|
|
31
44
|
|
|
32
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Execute the "Get Single Limetype" operation.
|
|
47
|
+
*
|
|
48
|
+
* Retrieves detailed information about a specific Limetype from Lime CRM.
|
|
49
|
+
*
|
|
50
|
+
* @param i - The index of the current item being processed within the n8n execution loop.
|
|
51
|
+
* @returns Limetype details as returned from the API.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export async function execute(
|
|
56
|
+
this: IExecuteFunctions,
|
|
57
|
+
i: number
|
|
58
|
+
): Promise<WorkflowResponse<Limetype>> {
|
|
33
59
|
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
34
60
|
|
|
35
|
-
|
|
61
|
+
const response = await getLimetype(this, limetype);
|
|
62
|
+
return response.data;
|
|
36
63
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @group Resources
|
|
3
|
+
*/
|
|
4
|
+
export * as getSingleLimetype from './getSingleLimetype.operation';
|
|
5
|
+
/**
|
|
6
|
+
* @group Resources
|
|
7
|
+
*/
|
|
8
|
+
export * as getAllLimetypes from './getAllLimetypes.operation';
|
|
9
|
+
/**
|
|
10
|
+
* @group Resources
|
|
11
|
+
*/
|
|
12
|
+
export * as getSingleFileMetadata from './getSingleFileMetadata.operation';
|