@limetech/n8n-nodes-lime 0.2.8 → 0.3.0

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.
Files changed (88) hide show
  1. package/.dockerignore +1 -0
  2. package/.github/workflows/lint.yml +21 -0
  3. package/.github/workflows/release.yml +82 -0
  4. package/.github/workflows/test-and-build.yml +47 -0
  5. package/.prettierignore +4 -0
  6. package/.prettierrc.mjs +1 -0
  7. package/.releaserc.json +34 -0
  8. package/CHANGELOG.md +74 -0
  9. package/Dockerfile +21 -0
  10. package/README.md +4 -0
  11. package/credentials/FortnoxApi.credentials.ts +61 -0
  12. package/credentials/LimeCrmApi.credentials.ts +60 -0
  13. package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.js +1 -1
  14. package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.js.map +1 -1
  15. package/dist/package.json +1 -1
  16. package/dist/tsconfig.tsbuildinfo +1 -1
  17. package/docker-compose.yml +46 -0
  18. package/eslint.config.mjs +27 -0
  19. package/jest.config.js +11 -0
  20. package/nodes/fortnox/Fortnox.node.json +18 -0
  21. package/nodes/fortnox/Fortnox.node.ts +102 -0
  22. package/nodes/fortnox/FortnoxTrigger.node.json +18 -0
  23. package/nodes/fortnox/FortnoxTrigger.node.ts +196 -0
  24. package/nodes/fortnox/commons.ts +94 -0
  25. package/nodes/fortnox/fortnoxLogo.svg +15 -0
  26. package/nodes/fortnox/model.ts +25 -0
  27. package/nodes/fortnox/resources/customers/filterParameters.ts +47 -0
  28. package/nodes/fortnox/resources/customers/index.ts +57 -0
  29. package/nodes/fortnox/resources/customers/model.ts +107 -0
  30. package/nodes/fortnox/resources/customers/operations/create.operation.ts +303 -0
  31. package/nodes/fortnox/resources/customers/operations/delete.operation.ts +44 -0
  32. package/nodes/fortnox/resources/customers/operations/get.operation.ts +45 -0
  33. package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +80 -0
  34. package/nodes/fortnox/resources/customers/operations/update.operation.ts +278 -0
  35. package/nodes/fortnox/resources/customers/sortParameters.ts +32 -0
  36. package/nodes/fortnox/resources/invoice/filterParameters.ts +88 -0
  37. package/nodes/fortnox/resources/invoice/index.ts +51 -0
  38. package/nodes/fortnox/resources/invoice/invoiceParameters.ts +214 -0
  39. package/nodes/fortnox/resources/invoice/model.ts +160 -0
  40. package/nodes/fortnox/resources/invoice/operations/create.operation.ts +72 -0
  41. package/nodes/fortnox/resources/invoice/operations/get.operation.ts +45 -0
  42. package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +101 -0
  43. package/nodes/fortnox/resources/invoice/operations/update.operation.ts +74 -0
  44. package/nodes/fortnox/transport/errorCodes.ts +62 -0
  45. package/nodes/fortnox/transport/index.ts +98 -0
  46. package/nodes/lime-crm/LimeCrm.node.json +18 -0
  47. package/nodes/lime-crm/LimeCrmNode.node.ts +135 -0
  48. package/nodes/lime-crm/LimeCrmTrigger.node.ts +263 -0
  49. package/nodes/lime-crm/assets/lime-crm.svg +1 -0
  50. package/nodes/lime-crm/commons/constants.ts +9 -0
  51. package/nodes/lime-crm/commons/index.ts +9 -0
  52. package/nodes/lime-crm/commons/limetype.ts +11 -0
  53. package/nodes/lime-crm/commons/task.ts +55 -0
  54. package/nodes/lime-crm/commons/webhook.ts +50 -0
  55. package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +11 -0
  56. package/nodes/lime-crm/methods/getLimeTypeProperties.ts +27 -0
  57. package/nodes/lime-crm/methods/getLimeTypes.ts +23 -0
  58. package/nodes/lime-crm/methods/index.ts +3 -0
  59. package/nodes/lime-crm/resources/erpConnector/index.ts +43 -0
  60. package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +69 -0
  61. package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +274 -0
  62. package/nodes/lime-crm/resources/erpConnector/transform.ts +49 -0
  63. package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +18 -0
  64. package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +201 -0
  65. package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +1 -0
  66. package/nodes/lime-crm/resources/limeObject/index.ts +64 -0
  67. package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +152 -0
  68. package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +55 -0
  69. package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +54 -0
  70. package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +99 -0
  71. package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +157 -0
  72. package/nodes/lime-crm/resources/limeType/index.ts +58 -0
  73. package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +42 -0
  74. package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +36 -0
  75. package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +18 -0
  76. package/nodes/lime-crm/transport/commons.ts +44 -0
  77. package/nodes/lime-crm/transport/erpConnector.ts +21 -0
  78. package/nodes/lime-crm/transport/index.ts +17 -0
  79. package/nodes/lime-crm/transport/limeobjects.ts +83 -0
  80. package/nodes/lime-crm/transport/limetypes.ts +68 -0
  81. package/nodes/lime-crm/transport/task.ts +32 -0
  82. package/nodes/lime-crm/transport/webhooks.ts +61 -0
  83. package/nodes/nodeResponse.ts +13 -0
  84. package/package.json +36 -16
  85. package/tests/fixtures/fortnox.ts +182 -0
  86. package/tests/transform.spec.ts +187 -0
  87. package/tsconfig.json +30 -0
  88. 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 .
