@limetech/n8n-nodes-lime 0.1.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 (194) hide show
  1. package/.eslintrc.js +58 -0
  2. package/.github/copilot-instructions.md +20 -0
  3. package/.github/workflows/publish.yml +34 -0
  4. package/README.md +79 -0
  5. package/credentials/LimeCrmApi.credentials.ts +57 -0
  6. package/credentials/LimeGoApi.credentials.ts +31 -0
  7. package/dist/credentials/LimeCrmApi.credentials.d.ts +9 -0
  8. package/dist/credentials/LimeCrmApi.credentials.js +53 -0
  9. package/dist/credentials/LimeCrmApi.credentials.js.map +1 -0
  10. package/dist/credentials/LimeGoApi.credentials.d.ts +15 -0
  11. package/dist/credentials/LimeGoApi.credentials.js +32 -0
  12. package/dist/credentials/LimeGoApi.credentials.js.map +1 -0
  13. package/dist/nodes/lime-crm/GenericTypes.d.ts +80 -0
  14. package/dist/nodes/lime-crm/GenericTypes.js +7 -0
  15. package/dist/nodes/lime-crm/GenericTypes.js.map +1 -0
  16. package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
  17. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +17 -0
  18. package/dist/nodes/lime-crm/LimeCrmNode.node.js +114 -0
  19. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
  20. package/dist/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.d.ts +17 -0
  21. package/dist/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.js +408 -0
  22. package/dist/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.js.map +1 -0
  23. package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +17 -0
  24. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +439 -0
  25. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
  26. package/dist/nodes/lime-crm/lime-crm.svg +1 -0
  27. package/dist/nodes/lime-crm/methods/getAllSortableFields.d.ts +7 -0
  28. package/dist/nodes/lime-crm/methods/getAllSortableFields.js +53 -0
  29. package/dist/nodes/lime-crm/methods/getAllSortableFields.js.map +1 -0
  30. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +3 -0
  31. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +40 -0
  32. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +1 -0
  33. package/dist/nodes/lime-crm/methods/getLimeTypeRelations.d.ts +7 -0
  34. package/dist/nodes/lime-crm/methods/getLimeTypeRelations.js +30 -0
  35. package/dist/nodes/lime-crm/methods/getLimeTypeRelations.js.map +1 -0
  36. package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +3 -0
  37. package/dist/nodes/lime-crm/methods/getLimeTypes.js +33 -0
  38. package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +1 -0
  39. package/dist/nodes/lime-crm/methods/getRelatedTypeProperties.d.ts +7 -0
  40. package/dist/nodes/lime-crm/methods/getRelatedTypeProperties.js +39 -0
  41. package/dist/nodes/lime-crm/methods/getRelatedTypeProperties.js.map +1 -0
  42. package/dist/nodes/lime-crm/methods/index.d.ts +5 -0
  43. package/dist/nodes/lime-crm/methods/index.js +14 -0
  44. package/dist/nodes/lime-crm/methods/index.js.map +1 -0
  45. package/dist/nodes/lime-crm/resources/limeObject/commonFields.d.ts +4 -0
  46. package/dist/nodes/lime-crm/resources/limeObject/commonFields.js +165 -0
  47. package/dist/nodes/lime-crm/resources/limeObject/commonFields.js.map +1 -0
  48. package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +6 -0
  49. package/dist/nodes/lime-crm/resources/limeObject/index.js +79 -0
  50. package/dist/nodes/lime-crm/resources/limeObject/index.js.map +1 -0
  51. package/dist/nodes/lime-crm/resources/limeObject/operations/common.operation.d.ts +2 -0
  52. package/dist/nodes/lime-crm/resources/limeObject/operations/common.operation.js +36 -0
  53. package/dist/nodes/lime-crm/resources/limeObject/operations/common.operation.js.map +1 -0
  54. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +9 -0
  55. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +234 -0
  56. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +1 -0
  57. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +9 -0
  58. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +136 -0
  59. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +1 -0
  60. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +9 -0
  61. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +125 -0
  62. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +1 -0
  63. package/dist/nodes/lime-crm/resources/limeObject/operations/getAll.operation.d.ts +3 -0
  64. package/dist/nodes/lime-crm/resources/limeObject/operations/getAll.operation.js +212 -0
  65. package/dist/nodes/lime-crm/resources/limeObject/operations/getAll.operation.js.map +1 -0
  66. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +9 -0
  67. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +232 -0
  68. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -0
  69. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +9 -0
  70. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +186 -0
  71. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +1 -0
  72. package/dist/nodes/lime-crm/resources/limeType/index.d.ts +6 -0
  73. package/dist/nodes/lime-crm/resources/limeType/index.js +81 -0
  74. package/dist/nodes/lime-crm/resources/limeType/index.js.map +1 -0
  75. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +9 -0
  76. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +112 -0
  77. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +1 -0
  78. package/dist/nodes/lime-crm/resources/limeType/operations/getRelations.operation.d.ts +9 -0
  79. package/dist/nodes/lime-crm/resources/limeType/operations/getRelations.operation.js +112 -0
  80. package/dist/nodes/lime-crm/resources/limeType/operations/getRelations.operation.js.map +1 -0
  81. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +9 -0
  82. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +70 -0
  83. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +1 -0
  84. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +9 -0
  85. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +86 -0
  86. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +1 -0
  87. package/dist/nodes/lime-crm/resources/queryApi/index.d.ts +6 -0
  88. package/dist/nodes/lime-crm/resources/queryApi/index.js +57 -0
  89. package/dist/nodes/lime-crm/resources/queryApi/index.js.map +1 -0
  90. package/dist/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.d.ts +9 -0
  91. package/dist/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.js +559 -0
  92. package/dist/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.js.map +1 -0
  93. package/dist/nodes/lime-crm/transport/index.d.ts +2 -0
  94. package/dist/nodes/lime-crm/transport/index.js +50 -0
  95. package/dist/nodes/lime-crm/transport/index.js.map +1 -0
  96. package/dist/nodes/lime-go/LimeGo.node.d.ts +8 -0
  97. package/dist/nodes/lime-go/LimeGo.node.js +123 -0
  98. package/dist/nodes/lime-go/LimeGo.node.js.map +1 -0
  99. package/dist/nodes/lime-go/actions/organization/get.operation.d.ts +5 -0
  100. package/dist/nodes/lime-go/actions/organization/get.operation.js +39 -0
  101. package/dist/nodes/lime-go/actions/organization/get.operation.js.map +1 -0
  102. package/dist/nodes/lime-go/actions/organization/getByExternalKey.operation.d.ts +5 -0
  103. package/dist/nodes/lime-go/actions/organization/getByExternalKey.operation.js +54 -0
  104. package/dist/nodes/lime-go/actions/organization/getByExternalKey.operation.js.map +1 -0
  105. package/dist/nodes/lime-go/actions/organization/index.d.ts +7 -0
  106. package/dist/nodes/lime-go/actions/organization/index.js +92 -0
  107. package/dist/nodes/lime-go/actions/organization/index.js.map +1 -0
  108. package/dist/nodes/lime-go/actions/organization/organizationFields.d.ts +2 -0
  109. package/dist/nodes/lime-go/actions/organization/organizationFields.js +162 -0
  110. package/dist/nodes/lime-go/actions/organization/organizationFields.js.map +1 -0
  111. package/dist/nodes/lime-go/actions/organization/search.operation.d.ts +5 -0
  112. package/dist/nodes/lime-go/actions/organization/search.operation.js +70 -0
  113. package/dist/nodes/lime-go/actions/organization/search.operation.js.map +1 -0
  114. package/dist/nodes/lime-go/actions/organization/update.operation.d.ts +5 -0
  115. package/dist/nodes/lime-go/actions/organization/update.operation.js +125 -0
  116. package/dist/nodes/lime-go/actions/organization/update.operation.js.map +1 -0
  117. package/dist/nodes/lime-go/actions/person/createMail.operation.d.ts +7 -0
  118. package/dist/nodes/lime-go/actions/person/createMail.operation.js +130 -0
  119. package/dist/nodes/lime-go/actions/person/createMail.operation.js.map +1 -0
  120. package/dist/nodes/lime-go/actions/person/get.operation.d.ts +7 -0
  121. package/dist/nodes/lime-go/actions/person/get.operation.js +45 -0
  122. package/dist/nodes/lime-go/actions/person/get.operation.js.map +1 -0
  123. package/dist/nodes/lime-go/actions/person/index.d.ts +7 -0
  124. package/dist/nodes/lime-go/actions/person/index.js +92 -0
  125. package/dist/nodes/lime-go/actions/person/index.js.map +1 -0
  126. package/dist/nodes/lime-go/actions/person/personFields.d.ts +2 -0
  127. package/dist/nodes/lime-go/actions/person/personFields.js +134 -0
  128. package/dist/nodes/lime-go/actions/person/personFields.js.map +1 -0
  129. package/dist/nodes/lime-go/actions/person/search.operation.d.ts +7 -0
  130. package/dist/nodes/lime-go/actions/person/search.operation.js +81 -0
  131. package/dist/nodes/lime-go/actions/person/search.operation.js.map +1 -0
  132. package/dist/nodes/lime-go/actions/person/update.operation.d.ts +7 -0
  133. package/dist/nodes/lime-go/actions/person/update.operation.js +104 -0
  134. package/dist/nodes/lime-go/actions/person/update.operation.js.map +1 -0
  135. package/dist/nodes/lime-go/lime-go.svg +1 -0
  136. package/dist/nodes/lime-go/transport/graphqlRequest.d.ts +2 -0
  137. package/dist/nodes/lime-go/transport/graphqlRequest.js +23 -0
  138. package/dist/nodes/lime-go/transport/graphqlRequest.js.map +1 -0
  139. package/dist/nodes/lime-go/transport/transport.d.ts +3 -0
  140. package/dist/nodes/lime-go/transport/transport.js +58 -0
  141. package/dist/nodes/lime-go/transport/transport.js.map +1 -0
  142. package/dist/nodes/lime-go/triggers/webhook.d.ts +10 -0
  143. package/dist/nodes/lime-go/triggers/webhook.js +92 -0
  144. package/dist/nodes/lime-go/triggers/webhook.js.map +1 -0
  145. package/dist/package.json +49 -0
  146. package/dist/tsconfig.tsbuildinfo +1 -0
  147. package/docker-compose.yml +44 -0
  148. package/index.js +3 -0
  149. package/nodes/lime-crm/GenericTypes.ts +114 -0
  150. package/nodes/lime-crm/LimeCrm.node.json +18 -0
  151. package/nodes/lime-crm/LimeCrmNode.node.ts +154 -0
  152. package/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.ts +461 -0
  153. package/nodes/lime-crm/LimeCrmTrigger.node.ts +505 -0
  154. package/nodes/lime-crm/lime-crm.svg +1 -0
  155. package/nodes/lime-crm/methods/getAllSortableFields.ts +73 -0
  156. package/nodes/lime-crm/methods/getLimeTypeProperties.ts +48 -0
  157. package/nodes/lime-crm/methods/getLimeTypeRelations.ts +32 -0
  158. package/nodes/lime-crm/methods/getLimeTypes.ts +33 -0
  159. package/nodes/lime-crm/methods/getRelatedTypeProperties.ts +47 -0
  160. package/nodes/lime-crm/methods/index.ts +5 -0
  161. package/nodes/lime-crm/resources/limeObject/commonFields.ts +179 -0
  162. package/nodes/lime-crm/resources/limeObject/index.ts +64 -0
  163. package/nodes/lime-crm/resources/limeObject/operations/common.operation.ts +35 -0
  164. package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +234 -0
  165. package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +136 -0
  166. package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +124 -0
  167. package/nodes/lime-crm/resources/limeObject/operations/getAll.operation.ts +242 -0
  168. package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +242 -0
  169. package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +201 -0
  170. package/nodes/lime-crm/resources/limeType/index.ts +66 -0
  171. package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +105 -0
  172. package/nodes/lime-crm/resources/limeType/operations/getRelations.operation.ts +105 -0
  173. package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +58 -0
  174. package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +76 -0
  175. package/nodes/lime-crm/resources/queryApi/index.ts +42 -0
  176. package/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.ts +605 -0
  177. package/nodes/lime-crm/transport/index.ts +74 -0
  178. package/nodes/lime-go/LimeGo.node.ts +146 -0
  179. package/nodes/lime-go/actions/organization/get.operation.ts +42 -0
  180. package/nodes/lime-go/actions/organization/getByExternalKey.operation.ts +57 -0
  181. package/nodes/lime-go/actions/organization/index.ts +69 -0
  182. package/nodes/lime-go/actions/organization/organizationFields.ts +160 -0
  183. package/nodes/lime-go/actions/organization/search.operation.ts +73 -0
  184. package/nodes/lime-go/actions/organization/update.operation.ts +140 -0
  185. package/nodes/lime-go/actions/person/createMail.operation.ts +140 -0
  186. package/nodes/lime-go/actions/person/get.operation.ts +51 -0
  187. package/nodes/lime-go/actions/person/index.ts +69 -0
  188. package/nodes/lime-go/actions/person/personFields.ts +132 -0
  189. package/nodes/lime-go/actions/person/search.operation.ts +88 -0
  190. package/nodes/lime-go/actions/person/update.operation.ts +122 -0
  191. package/nodes/lime-go/lime-go.svg +1 -0
  192. package/nodes/lime-go/transport/graphqlRequest.ts +30 -0
  193. package/package.json +50 -0
  194. package/tsconfig.json +30 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @type {import('@types/eslint').ESLint.ConfigData}
