@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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
import { getLimeobject, getProperties } from '../../../transport';
|
|
4
|
+
import { DATA_RESOURCE } from '../../../models';
|
|
5
|
+
import { getFilePropertiesNames, processFileResponse } from '../../../utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Description and metadata for the "Get Single Object" operation in Lime CRM.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export const description = {
|
|
13
|
+
name: 'Get Single Object',
|
|
14
|
+
value: 'getSingleObject',
|
|
15
|
+
description: 'Get one specific object',
|
|
16
|
+
action: 'Get single object',
|
|
17
|
+
};
|
|
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
|
+
*/
|
|
28
|
+
export const properties: INodeProperties[] = [
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Limetype',
|
|
31
|
+
name: 'limetype',
|
|
32
|
+
type: 'options',
|
|
33
|
+
typeOptions: {
|
|
34
|
+
loadOptionsMethod: 'getLimetypes',
|
|
35
|
+
},
|
|
36
|
+
required: true,
|
|
37
|
+
default: '',
|
|
38
|
+
description: 'The type of entity to retrieve',
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
resource: [DATA_RESOURCE],
|
|
42
|
+
operation: ['getSingleObject'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Object ID',
|
|
49
|
+
name: 'objectId',
|
|
50
|
+
type: 'string',
|
|
51
|
+
required: true,
|
|
52
|
+
default: '',
|
|
53
|
+
description: 'The ID of the object to retrieve',
|
|
54
|
+
displayOptions: {
|
|
55
|
+
show: {
|
|
56
|
+
resource: [DATA_RESOURCE],
|
|
57
|
+
operation: ['getSingleObject'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Include file content',
|
|
63
|
+
name: 'includeFileContent',
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
default: false,
|
|
66
|
+
description:
|
|
67
|
+
'Include file binary data if the Limetype has any file properties. ' +
|
|
68
|
+
'Keep performance in mind before activating this. ' +
|
|
69
|
+
'For Limetypes without any file properties, this setting is ignored.',
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
resource: [DATA_RESOURCE],
|
|
73
|
+
operation: ['getSingleObject'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
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(this: IExecuteFunctions, i: number) {
|
|
98
|
+
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
99
|
+
const objectId = this.getNodeParameter('objectId', i) as string;
|
|
100
|
+
const includeFileContent = this.getNodeParameter(
|
|
101
|
+
'includeFileContent',
|
|
102
|
+
i
|
|
103
|
+
) as boolean;
|
|
104
|
+
|
|
105
|
+
const limeObjectResponse = await getLimeobject(this, limetype, objectId);
|
|
106
|
+
|
|
107
|
+
const propertiesResponse = await getProperties(this, limetype);
|
|
108
|
+
|
|
109
|
+
const fileProperties = getFilePropertiesNames(propertiesResponse);
|
|
110
|
+
return processFileResponse(
|
|
111
|
+
this,
|
|
112
|
+
fileProperties,
|
|
113
|
+
limeObjectResponse,
|
|
114
|
+
includeFileContent
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -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,30 +1,52 @@
|
|
|
1
1
|
import { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { getProperties, updateLimeobject } from '../../../transport';
|
|
3
|
+
import { DATA_RESOURCE } from '../../../models';
|
|
4
|
+
import {
|
|
5
|
+
adaptProperty,
|
|
6
|
+
getFilePropertiesNames,
|
|
7
|
+
getPropertyType,
|
|
8
|
+
processFileResponse,
|
|
9
|
+
setFileProperties,
|
|
10
|
+
} from '../../../utils';
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Description and metadata for the "Update Single Object" operation in Lime CRM.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
6
17
|
export const description = {
|
|
7
|
-
name: 'Update',
|
|
8
|
-
value: '
|
|
9
|
-
description: 'Update
|
|
10
|
-
action: 'Update
|
|
18
|
+
name: 'Update Single Object',
|
|
19
|
+
value: 'updateSingleObject',
|
|
20
|
+
description: 'Update one specific object',
|
|
21
|
+
action: 'Update single object',
|
|
11
22
|
};
|
|
12
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
|
+
*/
|
|
13
35
|
export const properties: INodeProperties[] = [
|
|
14
36
|
{
|
|
15
|
-
displayName: '
|
|
16
|
-
name: '
|
|
37
|
+
displayName: 'Limetype',
|
|
38
|
+
name: 'limetype',
|
|
17
39
|
type: 'options',
|
|
18
40
|
typeOptions: {
|
|
19
|
-
loadOptionsMethod: '
|
|
41
|
+
loadOptionsMethod: 'getLimetypes',
|
|
20
42
|
},
|
|
21
43
|
required: true,
|
|
22
44
|
default: '',
|
|
23
45
|
description: 'The type of entity to update',
|
|
24
46
|
displayOptions: {
|
|
25
47
|
show: {
|
|
26
|
-
resource: [
|
|
27
|
-
operation: ['
|
|
48
|
+
resource: [DATA_RESOURCE],
|
|
49
|
+
operation: ['updateSingleObject'],
|
|
28
50
|
},
|
|
29
51
|
},
|
|
30
52
|
},
|
|
@@ -37,8 +59,8 @@ export const properties: INodeProperties[] = [
|
|
|
37
59
|
description: 'ID of the record to update',
|
|
38
60
|
displayOptions: {
|
|
39
61
|
show: {
|
|
40
|
-
resource: [
|
|
41
|
-
operation: ['
|
|
62
|
+
resource: [DATA_RESOURCE],
|
|
63
|
+
operation: ['updateSingleObject'],
|
|
42
64
|
},
|
|
43
65
|
},
|
|
44
66
|
},
|
|
@@ -62,8 +84,8 @@ export const properties: INodeProperties[] = [
|
|
|
62
84
|
description: 'How to input the data',
|
|
63
85
|
displayOptions: {
|
|
64
86
|
show: {
|
|
65
|
-
resource: [
|
|
66
|
-
operation: ['
|
|
87
|
+
resource: [DATA_RESOURCE],
|
|
88
|
+
operation: ['updateSingleObject'],
|
|
67
89
|
},
|
|
68
90
|
},
|
|
69
91
|
},
|
|
@@ -80,8 +102,8 @@ export const properties: INodeProperties[] = [
|
|
|
80
102
|
},
|
|
81
103
|
displayOptions: {
|
|
82
104
|
show: {
|
|
83
|
-
resource: [
|
|
84
|
-
operation: ['
|
|
105
|
+
resource: [DATA_RESOURCE],
|
|
106
|
+
operation: ['updateSingleObject'],
|
|
85
107
|
inputType: ['json'],
|
|
86
108
|
},
|
|
87
109
|
},
|
|
@@ -98,8 +120,8 @@ export const properties: INodeProperties[] = [
|
|
|
98
120
|
default: {},
|
|
99
121
|
displayOptions: {
|
|
100
122
|
show: {
|
|
101
|
-
resource: [
|
|
102
|
-
operation: ['
|
|
123
|
+
resource: [DATA_RESOURCE],
|
|
124
|
+
operation: ['updateSingleObject'],
|
|
103
125
|
inputType: ['simple'],
|
|
104
126
|
},
|
|
105
127
|
},
|
|
@@ -113,8 +135,8 @@ export const properties: INodeProperties[] = [
|
|
|
113
135
|
name: 'fieldName',
|
|
114
136
|
type: 'options',
|
|
115
137
|
typeOptions: {
|
|
116
|
-
loadOptionsMethod: '
|
|
117
|
-
loadOptionsDependsOn: ['
|
|
138
|
+
loadOptionsMethod: 'getNoHasManyProperties',
|
|
139
|
+
loadOptionsDependsOn: ['limetype'],
|
|
118
140
|
},
|
|
119
141
|
default: '',
|
|
120
142
|
description: 'The name of the field',
|
|
@@ -132,13 +154,36 @@ export const properties: INodeProperties[] = [
|
|
|
132
154
|
},
|
|
133
155
|
];
|
|
134
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Execute the "Update Single Object" operation for Lime CRM.
|
|
159
|
+
*
|
|
160
|
+
* @remarks
|
|
161
|
+
* This method updates a single Lime CRM object identified by its ID and Limetype.
|
|
162
|
+
* It supports two input methods:
|
|
163
|
+
* - 'simple': key-value pairs provided via the UI
|
|
164
|
+
* - 'json': full object data in JSON format
|
|
165
|
+
*
|
|
166
|
+
* The method performs the following steps:
|
|
167
|
+
* 1. Retrieves the `limetype`, `id`, and input data from {@link properties}.
|
|
168
|
+
* 2. Collects and prepares any file properties using {@link getFilePropertiesNames} and {@link setFileProperties}.
|
|
169
|
+
* 3. Calls {@link updateLimeobject} to update the object in Lime CRM.
|
|
170
|
+
* 4. Processes the response, including file properties, using {@link processFileResponse}.
|
|
171
|
+
*
|
|
172
|
+
* @param i - The index of the current item in the workflow execution
|
|
173
|
+
*
|
|
174
|
+
* @returns The updated Lime object data, optionally including file binary content.
|
|
175
|
+
*
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
135
178
|
export async function execute(this: IExecuteFunctions, i: number) {
|
|
136
|
-
const
|
|
179
|
+
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
137
180
|
const id = this.getNodeParameter('id', i) as string;
|
|
138
181
|
const inputType = this.getNodeParameter('inputType', i) as string;
|
|
139
182
|
|
|
140
183
|
let body: IDataObject = {};
|
|
141
184
|
|
|
185
|
+
const properties = await getProperties(this, limetype);
|
|
186
|
+
|
|
142
187
|
if (inputType === 'json') {
|
|
143
188
|
const jsonData = this.getNodeParameter('jsonData', i) as string;
|
|
144
189
|
body = JSON.parse(jsonData);
|
|
@@ -149,9 +194,30 @@ export async function execute(this: IExecuteFunctions, i: number) {
|
|
|
149
194
|
[]
|
|
150
195
|
) as IDataObject[];
|
|
151
196
|
for (const field of simpleFields) {
|
|
152
|
-
|
|
197
|
+
const fieldName = field.fieldName as string;
|
|
198
|
+
const fieldValue = field.fieldValue as string;
|
|
199
|
+
body[fieldName] = adaptProperty(
|
|
200
|
+
fieldValue,
|
|
201
|
+
getPropertyType(fieldName, properties)
|
|
202
|
+
);
|
|
153
203
|
}
|
|
154
204
|
}
|
|
155
205
|
|
|
156
|
-
|
|
206
|
+
const fileProperties = getFilePropertiesNames(properties);
|
|
207
|
+
|
|
208
|
+
await setFileProperties(this, i, fileProperties, body);
|
|
209
|
+
|
|
210
|
+
const updateLimeobjectResponse = await updateLimeobject(
|
|
211
|
+
this,
|
|
212
|
+
limetype,
|
|
213
|
+
id,
|
|
214
|
+
body
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
const response = await processFileResponse(
|
|
218
|
+
this,
|
|
219
|
+
fileProperties,
|
|
220
|
+
updateLimeobjectResponse
|
|
221
|
+
);
|
|
222
|
+
return response.json;
|
|
157
223
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INodeExecutionData,
|
|
3
|
+
IExecuteFunctions,
|
|
4
|
+
INodeProperties,
|
|
5
|
+
NodePropertyTypes,
|
|
6
|
+
NodeOperationError,
|
|
7
|
+
} from 'n8n-workflow';
|
|
8
|
+
|
|
9
|
+
import * as operations from './operations';
|
|
10
|
+
import { METADATA_RESOURCE } from '../../models';
|
|
11
|
+
import { N8NOperationModuleHandler } from '../../../modules';
|
|
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
|
+
*/
|
|
33
|
+
export const metadataFields: INodeProperties[] = [
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Operation',
|
|
36
|
+
name: 'operation',
|
|
37
|
+
type: 'options' as NodePropertyTypes,
|
|
38
|
+
noDataExpression: true,
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
resource: [METADATA_RESOURCE],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
options: moduleHandler.getDescriptions(),
|
|
45
|
+
default: 'getAllLimetypes',
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
...moduleHandler.getProperties(),
|
|
49
|
+
];
|
|
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
|
+
*/
|
|
65
|
+
export async function metadataOperations(
|
|
66
|
+
this: IExecuteFunctions,
|
|
67
|
+
{ operation, i }: { operation: string; i: number }
|
|
68
|
+
): Promise<INodeExecutionData | INodeExecutionData[]> {
|
|
69
|
+
switch (operation) {
|
|
70
|
+
case 'getAllLimetypes': {
|
|
71
|
+
const results = await operations.getAllLimetypes.execute.call(this);
|
|
72
|
+
return results.map((limetype) => ({
|
|
73
|
+
json: limetype,
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
case 'getSingleLimetype': {
|
|
77
|
+
return {
|
|
78
|
+
json: await operations.getSingleLimetype.execute.call(this, i),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
case 'getSingleFileMetadata': {
|
|
82
|
+
return {
|
|
83
|
+
json: await operations.getSingleFileMetadata.execute.call(
|
|
84
|
+
this,
|
|
85
|
+
i
|
|
86
|
+
),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
throw new NodeOperationError(
|
|
92
|
+
this.getNode(),
|
|
93
|
+
`The operation "${operation}" is not supported!`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export * from './operations';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
import { getLimetypesFromApi } from '../../../transport';
|
|
4
|
+
import { Limetype } from '../../../models';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Description and metadata for the "Get All Limetypes" operation in Lime CRM.
|
|
8
|
+
*/
|
|
9
|
+
export const description = {
|
|
10
|
+
name: 'Get all Limetypes',
|
|
11
|
+
value: 'getAllLimetypes',
|
|
12
|
+
description: 'Get a list of all available Limetypes',
|
|
13
|
+
action: 'Get all Limetypes',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a list of all available Limetypes from Lime CRM.
|
|
18
|
+
*
|
|
19
|
+
* This operation queries the Lime CRM API for all accessible Limetypes,
|
|
20
|
+
* such as company, person, deal, etc.
|
|
21
|
+
*
|
|
22
|
+
* @returns An array of Limetype objects
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export async function execute(this: IExecuteFunctions): Promise<Limetype[]> {
|
|
27
|
+
return await getLimetypesFromApi(this);
|
|
28
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IExecuteFunctions,
|
|
3
|
+
INodeProperties,
|
|
4
|
+
NodeOperationError,
|
|
5
|
+
} from 'n8n-workflow';
|
|
6
|
+
import {
|
|
7
|
+
FileMetadata,
|
|
8
|
+
getFileMetadata,
|
|
9
|
+
getFileMetadataByLimeobject,
|
|
10
|
+
} from '../../../transport';
|
|
11
|
+
import { METADATA_RESOURCE } from '../../../models';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Description and metadata for the "Get Single File Metadata" operation in Lime CRM.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export const description = {
|
|
19
|
+
name: 'Get Single File Metadata',
|
|
20
|
+
value: 'getSingleFileMetadata',
|
|
21
|
+
description: 'Get the metadata for a single file',
|
|
22
|
+
action: 'Get single file metadata',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Node parameter definitions for the "Get Single File Metadata" operation.
|
|
27
|
+
*
|
|
28
|
+
* @param source - Determines whether the file is retrieved by its ID or by its associated Limeobject ID
|
|
29
|
+
* @param limetype - The Lime CRM entity type associated with the file (required when `source` is `byLimeobject`)
|
|
30
|
+
* @param identifier - The unique identifier of the file or Limeobject to retrieve metadata for
|
|
31
|
+
* @param property - The file property in the Limeobject containing the file reference (used when `source` is `byLimeobject`)
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export const properties: INodeProperties[] = [
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Get by',
|
|
38
|
+
name: 'source',
|
|
39
|
+
type: 'options',
|
|
40
|
+
required: true,
|
|
41
|
+
placeholder: 'Add Source',
|
|
42
|
+
displayOptions: {
|
|
43
|
+
show: {
|
|
44
|
+
resource: [METADATA_RESOURCE],
|
|
45
|
+
operation: ['getSingleFileMetadata'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
name: 'File ID',
|
|
51
|
+
value: 'byFile',
|
|
52
|
+
description: 'Get file by its ID',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Limeobject ID',
|
|
56
|
+
value: 'byLimeobject',
|
|
57
|
+
description: "Get file by it's associated Limeobject ID",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
default: 'byFile',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Limetype',
|
|
64
|
+
name: 'limetype',
|
|
65
|
+
type: 'options',
|
|
66
|
+
typeOptions: {
|
|
67
|
+
loadOptionsMethod: 'getLimetypes',
|
|
68
|
+
},
|
|
69
|
+
required: true,
|
|
70
|
+
default: '',
|
|
71
|
+
description: 'The type of entity associated with the file',
|
|
72
|
+
displayOptions: {
|
|
73
|
+
show: {
|
|
74
|
+
resource: [METADATA_RESOURCE],
|
|
75
|
+
operation: ['getSingleFileMetadata'],
|
|
76
|
+
source: ['byLimeobject'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Identifier',
|
|
82
|
+
name: 'identifier',
|
|
83
|
+
type: 'string',
|
|
84
|
+
required: true,
|
|
85
|
+
default: '',
|
|
86
|
+
description: 'The ID of the file or Limeobject to retrieve',
|
|
87
|
+
displayOptions: {
|
|
88
|
+
show: {
|
|
89
|
+
resource: [METADATA_RESOURCE],
|
|
90
|
+
operation: ['getSingleFileMetadata'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
placeholder: 'e.g., 12345',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'File type property',
|
|
97
|
+
name: 'property',
|
|
98
|
+
type: 'options',
|
|
99
|
+
typeOptions: {
|
|
100
|
+
loadOptionsMethod: 'getFileProperties',
|
|
101
|
+
loadOptionsDependsOn: ['limetype'],
|
|
102
|
+
},
|
|
103
|
+
required: true,
|
|
104
|
+
default: '',
|
|
105
|
+
description: 'The type of entity associated with the file',
|
|
106
|
+
displayOptions: {
|
|
107
|
+
show: {
|
|
108
|
+
resource: [METADATA_RESOURCE],
|
|
109
|
+
operation: ['getSingleFileMetadata'],
|
|
110
|
+
source: ['byLimeobject'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Execute the "Get Single File Metadata" operation.
|
|
118
|
+
*
|
|
119
|
+
* Retrieves file metadata either directly via its file ID, or through its associated Limeobject.
|
|
120
|
+
* The function dynamically calls the correct method depending on user configuration.
|
|
121
|
+
*
|
|
122
|
+
* @param i - The index of the current item being processed within the n8n execution loop.
|
|
123
|
+
* @returns File metadata
|
|
124
|
+
*
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
127
|
+
export async function execute(
|
|
128
|
+
this: IExecuteFunctions,
|
|
129
|
+
i: number
|
|
130
|
+
): Promise<FileMetadata> {
|
|
131
|
+
const source = this.getNodeParameter('source', i) as string;
|
|
132
|
+
const id = this.getNodeParameter('identifier', i) as string;
|
|
133
|
+
|
|
134
|
+
if (source == 'byFile') {
|
|
135
|
+
return await getFileMetadata(this, id);
|
|
136
|
+
}
|
|
137
|
+
if (source == 'byLimeobject') {
|
|
138
|
+
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
139
|
+
const property = this.getNodeParameter('property', i) as string;
|
|
140
|
+
return await getFileMetadataByLimeobject(this, limetype, id, property);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
throw new NodeOperationError(
|
|
144
|
+
this.getNode(),
|
|
145
|
+
`The source "${source}" is not supported!`
|
|
146
|
+
);
|
|
147
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { getLimetype } from '../../../transport/limetypes';
|
|
3
|
+
import { METADATA_RESOURCE } from '../../../models';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Description and metadata for the "Get Single Limetype" operation in Lime CRM.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export const description = {
|
|
11
|
+
name: 'Get Single Limetype',
|
|
12
|
+
value: 'getSingleLimetype',
|
|
13
|
+
description: 'Get details about a specific Limetype',
|
|
14
|
+
action: 'Get single Limetype',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Node parameter definitions for the "Get Single Limetype" operation.
|
|
19
|
+
*
|
|
20
|
+
* @param limetype - The name of the entity type (Limetype) to retrieve details for
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export const properties: INodeProperties[] = [
|
|
25
|
+
{
|
|
26
|
+
displayName: 'Limetype',
|
|
27
|
+
name: 'limetype',
|
|
28
|
+
type: 'options',
|
|
29
|
+
typeOptions: {
|
|
30
|
+
loadOptionsMethod: 'getLimetypes',
|
|
31
|
+
},
|
|
32
|
+
required: true,
|
|
33
|
+
default: '',
|
|
34
|
+
description: 'The name of the entity type to get details for',
|
|
35
|
+
displayOptions: {
|
|
36
|
+
show: {
|
|
37
|
+
resource: [METADATA_RESOURCE],
|
|
38
|
+
operation: ['getSingleLimetype'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Execute the "Get Single Limetype" operation.
|
|
46
|
+
*
|
|
47
|
+
* Retrieves detailed information about a specific Limetype from Lime CRM.
|
|
48
|
+
*
|
|
49
|
+
* @param i - The index of the current item being processed within the n8n execution loop.
|
|
50
|
+
* @returns Limetype details as returned from the API.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export async function execute(this: IExecuteFunctions, i: number) {
|
|
55
|
+
const limetype = this.getNodeParameter('limetype', i) as string;
|
|
56
|
+
|
|
57
|
+
return getLimetype(this, limetype);
|
|
58
|
+
}
|
|
@@ -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';
|