@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,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set of helper functions, classes and types used for adapting the data from
|
|
3
|
+
* N8N's simple fields to Lime CRM format
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LimetypeProperty } from '../models';
|
|
7
|
+
import { YES_NO_PROPERTY_TYPE, PropertyTypeMap } from '../models';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Base inteface for Property Adapter class
|
|
11
|
+
*/
|
|
12
|
+
interface PropertyAdapter<T> {
|
|
13
|
+
adapt(value: string): T | string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Adapter which takes a string from user input and parses it into boolean to
|
|
18
|
+
* conform to Lime CRM's YesNo type
|
|
19
|
+
*/
|
|
20
|
+
class YesNoPropertyAdapter implements PropertyAdapter<boolean> {
|
|
21
|
+
adapt(value: string): boolean | string {
|
|
22
|
+
if (value == 'true') {
|
|
23
|
+
return true;
|
|
24
|
+
} else if (value == 'false') {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Factory class which returns the proper adapter based on data type
|
|
33
|
+
* @param propertyType
|
|
34
|
+
*/
|
|
35
|
+
function getPropertyAdapter(
|
|
36
|
+
propertyType: string
|
|
37
|
+
): PropertyAdapter<PropertyTypeMap[keyof PropertyTypeMap]> | null {
|
|
38
|
+
if (propertyType == YES_NO_PROPERTY_TYPE) {
|
|
39
|
+
return new YesNoPropertyAdapter();
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Main function which takes the value from simple fields mode and the type of
|
|
46
|
+
* property and parses it accordingly to what Lime CRM expects
|
|
47
|
+
* @param propertyValue - user input, always string
|
|
48
|
+
* @param propertyType - type of property from Lime CRM
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @group Utils
|
|
52
|
+
*/
|
|
53
|
+
export function adaptProperty(propertyValue: string, propertyType: string) {
|
|
54
|
+
const adapter = getPropertyAdapter(propertyType);
|
|
55
|
+
return adapter === null ? propertyValue : adapter.adapt(propertyValue);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Given the name of the property and the set of Limetype properties, return the
|
|
60
|
+
* property type
|
|
61
|
+
* @param propertyName - name of the property we want to get the type of
|
|
62
|
+
* @param properties - list of {@link LimetypeProperty} entries
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
* @group Utils
|
|
66
|
+
*/
|
|
67
|
+
export function getPropertyType(
|
|
68
|
+
propertyName: string,
|
|
69
|
+
properties: LimetypeProperty[]
|
|
70
|
+
): string {
|
|
71
|
+
return (
|
|
72
|
+
properties.find((property) => property.name === propertyName)?.type ||
|
|
73
|
+
'string'
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Webhook, WebhookContext, WebhookFunctions } from '../models';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extract and format event identifiers from the node parameters.
|
|
5
|
+
*
|
|
6
|
+
* Builds an array of event strings in the format `<limetype>.<eventType>`
|
|
7
|
+
* based on the selected events.
|
|
8
|
+
*
|
|
9
|
+
* @param hookData - The n8n hook context
|
|
10
|
+
* @returns An array of formatted event strings.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
* @group Utils
|
|
14
|
+
*/
|
|
15
|
+
function getEvents(hookData: WebhookFunctions): string[] {
|
|
16
|
+
const eventData = hookData.getNodeParameter('events', []) as {
|
|
17
|
+
event: Array<{
|
|
18
|
+
limetype: string;
|
|
19
|
+
eventType: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
const eventItems = eventData.event;
|
|
23
|
+
const events: string[] = [];
|
|
24
|
+
for (const eventItem of eventItems) {
|
|
25
|
+
events.push(`${eventItem.limetype}.${eventItem.eventType}`);
|
|
26
|
+
}
|
|
27
|
+
return events;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Generate a unique webhook name based on the selected Lime type and event.
|
|
32
|
+
*
|
|
33
|
+
* The name is constructed using the format:
|
|
34
|
+
* `<limetype>-<eventType>-<timestamp>`, ensuring uniqueness for each webhook.
|
|
35
|
+
*
|
|
36
|
+
* @param hookData - The n8n hook context used to access node parameters
|
|
37
|
+
* @returns A unique webhook name string.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
* @group Utils
|
|
41
|
+
*/
|
|
42
|
+
function createWebhookName(hookData: WebhookFunctions): string {
|
|
43
|
+
interface Events {
|
|
44
|
+
event: Array<{
|
|
45
|
+
limetype: string;
|
|
46
|
+
eventType: string;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const events = hookData.getNodeParameter('events') as Events;
|
|
51
|
+
return `${events.event[0].limetype}-${events.event[0].eventType}-${Date.now()}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Retrieve a fully constructed webhook object from the given node context.
|
|
56
|
+
*
|
|
57
|
+
* @param hookData - The n8n node context
|
|
58
|
+
*
|
|
59
|
+
* @returns A {@link Webhook} object with a generated name
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
* @group Utils
|
|
63
|
+
*/
|
|
64
|
+
export function getWebhook(hookData: WebhookFunctions): Webhook {
|
|
65
|
+
const node = hookData.getNode();
|
|
66
|
+
const workflow = hookData.getWorkflow();
|
|
67
|
+
const context: WebhookContext = {
|
|
68
|
+
nodeId: node.id,
|
|
69
|
+
nodeName: node.name,
|
|
70
|
+
workflowId: workflow.id,
|
|
71
|
+
workflowName: workflow.name,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
data: hookData.getWorkflowStaticData('node'),
|
|
76
|
+
events: getEvents(hookData),
|
|
77
|
+
url: hookData.getNodeWebhookUrl('default'),
|
|
78
|
+
context: context,
|
|
79
|
+
name: createWebhookName(hookData),
|
|
80
|
+
};
|
|
81
|
+
}
|
package/nodes/modules.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helper class describing a typical module for .operation.ts files
|
|
5
|
+
*/
|
|
6
|
+
interface N8NOperationModule {
|
|
7
|
+
description: INodePropertyOptions;
|
|
8
|
+
properties?: INodeProperties[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Utility class used to simplify handling modules in N8N classes and
|
|
13
|
+
* show them in a standardized way
|
|
14
|
+
*/
|
|
15
|
+
export class N8NOperationModuleHandler {
|
|
16
|
+
modules: N8NOperationModule[];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Constructor class
|
|
20
|
+
* @param modules - list of modules for a given resource
|
|
21
|
+
*/
|
|
22
|
+
constructor(modules: N8NOperationModule[]) {
|
|
23
|
+
this.modules = modules.sort((operation1, operation2) =>
|
|
24
|
+
operation1.description.name.localeCompare(
|
|
25
|
+
operation2.description.name,
|
|
26
|
+
'en'
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Return descriptions for all the modules for a given resource
|
|
33
|
+
*/
|
|
34
|
+
getDescriptions(): INodePropertyOptions[] {
|
|
35
|
+
return this.modules.map((operation) => operation.description);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns flatten properties for all modules for a given resource
|
|
40
|
+
*/
|
|
41
|
+
getProperties(): INodeProperties[] {
|
|
42
|
+
return this.modules.flatMap((operation) => operation.properties || []);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBinaryData } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response object that includes both JSON data and optional binary file content.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - The shape of the JSON data returned in the response
|
|
7
|
+
* @property json - The n8n node response, containing structured JSON data.
|
|
8
|
+
* @property binary - An optional record of binary file data
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @group Response
|
|
12
|
+
*/
|
|
13
|
+
export type FileResponse<T> = {
|
|
14
|
+
json: T;
|
|
15
|
+
binary?: Record<string, IBinaryData>;
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/n8n-nodes-lime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.3.1-dev.1",
|
|
4
4
|
"description": "n8n node to connect to Lime CRM",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"main": "index.
|
|
6
|
+
"main": "nodes/index.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc &&
|
|
8
|
+
"build": "tsc && copyfiles \"nodes/**/*.svg\" dist",
|
|
9
9
|
"dev": "tsc --watch",
|
|
10
10
|
"dev:reload": "nodemon --watch dist --exec 'cp -R dist/* ~/.n8n/custom/dist/'",
|
|
11
11
|
"watch": "concurrently \"npm run dev\" \"npm run dev:reload\"",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"lint:fix": "eslint --max-warnings=0 . --fix",
|
|
14
14
|
"format": "prettier -c .",
|
|
15
15
|
"format:fix": "prettier --write .",
|
|
16
|
-
"test": "jest"
|
|
16
|
+
"test": "jest",
|
|
17
|
+
"docs": "npx typedoc",
|
|
18
|
+
"knip": "knip"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [
|
|
19
21
|
"n8n",
|
|
@@ -36,40 +38,30 @@
|
|
|
36
38
|
]
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
41
|
+
"@limetech/eslint-config": "^4.0.0",
|
|
39
42
|
"@semantic-release/changelog": "^6.0.3",
|
|
40
|
-
"@semantic-release/
|
|
43
|
+
"@semantic-release/exec": "^7.1.0",
|
|
41
44
|
"@semantic-release/git": "^10.0.1",
|
|
42
|
-
"@semantic-release/github": "^11.0.4",
|
|
43
|
-
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
44
45
|
"@types/jest": "^30.0.0",
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"@types/request-promise-native": "^1.0.18",
|
|
46
|
+
"@types/node": "^24.10.1",
|
|
47
47
|
"@types/ws": "^8.18.1",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"eslint-plugin-prettier": "^5.5.3",
|
|
55
|
-
"install": "^0.13.0",
|
|
56
|
-
"jest": "^30.0.5",
|
|
57
|
-
"nodemon": "^2.0.15",
|
|
58
|
-
"npm": "^11.5.2",
|
|
48
|
+
"concurrently": "^9.2.1",
|
|
49
|
+
"copyfiles": "^2.4.1",
|
|
50
|
+
"eslint": "^9.39.1",
|
|
51
|
+
"jest": "^30.2.0",
|
|
52
|
+
"knip": "^5.69.0",
|
|
53
|
+
"nodemon": "^3.1.11",
|
|
59
54
|
"prettier": "^3.6.2",
|
|
60
|
-
"semantic-release": "^
|
|
61
|
-
"ts-jest": "^29.4.
|
|
62
|
-
"
|
|
55
|
+
"semantic-release": "^25.0.2",
|
|
56
|
+
"ts-jest": "^29.4.5",
|
|
57
|
+
"typedoc": "^0.28.14",
|
|
58
|
+
"typescript": "^5.9.3"
|
|
63
59
|
},
|
|
64
60
|
"dependencies": {
|
|
65
|
-
"@limetech/eslint-config": "^3.0.2",
|
|
66
|
-
"@semantic-release/exec": "^7.1.0",
|
|
67
61
|
"currency-codes": "^2.2.0",
|
|
68
|
-
"request": "^2.88.2",
|
|
69
|
-
"request-promise-native": "^1.0.9",
|
|
70
62
|
"ws": "^8.18.3"
|
|
71
63
|
},
|
|
72
64
|
"peerDependencies": {
|
|
73
|
-
"n8n-workflow": "
|
|
65
|
+
"n8n-workflow": "^1.109.0"
|
|
74
66
|
}
|
|
75
|
-
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
### n8n Scripts
|
|
2
|
+
|
|
3
|
+
Utility scripts to batch upload, download and transfer workflows as JSON data to and from an n8n instance via
|
|
4
|
+
its REST API.
|
|
5
|
+
|
|
6
|
+
=========================================================================================
|
|
7
|
+
### Features
|
|
8
|
+
- download: Fetch items workflows from n8n and store locally.
|
|
9
|
+
- upload: Push local workflows to n8n.
|
|
10
|
+
- transfer: Combine download then upload for migrating between two instances without local storage
|
|
11
|
+
- cli: Unified command line entrypoint wrapping the download and upload operations.
|
|
12
|
+
|
|
13
|
+
=========================================================================================
|
|
14
|
+
### Installation
|
|
15
|
+
```bash
|
|
16
|
+
poetry install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
=========================================================================================
|
|
20
|
+
### Usage
|
|
21
|
+
|
|
22
|
+
#### Interactive Mode
|
|
23
|
+
```bash
|
|
24
|
+
poetry run python ./main.py
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The api_key can also be provided in files [root directory]:
|
|
28
|
+
- `api_key_download.txt` for download operations
|
|
29
|
+
- `api_key_upload.txt` for upload operations
|
|
30
|
+
|
|
31
|
+
#### CLI Mode
|
|
32
|
+
Download
|
|
33
|
+
```bash
|
|
34
|
+
poetry run python ./cli.py download --instance_url <INSTANCE_URL> --api_key <API_KEY> --folder_path <FOLDER_PATH>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Upload
|
|
38
|
+
```bash
|
|
39
|
+
poetry run python ./cli.py upload --instance_url <INSTANCE_URL> --api_key <API_KEY> --folder_path <FOLDER_PATH>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The api_key can also be provided via the N8N_API_KEY environment variable.
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from download import create_workflows_endpoint, fetch_workflows, save_workflows
|
|
7
|
+
from upload import upload_workflows
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _get_api_key(parser_args):
|
|
11
|
+
api_key = parser_args.api_key or os.getenv("N8N_API_KEY")
|
|
12
|
+
if not api_key:
|
|
13
|
+
print("Error: No api_key provided. Use --api_key argument or set N8N_API_KEY environment variable.",
|
|
14
|
+
file=sys.stderr)
|
|
15
|
+
sys.exit(1)
|
|
16
|
+
|
|
17
|
+
return api_key
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def download(instance_url, folder_path, parser_args):
|
|
21
|
+
api_key = _get_api_key(parser_args)
|
|
22
|
+
url = create_workflows_endpoint(instance_url, active=False, pinned_data=True)
|
|
23
|
+
|
|
24
|
+
if workflows:= fetch_workflows(url, api_key):
|
|
25
|
+
os.makedirs(os.path.normpath(folder_path), exist_ok=True)
|
|
26
|
+
save_workflows(folder_path, workflows)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def upload(instance_url, folder_path, parser_args):
|
|
30
|
+
api_key = _get_api_key(parser_args)
|
|
31
|
+
url = f"{instance_url}/api/v1/workflows"
|
|
32
|
+
|
|
33
|
+
upload_workflows(
|
|
34
|
+
url=url, api_key=api_key, folder_path=os.path.normpath(folder_path))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def download_cmd(subparsers):
|
|
38
|
+
download_parser = subparsers.add_parser("download", help="Download workflows from an n8n instance")
|
|
39
|
+
download_parser.add_argument("--instance_url", required=True,
|
|
40
|
+
help="n8n instance URL (e.g., https://n8n.example.com)")
|
|
41
|
+
download_parser.add_argument("--folder_path", required=True,
|
|
42
|
+
help="Path to save downloaded workflows")
|
|
43
|
+
download_parser.add_argument("--api_key",
|
|
44
|
+
help="Your n8n API key the default is read from N8N_API_KEY env variable")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def upload_cmd(subparsers):
|
|
48
|
+
upload_parser = subparsers.add_parser("upload", help="Upload workflows to an n8n instance")
|
|
49
|
+
upload_parser.add_argument("--instance_url", required=True,
|
|
50
|
+
help="n8n instance URL (e.g., https://n8n.example.com)")
|
|
51
|
+
upload_parser.add_argument("--folder_path", required=True,
|
|
52
|
+
help="Path to the folder containing workflows to upload")
|
|
53
|
+
upload_parser.add_argument("--api_key",
|
|
54
|
+
help="Your n8n API key the default is read from N8N_API_KEY env variable")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def main():
|
|
58
|
+
parser = argparse.ArgumentParser(description="A simple CLI tool for n8n workflows restore.")
|
|
59
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
60
|
+
|
|
61
|
+
download_cmd(subparsers)
|
|
62
|
+
upload_cmd(subparsers)
|
|
63
|
+
|
|
64
|
+
args = parser.parse_args()
|
|
65
|
+
|
|
66
|
+
if args.command == "download":
|
|
67
|
+
download(parser_args=args, instance_url=args.instance_url, folder_path=args.folder_path)
|
|
68
|
+
elif args.command == "upload":
|
|
69
|
+
upload(parser_args=args, instance_url=args.instance_url, folder_path=args.folder_path)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if __name__ == "__main__":
|
|
73
|
+
main()
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
import requests
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
from utils import get_api_key, create_headers
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
print("n8n Workflow Downloader")
|
|
12
|
+
instance_url = input("Enter n8n instance URL (e.g., https://n8n.example.com): ").strip().rstrip("/")
|
|
13
|
+
api_key = input("Enter your n8n API key: ").strip() or get_api_key("api_key_download.txt")
|
|
14
|
+
active = input("Do you want to download only active workflows? (y/n, default n): ").strip().lower() == 'y'
|
|
15
|
+
pinned_data = input("Do you want to download pinned data also? (y/n, default n): ").strip().lower() == 'y'
|
|
16
|
+
|
|
17
|
+
url = create_workflows_endpoint(instance_url, active, pinned_data)
|
|
18
|
+
if workflows:= fetch_workflows(url, api_key):
|
|
19
|
+
folder_path = create_folder(folder_path="./workflows/", instance_url=instance_url)
|
|
20
|
+
save_workflows(folder_path, workflows)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def create_workflows_endpoint(instance_url: str, active: bool, pinned_data: bool):
|
|
24
|
+
base_url = f"{instance_url}/api/v1/workflows"
|
|
25
|
+
active = "true" if active else "false"
|
|
26
|
+
pinned_data = "true" if not pinned_data else "false"
|
|
27
|
+
|
|
28
|
+
return f"{base_url}?active={active}&excludePinnedData={pinned_data}"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def fetch_workflows(url, api_key):
|
|
32
|
+
headers = create_headers(api_key)
|
|
33
|
+
workflows = []
|
|
34
|
+
next_cursor = None
|
|
35
|
+
while True:
|
|
36
|
+
full_url = f"{url}&limit=100" + (f"&cursor={next_cursor}" if next_cursor else "")
|
|
37
|
+
try:
|
|
38
|
+
resp = requests.get(full_url, headers=headers)
|
|
39
|
+
resp.raise_for_status()
|
|
40
|
+
except requests.RequestException as e:
|
|
41
|
+
print(f"Error: {e}")
|
|
42
|
+
return []
|
|
43
|
+
|
|
44
|
+
data = resp.json()
|
|
45
|
+
workflows.extend(data.get("data", []))
|
|
46
|
+
next_cursor = data.get("nextCursor")
|
|
47
|
+
if not next_cursor:
|
|
48
|
+
break
|
|
49
|
+
|
|
50
|
+
return workflows
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def create_folder(folder_path, instance_url):
|
|
54
|
+
name = (f"{datetime.datetime.now().strftime('%Y_%m_%d-%H_%M')}-"
|
|
55
|
+
f"{instance_url.replace('https://', '').replace('http://', '').replace('/', '_')}"
|
|
56
|
+
)
|
|
57
|
+
path = os.path.join(folder_path, name)
|
|
58
|
+
os.makedirs(path, exist_ok=True)
|
|
59
|
+
|
|
60
|
+
return path
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def save_workflows(folder_path, workflows):
|
|
64
|
+
for workflow in workflows:
|
|
65
|
+
filename = f"{workflow['name']}.json"
|
|
66
|
+
with open(f"{folder_path}/{filename}", "w") as f:
|
|
67
|
+
json.dump(workflow, f, indent=2)
|
|
68
|
+
print(f"{filename} - saved")
|
|
69
|
+
print(f"All workflows has been saved to {folder_path}")
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if __name__ == "__main__":
|
|
73
|
+
main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from utils import select_option
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main():
|
|
5
|
+
options = ["Download", "Upload", "Transfer"]
|
|
6
|
+
selected = select_option(options)
|
|
7
|
+
match selected:
|
|
8
|
+
case "Download":
|
|
9
|
+
from download import main
|
|
10
|
+
case "Upload":
|
|
11
|
+
from upload import main
|
|
12
|
+
case "Transfer":
|
|
13
|
+
from transfer import main
|
|
14
|
+
|
|
15
|
+
main()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == "__main__":
|
|
19
|
+
main()
|