@limetech/n8n-nodes-lime 0.1.0 → 0.2.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.
Files changed (192) hide show
  1. package/nodes/lime-crm/LimeCrm.node.json +16 -16
  2. package/package.json +47 -47
  3. package/{dist/tsconfig.tsbuildinfo → tsconfig.tsbuildinfo} +1 -1
  4. package/.eslintrc.js +0 -58
  5. package/.github/copilot-instructions.md +0 -20
  6. package/.github/workflows/publish.yml +0 -34
  7. package/README.md +0 -79
  8. package/credentials/LimeCrmApi.credentials.ts +0 -57
  9. package/credentials/LimeGoApi.credentials.ts +0 -31
  10. package/dist/nodes/lime-crm/LimeCrm.node.json +0 -18
  11. package/dist/nodes/lime-crm/lime-crm.svg +0 -1
  12. package/dist/nodes/lime-go/lime-go.svg +0 -1
  13. package/dist/package.json +0 -49
  14. package/docker-compose.yml +0 -44
  15. package/index.js +0 -3
  16. package/nodes/lime-crm/GenericTypes.ts +0 -114
  17. package/nodes/lime-crm/LimeCrmNode.node.ts +0 -154
  18. package/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.ts +0 -461
  19. package/nodes/lime-crm/LimeCrmTrigger.node.ts +0 -505
  20. package/nodes/lime-crm/methods/getAllSortableFields.ts +0 -73
  21. package/nodes/lime-crm/methods/getLimeTypeProperties.ts +0 -48
  22. package/nodes/lime-crm/methods/getLimeTypeRelations.ts +0 -32
  23. package/nodes/lime-crm/methods/getLimeTypes.ts +0 -33
  24. package/nodes/lime-crm/methods/getRelatedTypeProperties.ts +0 -47
  25. package/nodes/lime-crm/methods/index.ts +0 -5
  26. package/nodes/lime-crm/resources/limeObject/commonFields.ts +0 -179
  27. package/nodes/lime-crm/resources/limeObject/index.ts +0 -64
  28. package/nodes/lime-crm/resources/limeObject/operations/common.operation.ts +0 -35
  29. package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +0 -234
  30. package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +0 -136
  31. package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +0 -124
  32. package/nodes/lime-crm/resources/limeObject/operations/getAll.operation.ts +0 -242
  33. package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +0 -242
  34. package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +0 -201
  35. package/nodes/lime-crm/resources/limeType/index.ts +0 -66
  36. package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +0 -105
  37. package/nodes/lime-crm/resources/limeType/operations/getRelations.operation.ts +0 -105
  38. package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +0 -58
  39. package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +0 -76
  40. package/nodes/lime-crm/resources/queryApi/index.ts +0 -42
  41. package/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.ts +0 -605
  42. package/nodes/lime-crm/transport/index.ts +0 -74
  43. package/nodes/lime-go/LimeGo.node.ts +0 -146
  44. package/nodes/lime-go/actions/organization/get.operation.ts +0 -42
  45. package/nodes/lime-go/actions/organization/getByExternalKey.operation.ts +0 -57
  46. package/nodes/lime-go/actions/organization/index.ts +0 -69
  47. package/nodes/lime-go/actions/organization/organizationFields.ts +0 -160
  48. package/nodes/lime-go/actions/organization/search.operation.ts +0 -73
  49. package/nodes/lime-go/actions/organization/update.operation.ts +0 -140
  50. package/nodes/lime-go/actions/person/createMail.operation.ts +0 -140
  51. package/nodes/lime-go/actions/person/get.operation.ts +0 -51
  52. package/nodes/lime-go/actions/person/index.ts +0 -69
  53. package/nodes/lime-go/actions/person/personFields.ts +0 -132
  54. package/nodes/lime-go/actions/person/search.operation.ts +0 -88
  55. package/nodes/lime-go/actions/person/update.operation.ts +0 -122
  56. package/nodes/lime-go/transport/graphqlRequest.ts +0 -30
  57. package/tsconfig.json +0 -30
  58. /package/{dist/credentials → credentials}/LimeCrmApi.credentials.d.ts +0 -0
  59. /package/{dist/credentials → credentials}/LimeCrmApi.credentials.js +0 -0
  60. /package/{dist/credentials → credentials}/LimeCrmApi.credentials.js.map +0 -0
  61. /package/{dist/credentials → credentials}/LimeGoApi.credentials.d.ts +0 -0
  62. /package/{dist/credentials → credentials}/LimeGoApi.credentials.js +0 -0
  63. /package/{dist/credentials → credentials}/LimeGoApi.credentials.js.map +0 -0
  64. /package/{dist/nodes → nodes}/lime-crm/GenericTypes.d.ts +0 -0
  65. /package/{dist/nodes → nodes}/lime-crm/GenericTypes.js +0 -0
  66. /package/{dist/nodes → nodes}/lime-crm/GenericTypes.js.map +0 -0
  67. /package/{dist/nodes → nodes}/lime-crm/LimeCrmNode.node.d.ts +0 -0
  68. /package/{dist/nodes → nodes}/lime-crm/LimeCrmNode.node.js +0 -0
  69. /package/{dist/nodes → nodes}/lime-crm/LimeCrmNode.node.js.map +0 -0
  70. /package/{dist/nodes → nodes}/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.d.ts +0 -0
  71. /package/{dist/nodes → nodes}/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.js +0 -0
  72. /package/{dist/nodes → nodes}/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.js.map +0 -0
  73. /package/{dist/nodes → nodes}/lime-crm/LimeCrmTrigger.node.d.ts +0 -0
  74. /package/{dist/nodes → nodes}/lime-crm/LimeCrmTrigger.node.js +0 -0
  75. /package/{dist/nodes → nodes}/lime-crm/LimeCrmTrigger.node.js.map +0 -0
  76. /package/{dist/nodes → nodes}/lime-crm/methods/getAllSortableFields.d.ts +0 -0
  77. /package/{dist/nodes → nodes}/lime-crm/methods/getAllSortableFields.js +0 -0
  78. /package/{dist/nodes → nodes}/lime-crm/methods/getAllSortableFields.js.map +0 -0
  79. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypeProperties.d.ts +0 -0
  80. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypeProperties.js +0 -0
  81. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypeProperties.js.map +0 -0
  82. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypeRelations.d.ts +0 -0
  83. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypeRelations.js +0 -0
  84. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypeRelations.js.map +0 -0
  85. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypes.d.ts +0 -0
  86. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypes.js +0 -0
  87. /package/{dist/nodes → nodes}/lime-crm/methods/getLimeTypes.js.map +0 -0
  88. /package/{dist/nodes → nodes}/lime-crm/methods/getRelatedTypeProperties.d.ts +0 -0
  89. /package/{dist/nodes → nodes}/lime-crm/methods/getRelatedTypeProperties.js +0 -0
  90. /package/{dist/nodes → nodes}/lime-crm/methods/getRelatedTypeProperties.js.map +0 -0
  91. /package/{dist/nodes → nodes}/lime-crm/methods/index.d.ts +0 -0
  92. /package/{dist/nodes → nodes}/lime-crm/methods/index.js +0 -0
  93. /package/{dist/nodes → nodes}/lime-crm/methods/index.js.map +0 -0
  94. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/commonFields.d.ts +0 -0
  95. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/commonFields.js +0 -0
  96. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/commonFields.js.map +0 -0
  97. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/index.d.ts +0 -0
  98. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/index.js +0 -0
  99. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/index.js.map +0 -0
  100. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/common.operation.d.ts +0 -0
  101. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/common.operation.js +0 -0
  102. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/common.operation.js.map +0 -0
  103. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/create.operation.d.ts +0 -0
  104. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/create.operation.js +0 -0
  105. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/create.operation.js.map +0 -0
  106. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/delete.operation.d.ts +0 -0
  107. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/delete.operation.js +0 -0
  108. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/delete.operation.js.map +0 -0
  109. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/get.operation.d.ts +0 -0
  110. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/get.operation.js +0 -0
  111. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/get.operation.js.map +0 -0
  112. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/getAll.operation.d.ts +0 -0
  113. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/getAll.operation.js +0 -0
  114. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/getAll.operation.js.map +0 -0
  115. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/search.operation.d.ts +0 -0
  116. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/search.operation.js +0 -0
  117. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/search.operation.js.map +0 -0
  118. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/update.operation.d.ts +0 -0
  119. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/update.operation.js +0 -0
  120. /package/{dist/nodes → nodes}/lime-crm/resources/limeObject/operations/update.operation.js.map +0 -0
  121. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/index.d.ts +0 -0
  122. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/index.js +0 -0
  123. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/index.js.map +0 -0
  124. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +0 -0
  125. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getProperties.operation.js +0 -0
  126. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getProperties.operation.js.map +0 -0
  127. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getRelations.operation.d.ts +0 -0
  128. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getRelations.operation.js +0 -0
  129. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getRelations.operation.js.map +0 -0
  130. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getType.operation.d.ts +0 -0
  131. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getType.operation.js +0 -0
  132. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/getType.operation.js.map +0 -0
  133. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +0 -0
  134. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/listTypes.operation.js +0 -0
  135. /package/{dist/nodes → nodes}/lime-crm/resources/limeType/operations/listTypes.operation.js.map +0 -0
  136. /package/{dist/nodes → nodes}/lime-crm/resources/queryApi/index.d.ts +0 -0
  137. /package/{dist/nodes → nodes}/lime-crm/resources/queryApi/index.js +0 -0
  138. /package/{dist/nodes → nodes}/lime-crm/resources/queryApi/index.js.map +0 -0
  139. /package/{dist/nodes → nodes}/lime-crm/resources/queryApi/operations/executeQuery.operation.d.ts +0 -0
  140. /package/{dist/nodes → nodes}/lime-crm/resources/queryApi/operations/executeQuery.operation.js +0 -0
  141. /package/{dist/nodes → nodes}/lime-crm/resources/queryApi/operations/executeQuery.operation.js.map +0 -0
  142. /package/{dist/nodes → nodes}/lime-crm/transport/index.d.ts +0 -0
  143. /package/{dist/nodes → nodes}/lime-crm/transport/index.js +0 -0
  144. /package/{dist/nodes → nodes}/lime-crm/transport/index.js.map +0 -0
  145. /package/{dist/nodes → nodes}/lime-go/LimeGo.node.d.ts +0 -0
  146. /package/{dist/nodes → nodes}/lime-go/LimeGo.node.js +0 -0
  147. /package/{dist/nodes → nodes}/lime-go/LimeGo.node.js.map +0 -0
  148. /package/{dist/nodes → nodes}/lime-go/actions/organization/get.operation.d.ts +0 -0
  149. /package/{dist/nodes → nodes}/lime-go/actions/organization/get.operation.js +0 -0
  150. /package/{dist/nodes → nodes}/lime-go/actions/organization/get.operation.js.map +0 -0
  151. /package/{dist/nodes → nodes}/lime-go/actions/organization/getByExternalKey.operation.d.ts +0 -0
  152. /package/{dist/nodes → nodes}/lime-go/actions/organization/getByExternalKey.operation.js +0 -0
  153. /package/{dist/nodes → nodes}/lime-go/actions/organization/getByExternalKey.operation.js.map +0 -0
  154. /package/{dist/nodes → nodes}/lime-go/actions/organization/index.d.ts +0 -0
  155. /package/{dist/nodes → nodes}/lime-go/actions/organization/index.js +0 -0
  156. /package/{dist/nodes → nodes}/lime-go/actions/organization/index.js.map +0 -0
  157. /package/{dist/nodes → nodes}/lime-go/actions/organization/organizationFields.d.ts +0 -0
  158. /package/{dist/nodes → nodes}/lime-go/actions/organization/organizationFields.js +0 -0
  159. /package/{dist/nodes → nodes}/lime-go/actions/organization/organizationFields.js.map +0 -0
  160. /package/{dist/nodes → nodes}/lime-go/actions/organization/search.operation.d.ts +0 -0
  161. /package/{dist/nodes → nodes}/lime-go/actions/organization/search.operation.js +0 -0
  162. /package/{dist/nodes → nodes}/lime-go/actions/organization/search.operation.js.map +0 -0
  163. /package/{dist/nodes → nodes}/lime-go/actions/organization/update.operation.d.ts +0 -0
  164. /package/{dist/nodes → nodes}/lime-go/actions/organization/update.operation.js +0 -0
  165. /package/{dist/nodes → nodes}/lime-go/actions/organization/update.operation.js.map +0 -0
  166. /package/{dist/nodes → nodes}/lime-go/actions/person/createMail.operation.d.ts +0 -0
  167. /package/{dist/nodes → nodes}/lime-go/actions/person/createMail.operation.js +0 -0
  168. /package/{dist/nodes → nodes}/lime-go/actions/person/createMail.operation.js.map +0 -0
  169. /package/{dist/nodes → nodes}/lime-go/actions/person/get.operation.d.ts +0 -0
  170. /package/{dist/nodes → nodes}/lime-go/actions/person/get.operation.js +0 -0
  171. /package/{dist/nodes → nodes}/lime-go/actions/person/get.operation.js.map +0 -0
  172. /package/{dist/nodes → nodes}/lime-go/actions/person/index.d.ts +0 -0
  173. /package/{dist/nodes → nodes}/lime-go/actions/person/index.js +0 -0
  174. /package/{dist/nodes → nodes}/lime-go/actions/person/index.js.map +0 -0
  175. /package/{dist/nodes → nodes}/lime-go/actions/person/personFields.d.ts +0 -0
  176. /package/{dist/nodes → nodes}/lime-go/actions/person/personFields.js +0 -0
  177. /package/{dist/nodes → nodes}/lime-go/actions/person/personFields.js.map +0 -0
  178. /package/{dist/nodes → nodes}/lime-go/actions/person/search.operation.d.ts +0 -0
  179. /package/{dist/nodes → nodes}/lime-go/actions/person/search.operation.js +0 -0
  180. /package/{dist/nodes → nodes}/lime-go/actions/person/search.operation.js.map +0 -0
  181. /package/{dist/nodes → nodes}/lime-go/actions/person/update.operation.d.ts +0 -0
  182. /package/{dist/nodes → nodes}/lime-go/actions/person/update.operation.js +0 -0
  183. /package/{dist/nodes → nodes}/lime-go/actions/person/update.operation.js.map +0 -0
  184. /package/{dist/nodes → nodes}/lime-go/transport/graphqlRequest.d.ts +0 -0
  185. /package/{dist/nodes → nodes}/lime-go/transport/graphqlRequest.js +0 -0
  186. /package/{dist/nodes → nodes}/lime-go/transport/graphqlRequest.js.map +0 -0
  187. /package/{dist/nodes → nodes}/lime-go/transport/transport.d.ts +0 -0
  188. /package/{dist/nodes → nodes}/lime-go/transport/transport.js +0 -0
  189. /package/{dist/nodes → nodes}/lime-go/transport/transport.js.map +0 -0
  190. /package/{dist/nodes → nodes}/lime-go/triggers/webhook.d.ts +0 -0
  191. /package/{dist/nodes → nodes}/lime-go/triggers/webhook.js +0 -0
  192. /package/{dist/nodes → nodes}/lime-go/triggers/webhook.js.map +0 -0
