@limetech/n8n-nodes-lime 0.2.9 → 0.3.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/.dockerignore +1 -0
- package/.github/workflows/lint.yml +21 -0
- package/.github/workflows/release.yml +82 -0
- package/.github/workflows/test-and-build.yml +47 -0
- package/.prettierignore +4 -0
- package/.prettierrc.mjs +1 -0
- package/.releaserc.json +34 -0
- package/CHANGELOG.md +74 -0
- package/Dockerfile +21 -0
- package/README.md +4 -0
- package/credentials/FortnoxApi.credentials.ts +61 -0
- package/credentials/LimeCrmApi.credentials.ts +60 -0
- package/dist/credentials/FortnoxApi.credentials.d.ts +9 -0
- package/dist/credentials/FortnoxApi.credentials.js +57 -0
- package/dist/credentials/FortnoxApi.credentials.js.map +1 -0
- package/dist/credentials/LimeCrmApi.credentials.js +3 -2
- package/dist/credentials/LimeCrmApi.credentials.js.map +1 -1
- package/dist/nodes/fortnox/Fortnox.node.d.ts +5 -0
- package/dist/nodes/fortnox/Fortnox.node.js +95 -0
- package/dist/nodes/fortnox/Fortnox.node.js.map +1 -0
- package/dist/nodes/fortnox/Fortnox.node.json +18 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +5 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.js +155 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +1 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.json +18 -0
- package/dist/nodes/fortnox/commons.d.ts +25 -0
- package/dist/nodes/fortnox/commons.js +44 -0
- package/dist/nodes/fortnox/commons.js.map +1 -0
- package/dist/nodes/fortnox/model.d.ts +20 -0
- package/dist/nodes/fortnox/model.js +3 -0
- package/dist/nodes/fortnox/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.js +31 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/index.d.ts +20 -0
- package/dist/nodes/fortnox/resources/customers/index.js +77 -0
- package/dist/nodes/fortnox/resources/customers/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/model.d.ts +99 -0
- package/dist/nodes/fortnox/resources/customers/model.js +3 -0
- package/dist/nodes/fortnox/resources/customers/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +12 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +283 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +36 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +36 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +68 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +12 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +267 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.js +30 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js +72 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/index.d.ts +20 -0
- package/dist/nodes/fortnox/resources/invoice/index.js +71 -0
- package/dist/nodes/fortnox/resources/invoice/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +193 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/model.d.ts +150 -0
- package/dist/nodes/fortnox/resources/invoice/model.js +3 -0
- package/dist/nodes/fortnox/resources/invoice/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +64 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +35 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +92 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +11 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +62 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -0
- package/dist/nodes/fortnox/transport/errorCodes.d.ts +1 -0
- package/dist/nodes/fortnox/transport/errorCodes.js +51 -0
- package/dist/nodes/fortnox/transport/errorCodes.js.map +1 -0
- package/dist/nodes/fortnox/transport/index.d.ts +4 -0
- package/dist/nodes/fortnox/transport/index.js +72 -0
- package/dist/nodes/fortnox/transport/index.js.map +1 -0
- package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +14 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.js +113 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +18 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +200 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
- package/dist/nodes/lime-crm/commons/constants.d.ts +4 -0
- package/dist/nodes/lime-crm/commons/constants.js +8 -0
- package/dist/nodes/lime-crm/commons/constants.js.map +1 -0
- package/dist/nodes/lime-crm/commons/index.d.ts +3 -0
- package/dist/nodes/lime-crm/commons/index.js +11 -0
- package/dist/nodes/lime-crm/commons/index.js.map +1 -0
- package/dist/nodes/lime-crm/commons/limetype.d.ts +10 -0
- package/dist/nodes/lime-crm/commons/limetype.js +3 -0
- package/dist/nodes/lime-crm/commons/limetype.js.map +1 -0
- package/dist/nodes/lime-crm/commons/task.d.ts +14 -0
- package/dist/nodes/lime-crm/commons/task.js +49 -0
- package/dist/nodes/lime-crm/commons/task.js.map +1 -0
- package/dist/nodes/lime-crm/commons/webhook.d.ts +16 -0
- package/dist/nodes/lime-crm/commons/webhook.js +30 -0
- package/dist/nodes/lime-crm/commons/webhook.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +5 -0
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +12 -0
- package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +2 -0
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +21 -0
- package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +2 -0
- package/dist/nodes/lime-crm/methods/getLimeTypes.js +21 -0
- package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +1 -0
- package/dist/nodes/lime-crm/methods/index.d.ts +3 -0
- package/dist/nodes/lime-crm/methods/index.js +10 -0
- package/dist/nodes/lime-crm/methods/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +23 -0
- package/dist/nodes/lime-crm/resources/erpConnector/index.js +57 -0
- package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +26 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +65 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +220 -0
- package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +15 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transform.js +12 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +4 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +7 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +37 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +124 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +1 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +6 -0
- package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +14 -0
- package/dist/nodes/lime-crm/resources/limeObject/index.js +78 -0
- package/dist/nodes/lime-crm/resources/limeObject/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +139 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +51 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +51 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +86 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +149 -0
- package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/index.d.ts +20 -0
- package/dist/nodes/lime-crm/resources/limeType/index.js +71 -0
- package/dist/nodes/lime-crm/resources/limeType/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +36 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +36 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +10 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +15 -0
- package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +1 -0
- package/dist/nodes/lime-crm/transport/commons.d.ts +5 -0
- package/dist/nodes/lime-crm/transport/commons.js +33 -0
- package/dist/nodes/lime-crm/transport/commons.js.map +1 -0
- package/dist/nodes/lime-crm/transport/erpConnector.d.ts +9 -0
- package/dist/nodes/lime-crm/transport/erpConnector.js +12 -0
- package/dist/nodes/lime-crm/transport/erpConnector.js.map +1 -0
- package/dist/nodes/lime-crm/transport/index.d.ts +5 -0
- package/dist/nodes/lime-crm/transport/index.js +22 -0
- package/dist/nodes/lime-crm/transport/index.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limeobjects.d.ts +7 -0
- package/dist/nodes/lime-crm/transport/limeobjects.js +49 -0
- package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limetypes.d.ts +6 -0
- package/dist/nodes/lime-crm/transport/limetypes.js +40 -0
- package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -0
- package/dist/nodes/lime-crm/transport/task.d.ts +13 -0
- package/dist/nodes/lime-crm/transport/task.js +14 -0
- package/dist/nodes/lime-crm/transport/task.js.map +1 -0
- package/dist/nodes/lime-crm/transport/webhooks.d.ts +15 -0
- package/dist/nodes/lime-crm/transport/webhooks.js +33 -0
- package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -0
- package/dist/nodes/nodeResponse.d.ts +12 -0
- package/dist/nodes/nodeResponse.js +3 -0
- package/dist/nodes/nodeResponse.js.map +1 -0
- package/dist/package.json +36 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docker-compose.yml +46 -0
- package/eslint.config.mjs +27 -0
- package/jest.config.js +11 -0
- package/nodes/fortnox/Fortnox.node.json +18 -0
- package/nodes/fortnox/Fortnox.node.ts +102 -0
- package/nodes/fortnox/FortnoxTrigger.node.json +18 -0
- package/nodes/fortnox/FortnoxTrigger.node.ts +196 -0
- package/nodes/fortnox/commons.ts +94 -0
- package/nodes/fortnox/fortnoxLogo.svg +15 -0
- package/nodes/fortnox/model.ts +25 -0
- package/nodes/fortnox/resources/customers/filterParameters.ts +47 -0
- package/nodes/fortnox/resources/customers/index.ts +57 -0
- package/nodes/fortnox/resources/customers/model.ts +107 -0
- package/nodes/fortnox/resources/customers/operations/create.operation.ts +303 -0
- package/nodes/fortnox/resources/customers/operations/delete.operation.ts +44 -0
- package/nodes/fortnox/resources/customers/operations/get.operation.ts +45 -0
- package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +80 -0
- package/nodes/fortnox/resources/customers/operations/update.operation.ts +278 -0
- package/nodes/fortnox/resources/customers/sortParameters.ts +32 -0
- package/nodes/fortnox/resources/invoice/filterParameters.ts +88 -0
- package/nodes/fortnox/resources/invoice/index.ts +51 -0
- package/nodes/fortnox/resources/invoice/invoiceParameters.ts +214 -0
- package/nodes/fortnox/resources/invoice/model.ts +160 -0
- package/nodes/fortnox/resources/invoice/operations/create.operation.ts +72 -0
- package/nodes/fortnox/resources/invoice/operations/get.operation.ts +45 -0
- package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +101 -0
- package/nodes/fortnox/resources/invoice/operations/update.operation.ts +74 -0
- package/nodes/fortnox/transport/errorCodes.ts +62 -0
- package/nodes/fortnox/transport/index.ts +98 -0
- package/nodes/lime-crm/LimeCrm.node.json +18 -0
- package/nodes/lime-crm/LimeCrmNode.node.ts +135 -0
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +263 -0
- package/nodes/lime-crm/assets/lime-crm.svg +1 -0
- package/nodes/lime-crm/commons/constants.ts +9 -0
- package/nodes/lime-crm/commons/index.ts +9 -0
- package/nodes/lime-crm/commons/limetype.ts +11 -0
- package/nodes/lime-crm/commons/task.ts +55 -0
- package/nodes/lime-crm/commons/webhook.ts +50 -0
- package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +11 -0
- package/nodes/lime-crm/methods/getLimeTypeProperties.ts +27 -0
- package/nodes/lime-crm/methods/getLimeTypes.ts +23 -0
- package/nodes/lime-crm/methods/index.ts +3 -0
- package/nodes/lime-crm/resources/erpConnector/index.ts +43 -0
- package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +69 -0
- package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +274 -0
- package/nodes/lime-crm/resources/erpConnector/transform.ts +49 -0
- package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +18 -0
- package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +201 -0
- package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +1 -0
- package/nodes/lime-crm/resources/limeObject/index.ts +64 -0
- package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +152 -0
- package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +55 -0
- package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +54 -0
- package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +99 -0
- package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +157 -0
- package/nodes/lime-crm/resources/limeType/index.ts +58 -0
- package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +42 -0
- package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +36 -0
- package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +18 -0
- package/nodes/lime-crm/transport/commons.ts +44 -0
- package/nodes/lime-crm/transport/erpConnector.ts +21 -0
- package/nodes/lime-crm/transport/index.ts +17 -0
- package/nodes/lime-crm/transport/limeobjects.ts +83 -0
- package/nodes/lime-crm/transport/limetypes.ts +68 -0
- package/nodes/lime-crm/transport/task.ts +32 -0
- package/nodes/lime-crm/transport/webhooks.ts +61 -0
- package/nodes/nodeResponse.ts +13 -0
- package/package.json +36 -16
- package/tests/fixtures/fortnox.ts +182 -0
- package/tests/transform.spec.ts +187 -0
- package/tsconfig.json +30 -0
- package/index.js +0 -3
package/.dockerignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.git
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: actions/setup-node@v4
|
|
15
|
+
with:
|
|
16
|
+
node-version: 21
|
|
17
|
+
- run: npm ci
|
|
18
|
+
- name: Run eslint
|
|
19
|
+
run: npm run lint
|
|
20
|
+
- name: Run prettier
|
|
21
|
+
run: npm run format
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: Release and Push to ECR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- dev
|
|
8
|
+
- '*[0-9].*[0-9].x'
|
|
9
|
+
- '*[0-9].x.x'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
name: Lime N8N Semantic Release
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
outputs:
|
|
16
|
+
version: ${{ steps.semantic_release.outputs.version }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v3
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-node@v3
|
|
21
|
+
with:
|
|
22
|
+
node-version: 21
|
|
23
|
+
|
|
24
|
+
- run: npm ci
|
|
25
|
+
|
|
26
|
+
- name: Semantic release
|
|
27
|
+
id: semantic_release
|
|
28
|
+
run: |
|
|
29
|
+
npx semantic-release
|
|
30
|
+
VERSION=$(cat VERSION)
|
|
31
|
+
echo "Successfully released version: $VERSION"
|
|
32
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
33
|
+
env:
|
|
34
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
35
|
+
|
|
36
|
+
push-to-ecr:
|
|
37
|
+
name: Push images to ECR
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
needs: release
|
|
40
|
+
permissions:
|
|
41
|
+
id-token: write
|
|
42
|
+
contents: read
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout repository
|
|
45
|
+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
|
|
46
|
+
|
|
47
|
+
- name: Set up Docker Buildx
|
|
48
|
+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
|
|
49
|
+
|
|
50
|
+
- name: Configure AWS credentials
|
|
51
|
+
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a #v4.3.1
|
|
52
|
+
with:
|
|
53
|
+
role-to-assume: ${{ secrets.AWS_ECR_PUSH_ROLE_SHARED_ACCOUNT_ARN }}
|
|
54
|
+
role-session-name: GitHubActions-ECR-Push
|
|
55
|
+
aws-region: ${{ secrets.AWS_REGION_SHARED }}
|
|
56
|
+
|
|
57
|
+
- name: Login to Amazon ECR
|
|
58
|
+
id: login-ecr
|
|
59
|
+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 #v2.0.1
|
|
60
|
+
|
|
61
|
+
- name: Create ECR repository if it does not exist
|
|
62
|
+
shell: bash
|
|
63
|
+
run: |
|
|
64
|
+
if [ -z "$(aws ecr describe-repositories --repository-names lime-cloud-n8n)" ]; then
|
|
65
|
+
aws ecr create-repository --repository-name lime-cloud-n8n
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
- name: Set environment variables
|
|
69
|
+
id: vars
|
|
70
|
+
run: |
|
|
71
|
+
echo "ECR_REPO=lime-cloud-n8n" >> $GITHUB_ENV
|
|
72
|
+
echo "ECR_URI=${{ steps.login-ecr.outputs.registry }}/lime-cloud-n8n" >> $GITHUB_ENV
|
|
73
|
+
echo "IMAGE_TAG=${{ needs.release.outputs.version }}" >> $GITHUB_ENV
|
|
74
|
+
|
|
75
|
+
- name: Build Docker image
|
|
76
|
+
run: |
|
|
77
|
+
docker build -t $ECR_URI:$IMAGE_TAG .
|
|
78
|
+
|
|
79
|
+
- name: Push Docker image to ECR
|
|
80
|
+
run: |
|
|
81
|
+
echo "Pushing image to: $ECR_URI:$IMAGE_TAG"
|
|
82
|
+
docker push $ECR_URI:$IMAGE_TAG
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Test and build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
name: Test build
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v3
|
|
19
|
+
|
|
20
|
+
- name: Set up Node.js
|
|
21
|
+
uses: actions/setup-node@v3
|
|
22
|
+
with:
|
|
23
|
+
node-version: 21
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm install
|
|
27
|
+
|
|
28
|
+
- name: Build the package
|
|
29
|
+
run: npm run build
|
|
30
|
+
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: npm run test
|
|
33
|
+
|
|
34
|
+
docker-build:
|
|
35
|
+
name: Build docker image
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- name: Checkout code
|
|
40
|
+
uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- name: Set up Docker Buildx
|
|
43
|
+
uses: docker/setup-buildx-action@v3
|
|
44
|
+
|
|
45
|
+
- name: Test Docker build
|
|
46
|
+
run: |
|
|
47
|
+
docker build .
|
package/.prettierignore
ADDED
package/.prettierrc.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@limetech/eslint-config/prettier.config.js';
|
package/.releaserc.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main",
|
|
4
|
+
{
|
|
5
|
+
"name": "dev",
|
|
6
|
+
"prerelease": true
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"plugins": [
|
|
10
|
+
"@semantic-release/commit-analyzer",
|
|
11
|
+
"@semantic-release/release-notes-generator",
|
|
12
|
+
[
|
|
13
|
+
"@semantic-release/changelog",
|
|
14
|
+
{
|
|
15
|
+
"changelogFile": "CHANGELOG.md"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"@semantic-release/git",
|
|
20
|
+
{
|
|
21
|
+
"assets": ["package.json", "CHANGELOG.md"],
|
|
22
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"@semantic-release/exec",
|
|
27
|
+
{
|
|
28
|
+
"successCmd": "echo v${nextRelease.version} > VERSION",
|
|
29
|
+
"__note": "DO NOT CHANGE - this command is used in Release action"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"@semantic-release/github"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# [1.2.0](https://github.com/Lundalogik/lime-n8n/compare/v1.1.1...v1.2.0) (2025-09-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add missing trailing slash to the endpoint ([4a169af](https://github.com/Lundalogik/lime-n8n/commit/4a169afc5e65c28d972db1311906e61ed03a7bc6))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* implement error handling on node side ([e464ee3](https://github.com/Lundalogik/lime-n8n/commit/e464ee33de151ae795c34ea979c4fe4edb15129d))
|
|
12
|
+
|
|
13
|
+
## [1.1.1](https://github.com/Lundalogik/lime-n8n/compare/v1.1.0...v1.1.1) (2025-09-05)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* make push to ECR work ([7fd0194](https://github.com/Lundalogik/lime-n8n/commit/7fd0194ad4516a51df5c96b2eba626948fa3c48d))
|
|
19
|
+
|
|
20
|
+
# [1.1.0](https://github.com/Lundalogik/lime-n8n/compare/v1.0.0...v1.1.0) (2025-09-03)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* add Changelog.MD to prettierignore ([b8fe38d](https://github.com/Lundalogik/lime-n8n/commit/b8fe38d71d5f1232ac1fe3f1755c97abbf99490a))
|
|
26
|
+
* set up node version in lint action ([2a282c7](https://github.com/Lundalogik/lime-n8n/commit/2a282c765d0cd6af764d85fe18b71ac35f388664))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* add on-release action to push images to ECR ([a04f9f9](https://github.com/Lundalogik/lime-n8n/commit/a04f9f9ddc9b11d435c6366f03593183f4cde554))
|
|
32
|
+
* add on-release action to push images to ECR ([52d87ae](https://github.com/Lundalogik/lime-n8n/commit/52d87ae6b94ddea331c3d8f64776b1eeaf29b9fd))
|
|
33
|
+
|
|
34
|
+
# 1.0.0 (2025-09-02)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* added org name ([e8bacbd](https://github.com/Lundalogik/lime-n8n/commit/e8bacbd7fd1637590391d6b5626d5b2e66e90a8c))
|
|
40
|
+
* enhance docker setup ([5b273d3](https://github.com/Lundalogik/lime-n8n/commit/5b273d3e882c259925d8965ef025ba04d87f0483))
|
|
41
|
+
* fix a bug in search ([f9e0d97](https://github.com/Lundalogik/lime-n8n/commit/f9e0d970f5da41bd5e00c25c926a91a131b93c84))
|
|
42
|
+
* **fortnox:** change icon name ([a7174f0](https://github.com/Lundalogik/lime-n8n/commit/a7174f09009905be7f3a352f3d7c6ce0c414dff4))
|
|
43
|
+
* **fortnox:** change InvoiceType field to enum ([abe3e81](https://github.com/Lundalogik/lime-n8n/commit/abe3e81bab6401cdbc95b8efd39cd1d112c0355a))
|
|
44
|
+
* **fortnox:** emit event related messages only ([0844541](https://github.com/Lundalogik/lime-n8n/commit/0844541b88dd1785bac4c7e6ad4c64b8eb8a48e9))
|
|
45
|
+
* **fortnox:** handle Websocket messages correctly ([8538ad5](https://github.com/Lundalogik/lime-n8n/commit/8538ad5e92251ce25ba1cfa193ba1ba60546d2ea))
|
|
46
|
+
* paths ([fcd9929](https://github.com/Lundalogik/lime-n8n/commit/fcd99298682693f5cd014ddb852797ca99f4aae0))
|
|
47
|
+
* remove console.logs ([f11af06](https://github.com/Lundalogik/lime-n8n/commit/f11af06f1eb90f817177c106a66c2d8ad817722d))
|
|
48
|
+
* remove redundant lint step in CI ([876e3ea](https://github.com/Lundalogik/lime-n8n/commit/876e3ea825e1c83ad1a117dfca131230b0351302))
|
|
49
|
+
* token ([d9d6c82](https://github.com/Lundalogik/lime-n8n/commit/d9d6c82bea9a4a840eb37f203c684b491fb15b62))
|
|
50
|
+
* trailing slash... ([305b739](https://github.com/Lundalogik/lime-n8n/commit/305b7392138dae2f3f86935fed22de7467b55521))
|
|
51
|
+
* **transport:** add missing slash to the endpoint ([cd24688](https://github.com/Lundalogik/lime-n8n/commit/cd2468800192d5baf00373b3e698db7d970d7f45))
|
|
52
|
+
* **transport:** add missing trailing slash ([55b1582](https://github.com/Lundalogik/lime-n8n/commit/55b15825ef4bac0f9665b847c4c00214d31dde6d))
|
|
53
|
+
* **transport:** remove additional slash in limeobject search url ([35b2dd8](https://github.com/Lundalogik/lime-n8n/commit/35b2dd8b9eb59c15fb9eb696b152caec648bf114))
|
|
54
|
+
* typo ([bf74c1e](https://github.com/Lundalogik/lime-n8n/commit/bf74c1ecc4d22ab9f4780a8558cc81c828d516da))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
|
|
59
|
+
* add `CreateOrUpdateObjects` node ([796aba5](https://github.com/Lundalogik/lime-n8n/commit/796aba5a389178d5aa61c44a718a05a57da04cd5))
|
|
60
|
+
* add data transformation layer between ERP and Lime CRM ([368ad79](https://github.com/Lundalogik/lime-n8n/commit/368ad792867b868d3617fa8573f58b332f2d0334))
|
|
61
|
+
* add Fortnox trigger ([492f515](https://github.com/Lundalogik/lime-n8n/commit/492f515787eee6db5ff8bc0517c8d805a906f657))
|
|
62
|
+
* add jest ([8583608](https://github.com/Lundalogik/lime-n8n/commit/85836086f28dbd75db44b6d6f129c5b959e4e500))
|
|
63
|
+
* add release action ([a56ed4f](https://github.com/Lundalogik/lime-n8n/commit/a56ed4f6455f385bbbb041b5cea1e3dbcd199878))
|
|
64
|
+
* add tsc watcher container ([9ec5c70](https://github.com/Lundalogik/lime-n8n/commit/9ec5c70f2bdbb9ebc662e676cc8d867bb5d9fb48))
|
|
65
|
+
* enable publishing ([ba2f45a](https://github.com/Lundalogik/lime-n8n/commit/ba2f45a7299985d77aecc687aedf908b9f149548))
|
|
66
|
+
* **fortnox:** add fortnox node and customer operations ([3a9316b](https://github.com/Lundalogik/lime-n8n/commit/3a9316b291cb63f36149db8b29160c979aceac25))
|
|
67
|
+
* **fortnox:** add invoice nodes for Fortnox ([df58077](https://github.com/Lundalogik/lime-n8n/commit/df58077472ea5634283af75c3217d7308a327a89))
|
|
68
|
+
* handle nested objects transformation ([5cf450f](https://github.com/Lundalogik/lime-n8n/commit/5cf450f0884fc4745d7c10dc3e19a0af609f85d3))
|
|
69
|
+
* **lime-crm:** add LimeCrm and LimeCrmTrigger node configurations ([b655f59](https://github.com/Lundalogik/lime-n8n/commit/b655f591b97bfab135a09c1923b389330bac6688))
|
|
70
|
+
* **lime-crm:** enhance Lime type properties and types retrieval with embedded API data ([da5d57a](https://github.com/Lundalogik/lime-n8n/commit/da5d57ad8766098a382b2fbebed48e15fa95aefb))
|
|
71
|
+
* **lime-crm:** implement Lime CRM object operations and API request handling ([c2ae9cb](https://github.com/Lundalogik/lime-n8n/commit/c2ae9cb49f5c50f9b80ba232ea715c9266b5cf2f))
|
|
72
|
+
* **lime-crm:** remove LimeCrmApi.credentials and update node structure ([4c85a87](https://github.com/Lundalogik/lime-n8n/commit/4c85a8711e508a74316b3e36415034f2e87debb8))
|
|
73
|
+
* **lime-go:** add Lime Go API integration and remove unused Lime CRM files ([cb6292c](https://github.com/Lundalogik/lime-n8n/commit/cb6292c4651b25330c85495ffde53760f99fa480))
|
|
74
|
+
* prevent webhook duplication ([2f7241e](https://github.com/Lundalogik/lime-n8n/commit/2f7241e1781065a2d1ff00f0224e4da95dccaac5))
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ----------- Stage 1: Build -----------
|
|
2
|
+
FROM node:18 AS builder
|
|
3
|
+
|
|
4
|
+
RUN mkdir /source
|
|
5
|
+
WORKDIR /source
|
|
6
|
+
COPY . .
|
|
7
|
+
RUN npm install -g typescript@5.3.2
|
|
8
|
+
RUN npm install --include=dev
|
|
9
|
+
RUN npm run build
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# ----------- Stage 2: Production -----------
|
|
13
|
+
FROM n8nio/n8n
|
|
14
|
+
|
|
15
|
+
ENV N8N_CUSTOM_EXTENSIONS=/home/node/.n8n/custom
|
|
16
|
+
|
|
17
|
+
USER root
|
|
18
|
+
COPY --from=builder /source/dist ${N8N_CUSTOM_EXTENSIONS}
|
|
19
|
+
|
|
20
|
+
USER node
|
|
21
|
+
WORKDIR /home/node
|
package/README.md
CHANGED
|
@@ -8,16 +8,20 @@ This repository contains configuration to run n8n locally using Docker.
|
|
|
8
8
|
- Docker Compose
|
|
9
9
|
|
|
10
10
|
## Getting Started
|
|
11
|
+
|
|
11
12
|
1. Build nodes
|
|
13
|
+
|
|
12
14
|
```bash
|
|
13
15
|
npm i
|
|
14
16
|
npm run build
|
|
15
17
|
```
|
|
18
|
+
|
|
16
19
|
2. Start n8n and PostgreSQL:
|
|
17
20
|
|
|
18
21
|
```bash
|
|
19
22
|
docker-compose up -d
|
|
20
23
|
```
|
|
24
|
+
|
|
21
25
|
3. Access n8n in your browser at: http://localhost:5678
|
|
22
26
|
|
|
23
27
|
4. To stop the containers:
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ICredentialType,
|
|
3
|
+
INodeProperties,
|
|
4
|
+
IHttpRequestMethods,
|
|
5
|
+
IAuthenticate,
|
|
6
|
+
ICredentialTestRequest,
|
|
7
|
+
} from 'n8n-workflow';
|
|
8
|
+
import { FORTNOX_API_CREDENTIAL_KEY } from '../nodes/fortnox/commons';
|
|
9
|
+
import { FORTNOX_BASE_URL } from '../nodes/fortnox/transport';
|
|
10
|
+
|
|
11
|
+
export class FortnoxApi implements ICredentialType {
|
|
12
|
+
name = FORTNOX_API_CREDENTIAL_KEY;
|
|
13
|
+
displayName = 'Fortnox API';
|
|
14
|
+
documentationUrl = 'https://www.fortnox.se/developer';
|
|
15
|
+
properties: INodeProperties[] = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Token',
|
|
18
|
+
name: 'token',
|
|
19
|
+
type: 'string',
|
|
20
|
+
typeOptions: {
|
|
21
|
+
password: true,
|
|
22
|
+
},
|
|
23
|
+
default: '',
|
|
24
|
+
required: true,
|
|
25
|
+
description: 'Token for authentication with the Fortnox API',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Client Secret',
|
|
29
|
+
name: 'clientSecret',
|
|
30
|
+
type: 'string',
|
|
31
|
+
typeOptions: {
|
|
32
|
+
password: true,
|
|
33
|
+
},
|
|
34
|
+
default: '',
|
|
35
|
+
description:
|
|
36
|
+
'Unique key provided when you register your Fortnox integration',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
authenticate: IAuthenticate = {
|
|
41
|
+
type: 'generic',
|
|
42
|
+
properties: {
|
|
43
|
+
headers: {
|
|
44
|
+
Authorization: '=Bearer {{$credentials.token}}',
|
|
45
|
+
Accept: 'application/json',
|
|
46
|
+
'Content-Type': 'application/json',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
test: ICredentialTestRequest = {
|
|
52
|
+
request: {
|
|
53
|
+
baseURL: FORTNOX_BASE_URL,
|
|
54
|
+
url: 'invoices',
|
|
55
|
+
method: 'GET' as IHttpRequestMethods,
|
|
56
|
+
headers: {
|
|
57
|
+
Authorization: '=Bearer {{$credentials.token}}',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ICredentialType,
|
|
3
|
+
INodeProperties,
|
|
4
|
+
IHttpRequestMethods,
|
|
5
|
+
IAuthenticate,
|
|
6
|
+
ICredentialTestRequest,
|
|
7
|
+
} from 'n8n-workflow';
|
|
8
|
+
|
|
9
|
+
import { LIME_CRM_API_CREDENTIAL_KEY } from '../nodes/lime-crm/commons';
|
|
10
|
+
|
|
11
|
+
export class LimeCrmApi implements ICredentialType {
|
|
12
|
+
name = LIME_CRM_API_CREDENTIAL_KEY;
|
|
13
|
+
displayName = 'Lime CRM API';
|
|
14
|
+
documentationUrl = 'https://lime-crm.com/api-docs/';
|
|
15
|
+
properties: INodeProperties[] = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Server URL',
|
|
18
|
+
name: 'url',
|
|
19
|
+
type: 'string',
|
|
20
|
+
default: '',
|
|
21
|
+
placeholder: 'https://instance.lime-crm.com',
|
|
22
|
+
required: true,
|
|
23
|
+
description:
|
|
24
|
+
'The URL of your Lime CRM instance (without trailing slash)',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
displayName: 'API Key',
|
|
28
|
+
name: 'apiKey',
|
|
29
|
+
type: 'string',
|
|
30
|
+
typeOptions: {
|
|
31
|
+
password: true,
|
|
32
|
+
},
|
|
33
|
+
default: '',
|
|
34
|
+
required: true,
|
|
35
|
+
description: 'The API key obtained from Lime CRM',
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
authenticate: IAuthenticate = {
|
|
40
|
+
type: 'generic',
|
|
41
|
+
properties: {
|
|
42
|
+
headers: {
|
|
43
|
+
// Ensure the header name matches exactly what the Lime CRM API expects
|
|
44
|
+
'X-API-Key': '={{$credentials.apiKey}}',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
test: ICredentialTestRequest = {
|
|
50
|
+
request: {
|
|
51
|
+
baseURL: '={{$credentials.url}}',
|
|
52
|
+
url: '/api/v1/',
|
|
53
|
+
method: 'GET' as IHttpRequestMethods,
|
|
54
|
+
headers: {
|
|
55
|
+
'X-API-Key': '={{$credentials.apiKey}}',
|
|
56
|
+
Accept: 'application/json',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties, IAuthenticate, ICredentialTestRequest } from 'n8n-workflow';
|
|
2
|
+
export declare class FortnoxApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticate;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FortnoxApi = void 0;
|
|
4
|
+
const commons_1 = require("../nodes/fortnox/commons");
|
|
5
|
+
const transport_1 = require("../nodes/fortnox/transport");
|
|
6
|
+
class FortnoxApi {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.name = commons_1.FORTNOX_API_CREDENTIAL_KEY;
|
|
9
|
+
this.displayName = 'Fortnox API';
|
|
10
|
+
this.documentationUrl = 'https://www.fortnox.se/developer';
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Token',
|
|
14
|
+
name: 'token',
|
|
15
|
+
type: 'string',
|
|
16
|
+
typeOptions: {
|
|
17
|
+
password: true,
|
|
18
|
+
},
|
|
19
|
+
default: '',
|
|
20
|
+
required: true,
|
|
21
|
+
description: 'Token for authentication with the Fortnox API',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Client Secret',
|
|
25
|
+
name: 'clientSecret',
|
|
26
|
+
type: 'string',
|
|
27
|
+
typeOptions: {
|
|
28
|
+
password: true,
|
|
29
|
+
},
|
|
30
|
+
default: '',
|
|
31
|
+
description: 'Unique key provided when you register your Fortnox integration',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
this.authenticate = {
|
|
35
|
+
type: 'generic',
|
|
36
|
+
properties: {
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: '=Bearer {{$credentials.token}}',
|
|
39
|
+
Accept: 'application/json',
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
this.test = {
|
|
45
|
+
request: {
|
|
46
|
+
baseURL: transport_1.FORTNOX_BASE_URL,
|
|
47
|
+
url: 'invoices',
|
|
48
|
+
method: 'GET',
|
|
49
|
+
headers: {
|
|
50
|
+
Authorization: '=Bearer {{$credentials.token}}',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.FortnoxApi = FortnoxApi;
|
|
57
|
+
//# sourceMappingURL=FortnoxApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FortnoxApi.credentials.js","sourceRoot":"","sources":["../../credentials/FortnoxApi.credentials.ts"],"names":[],"mappings":";;;AAOA,sDAAsE;AACtE,0DAA8D;AAE9D,MAAa,UAAU;IAAvB;QACI,SAAI,GAAG,oCAA0B,CAAC;QAClC,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,kCAAkC,CAAC;QACtD,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,+CAA+C;aAC/D;YACD;gBACI,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EACP,gEAAgE;aACvE;SACJ,CAAC;QAEF,iBAAY,GAAkB;YAC1B,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,gCAAgC;oBAC/C,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBACrC;aACJ;SACJ,CAAC;QAEF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,4BAAgB;gBACzB,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,KAA4B;gBACpC,OAAO,EAAE;oBACL,aAAa,EAAE,gCAAgC;iBAClD;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAlDD,gCAkDC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LimeCrmApi = void 0;
|
|
4
|
+
const commons_1 = require("../nodes/lime-crm/commons");
|
|
4
5
|
class LimeCrmApi {
|
|
5
6
|
constructor() {
|
|
6
|
-
this.name =
|
|
7
|
+
this.name = commons_1.LIME_CRM_API_CREDENTIAL_KEY;
|
|
7
8
|
this.displayName = 'Lime CRM API';
|
|
8
9
|
this.documentationUrl = 'https://lime-crm.com/api-docs/';
|
|
9
10
|
this.properties = [
|
|
@@ -43,7 +44,7 @@ class LimeCrmApi {
|
|
|
43
44
|
method: 'GET',
|
|
44
45
|
headers: {
|
|
45
46
|
'X-API-Key': '={{$credentials.apiKey}}',
|
|
46
|
-
|
|
47
|
+
Accept: 'application/json',
|
|
47
48
|
},
|
|
48
49
|
},
|
|
49
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LimeCrmApi.credentials.js","sourceRoot":"","sources":["../../credentials/LimeCrmApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,UAAU;IAAvB;QACI,SAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"LimeCrmApi.credentials.js","sourceRoot":"","sources":["../../credentials/LimeCrmApi.credentials.ts"],"names":[],"mappings":";;;AAQA,uDAAwE;AAExE,MAAa,UAAU;IAAvB;QACI,SAAI,GAAG,qCAA2B,CAAC;QACnC,gBAAW,GAAG,cAAc,CAAC;QAC7B,qBAAgB,GAAG,gCAAgC,CAAC;QACpD,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+BAA+B;gBAC5C,QAAQ,EAAE,IAAI;gBACd,WAAW,EACP,4DAA4D;aACnE;YACD;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;aACpD;SACJ,CAAC;QAEF,iBAAY,GAAkB;YAC1B,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACR,OAAO,EAAE;oBAEL,WAAW,EAAE,0BAA0B;iBAC1C;aACJ;SACJ,CAAC;QAEF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,uBAAuB;gBAChC,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,KAA4B;gBACpC,OAAO,EAAE;oBACL,WAAW,EAAE,0BAA0B;oBACvC,MAAM,EAAE,kBAAkB;iBAC7B;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAjDD,gCAiDC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Fortnox = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const invoice_1 = require("./resources/invoice");
|
|
6
|
+
const commons_1 = require("./commons");
|
|
7
|
+
const customers_1 = require("./resources/customers");
|
|
8
|
+
class Fortnox {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'Fortnox',
|
|
12
|
+
name: 'fortnox',
|
|
13
|
+
icon: 'file:fortnoxLogo.svg',
|
|
14
|
+
group: ['transform'],
|
|
15
|
+
version: 1,
|
|
16
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
17
|
+
description: 'Consume the Fortnox API',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Fortnox',
|
|
20
|
+
},
|
|
21
|
+
inputs: ["main"],
|
|
22
|
+
outputs: ["main"],
|
|
23
|
+
credentials: [
|
|
24
|
+
{
|
|
25
|
+
name: commons_1.FORTNOX_API_CREDENTIAL_KEY,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
properties: [
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Resource',
|
|
32
|
+
name: 'resource',
|
|
33
|
+
type: 'options',
|
|
34
|
+
noDataExpression: true,
|
|
35
|
+
options: [
|
|
36
|
+
{
|
|
37
|
+
name: 'Customer',
|
|
38
|
+
value: 'customer',
|
|
39
|
+
description: 'Work with customers',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Invoice',
|
|
43
|
+
value: 'invoice',
|
|
44
|
+
description: 'Work with invoices',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
default: 'customer',
|
|
48
|
+
},
|
|
49
|
+
...customers_1.customerProperties,
|
|
50
|
+
...invoice_1.invoiceProperties,
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
async execute() {
|
|
55
|
+
const items = this.getInputData();
|
|
56
|
+
const returnData = [];
|
|
57
|
+
let responseData;
|
|
58
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
59
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
60
|
+
for (let i = 0; i < items.length; i++) {
|
|
61
|
+
if (resource === 'customer') {
|
|
62
|
+
responseData = await customers_1.customerOperations.call(this, {
|
|
63
|
+
operation,
|
|
64
|
+
i,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else if (resource === 'invoice') {
|
|
68
|
+
responseData = await invoice_1.invoiceOperations.call(this, {
|
|
69
|
+
operation,
|
|
70
|
+
i,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const errorLog = `The resource "${resource}" is not supported!`;
|
|
75
|
+
if (this.continueOnFail()) {
|
|
76
|
+
returnData.push({
|
|
77
|
+
error: errorLog,
|
|
78
|
+
json: { error: errorLog },
|
|
79
|
+
});
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorLog);
|
|
83
|
+
}
|
|
84
|
+
if (Array.isArray(responseData)) {
|
|
85
|
+
returnData.push(...responseData);
|
|
86
|
+
}
|
|
87
|
+
else if (responseData !== undefined && responseData !== null) {
|
|
88
|
+
returnData.push(responseData);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.Fortnox = Fortnox;
|
|
95
|
+
//# sourceMappingURL=Fortnox.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fortnox.node.js","sourceRoot":"","sources":["../../../nodes/fortnox/Fortnox.node.ts"],"names":[],"mappings":"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"}
|