@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,73 @@
|
|
|
1
|
+
// Credentials
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Credential name for Lime CRM API nodes.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @group Models
|
|
8
|
+
*/
|
|
9
|
+
export const LIME_CRM_API_CREDENTIAL_KEY = 'limeCrmApi';
|
|
10
|
+
|
|
11
|
+
// Resources
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Resource name for administrative data operations.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @group Models
|
|
18
|
+
*/
|
|
19
|
+
export const ADMIN_RESOURCE = 'admin';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resource name for main data operations.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
* @group Models
|
|
26
|
+
*/
|
|
27
|
+
export const DATA_RESOURCE = 'data';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Resource name for metadata-related operations.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
* @group Models
|
|
34
|
+
*/
|
|
35
|
+
export const METADATA_RESOURCE = 'metadata';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Resource name for ERP connector-related operations.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
* @group Models
|
|
42
|
+
*/
|
|
43
|
+
export const ERP_CONNECTOR_RESOURCE = 'erpConnector';
|
|
44
|
+
|
|
45
|
+
// Types
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Helper type used when none value was provided in N8N form
|
|
49
|
+
* @public
|
|
50
|
+
* @group Models
|
|
51
|
+
*/
|
|
52
|
+
export type NullOptionType = '';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Wrapper for generic return type of Lime CRM API values
|
|
56
|
+
*/
|
|
57
|
+
export type APIResponsePrimitiveValue = string | boolean | number | null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Wrapper for types of Lime CRM API values
|
|
61
|
+
*/
|
|
62
|
+
export type APIResponseValue =
|
|
63
|
+
| APIResponsePrimitiveValue
|
|
64
|
+
| APIResponsePrimitiveValue[]
|
|
65
|
+
| Record<string, APIResponsePrimitiveValue>;
|
|
66
|
+
|
|
67
|
+
// API
|
|
68
|
+
/**
|
|
69
|
+
* Default limit when working with Lime CRM API
|
|
70
|
+
* @public
|
|
71
|
+
* @group Models
|
|
72
|
+
*/
|
|
73
|
+
export const DEFAULT_API_OBJECT_LIMIT = 50;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export {
|
|
2
|
+
LIME_CRM_API_CREDENTIAL_KEY,
|
|
3
|
+
ADMIN_RESOURCE,
|
|
4
|
+
DATA_RESOURCE,
|
|
5
|
+
METADATA_RESOURCE,
|
|
6
|
+
ERP_CONNECTOR_RESOURCE,
|
|
7
|
+
DEFAULT_API_OBJECT_LIMIT,
|
|
8
|
+
NullOptionType,
|
|
9
|
+
APIResponseValue,
|
|
10
|
+
APIResponsePrimitiveValue,
|
|
11
|
+
} from './constants';
|
|
12
|
+
export { Limetype, LimetypeLocalName, LimetypeProperty } from './limetype';
|
|
13
|
+
export { Limeobject } from './limeobject';
|
|
14
|
+
export {
|
|
15
|
+
CreateWebhook,
|
|
16
|
+
Webhook,
|
|
17
|
+
WebhookContext,
|
|
18
|
+
WebhookFunctions,
|
|
19
|
+
} from './webhook';
|
|
20
|
+
export { User, UserLoginType, UserType } from './users';
|
|
21
|
+
export { YES_NO_PROPERTY_TYPE, PropertyTypeMap } from './propertyTypes';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APIResponseValue } from './constants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Representation of a Limeobject returned by the Lime CRM API.
|
|
5
|
+
*
|
|
6
|
+
* @property id_ - The unique ID of the Limeobject
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
* @group Models
|
|
10
|
+
*/
|
|
11
|
+
export type Limeobject = {
|
|
12
|
+
id_: number;
|
|
13
|
+
} & Record<string, APIResponseValue>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { APIResponseValue } from './constants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Representation of a property of a Limetype.
|
|
5
|
+
*
|
|
6
|
+
* @property name - The internal name of the property
|
|
7
|
+
* @property localname - The display name of the property
|
|
8
|
+
* @property type - The type of the property (e.g., string, file, hasmany)
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @group Models
|
|
12
|
+
*/
|
|
13
|
+
export type LimetypeProperty = {
|
|
14
|
+
name: string;
|
|
15
|
+
localname: string;
|
|
16
|
+
type: string;
|
|
17
|
+
} & Record<string, APIResponseValue>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Localized names for a Limetype.
|
|
21
|
+
*
|
|
22
|
+
* @property singular - Singular display name
|
|
23
|
+
* @property plural - Plural display name
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
* @group Models
|
|
27
|
+
*/
|
|
28
|
+
export type LimetypeLocalName = {
|
|
29
|
+
singular: string;
|
|
30
|
+
plural: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Representation of a Limetype.
|
|
35
|
+
*
|
|
36
|
+
* @property name - Internal name of the Limetype
|
|
37
|
+
* @property localname - Localized names
|
|
38
|
+
* @property properties - List of properties of this Limetype
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
* @group Models
|
|
42
|
+
*/
|
|
43
|
+
export type Limetype = {
|
|
44
|
+
name: string;
|
|
45
|
+
localname: LimetypeLocalName;
|
|
46
|
+
properties: LimetypeProperty[];
|
|
47
|
+
} & Record<string, APIResponseValue>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module for defining Lime CRM types which will need to be adapted to the
|
|
3
|
+
* proper format later on.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const YES_NO_PROPERTY_TYPE = 'yesno';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A map of <Lime CRM Type>:<The type required in JSON format>
|
|
10
|
+
*/
|
|
11
|
+
export type PropertyTypeMap = {
|
|
12
|
+
YES_NO_PROPERTY_TYPE: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { APIResponseValue } from './constants';
|
|
2
|
+
import { IncludedProperties } from '../transport';
|
|
3
|
+
import { Limeobject } from './limeobject';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Available user login types in Lime CRM
|
|
7
|
+
* @public
|
|
8
|
+
* @group Models
|
|
9
|
+
*/
|
|
10
|
+
type UserLoginType = 'DEFAULT' | 'LIME' | 'LIME_AND_WINDOWS';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Available user types in Lime CRM
|
|
14
|
+
* @public
|
|
15
|
+
* @group Models
|
|
16
|
+
*/
|
|
17
|
+
type UserType =
|
|
18
|
+
| 'STANDARD'
|
|
19
|
+
| 'ADMINISTRATION'
|
|
20
|
+
| 'SERVICE'
|
|
21
|
+
| 'INTEGRATION'
|
|
22
|
+
| 'SYNCHRONIZATION'
|
|
23
|
+
| 'TEST'
|
|
24
|
+
| 'API';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Representation of a user returned by the Lime CRM API.
|
|
28
|
+
*
|
|
29
|
+
* @property id - The unique ID of the user
|
|
30
|
+
* @property username - username, most often email address
|
|
31
|
+
* @property active - flag determining whether user is active
|
|
32
|
+
* @property loginType - user login type from Lime CRM
|
|
33
|
+
* @property userType - user type from Lime CRM
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
* @group Models
|
|
37
|
+
*/
|
|
38
|
+
type User = {
|
|
39
|
+
id: number;
|
|
40
|
+
username: string;
|
|
41
|
+
active: boolean;
|
|
42
|
+
loginType: UserLoginType;
|
|
43
|
+
userType: UserType;
|
|
44
|
+
} & Record<string, APIResponseValue | IncludedProperties | Limeobject>;
|
|
45
|
+
|
|
46
|
+
export { User, UserType, UserLoginType };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IDataObject, IHookFunctions, IWebhookFunctions } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Available webhook execution contexts in n8n.
|
|
5
|
+
*
|
|
6
|
+
* It can be either IHookFunctions or IWebhookFunctions,
|
|
7
|
+
* depending on the lifecycle stage of the node.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
* @group Models
|
|
11
|
+
*/
|
|
12
|
+
export type WebhookFunctions = IHookFunctions | IWebhookFunctions;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Contextual information about a webhook, including its node and workflow details.
|
|
16
|
+
*
|
|
17
|
+
* @property nodeId - The unique identifier of the node
|
|
18
|
+
* @property nodeName - The name of the node (optional)
|
|
19
|
+
* @property workflowId - The unique identifier of the workflow (optional)
|
|
20
|
+
* @property workflowName - The name of the workflow (optional)
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
* @group Models
|
|
24
|
+
*/
|
|
25
|
+
export interface WebhookContext {
|
|
26
|
+
nodeId: string;
|
|
27
|
+
nodeName?: string;
|
|
28
|
+
workflowId?: string;
|
|
29
|
+
workflowName?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Represent a webhook object.
|
|
34
|
+
*
|
|
35
|
+
* @property data - Arbitrary workflow data associated with this webhook
|
|
36
|
+
* @property events - List of events that this webhook is subscribed to
|
|
37
|
+
* @property url - Optional URL of the webhook
|
|
38
|
+
* @property context - Context about the node and workflow that owns the webhook
|
|
39
|
+
* @property name - Name of the webhook
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
* @group Models
|
|
43
|
+
*/
|
|
44
|
+
export interface Webhook {
|
|
45
|
+
data: IDataObject;
|
|
46
|
+
events: string[];
|
|
47
|
+
url?: string;
|
|
48
|
+
context: WebhookContext;
|
|
49
|
+
name: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Extend {@link Webhook} with an optional secret for secure webhooks.
|
|
54
|
+
*
|
|
55
|
+
* @property secret - Optional secret used to verify webhook requests
|
|
56
|
+
* @public
|
|
57
|
+
* @group Models
|
|
58
|
+
*/
|
|
59
|
+
export interface CreateWebhook extends Webhook {
|
|
60
|
+
secret?: string;
|
|
61
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INodeExecutionData,
|
|
3
|
+
IExecuteFunctions,
|
|
4
|
+
INodeProperties,
|
|
5
|
+
NodePropertyTypes,
|
|
6
|
+
NodeOperationError,
|
|
7
|
+
} from 'n8n-workflow';
|
|
8
|
+
|
|
9
|
+
import * as operations from './operations';
|
|
10
|
+
|
|
11
|
+
import { ADMIN_RESOURCE, User } from '../../models';
|
|
12
|
+
import { N8NOperationModuleHandler } from '../../../modules';
|
|
13
|
+
|
|
14
|
+
const moduleHandler = new N8NOperationModuleHandler([
|
|
15
|
+
operations.getManyUsers,
|
|
16
|
+
operations.getSingleUser,
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Fields and operations for the **Admin** resource in Lime CRM.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* - These fields are displayed in the n8n node UI when the resource is set to `Admin`.
|
|
24
|
+
* - Each operation corresponds to a CRUD action.
|
|
25
|
+
*
|
|
26
|
+
* @group Resources
|
|
27
|
+
* @public
|
|
28
|
+
*
|
|
29
|
+
* @see {@link getManyUsers} - Operation to retrieve many Lime CRM users' data
|
|
30
|
+
* @see {@link getSingleUser} - Operation to retrieve a single user from Lime CRM
|
|
31
|
+
*/
|
|
32
|
+
export const adminFields: INodeProperties[] = [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Operation',
|
|
35
|
+
name: 'operation',
|
|
36
|
+
type: 'options' as NodePropertyTypes,
|
|
37
|
+
noDataExpression: true,
|
|
38
|
+
displayOptions: {
|
|
39
|
+
show: {
|
|
40
|
+
resource: [ADMIN_RESOURCE],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
options: moduleHandler.getDescriptions(),
|
|
44
|
+
default: 'getSingleUser',
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
...moduleHandler.getProperties(),
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Execute a specific **Admin** operation on Lime CRM objects.
|
|
52
|
+
*
|
|
53
|
+
* @param args - Contextual parameters for the operation being executed
|
|
54
|
+
* @param args.operation - The operation to perform (e.g., `getSingleUser`, `getManyUsers`)
|
|
55
|
+
* @param args.i - The index of the input item to process
|
|
56
|
+
*
|
|
57
|
+
* @returns A promise resolving to the n8n object containing the result of the operation.
|
|
58
|
+
*
|
|
59
|
+
* @throws NodeOperationError if the operation is unsupported or fails.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
* @group Resources
|
|
63
|
+
*/
|
|
64
|
+
export async function adminOperations(
|
|
65
|
+
this: IExecuteFunctions,
|
|
66
|
+
{ operation, i }: { operation: string; i: number }
|
|
67
|
+
): Promise<INodeExecutionData | INodeExecutionData[]> {
|
|
68
|
+
switch (operation) {
|
|
69
|
+
case 'getManyUsers': {
|
|
70
|
+
const result = await operations.getManyUsers.execute.call(this, i);
|
|
71
|
+
|
|
72
|
+
return result.map((item: User) => ({
|
|
73
|
+
json: item,
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
case 'getSingleUser': {
|
|
77
|
+
return {
|
|
78
|
+
json: await operations.getSingleUser.execute.call(this, i),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
throw new NodeOperationError(
|
|
84
|
+
this.getNode(),
|
|
85
|
+
`The operation "${operation}" is not supported!`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export * from './operations';
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
User,
|
|
5
|
+
UserType,
|
|
6
|
+
ADMIN_RESOURCE,
|
|
7
|
+
NullOptionType,
|
|
8
|
+
DEFAULT_API_OBJECT_LIMIT,
|
|
9
|
+
} from '../../../models';
|
|
10
|
+
import { fetchManyUsers } from '../../../transport';
|
|
11
|
+
|
|
12
|
+
export const description = {
|
|
13
|
+
name: 'Get many users',
|
|
14
|
+
value: 'getManyUsers',
|
|
15
|
+
description: 'Get a list of users in the system',
|
|
16
|
+
action: 'Get many users',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Node properties for the "Get Many Users" operation.
|
|
21
|
+
*
|
|
22
|
+
* @param {boolean | null} id - Filter only active or inactive users
|
|
23
|
+
* @param {UserType} userType - Filter by User Type
|
|
24
|
+
* @param {number} limit - Set a limit for how many users should the API return
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export const properties: INodeProperties[] = [
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Active',
|
|
31
|
+
name: 'active',
|
|
32
|
+
type: 'options',
|
|
33
|
+
description: 'Filter only active or inactive users',
|
|
34
|
+
default: '',
|
|
35
|
+
displayOptions: {
|
|
36
|
+
show: {
|
|
37
|
+
resource: [ADMIN_RESOURCE],
|
|
38
|
+
operation: ['getManyUsers'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
options: [
|
|
42
|
+
{
|
|
43
|
+
name: '',
|
|
44
|
+
value: '',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Active',
|
|
48
|
+
value: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Inactive',
|
|
52
|
+
value: false,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'User Type',
|
|
58
|
+
name: 'userType',
|
|
59
|
+
type: 'options',
|
|
60
|
+
description: 'Get only selected user types',
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
resource: [ADMIN_RESOURCE],
|
|
64
|
+
operation: ['getManyUsers'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
default: '',
|
|
68
|
+
options: [
|
|
69
|
+
{
|
|
70
|
+
name: '',
|
|
71
|
+
value: '',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Standard',
|
|
75
|
+
value: 'STANDARD',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Administration',
|
|
79
|
+
value: 'ADMINISTRATION',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Service',
|
|
83
|
+
value: 'SERVICE',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Integration',
|
|
87
|
+
value: 'INTEGRATION',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Synchronization',
|
|
91
|
+
value: 'SYNCHRONIZATION',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'Test',
|
|
95
|
+
value: 'TEST',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'API',
|
|
99
|
+
value: 'API',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Limit',
|
|
105
|
+
name: 'limit',
|
|
106
|
+
type: 'number',
|
|
107
|
+
default: DEFAULT_API_OBJECT_LIMIT,
|
|
108
|
+
description: 'The maximum number of records to return',
|
|
109
|
+
displayOptions: {
|
|
110
|
+
show: {
|
|
111
|
+
resource: [ADMIN_RESOURCE],
|
|
112
|
+
operation: ['getManyUsers'],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
displayName: 'Include Coworker',
|
|
118
|
+
name: 'withCoworker',
|
|
119
|
+
type: 'boolean',
|
|
120
|
+
default: '',
|
|
121
|
+
description: 'Whether to include coworker data in the response',
|
|
122
|
+
displayOptions: {
|
|
123
|
+
show: {
|
|
124
|
+
resource: [ADMIN_RESOURCE],
|
|
125
|
+
operation: ['getManyUsers'],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Execute the "Get Many Users" operation for Lime CRM.
|
|
133
|
+
*
|
|
134
|
+
* @remarks
|
|
135
|
+
* This method retrieves many Lime CRM users with properties, if provided.
|
|
136
|
+
*
|
|
137
|
+
* @param i - The index of the current item in the workflow execution
|
|
138
|
+
*
|
|
139
|
+
* @returns User data.
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
export async function execute(
|
|
145
|
+
this: IExecuteFunctions,
|
|
146
|
+
i: number
|
|
147
|
+
): Promise<User[]> {
|
|
148
|
+
const active = this.getNodeParameter('active', i) as
|
|
149
|
+
| boolean
|
|
150
|
+
| NullOptionType;
|
|
151
|
+
const userType = this.getNodeParameter('userType', i) as
|
|
152
|
+
| UserType
|
|
153
|
+
| NullOptionType;
|
|
154
|
+
const limit =
|
|
155
|
+
(this.getNodeParameter(
|
|
156
|
+
'limit',
|
|
157
|
+
i,
|
|
158
|
+
DEFAULT_API_OBJECT_LIMIT
|
|
159
|
+
) as number) || DEFAULT_API_OBJECT_LIMIT;
|
|
160
|
+
const withCoworker = this.getNodeParameter(
|
|
161
|
+
'withCoworker',
|
|
162
|
+
i,
|
|
163
|
+
false
|
|
164
|
+
) as boolean;
|
|
165
|
+
return await fetchManyUsers(this, active, userType, limit, withCoworker);
|
|
166
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IExecuteFunctions,
|
|
3
|
+
INodeProperties,
|
|
4
|
+
NodeOperationError,
|
|
5
|
+
} from 'n8n-workflow';
|
|
6
|
+
|
|
7
|
+
import { User, ADMIN_RESOURCE } from '../../../models';
|
|
8
|
+
import {
|
|
9
|
+
fetchSingleUserById,
|
|
10
|
+
fetchSingleUserByLimeobjectId,
|
|
11
|
+
} from '../../../transport';
|
|
12
|
+
|
|
13
|
+
export const description = {
|
|
14
|
+
name: 'Get single user',
|
|
15
|
+
value: 'getSingleUser',
|
|
16
|
+
description: 'Get a single user data',
|
|
17
|
+
action: 'Get single user',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Node properties for the "Get Single User" operation.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} id - The ID of the user to retrieve
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export const properties: INodeProperties[] = [
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Get by',
|
|
30
|
+
name: 'source',
|
|
31
|
+
type: 'options',
|
|
32
|
+
required: true,
|
|
33
|
+
placeholder: 'Add Source',
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: {
|
|
36
|
+
resource: [ADMIN_RESOURCE],
|
|
37
|
+
operation: ['getSingleUser'],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
options: [
|
|
41
|
+
{
|
|
42
|
+
name: 'User ID',
|
|
43
|
+
value: 'byUser',
|
|
44
|
+
description: 'Get user by its ID',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Limeobject ID',
|
|
48
|
+
value: 'byLimeobject',
|
|
49
|
+
description: "Get user by it's related Limeobject ID",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
default: 'byUser',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Identifier',
|
|
56
|
+
name: 'identifier',
|
|
57
|
+
type: 'string',
|
|
58
|
+
required: true,
|
|
59
|
+
default: '',
|
|
60
|
+
description: 'The ID of the user or Limeobject to retrieve',
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
resource: [ADMIN_RESOURCE],
|
|
64
|
+
operation: ['getSingleUser'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Include Coworker',
|
|
70
|
+
name: 'withCoworker',
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
default: '',
|
|
73
|
+
description: 'Whether to include coworker data in the response',
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: {
|
|
76
|
+
resource: [ADMIN_RESOURCE],
|
|
77
|
+
operation: ['getSingleUser'],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
/**
|
|
83
|
+
* Execute the "Get Single Object" operation for Lime CRM.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* This method retrieves a single Lime CRM user identified by its ID.
|
|
87
|
+
*
|
|
88
|
+
* @param i - The index of the current item in the workflow execution
|
|
89
|
+
*
|
|
90
|
+
* @returns User data.
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
export async function execute(
|
|
95
|
+
this: IExecuteFunctions,
|
|
96
|
+
i: number
|
|
97
|
+
): Promise<User> {
|
|
98
|
+
const source = this.getNodeParameter('source', i) as string;
|
|
99
|
+
const id = this.getNodeParameter('identifier', i) as string;
|
|
100
|
+
const withCoworker = this.getNodeParameter('withCoworker', i) as boolean;
|
|
101
|
+
|
|
102
|
+
if (source == 'byUser') {
|
|
103
|
+
return await fetchSingleUserById(this, id, withCoworker);
|
|
104
|
+
}
|
|
105
|
+
if (source == 'byLimeobject') {
|
|
106
|
+
return await fetchSingleUserByLimeobjectId(this, id, withCoworker);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
throw new NodeOperationError(
|
|
110
|
+
this.getNode(),
|
|
111
|
+
`The source "${source}" is not supported!`
|
|
112
|
+
);
|
|
113
|
+
}
|