@limetech/n8n-nodes-lime 0.2.0 → 0.2.2

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 (54) hide show
  1. package/dist/package.json +11 -7
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +8 -5
  4. package/.eslintrc.js +0 -58
  5. package/.github/copilot-instructions.md +0 -20
  6. package/.github/workflows/publish.yml +0 -34
  7. package/credentials/LimeCrmApi.credentials.ts +0 -57
  8. package/credentials/LimeGoApi.credentials.ts +0 -31
  9. package/docker-compose.yml +0 -44
  10. package/nodes/lime-crm/GenericTypes.ts +0 -114
  11. package/nodes/lime-crm/LimeCrm.node.json +0 -18
  12. package/nodes/lime-crm/LimeCrmNode.node.ts +0 -154
  13. package/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.ts +0 -461
  14. package/nodes/lime-crm/LimeCrmTrigger.node.ts +0 -505
  15. package/nodes/lime-crm/lime-crm.svg +0 -1
  16. package/nodes/lime-crm/methods/getAllSortableFields.ts +0 -73
  17. package/nodes/lime-crm/methods/getLimeTypeProperties.ts +0 -48
  18. package/nodes/lime-crm/methods/getLimeTypeRelations.ts +0 -32
  19. package/nodes/lime-crm/methods/getLimeTypes.ts +0 -33
  20. package/nodes/lime-crm/methods/getRelatedTypeProperties.ts +0 -47
  21. package/nodes/lime-crm/methods/index.ts +0 -5
  22. package/nodes/lime-crm/resources/limeObject/commonFields.ts +0 -179
  23. package/nodes/lime-crm/resources/limeObject/index.ts +0 -64
  24. package/nodes/lime-crm/resources/limeObject/operations/common.operation.ts +0 -35
  25. package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +0 -234
  26. package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +0 -136
  27. package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +0 -124
  28. package/nodes/lime-crm/resources/limeObject/operations/getAll.operation.ts +0 -242
  29. package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +0 -242
  30. package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +0 -201
  31. package/nodes/lime-crm/resources/limeType/index.ts +0 -66
  32. package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +0 -105
  33. package/nodes/lime-crm/resources/limeType/operations/getRelations.operation.ts +0 -105
  34. package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +0 -58
  35. package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +0 -76
  36. package/nodes/lime-crm/resources/queryApi/index.ts +0 -42
  37. package/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.ts +0 -605
  38. package/nodes/lime-crm/transport/index.ts +0 -74
  39. package/nodes/lime-go/LimeGo.node.ts +0 -146
  40. package/nodes/lime-go/actions/organization/get.operation.ts +0 -42
  41. package/nodes/lime-go/actions/organization/getByExternalKey.operation.ts +0 -57
  42. package/nodes/lime-go/actions/organization/index.ts +0 -69
  43. package/nodes/lime-go/actions/organization/organizationFields.ts +0 -160
  44. package/nodes/lime-go/actions/organization/search.operation.ts +0 -73
  45. package/nodes/lime-go/actions/organization/update.operation.ts +0 -140
  46. package/nodes/lime-go/actions/person/createMail.operation.ts +0 -140
  47. package/nodes/lime-go/actions/person/get.operation.ts +0 -51
  48. package/nodes/lime-go/actions/person/index.ts +0 -69
  49. package/nodes/lime-go/actions/person/personFields.ts +0 -132
  50. package/nodes/lime-go/actions/person/search.operation.ts +0 -88
  51. package/nodes/lime-go/actions/person/update.operation.ts +0 -122
  52. package/nodes/lime-go/lime-go.svg +0 -1
  53. package/nodes/lime-go/transport/graphqlRequest.ts +0 -30
  54. package/tsconfig.json +0 -30
@@ -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
- }