@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,140 +0,0 @@
1
- import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
- import { graphqlRequest } from '../../transport/graphqlRequest';
3
-
4
- export const description: INodeProperties[] = [
5
- {
6
- displayName: 'Email Subject',
7
- name: 'subject',
8
- type: 'string',
9
- default: '',
10
- required: true,
11
- description: 'Subject of the email',
12
- displayOptions: {
13
- show: {
14
- resource: ['person'],
15
- operation: ['createMail'],
16
- },
17
- },
18
- },
19
- {
20
- displayName: 'Email Body',
21
- name: 'body',
22
- type: 'string',
23
- typeOptions: {
24
- rows: 4,
25
- },
26
- default: '',
27
- required: true,
28
- description: 'Body content of the email',
29
- displayOptions: {
30
- show: {
31
- resource: ['person'],
32
- operation: ['createMail'],
33
- },
34
- },
35
- },
36
- {
37
- displayName: 'Person Details',
38
- name: 'personDetails',
39
- type: 'collection',
40
- placeholder: 'Add Person Details',
41
- default: {},
42
- options: [
43
- {
44
- displayName: 'First Name',
45
- name: 'firstName',
46
- type: 'string',
47
- default: '',
48
- description: 'First name of the person',
49
- },
50
- {
51
- displayName: 'Last Name',
52
- name: 'lastName',
53
- type: 'string',
54
- default: '',
55
- description: 'Last name of the person',
56
- },
57
- ],
58
- required: true,
59
- displayOptions: {
60
- show: {
61
- resource: ['person'],
62
- operation: ['createMail'],
63
- },
64
- },
65
- },
66
- {
67
- displayName: 'Organization Details',
68
- name: 'organizationDetails',
69
- type: 'collection',
70
- placeholder: 'Add Organization Details',
71
- default: {},
72
- options: [
73
- {
74
- displayName: 'Name',
75
- name: 'name',
76
- type: 'string',
77
- default: '',
78
- description: 'Name of the organization',
79
- },
80
- {
81
- displayName: 'City',
82
- name: 'city',
83
- type: 'string',
84
- default: '',
85
- description: 'City of the organization',
86
- },
87
- ],
88
- required: true,
89
- displayOptions: {
90
- show: {
91
- resource: ['person'],
92
- operation: ['createMail'],
93
- },
94
- },
95
- },
96
- ];
97
-
98
- export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
99
- const subject = this.getNodeParameter('subject', i) as string;
100
- const body = this.getNodeParameter('body', i) as string;
101
- const personDetails = this.getNodeParameter('personDetails', i) as {
102
- firstName: string;
103
- lastName: string;
104
- };
105
- const organizationDetails = this.getNodeParameter('organizationDetails', i) as {
106
- name: string;
107
- city: string;
108
- };
109
-
110
- const mutation = `
111
- mutation ($input: CreateMailInput!) {
112
- createMail(input: $input) {
113
- mailId
114
- }
115
- }
116
- `;
117
-
118
- const input = {
119
- email: {
120
- subject,
121
- body,
122
- },
123
- person: {
124
- firstName: personDetails.firstName,
125
- lastName: personDetails.lastName,
126
- },
127
- organization: {
128
- name: organizationDetails.name,
129
- city: organizationDetails.city,
130
- },
131
- };
132
-
133
- const variables = { input };
134
- const responseData = await graphqlRequest.call(this, mutation, variables);
135
-
136
- return responseData.createMail;
137
- }
138
-
139
- // Add an export to ensure TypeScript recognizes this as a module
140
- export default {};
@@ -1,51 +0,0 @@
1
- import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
- import { graphqlRequest } from '../../transport/graphqlRequest';
3
- import { personFields } from './personFields';
4
-
5
- export const description: INodeProperties[] = [
6
- {
7
- displayName: 'Person ID',
8
- name: 'id',
9
- type: 'string',
10
- default: '',
11
- required: true,
12
- displayOptions: {
13
- show: {
14
- resource: ['person'],
15
- operation: ['get'],
16
- },
17
- },
18
- description: 'The ID of the person to retrieve',
19
- },
20
- ...personFields,
21
- ];
22
-
23
- export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
24
- const id = this.getNodeParameter('id', i) as string;
25
- const returnFields = this.getNodeParameter('returnFields', i) as string[];
26
- const includeEmployer = this.getNodeParameter('includeEmployer', i) as boolean;
27
-
28
- let fieldsToReturn = [...returnFields];
29
-
30
- // Add employer details if requested
31
- if (includeEmployer) {
32
- const employerFields = this.getNodeParameter('employerFields', i) as string[];
33
- fieldsToReturn.push(`employer { ${employerFields.join(' ')} }`);
34
- }
35
-
36
- const query = `
37
- query ($id: ID!) {
38
- person(id: $id) {
39
- ${fieldsToReturn.join('\n')}
40
- }
41
- }
42
- `;
43
-
44
- const variables = { id };
45
- const responseData = await graphqlRequest.call(this, query, variables);
46
-
47
- return responseData.person;
48
- }
49
-
50
- // Add an export to ensure TypeScript recognizes this as a module
51
- export default {};
@@ -1,69 +0,0 @@
1
- import { INodeProperties } from 'n8n-workflow';
2
-
3
- import * as get from './get.operation';
4
- import * as search from './search.operation';
5
- import * as update from './update.operation';
6
- import * as createMail from './createMail.operation';
7
-
8
- export const person = {
9
- description: [
10
- {
11
- displayName: 'Operation',
12
- name: 'operation',
13
- type: 'options',
14
- noDataExpression: true,
15
- displayOptions: {
16
- show: {
17
- resource: ['person'],
18
- },
19
- },
20
- options: [
21
- {
22
- name: 'Get',
23
- value: 'get',
24
- description: 'Get a specific person by ID',
25
- action: 'Get a person by ID',
26
- },
27
- {
28
- name: 'Search',
29
- value: 'search',
30
- description: 'Search for persons',
31
- action: 'Search persons',
32
- },
33
- {
34
- name: 'Update',
35
- value: 'update',
36
- description: 'Update a person',
37
- action: 'Update a person',
38
- },
39
- {
40
- name: 'Create Mail',
41
- value: 'createMail',
42
- description: 'Add an email as a note',
43
- action: 'Create mail note',
44
- },
45
- ],
46
- default: 'get',
47
- },
48
- ...get.description,
49
- ...search.description,
50
- ...update.description,
51
- ...createMail.description,
52
- ] as INodeProperties[],
53
- execute: async function (this: any, { i }: { i: number }) {
54
- const operation = this.getNodeParameter('operation', i) as string;
55
-
56
- switch (operation) {
57
- case 'get':
58
- return await get.execute.call(this, { i });
59
- case 'search':
60
- return await search.execute.call(this, { i });
61
- case 'update':
62
- return await update.execute.call(this, { i });
63
- case 'createMail':
64
- return await createMail.execute.call(this, { i });
65
- default:
66
- throw new Error(`The operation "${operation}" is not supported!`);
67
- }
68
- },
69
- };
@@ -1,132 +0,0 @@
1
- import { INodeProperties } from 'n8n-workflow';
2
-
3
- export const personFields: INodeProperties[] = [
4
- {
5
- displayName: 'Return Fields',
6
- name: 'returnFields',
7
- type: 'multiOptions',
8
- options: [
9
- {
10
- name: 'ID',
11
- value: 'id',
12
- },
13
- {
14
- name: 'Name',
15
- value: 'name',
16
- },
17
- {
18
- name: 'Email',
19
- value: 'email',
20
- },
21
- {
22
- name: 'Phone Number',
23
- value: 'phoneNumber',
24
- },
25
- {
26
- name: 'Employer Name',
27
- value: 'employerName',
28
- },
29
- {
30
- name: 'Position',
31
- value: 'position',
32
- },
33
- {
34
- name: 'Tags',
35
- value: 'tags',
36
- },
37
- {
38
- name: 'Currently Employed',
39
- value: 'currentlyEmployed',
40
- },
41
- {
42
- name: 'Email Consent',
43
- value: 'emailConsent',
44
- },
45
- {
46
- name: 'Custom Fields',
47
- value: 'customFields { title type value }',
48
- },
49
- ],
50
- default: ['id', 'name', 'email'],
51
- description: 'The fields to return',
52
- displayOptions: {
53
- show: {
54
- resource: ['person'],
55
- operation: ['get', 'search', 'update'],
56
- },
57
- },
58
- },
59
- {
60
- displayName: 'Include Employer Details',
61
- name: 'includeEmployer',
62
- type: 'boolean',
63
- default: false,
64
- description: 'Whether to include detailed employer information',
65
- displayOptions: {
66
- show: {
67
- resource: ['person'],
68
- operation: ['get', 'search'],
69
- },
70
- },
71
- },
72
- {
73
- displayName: 'Employer Fields',
74
- name: 'employerFields',
75
- type: 'multiOptions',
76
- options: [
77
- {
78
- name: 'ID',
79
- value: 'id',
80
- },
81
- {
82
- name: 'Name',
83
- value: 'name',
84
- },
85
- {
86
- name: 'City',
87
- value: 'city',
88
- },
89
- {
90
- name: 'Email',
91
- value: 'email',
92
- },
93
- {
94
- name: 'Phone Number',
95
- value: 'phoneNumber',
96
- },
97
- {
98
- name: 'Organization Number',
99
- value: 'organizationNumber',
100
- },
101
- {
102
- name: 'Tags',
103
- value: 'tags',
104
- },
105
- {
106
- name: 'Temperature',
107
- value: 'temperature',
108
- },
109
- {
110
- name: 'Customer Relation',
111
- value: 'customerRelation',
112
- },
113
- {
114
- name: 'Responsible Coworker',
115
- value: 'responsibleCoworker { id name email phoneNumber }',
116
- },
117
- {
118
- name: 'Custom Fields',
119
- value: 'customFields { title type value }',
120
- },
121
- ],
122
- default: ['id', 'name'],
123
- description: 'The employer fields to return',
124
- displayOptions: {
125
- show: {
126
- resource: ['person'],
127
- operation: ['get', 'search'],
128
- includeEmployer: [true],
129
- },
130
- },
131
- },
132
- ];
@@ -1,88 +0,0 @@
1
- import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
- import { graphqlRequest } from '../../transport/graphqlRequest';
3
- import { personFields } from './personFields';
4
-
5
- export const description: INodeProperties[] = [
6
- {
7
- displayName: 'Search Query',
8
- name: 'query',
9
- type: 'string',
10
- default: '',
11
- placeholder: 'anna.johansson@lundalogik.se',
12
- description: 'Searches in person name, email, or employer name',
13
- displayOptions: {
14
- show: {
15
- resource: ['person'],
16
- operation: ['search'],
17
- },
18
- },
19
- },
20
- {
21
- displayName: 'Limit',
22
- name: 'limit',
23
- type: 'number',
24
- default: 10,
25
- description: 'Max number of results to return (max: 20)',
26
- typeOptions: {
27
- minValue: 1,
28
- maxValue: 20,
29
- },
30
- displayOptions: {
31
- show: {
32
- resource: ['person'],
33
- operation: ['search'],
34
- },
35
- },
36
- },
37
- {
38
- displayName: 'Offset',
39
- name: 'offset',
40
- type: 'number',
41
- default: 0,
42
- description: 'Number of results to skip',
43
- displayOptions: {
44
- show: {
45
- resource: ['person'],
46
- operation: ['search'],
47
- },
48
- },
49
- },
50
- ...personFields,
51
- ];
52
-
53
- export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
54
- const query = this.getNodeParameter('query', i) as string;
55
- const limit = this.getNodeParameter('limit', i) as number;
56
- const offset = this.getNodeParameter('offset', i) as number;
57
- const returnFields = this.getNodeParameter('returnFields', i) as string[];
58
- const includeEmployer = this.getNodeParameter('includeEmployer', i) as boolean;
59
-
60
- let fieldsToReturn = [...returnFields];
61
-
62
- // Add employer details if requested
63
- if (includeEmployer) {
64
- const employerFields = this.getNodeParameter('employerFields', i) as string[];
65
- fieldsToReturn.push(`employer { ${employerFields.join(' ')} }`);
66
- }
67
-
68
- const graphqlQuery = `
69
- query ($query: String, $first: Int!, $offset: Int!) {
70
- persons(query: $query, first: $first, offset: $offset) {
71
- ${fieldsToReturn.join('\n')}
72
- }
73
- }
74
- `;
75
-
76
- const variables = {
77
- query,
78
- first: limit,
79
- offset,
80
- };
81
-
82
- const responseData = await graphqlRequest.call(this, graphqlQuery, variables);
83
-
84
- return responseData.persons;
85
- }
86
-
87
- // Add an export to ensure TypeScript recognizes this as a module
88
- export default {};
@@ -1,122 +0,0 @@
1
- import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
- import { graphqlRequest } from '../../transport/graphqlRequest';
3
- import { personFields } from './personFields';
4
-
5
- export const description: INodeProperties[] = [
6
- {
7
- displayName: 'Person ID',
8
- name: 'id',
9
- type: 'string',
10
- default: '',
11
- required: true,
12
- description: 'ID of the person to update',
13
- displayOptions: {
14
- show: {
15
- resource: ['person'],
16
- operation: ['update'],
17
- },
18
- },
19
- },
20
- {
21
- displayName: 'Update Fields',
22
- name: 'updateFields',
23
- type: 'collection',
24
- placeholder: 'Add Field',
25
- default: {},
26
- options: [
27
- {
28
- displayName: 'Email',
29
- name: 'email',
30
- type: 'string',
31
- default: '',
32
- description: 'Email address of the person',
33
- },
34
- {
35
- displayName: 'Email Consent',
36
- name: 'emailConsent',
37
- type: 'boolean',
38
- default: false,
39
- description: 'Whether the person has given consent to receive emails',
40
- },
41
- {
42
- displayName: 'Tags',
43
- name: 'tags',
44
- type: 'string',
45
- default: '',
46
- placeholder: 'tag1,tag2',
47
- description: 'Comma-separated tags to add to the person',
48
- },
49
- {
50
- displayName: 'Remove Tags',
51
- name: 'removeTags',
52
- type: 'string',
53
- default: '',
54
- placeholder: 'tag1,tag2',
55
- description: 'Comma-separated tags to remove from the person',
56
- },
57
- ],
58
- displayOptions: {
59
- show: {
60
- resource: ['person'],
61
- operation: ['update'],
62
- },
63
- },
64
- },
65
- ...personFields,
66
- ];
67
-
68
- export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
69
- const id = this.getNodeParameter('id', i) as string;
70
- const updateFields = this.getNodeParameter('updateFields', i) as {
71
- email?: string;
72
- emailConsent?: boolean;
73
- tags?: string;
74
- removeTags?: string;
75
- };
76
- const returnFields = this.getNodeParameter('returnFields', i) as string[];
77
-
78
- // Prepare input for GraphQL mutation
79
- const input: Record<string, any> = {
80
- id,
81
- };
82
-
83
- // Add optional fields if provided
84
- if (updateFields.email !== undefined) {
85
- input.email = updateFields.email;
86
- }
87
-
88
- if (updateFields.emailConsent !== undefined) {
89
- input.emailConsent = updateFields.emailConsent;
90
- }
91
-
92
- // Handle tags
93
- const tags: Record<string, any> = {};
94
- if (updateFields.tags) {
95
- tags.addTags = updateFields.tags.split(',').map(tag => tag.trim());
96
- }
97
-
98
- if (updateFields.removeTags) {
99
- tags.removeTags = updateFields.removeTags.split(',').map(tag => tag.trim());
100
- }
101
-
102
- if (Object.keys(tags).length > 0) {
103
- input.tags = tags;
104
- }
105
-
106
- // Execute GraphQL mutation
107
- const mutation = `
108
- mutation ($input: UpdatePersonInput!) {
109
- updatePerson(input: $input) {
110
- ${returnFields.join('\n')}
111
- }
112
- }
113
- `;
114
-
115
- const variables = { input };
116
- const responseData = await graphqlRequest.call(this, mutation, variables);
117
-
118
- return responseData.updatePerson;
119
- }
120
-
121
- // Add an export to ensure TypeScript recognizes this as a module
122
- export default {};
@@ -1,30 +0,0 @@
1
- import { IExecuteFunctions } from 'n8n-workflow';
2
-
3
- export async function graphqlRequest(
4
- this: IExecuteFunctions,
5
- query: string,
6
- variables?: object,
7
- ) {
8
- const response = await this.helpers.requestWithAuthentication.call(
9
- this,
10
- 'limeGoApi',
11
- {
12
- method: 'POST',
13
- url: 'https://api.lime-go.com/v1/graphql',
14
- headers: {
15
- 'Content-Type': 'application/json',
16
- },
17
- body: {
18
- query,
19
- variables,
20
- },
21
- json: true,
22
- },
23
- );
24
-
25
- if (response.errors) {
26
- throw new Error(`GraphQL request failed: ${JSON.stringify(response.errors)}`);
27
- }
28
-
29
- return response.data;
30
- }
package/tsconfig.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "module": "commonjs",
5
- "moduleResolution": "node",
6
- "target": "es2019",
7
- "lib": ["es2019", "es2020", "es2022"],
8
- "removeComments": true,
9
- "useUnknownInCatchVariables": false,
10
- "forceConsistentCasingInFileNames": true,
11
- "noImplicitAny": true,
12
- "noImplicitReturns": true,
13
- "noUnusedLocals": true,
14
- "strictNullChecks": true,
15
- "preserveConstEnums": true,
16
- "esModuleInterop": true,
17
- "resolveJsonModule": true,
18
- "incremental": true,
19
- "declaration": true,
20
- "sourceMap": true,
21
- "skipLibCheck": true,
22
- "outDir": "./dist/",
23
- },
24
- "include": [
25
- "credentials/**/*",
26
- "nodes/**/*",
27
- "nodes/**/*.json",
28
- "package.json",
29
- ],
30
- }
File without changes