3
+ */
4
+ module.exports = {
5
+ root: true,
6
+
7
+ env: {
8
+ browser: true,
9
+ es6: true,
10
+ node: true,
11
+ },
12
+
13
+ parser: "@typescript-eslint/parser",
14
+
15
+ parserOptions: {
16
+ project: ["./tsconfig.json"],
17
+ sourceType: "module",
18
+ extraFileExtensions: [".json"],
19
+ },
20
+
21
+ ignorePatterns: [
22
+ ".eslintrc.js",
23
+ "**/*.js",
24
+ "**/node_modules/**",
25
+ "**/dist/**",
26
+ ],
27
+
28
+ overrides: [
29
+ {
30
+ files: ["package.json"],
31
+ plugins: ["eslint-plugin-n8n-nodes-base"],
32
+ extends: ["plugin:n8n-nodes-base/community"],
33
+ rules: {
34
+ "n8n-nodes-base/community-package-json-name-still-default": "off",
35
+ },
36
+ },
37
+ {
38
+ files: ["./credentials/**/*.ts"],
39
+ plugins: ["eslint-plugin-n8n-nodes-base"],
40
+ extends: ["plugin:n8n-nodes-base/credentials"],
41
+ rules: {
42
+ "n8n-nodes-base/cred-class-field-documentation-url-missing": "off",
43
+ "n8n-nodes-base/cred-class-field-documentation-url-miscased": "off",
44
+ },
45
+ },
46
+ {
47
+ files: ["./nodes/**/*.ts"],
48
+ plugins: ["eslint-plugin-n8n-nodes-base"],
49
+ extends: ["plugin:n8n-nodes-base/nodes"],
50
+ rules: {
51
+ "n8n-nodes-base/node-execute-block-missing-continue-on-fail": "off",
52
+ "n8n-nodes-base/node-resource-description-filename-against-convention":
53
+ "off",
54
+ "n8n-nodes-base/node-param-fixed-collection-type-unsorted-items": "off",
55
+ },
56
+ },
57
+ ],
58
+ };
@@ -0,0 +1,20 @@
1
+ - This is a project for a custom n8n nodes for 3 different systems, Lime CRM, Lime Go and Lime Connect
2
+
3
+ ## Lime CRM
4
+
5
+ - Lime CRM has a fully dynamic datastructure, so both which entities (company, person etc) and their properties and realtions are customer unique
6
+ - Lime CRM has several API:
7
+ - `limetype`: queries about the different entities and their properties
8
+ - `limeobject`: REST CRUD API for the actual data
9
+ - `QueryAPI`: API for GraphQL-like read queries
10
+
11
+ ## Lime Go
12
+
13
+ Lime Go has two APIs
14
+
15
+ - ´/graphql´: A API to access `organizations`, `persons` and `deals`
16
+ - ´/event/subscription´: A webhook API to listen to events
17
+
18
+ ## Lime Connect
19
+
20
+ TBA...
@@ -0,0 +1,34 @@
1
+ name: Publish to GitHub Packages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ publish:
13
+ name: Publish Package
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: 16
24
+
25
+ - name: Install dependencies
26
+ run: npm install
27
+
28
+ - name: Build the package
29
+ run: npm run build
30
+
31
+ - name: Publish to GitHub Packages
32
+ run: npm publish
33
+ env:
34
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # n8n Local Development with Docker
2
+
3
+ This repository contains configuration to run n8n locally using Docker.
4
+
5
+ ## Prerequisites
6
+
7
+ - Docker
8
+ - Docker Compose
9
+
10
+ ## Getting Started
11
+ 1. Build nodes
12
+ ```bash
13
+ npm i
14
+ npm run build
15
+ ```
16
+ 2. Start n8n and PostgreSQL:
17
+
18
+ ```bash
19
+ docker-compose up -d
20
+ ```
21
+ 3. Access n8n in your browser at: http://localhost:5678
22
+
23
+ 4. To stop the containers:
24
+
25
+ ```bash
26
+ docker-compose down
27
+ ```
28
+
29
+ ## Configuration
30
+
31
+ The setup uses PostgreSQL for data persistence. All n8n data is stored in the `postgres_data` volume.
32
+
33
+ The n8n configuration is stored at `~/.n8n` on your host machine.
34
+
35
+ ## Additional Commands
36
+
37
+ - View logs:
38
+
39
+ ```bash
40
+ docker-compose logs -f
41
+ ```
42
+
43
+ - Restart n8n:
44
+
45
+ ```bash
46
+ docker-compose restart n8n
47
+ ```
48
+
49
+ ## Custom Nodes
50
+
51
+ This setup includes support for custom nodes. Custom nodes are stored in the `custom-nodes` directory.
52
+
53
+ ### Working with Custom Nodes
54
+
55
+ 1. Make sure you have Node.js installed on your local machine
56
+ 2. To build the custom nodes:
57
+
58
+ ```bash
59
+ # Make the build script executable
60
+ chmod +x build-custom-nodes.sh
61
+
62
+ # Build the custom nodes
63
+ ./build-custom-nodes.sh
64
+ ```
65
+
66
+ 3. After building, restart n8n for the changes to take effect:
67
+
68
+ ```bash
69
+ docker-compose restart n8n
70
+ ```
71
+
72
+ ### Creating a New Custom Node
73
+
74
+ 1. Create a new directory in the `custom-nodes` directory
75
+ 2. Add your node's TypeScript files and package.json
76
+ 3. Build the nodes using the build script
77
+ 4. Restart n8n
78
+
79
+ For detailed information about creating custom nodes, refer to the [n8n documentation](https://docs.n8n.io/integrations/creating-nodes/).
@@ -0,0 +1,57 @@
1
+ import {
2
+ ICredentialType,
3
+ INodeProperties,
4
+ IHttpRequestMethods,
5
+ IAuthenticate,
6
+ ICredentialTestRequest,
7
+ } from 'n8n-workflow';
8
+
9
+ export class LimeCrmApi implements ICredentialType {
10
+ name = 'limeCrmApi';
11
+ displayName = 'Lime CRM API';
12
+ documentationUrl = 'https://lime-crm.com/api-docs/';
13
+ properties: INodeProperties[] = [
14
+ {
15
+ displayName: 'Server URL',
16
+ name: 'url',
17
+ type: 'string',
18
+ default: '',
19
+ placeholder: 'https://instance.lime-crm.com',
20
+ required: true,
21
+ description: 'The URL of your Lime CRM instance (without trailing slash)',
22
+ },
23
+ {
24
+ displayName: 'API Key',
25
+ name: 'apiKey',
26
+ type: 'string',
27
+ typeOptions: {
28
+ password: true,
29
+ },
30
+ default: '',
31
+ required: true,
32
+ description: 'The API key obtained from Lime CRM',
33
+ },
34
+ ];
35
+
36
+ authenticate: IAuthenticate = {
37
+ type: 'generic',
38
+ properties: {
39
+ headers: {
40
+ // Ensure the header name matches exactly what the Lime CRM API expects
41
+ 'X-API-Key': '={{$credentials.apiKey}}',
42
+ },
43
+ },
44
+ };
45
+
46
+ test: ICredentialTestRequest = {
47
+ request: {
48
+ baseURL: '={{$credentials.url}}',
49
+ url: '/api/v1/',
50
+ method: 'GET' as IHttpRequestMethods,
51
+ headers: {
52
+ 'X-API-Key': '={{$credentials.apiKey}}',
53
+ 'Accept': 'application/json',
54
+ },
55
+ },
56
+ };
57
+ }
@@ -0,0 +1,31 @@
1
+ import {
2
+ ICredentialType,
3
+ INodeProperties,
4
+ } from 'n8n-workflow';
5
+
6
+ export class LimeGoApi implements ICredentialType {
7
+ name = 'limeGoApi';
8
+ displayName = 'Lime Go API';
9
+ documentationUrl = 'https://api.lime-go.com/docs';
10
+ properties: INodeProperties[] = [
11
+ {
12
+ displayName: 'API Key',
13
+ name: 'apiKey',
14
+ type: 'string',
15
+ typeOptions: {
16
+ password: true,
17
+ },
18
+ default: '',
19
+ required: true,
20
+ },
21
+ ];
22
+
23
+ authenticate = {
24
+ type: 'generic' as 'generic',
25
+ properties: {
26
+ headers: {
27
+ Authorization: '=go-api:{{$credentials.apiKey}}',
28
+ },
29
+ },
30
+ };
31
+ }
@@ -0,0 +1,9 @@
1
+ import { ICredentialType, INodeProperties, IAuthenticate, ICredentialTestRequest } from 'n8n-workflow';
2
+ export declare class LimeCrmApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticate;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimeCrmApi = void 0;
4
+ class LimeCrmApi {
5
+ constructor() {
6
+ this.name = 'limeCrmApi';
7
+ this.displayName = 'Lime CRM API';
8
+ this.documentationUrl = 'https://lime-crm.com/api-docs/';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Server URL',
12
+ name: 'url',
13
+ type: 'string',
14
+ default: '',
15
+ placeholder: 'https://instance.lime-crm.com',
16
+ required: true,
17
+ description: 'The URL of your Lime CRM instance (without trailing slash)',
18
+ },
19
+ {
20
+ displayName: 'API Key',
21
+ name: 'apiKey',
22
+ type: 'string',
23
+ typeOptions: {
24
+ password: true,
25
+ },
26
+ default: '',
27
+ required: true,
28
+ description: 'The API key obtained from Lime CRM',
29
+ },
30
+ ];
31
+ this.authenticate = {
32
+ type: 'generic',
33
+ properties: {
34
+ headers: {
35
+ 'X-API-Key': '={{$credentials.apiKey}}',
36
+ },
37
+ },
38
+ };
39
+ this.test = {
40
+ request: {
41
+ baseURL: '={{$credentials.url}}',
42
+ url: '/api/v1/',
43
+ method: 'GET',
44
+ headers: {
45
+ 'X-API-Key': '={{$credentials.apiKey}}',
46
+ 'Accept': 'application/json',
47
+ },
48
+ },
49
+ };
50
+ }
51
+ }
52
+ exports.LimeCrmApi = LimeCrmApi;
53
+ //# sourceMappingURL=LimeCrmApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LimeCrmApi.credentials.js","sourceRoot":"","sources":["../../credentials/LimeCrmApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,UAAU;IAAvB;QACI,SAAI,GAAG,YAAY,CAAC;QACpB,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,EAAE,4DAA4D;aAC5E;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,QAAQ,EAAE,kBAAkB;iBAC/B;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAhDD,gCAgDC"}
@@ -0,0 +1,15 @@
1
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class LimeGoApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: {
8
+ type: "generic";
9
+ properties: {
10
+ headers: {
11
+ Authorization: string;
12
+ };
13
+ };
14
+ };
15
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimeGoApi = void 0;
4
+ class LimeGoApi {
5
+ constructor() {
6
+ this.name = 'limeGoApi';
7
+ this.displayName = 'Lime Go API';
8
+ this.documentationUrl = 'https://api.lime-go.com/docs';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: {
15
+ password: true,
16
+ },
17
+ default: '',
18
+ required: true,
19
+ },
20
+ ];
21
+ this.authenticate = {
22
+ type: 'generic',
23
+ properties: {
24
+ headers: {
25
+ Authorization: '=go-api:{{$credentials.apiKey}}',
26
+ },
27
+ },
28
+ };
29
+ }
30
+ }
31
+ exports.LimeGoApi = LimeGoApi;
32
+ //# sourceMappingURL=LimeGoApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LimeGoApi.credentials.js","sourceRoot":"","sources":["../../credentials/LimeGoApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,SAAS;IAAtB;QACI,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,8BAA8B,CAAC;QAClD,eAAU,GAAsB;YAC5B;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;aACjB;SACJ,CAAC;QAEF,iBAAY,GAAG;YACX,IAAI,EAAE,SAAsB;YAC5B,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,iCAAiC;iBACnD;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAzBD,8BAyBC"}
@@ -0,0 +1,80 @@
1
+ import { IDataObject } from 'n8n-workflow';
2
+ export interface IOperationParams {
3
+ operation: string;
4
+ i: number;
5
+ }
6
+ export interface ILimeCrmResponse {
7
+ [key: string]: any;
8
+ }
9
+ export interface ILimeTypeObject {
10
+ id?: number | string;
11
+ [key: string]: any;
12
+ }
13
+ export interface IWebhookObject {
14
+ name: string;
15
+ events: string[];
16
+ target_url: string;
17
+ enabled: boolean;
18
+ headers?: Array<{
19
+ name: string;
20
+ value: string;
21
+ secret_value?: string;
22
+ type: string;
23
+ }>;
24
+ secret?: string;
25
+ }
26
+ export interface IWebhookEventData {
27
+ event: string;
28
+ body: {
29
+ id: string;
30
+ values: IDataObject;
31
+ [key: string]: any;
32
+ };
33
+ [key: string]: any;
34
+ }
35
+ export interface ILimeTypeResponse {
36
+ _embedded?: {
37
+ properties?: ILimeTypeProperty[];
38
+ };
39
+ _links?: {
40
+ limetypes?: ILimeTypeLink[];
41
+ };
42
+ }
43
+ export interface ILimeTypeLink {
44
+ name: string;
45
+ href: string;
46
+ }
47
+ export interface ILimeTypeProperty {
48
+ id: string;
49
+ name: string;
50
+ localizedname: string;
51
+ propertytype: string;
52
+ readonly: boolean;
53
+ required: boolean;
54
+ [key: string]: any;
55
+ }
56
+ export interface ILimeObjectResponse {
57
+ _embedded?: {
58
+ limeobjects?: ILimeObject[];
59
+ };
60
+ _links?: {
61
+ next?: {
62
+ href: string;
63
+ };
64
+ self?: {
65
+ href: string;
66
+ };
67
+ };
68
+ }
69
+ export interface ILimeObject {
70
+ id: string;
71
+ [key: string]: any;
72
+ }
73
+ export interface IQueryParams {
74
+ _limit?: number;
75
+ _offset?: number;
76
+ _sort?: string;
77
+ [key: string]: any;
78
+ }
79
+ export declare class GenericTypes {
80
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenericTypes = void 0;
4
+ class GenericTypes {
5
+ }
6
+ exports.GenericTypes = GenericTypes;
7
+ //# sourceMappingURL=GenericTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericTypes.js","sourceRoot":"","sources":["../../../nodes/lime-crm/GenericTypes.ts"],"names":[],"mappings":";;;AAiHA,MAAa,YAAY;CAAI;AAA7B,oCAA6B"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-base.limeCrm",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["CRM"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://lime-crm.com/api-docs/"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://lime-crm.com/api-docs/"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,17 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ import { getLimeTypes, getLimeTypeProperties, getLimeTypeRelations, getRelatedTypeProperties, getAllSortableFields } from './methods';
3
+ import { LimeCrmTrigger } from './LimeCrmTrigger/LimeCrmTrigger.node';
4
+ export declare class LimeCrmNode implements INodeType {
5
+ description: INodeTypeDescription;
6
+ methods: {
7
+ loadOptions: {
8
+ getLimeTypes: typeof getLimeTypes;
9
+ getLimeTypeProperties: typeof getLimeTypeProperties;
10
+ getLimeTypeRelations: typeof getLimeTypeRelations;
11
+ getRelatedTypeProperties: typeof getRelatedTypeProperties;
12
+ getAllSortableFields: typeof getAllSortableFields;
13
+ };
14
+ };
15
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
16
+ }
17
+ export { LimeCrmTrigger };
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimeCrmTrigger = exports.LimeCrmNode = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const limeType_1 = require("./resources/limeType");
6
+ const limeObject_1 = require("./resources/limeObject");
7
+ const queryApi_1 = require("./resources/queryApi");
8
+ const methods_1 = require("./methods");
9
+ const LimeCrmTrigger_node_1 = require("./LimeCrmTrigger/LimeCrmTrigger.node");
10
+ Object.defineProperty(exports, "LimeCrmTrigger", { enumerable: true, get: function () { return LimeCrmTrigger_node_1.LimeCrmTrigger; } });
11
+ class LimeCrmNode {
12
+ constructor() {
13
+ this.description = {
14
+ displayName: 'Lime CRM',
15
+ name: 'limeCrm',
16
+ icon: 'file:lime-crm.svg',
17
+ group: ['transform'],
18
+ version: 1,
19
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
20
+ description: 'Consume the Lime CRM API',
21
+ defaults: {
22
+ name: 'Lime CRM',
23
+ },
24
+ inputs: ["main"],
25
+ outputs: ["main"],
26
+ credentials: [
27
+ {
28
+ name: 'limeCrmApi',
29
+ required: true,
30
+ },
31
+ ],
32
+ properties: [
33
+ {
34
+ displayName: 'Resource',
35
+ name: 'resource',
36
+ type: 'options',
37
+ noDataExpression: true,
38
+ options: [
39
+ {
40
+ name: 'Lime Type',
41
+ value: 'limeType',
42
+ description: 'Work with entity type definitions',
43
+ },
44
+ {
45
+ name: 'Lime Object',
46
+ value: 'limeObject',
47
+ description: 'Work with actual data records',
48
+ },
49
+ {
50
+ name: 'Query API',
51
+ value: 'queryApi',
52
+ description: 'Execute custom queries against the database',
53
+ },
54
+ ],
55
+ default: 'limeObject',
56
+ },
57
+ ...limeType_1.limeTypeFields,
58
+ ...limeObject_1.limeObjectFields,
59
+ ...queryApi_1.queryApiFields,
60
+ ],
61
+ };
62
+ this.methods = {
63
+ loadOptions: {
64
+ getLimeTypes: methods_1.getLimeTypes,
65
+ getLimeTypeProperties: methods_1.getLimeTypeProperties,
66
+ getLimeTypeRelations: methods_1.getLimeTypeRelations,
67
+ getRelatedTypeProperties: methods_1.getRelatedTypeProperties,
68
+ getAllSortableFields: methods_1.getAllSortableFields,
69
+ },
70
+ };
71
+ }
72
+ async execute() {
73
+ const items = this.getInputData();
74
+ const returnData = [];
75
+ let responseData;
76
+ const resource = this.getNodeParameter('resource', 0);
77
+ const operation = this.getNodeParameter('operation', 0);
78
+ for (let i = 0; i < items.length; i++) {
79
+ try {
80
+ if (resource === 'limeType') {
81
+ responseData = await limeType_1.limeTypeOperations.call(this, { operation, i });
82
+ }
83
+ else if (resource === 'limeObject') {
84
+ responseData = await limeObject_1.limeObjectOperations.call(this, { operation, i });
85
+ }
86
+ else if (resource === 'queryApi') {
87
+ responseData = await queryApi_1.queryApiOperations.call(this, { operation, i });
88
+ }
89
+ else {
90
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`);
91
+ }
92
+ if (Array.isArray(responseData)) {
93
+ returnData.push(...responseData);
94
+ }
95
+ else if (responseData !== undefined) {
96
+ returnData.push(responseData);
97
+ }
98
+ }
99
+ catch (error) {
100
+ if (this.continueOnFail()) {
101
+ returnData.push({
102
+ error: error.message,
103
+ json: { error: error.message },
104
+ });
105
+ continue;
106
+ }
107
+ throw error;
108
+ }
109
+ }
110
+ return [this.helpers.returnJsonArray(returnData)];
111
+ }
112
+ }
113
+ exports.LimeCrmNode = LimeCrmNode;
114
+ //# sourceMappingURL=LimeCrmNode.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LimeCrmNode.node.js","sourceRoot":"","sources":["../../../nodes/lime-crm/LimeCrmNode.node.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ import { IHookFunctions, IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare class LimeCrmTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getLimeTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
9
+ webhookMethods: {
10
+ default: {
11
+ checkExists(this: IHookFunctions): Promise<boolean>;
12
+ create(this: IHookFunctions): Promise<boolean>;
13
+ delete(this: IHookFunctions): Promise<boolean>;
14
+ };
15
+ };
16
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
17
+ }