@@ -0,0 +1,4 @@
1
+ dist/
2
+ node_modules/
3
+ package-lock.json
4
+ CHANGELOG.md
@@ -0,0 +1 @@
1
+ export { default } from '@limetech/eslint-config/prettier.config.js';
@@ -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
+ }
@@ -174,7 +174,7 @@ async function execute(i) {
174
174
  body[field.fieldName] = field.fieldValue;
175
175
  });
176
176
  }
177
- const endpoint = `/api/v1/limeobject/${limeType}/${id}/`;
177
+ const endpoint = `/api/v1/limeobject/${encodeURIComponent(limeType)}/${encodeURIComponent(id)}/`;
178
178
  const response = await transport_1.apiRequest.call(this, {
179
179
  method: 'PUT',
180
180
  url: endpoint,
@@ -1 +1 @@
1
- {"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/LimeCrm/resources/limeObject/operations/update.operation.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AACtB,kDAAgD;AAGnC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,2BAA2B;IACxC,MAAM,EAAE,iBAAiB;CAC5B,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACT,iBAAiB,EAAE,cAAc;SACpC;QACD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,YAAY;iBACf;gBACD,SAAS,EAAE;oBACP,QAAQ;iBACX;aACJ;SACJ;KACJ;IACD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4BAA4B;QACzC,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,YAAY;iBACf;gBACD,SAAS,EAAE;oBACP,QAAQ;iBACX;aACJ;SACJ;KACJ;IACD;QACI,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,4BAA4B;aAC5C;YACD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zF,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,IAAI,CAAC,KAAK,CAAC,SAAmB,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC;QACvD,CAAC,CAAC,CAAC;KACN;IAED,MAAM,QAAQ,GAAG,sBAAsB,QAAQ,IAAI,EAAE,GAAG,CAAC;IAGzD,MAAM,QAAQ,GAAG,MAAM,sBAAU,CAAC,IAAI,CAClC,IAAI,EACJ;QACI,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,QAAQ;QACb,IAAI;KACP,CACJ,CAAC;IAEF,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7C,CAAC;AAvCD,0BAuCC"}
1
+ {"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/LimeCrm/resources/limeObject/operations/update.operation.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AACtB,kDAAgD;AAGnC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,2BAA2B;IACxC,MAAM,EAAE,iBAAiB;CAC5B,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACT,iBAAiB,EAAE,cAAc;SACpC;QACD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,YAAY;iBACf;gBACD,SAAS,EAAE;oBACP,QAAQ;iBACX;aACJ;SACJ;KACJ;IACD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4BAA4B;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AC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAuB,CAAC;SACxF;QAAC,OAAO,KAAK,EAAE;YACZ,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;SAClF;KACJ;SAAM;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE,CAAkB,CAAC;QACzF,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,IAAI,CAAC,KAAK,CAAC,SAAmB,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC;QACvD,CAAC,CAAC,CAAC;KACN;IAED,MAAM,QAAQ,GAAG,sBAAsB,kBAAkB,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC;IAGjG,MAAM,QAAQ,GAAG,MAAM,sBAAU,CAAC,IAAI,CAClC,IAAI,EACJ;QACI,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,QAAQ;QACb,IAAI;KACP,CACJ,CAAC;IAEF,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7C,CAAC;AAvCD,0BAuCC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/n8n-nodes-lime",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "n8n node to connect to Lime CRM",
5
5
  "license": "MIT",
6
6
  "main": "index.js",