@@ -1,33 +0,0 @@
1
- import { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
- import { apiRequest } from '../transport';
3
-
4
- /**
5
- * Load available Lime types from the API
6
- */
7
- export async function getLimeTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
8
- try {
9
- const response = await apiRequest.call(this, {
10
- method: 'GET',
11
- endpoint: '/api/v1/limetype/',
12
- qs: {
13
- _embed: 'limetypes',
14
- },
15
- });
16
-
17
- // Check if response contains embedded limetypes
18
- if (response && response._embedded && Array.isArray(response._embedded.limetypes)) {
19
- return response._embedded.limetypes.map((type: any) => ({
20
- name: type.localname?.singular || type.name,
21
- value: type.name,
22
- description: `LimeType: ${type.name}`,
23
- }));
24
- }
25
-
26
- return [];
27
- } catch (error) {
28
- console.error('Error loading Lime types:', error);
29
- return [];
30
- }
31
- }
32
-
33
- export default getLimeTypes;
@@ -1,47 +0,0 @@
1
- import { ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
2
- import { apiRequest } from '../transport';
3
-
4
- /**
5
- * Load properties for a related Lime type
6
- */
7
- export async function getRelatedTypeProperties(this: ILoadOptionsFunctions) {
8
- const limeType = this.getNodeParameter('limetype', '') as string;
9
- const relationName = this.getNodeParameter('relationsConfig.relation[].relationName', '') as string;
10
-
11
- if (!limeType || !relationName) return [];
12
-
13
- try {
14
- // First get the relation to determine the target type
15
- const relationsResponse = await apiRequest.call(this, {
16
- method: 'GET',
17
- endpoint: `/api/v1/limetype/${limeType}/relation/${relationName}`,
18
- });
19
-
20
- if (!relationsResponse || !relationsResponse.targettype) {
21
- return [];
22
- }
23
-
24
- const targetType = relationsResponse.targettype as string;
25
-
26
- // Then get properties for the target type
27
- const propertiesResponse = await apiRequest.call(this, {
28
- method: 'GET',
29
- endpoint: `/api/v1/limetype/${targetType}/`,
30
- });
31
-
32
- if (!propertiesResponse || !Array.isArray(propertiesResponse)) {
33
- return [];
34
- }
35
-
36
- return propertiesResponse.map((property: IDataObject) => ({
37
- name: property.name as string,
38
- value: property.name as string,
39
- description: property.description as string || '',
40
- }));
41
- } catch (error) {
42
- console.error(`Error loading related properties for ${limeType}.${relationName}:`, error);
43
- return [];
44
- }
45
- }
46
-
47
- export default getRelatedTypeProperties;
@@ -1,5 +0,0 @@
1
- export { getLimeTypes } from './getLimeTypes';
2
- export { getLimeTypeProperties } from './getLimeTypeProperties';
3
- export { getLimeTypeRelations } from './getLimeTypeRelations';
4
- export { getRelatedTypeProperties } from './getRelatedTypeProperties';
5
- export { getAllSortableFields } from './getAllSortableFields';
@@ -1,179 +0,0 @@
1
- import { INodeProperties } from 'n8n-workflow';
2
-
3
- /**
4
- * Common property input fields for Lime CRM objects
5
- * These can be reused across different operations
6
- */
7
- export const propertyInputFields: INodeProperties[] = [
8
- // Property fields for simple mode
9
- {
10
- displayName: 'Properties',
11
- name: 'properties',
12
- type: 'fixedCollection',
13
- placeholder: 'Add Property',
14
- typeOptions: {
15
- multipleValues: true,
16
- sortable: true,
17
- },
18
- default: {},
19
- options: [
20
- {
21
- name: 'property',
22
- displayName: 'Property',
23
- values: [
24
- {
25
- displayName: 'Property Name',
26
- name: 'name',
27
- type: 'options',
28
- typeOptions: {
29
- loadOptionsMethod: 'getLimeTypeProperties',
30
- loadOptionsDependsOn: ['limeType'],
31
- },
32
- default: '',
33
- description: 'Name of the property to set',
34
- },
35
- {
36
- displayName: 'Property Value',
37
- name: 'value',
38
- type: 'string',
39
- default: '',
40
- description: 'Value of the property',
41
- },
42
- ],
43
- },
44
- ],
45
- description: 'Properties to set on the Lime CRM object',
46
- },
47
-
48
- // Property fields for mapping mode
49
- {
50
- displayName: 'Property Mappings',
51
- name: 'propertyMappings',
52
- placeholder: 'Add Property Mapping',
53
- type: 'fixedCollection',
54
- typeOptions: {
55
- multipleValues: true,
56
- sortable: true,
57
- },
58
- default: {},
59
- options: [
60
- {
61
- name: 'mapping',
62
- displayName: 'Property Mapping',
63
- values: [
64
- {
65
- displayName: 'Lime CRM Property',
66
- name: 'limeProperty',
67
- type: 'options',
68
- typeOptions: {
69
- loadOptionsMethod: 'getLimeTypeProperties',
70
- loadOptionsDependsOn: ['limeType'],
71
- },
72
- default: '',
73
- description: 'The Lime CRM property to map to',
74
- },
75
- {
76
- displayName: 'Source Value',
77
- name: 'sourceValue',
78
- type: 'string',
79
- default: '',
80
- description: 'The value to map (can use expressions like {{ $json.fieldName }})',
81
- },
82
- ],
83
- },
84
- ],
85
- description: 'Map input data to Lime CRM properties using expressions',
86
- },
87
- ];
88
-
89
- /**
90
- * Common relation input fields for Lime CRM objects
91
- * These can be used to configure relation settings
92
- */
93
- export const relationInputFields: INodeProperties[] = [
94
- {
95
- displayName: 'Include Relations',
96
- name: 'includeRelations',
97
- type: 'boolean',
98
- default: false,
99
- description: 'Whether to include related objects',
100
- },
101
- {
102
- displayName: 'Relation Configuration',
103
- name: 'relationsConfig',
104
- type: 'fixedCollection',
105
- placeholder: 'Add Relation',
106
- default: {},
107
- typeOptions: {
108
- multipleValues: true,
109
- },
110
- displayOptions: {
111
- show: {
112
- includeRelations: [true],
113
- },
114
- },
115
- options: [
116
- {
117
- name: 'relations',
118
- displayName: 'Relations',
119
- values: [
120
- {
121
- displayName: 'Relation Name',
122
- name: 'relationName',
123
- type: 'options',
124
- typeOptions: {
125
- loadOptionsMethod: 'getLimeTypeRelations',
126
- loadOptionsDependsOn: ['limeType'],
127
- },
128
- default: '',
129
- description: 'Name of the relation to include',
130
- },
131
- {
132
- displayName: 'Properties to Include',
133
- name: 'includeProperties',
134
- type: 'multiOptions',
135
- typeOptions: {
136
- loadOptionsMethod: 'getRelatedTypeProperties',
137
- loadOptionsDependsOn: ['limeType', 'relationName'],
138
- },
139
- default: [],
140
- description: 'Properties to include from related objects',
141
- },
142
- ],
143
- },
144
- ],
145
- description: 'Configure related objects to include',
146
- },
147
- ];
148
-
149
- /**
150
- * Common options fields for Lime CRM objects
151
- */
152
- export const commonOptionsFields: INodeProperties[] = [
153
- {
154
- displayName: 'Options',
155
- name: 'options',
156
- type: 'collection',
157
- placeholder: 'Add Option',
158
- default: {},
159
- options: [
160
- {
161
- displayName: 'Raw Response',
162
- name: 'rawResponse',
163
- type: 'boolean',
164
- default: false,
165
- description: 'Whether to return the raw API response instead of parsed data',
166
- },
167
- {
168
- displayName: 'Additional Parameters',
169
- name: 'additionalParameters',
170
- type: 'json',
171
- default: '{}',
172
- description: 'Additional parameters to include in the request',
173
- typeOptions: {
174
- alwaysOpenEditWindow: true,
175
- },
176
- },
177
- ],
178
- },
179
- ];
@@ -1,64 +0,0 @@
1
- import { IExecuteFunctions, INodeProperties, NodePropertyTypes } from 'n8n-workflow';
2
-
3
- import * as create from './operations/create.operation';
4
- import * as get from './operations/get.operation';
5
- import * as update from './operations/update.operation';
6
- import * as delete_ from './operations/delete.operation';
7
- import * as search from './operations/search.operation';
8
-
9
- // Export fields for the node
10
- export const limeObjectFields: INodeProperties[] = [
11
- // Operation selection for LimeObject
12
- {
13
- displayName: 'Operation',
14
- name: 'operation',
15
- type: 'options' as NodePropertyTypes,
16
- noDataExpression: true,
17
- displayOptions: {
18
- show: {
19
- resource: [
20
- 'limeObject',
21
- ],
22
- },
23
- },
24
- options: [
25
- create.description,
26
- get.description,
27
- update.description,
28
- delete_.description,
29
- search.description,
30
- ],
31
- default: 'search',
32
- },
33
-
34
- // Operation-specific fields
35
- ...create.properties,
36
- ...get.properties,
37
- ...update.properties,
38
- ...delete_.properties,
39
- ...search.properties,
40
- ];
41
-
42
- // Operations router
43
- export async function limeObjectOperations(
44
- this: IExecuteFunctions,
45
- { operation, i }: { operation: string; i: number },
46
- ) {
47
- if (operation === 'create') {
48
- return await create.execute.call(this, i);
49
- }
50
- if (operation === 'get') {
51
- return await get.execute.call(this, i);
52
- }
53
- if (operation === 'update') {
54
- return await update.execute.call(this, i);
55
- }
56
- if (operation === 'delete') {
57
- return await delete_.execute.call(this, i);
58
- }
59
- if (operation === 'search') {
60
- return await search.execute.call(this, i);
61
- }
62
-
63
- return null;
64
- }
@@ -1,35 +0,0 @@
1
- import { INodeProperties } from 'n8n-workflow';
2
-
3
- export const commonOperations: INodeProperties[] = [
4
- // Options for all operations
5
- {
6
- displayName: 'Options',
7
- name: 'options',
8
- type: 'collection',
9
- placeholder: 'Add Option',
10
- default: {},
11
- displayOptions: {
12
- show: {
13
- resource: [
14
- 'limeObject',
15
- ],
16
- },
17
- },
18
- options: [
19
- {
20
- displayName: 'Include Related Objects',
21
- name: 'includeRelated',
22
- type: 'boolean',
23
- default: false,
24
- description: 'Whether to include data from related objects',
25
- },
26
- {
27
- displayName: 'Raw Response',
28
- name: 'rawResponse',
29
- type: 'boolean',
30
- default: false,
31
- description: 'Whether to return the full API response instead of just the data',
32
- },
33
- ],
34
- },
35
- ];
@@ -1,234 +0,0 @@
1
- import {
2
- IExecuteFunctions,
3
- INodeProperties,
4
- IDataObject,
5
- NodeOperationError,
6
- } from 'n8n-workflow';
7
-
8
- export const description = {
9
- name: 'Create Object',
10
- value: 'create',
11
- description: 'Create a new object',
12
- action: 'Create an object',
13
- };
14
-
15
- export const properties: INodeProperties[] = [
16
- // Limetype selection
17
- {
18
- displayName: 'LimeType',
19
- name: 'limeType',
20
- type: 'options',
21
- typeOptions: {
22
- loadOptionsMethod: 'getLimeTypes',
23
- },
24
- required: true,
25
- default: '',
26
- description: 'The type of entity to create',
27
- displayOptions: {
28
- show: {
29
- resource: [
30
- 'limeObject',
31
- ],
32
- operation: [
33
- 'create',
34
- ],
35
- },
36
- },
37
- },
38
-
39
- // Object data input method
40
- {
41
- displayName: 'Input Method',
42
- name: 'inputMethod',
43
- type: 'options',
44
- options: [
45
- {
46
- name: 'Form Fields',
47
- value: 'fields',
48
- },
49
- {
50
- name: 'JSON',
51
- value: 'json',
52
- },
53
- ],
54
- default: 'fields',
55
- description: 'How to input the object data',
56
- displayOptions: {
57
- show: {
58
- resource: [
59
- 'limeObject',
60
- ],
61
- operation: [
62
- 'create',
63
- ],
64
- },
65
- },
66
- },
67
-
68
- // Dynamic properties for form input
69
- {
70
- displayName: 'Properties',
71
- name: 'properties',
72
- type: 'fixedCollection',
73
- placeholder: 'Add Property',
74
- typeOptions: {
75
- multipleValues: true,
76
- sortable: true,
77
- loadOptionsMethod: 'getLimeTypeProperties',
78
- loadOptionsDependsOn: ['limeType'],
79
- },
80
- default: {},
81
- displayOptions: {
82
- show: {
83
- resource: [
84
- 'limeObject',
85
- ],
86
- operation: [
87
- 'create',
88
- ],
89
- inputMethod: [
90
- 'fields',
91
- ],
92
- },
93
- },
94
- options: [
95
- {
96
- displayName: 'Property',
97
- name: 'property',
98
- values: [
99
- {
100
- displayName: 'Property Name',
101
- name: 'name',
102
- type: 'options',
103
- typeOptions: {
104
- loadOptionsMethod: 'getLimeTypeProperties',
105
- loadOptionsDependsOn: ['limeType'],
106
- },
107
- default: '',
108
- description: 'Name of the property',
109
- },
110
- {
111
- displayName: 'Property Value',
112
- name: 'value',
113
- type: 'string',
114
- default: '',
115
- description: 'Value of the property',
116
- },
117
- ],
118
- },
119
- ],
120
- },
121
-
122
- // JSON input
123
- {
124
- displayName: 'Object (JSON)',
125
- name: 'objectJson',
126
- type: 'json',
127
- default: '{\n "name": "New Company",\n "phone": "123-456-7890"\n}',
128
- description: 'Object to create in JSON format',
129
- displayOptions: {
130
- show: {
131
- resource: [
132
- 'limeObject',
133
- ],
134
- operation: [
135
- 'create',
136
- ],
137
- inputMethod: [
138
- 'json',
139
- ],
140
- },
141
- },
142
- typeOptions: {
143
- alwaysOpenEditWindow: true,
144
- },
145
- },
146
-
147
- // Additional options
148
- {
149
- displayName: 'Options',
150
- name: 'options',
151
- type: 'collection',
152
- placeholder: 'Add Option',
153
- default: {},
154
- displayOptions: {
155
- show: {
156
- resource: [
157
- 'limeObject',
158
- ],
159
- operation: [
160
- 'create',
161
- ],
162
- },
163
- },
164
- options: [
165
- {
166
- displayName: 'Return Created Object',
167
- name: 'returnObject',
168
- type: 'boolean',
169
- default: true,
170
- description: 'Whether to return the created object data',
171
- },
172
- ],
173
- },
174
- ];
175
-
176
- export async function execute(
177
- this: IExecuteFunctions,
178
- i: number,
179
- ) {
180
- const { apiRequest } = await import('../../../transport');
181
- const limeType = this.getNodeParameter('limeType', i) as string;
182
- const inputMethod = this.getNodeParameter('inputMethod', i) as string;
183
- const options = this.getNodeParameter('options', i, {}) as IDataObject;
184
-
185
- if (!limeType) {
186
- throw new NodeOperationError(this.getNode(), 'Lime type must be provided');
187
- }
188
-
189
- let objectData: IDataObject;
190
-
191
- // Get object data based on input method
192
- if (inputMethod === 'json') {
193
- try {
194
- const jsonInput = this.getNodeParameter('objectJson', i) as string;
195
- objectData = typeof jsonInput === 'string' ? JSON.parse(jsonInput) : jsonInput;
196
- } catch (error) {
197
- throw new NodeOperationError(this.getNode(), 'Invalid JSON input: ' + error.message);
198
- }
199
- } else {
200
- // Form fields input
201
- objectData = {};
202
- const propertiesInput = this.getNodeParameter('properties.property', i, []) as IDataObject[];
203
-
204
- if (propertiesInput && propertiesInput.length > 0) {
205
- propertiesInput.forEach((prop) => {
206
- if (prop.name && prop.value !== undefined) {
207
- objectData[prop.name as string] = prop.value;
208
- }
209
- });
210
- }
211
- }
212
-
213
- const endpoint = `/api/v1/limeobject/${encodeURIComponent(limeType)}/`;
214
-
215
- try {
216
- const response = await apiRequest.call(this, {
217
- method: 'POST',
218
- endpoint,
219
- body: objectData,
220
- });
221
-
222
- // If user wants the created object returned, make another request to get it
223
- if (options.returnObject === true && response && response._id) {
224
- return await apiRequest.call(this, {
225
- method: 'GET',
226
- endpoint: `${endpoint}/${response._id}`,
227
- });
228
- }
229
-
230
- return response;
231
- } catch (error) {
232
- throw new NodeOperationError(this.getNode(), `Failed to create ${limeType} object: ${error.message}`);
233
- }
234
- }