@ixiam/n8n-nodes-civicrm 1.1.30 → 1.1.32
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.
- package/dist/src/nodes/CiviCrm/CiviCrm.node.js +351 -0
- package/dist/src/nodes/CiviCrm/descriptions/generic.js +4 -4
- package/dist/src/nodes/CiviCrm/descriptions/resources.js +2 -0
- package/package.json +1 -1
- package/src/nodes/CiviCrm/CiviCrm.node.ts +356 -0
- package/src/nodes/CiviCrm/descriptions/generic.ts +4 -4
- package/src/nodes/CiviCrm/descriptions/resources.ts +2 -0
|
@@ -61,6 +61,351 @@ class CiviCrm {
|
|
|
61
61
|
defaults: { name: 'CiviCRM' },
|
|
62
62
|
inputs: ['main'],
|
|
63
63
|
outputs: ['main'],
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
usableAsTool: true,
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
actions: [
|
|
68
|
+
// ======================================================================
|
|
69
|
+
// CONTACT
|
|
70
|
+
// ======================================================================
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Get Contact',
|
|
73
|
+
name: 'getContact',
|
|
74
|
+
action: 'Get a contact',
|
|
75
|
+
description: 'Retrieve a contact from CiviCRM by ID or email.',
|
|
76
|
+
displayOptions: { show: { resource: ['contact'], operation: ['get'] } },
|
|
77
|
+
properties: [
|
|
78
|
+
{
|
|
79
|
+
displayName: 'ID',
|
|
80
|
+
name: 'id',
|
|
81
|
+
type: 'number',
|
|
82
|
+
default: 0,
|
|
83
|
+
description: 'The internal CiviCRM ID of the contact to retrieve.',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
displayName: 'Get Many Contacts',
|
|
89
|
+
name: 'getManyContacts',
|
|
90
|
+
action: 'Get many contacts',
|
|
91
|
+
description: 'Retrieve multiple contacts from CiviCRM with filtering.',
|
|
92
|
+
displayOptions: { show: { resource: ['contact'], operation: ['getMany'] } },
|
|
93
|
+
properties: [...generic_1.genericFields],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Create Contact',
|
|
97
|
+
name: 'createContact',
|
|
98
|
+
action: 'Create a contact',
|
|
99
|
+
description: 'Create a new contact in CiviCRM.',
|
|
100
|
+
displayOptions: { show: { resource: ['contact'], operation: ['create'] } },
|
|
101
|
+
properties: [...generic_1.upsertFields],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Update Contact',
|
|
105
|
+
name: 'updateContact',
|
|
106
|
+
action: 'Update a contact',
|
|
107
|
+
description: 'Update an existing contact in CiviCRM.',
|
|
108
|
+
displayOptions: { show: { resource: ['contact'], operation: ['update'] } },
|
|
109
|
+
properties: [
|
|
110
|
+
{
|
|
111
|
+
displayName: 'ID',
|
|
112
|
+
name: 'id',
|
|
113
|
+
type: 'number',
|
|
114
|
+
default: 0,
|
|
115
|
+
description: 'The ID of the contact to update.',
|
|
116
|
+
},
|
|
117
|
+
...generic_1.upsertFields,
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Delete Contact',
|
|
122
|
+
name: 'deleteContact',
|
|
123
|
+
action: 'Delete a contact',
|
|
124
|
+
description: 'Delete a contact from CiviCRM.',
|
|
125
|
+
displayOptions: { show: { resource: ['contact'], operation: ['delete'] } },
|
|
126
|
+
properties: [
|
|
127
|
+
{
|
|
128
|
+
displayName: 'ID',
|
|
129
|
+
name: 'id',
|
|
130
|
+
type: 'number',
|
|
131
|
+
default: 0,
|
|
132
|
+
description: 'The ID of the contact to delete.',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
// ======================================================================
|
|
137
|
+
// MEMBERSHIP
|
|
138
|
+
// ======================================================================
|
|
139
|
+
{
|
|
140
|
+
displayName: 'Get Membership',
|
|
141
|
+
name: 'getMembership',
|
|
142
|
+
action: 'Get a membership',
|
|
143
|
+
description: 'Retrieve a membership by ID.',
|
|
144
|
+
displayOptions: { show: { resource: ['membership'], operation: ['get'] } },
|
|
145
|
+
properties: [
|
|
146
|
+
{
|
|
147
|
+
displayName: 'ID',
|
|
148
|
+
name: 'id',
|
|
149
|
+
type: 'number',
|
|
150
|
+
default: 0,
|
|
151
|
+
description: 'The internal CiviCRM ID of the membership.',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
displayName: 'Get Many Memberships',
|
|
157
|
+
name: 'getManyMemberships',
|
|
158
|
+
action: 'Get many memberships',
|
|
159
|
+
description: 'Retrieve multiple memberships.',
|
|
160
|
+
displayOptions: { show: { resource: ['membership'], operation: ['getMany'] } },
|
|
161
|
+
properties: [...generic_1.genericFields],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
displayName: 'Create Membership',
|
|
165
|
+
name: 'createMembership',
|
|
166
|
+
action: 'Create a membership',
|
|
167
|
+
description: 'Create a new membership.',
|
|
168
|
+
displayOptions: { show: { resource: ['membership'], operation: ['create'] } },
|
|
169
|
+
properties: [...generic_1.upsertFields],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
displayName: 'Update Membership',
|
|
173
|
+
name: 'updateMembership',
|
|
174
|
+
action: 'Update a membership',
|
|
175
|
+
description: 'Update an existing membership.',
|
|
176
|
+
displayOptions: { show: { resource: ['membership'], operation: ['update'] } },
|
|
177
|
+
properties: [
|
|
178
|
+
{
|
|
179
|
+
displayName: 'ID',
|
|
180
|
+
name: 'id',
|
|
181
|
+
type: 'number',
|
|
182
|
+
default: 0,
|
|
183
|
+
description: 'The ID of the membership to update.',
|
|
184
|
+
},
|
|
185
|
+
...generic_1.upsertFields,
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
displayName: 'Delete Membership',
|
|
190
|
+
name: 'deleteMembership',
|
|
191
|
+
action: 'Delete a membership',
|
|
192
|
+
description: 'Delete a membership.',
|
|
193
|
+
displayOptions: { show: { resource: ['membership'], operation: ['delete'] } },
|
|
194
|
+
properties: [
|
|
195
|
+
{
|
|
196
|
+
displayName: 'ID',
|
|
197
|
+
name: 'id',
|
|
198
|
+
type: 'number',
|
|
199
|
+
default: 0,
|
|
200
|
+
description: 'The ID of the membership to delete.',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
// ======================================================================
|
|
205
|
+
// GROUP
|
|
206
|
+
// ======================================================================
|
|
207
|
+
{
|
|
208
|
+
displayName: 'Get Group',
|
|
209
|
+
name: 'getGroup',
|
|
210
|
+
action: 'Get a group',
|
|
211
|
+
description: 'Retrieve a group by ID.',
|
|
212
|
+
displayOptions: { show: { resource: ['group'], operation: ['get'] } },
|
|
213
|
+
properties: [
|
|
214
|
+
{
|
|
215
|
+
displayName: 'ID',
|
|
216
|
+
name: 'id',
|
|
217
|
+
type: 'number',
|
|
218
|
+
default: 0,
|
|
219
|
+
description: 'The internal CiviCRM ID of the group.',
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Get Many Groups',
|
|
225
|
+
name: 'getManyGroups',
|
|
226
|
+
action: 'Get many groups',
|
|
227
|
+
description: 'Retrieve multiple groups.',
|
|
228
|
+
displayOptions: { show: { resource: ['group'], operation: ['getMany'] } },
|
|
229
|
+
properties: [...generic_1.genericFields],
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
displayName: 'Create Group',
|
|
233
|
+
name: 'createGroup',
|
|
234
|
+
action: 'Create a group',
|
|
235
|
+
description: 'Create a new group.',
|
|
236
|
+
displayOptions: { show: { resource: ['group'], operation: ['create'] } },
|
|
237
|
+
properties: [...generic_1.upsertFields],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
displayName: 'Update Group',
|
|
241
|
+
name: 'updateGroup',
|
|
242
|
+
action: 'Update a group',
|
|
243
|
+
description: 'Update an existing group.',
|
|
244
|
+
displayOptions: { show: { resource: ['group'], operation: ['update'] } },
|
|
245
|
+
properties: [
|
|
246
|
+
{
|
|
247
|
+
displayName: 'ID',
|
|
248
|
+
name: 'id',
|
|
249
|
+
type: 'number',
|
|
250
|
+
default: 0,
|
|
251
|
+
description: 'The ID of the group to update.',
|
|
252
|
+
},
|
|
253
|
+
...generic_1.upsertFields,
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
displayName: 'Delete Group',
|
|
258
|
+
name: 'deleteGroup',
|
|
259
|
+
action: 'Delete a group',
|
|
260
|
+
description: 'Delete a group.',
|
|
261
|
+
displayOptions: { show: { resource: ['group'], operation: ['delete'] } },
|
|
262
|
+
properties: [
|
|
263
|
+
{
|
|
264
|
+
displayName: 'ID',
|
|
265
|
+
name: 'id',
|
|
266
|
+
type: 'number',
|
|
267
|
+
default: 0,
|
|
268
|
+
description: 'The ID of the group to delete.',
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
// ======================================================================
|
|
273
|
+
// RELATIONSHIP
|
|
274
|
+
// ======================================================================
|
|
275
|
+
{
|
|
276
|
+
displayName: 'Get Relationship',
|
|
277
|
+
name: 'getRelationship',
|
|
278
|
+
action: 'Get a relationship',
|
|
279
|
+
description: 'Retrieve a relationship by ID.',
|
|
280
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['get'] } },
|
|
281
|
+
properties: [
|
|
282
|
+
{
|
|
283
|
+
displayName: 'ID',
|
|
284
|
+
name: 'id',
|
|
285
|
+
type: 'number',
|
|
286
|
+
default: 0,
|
|
287
|
+
description: 'The internal CiviCRM ID of the relationship.',
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: 'Get Many Relationships',
|
|
293
|
+
name: 'getManyRelationships',
|
|
294
|
+
action: 'Get many relationships',
|
|
295
|
+
description: 'Retrieve multiple relationships.',
|
|
296
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['getMany'] } },
|
|
297
|
+
properties: [...generic_1.genericFields],
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
displayName: 'Create Relationship',
|
|
301
|
+
name: 'createRelationship',
|
|
302
|
+
action: 'Create a relationship',
|
|
303
|
+
description: 'Create a new relationship.',
|
|
304
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['create'] } },
|
|
305
|
+
properties: [...generic_1.upsertFields],
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
displayName: 'Update Relationship',
|
|
309
|
+
name: 'updateRelationship',
|
|
310
|
+
action: 'Update a relationship',
|
|
311
|
+
description: 'Update an existing relationship.',
|
|
312
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['update'] } },
|
|
313
|
+
properties: [
|
|
314
|
+
{
|
|
315
|
+
displayName: 'ID',
|
|
316
|
+
name: 'id',
|
|
317
|
+
type: 'number',
|
|
318
|
+
default: 0,
|
|
319
|
+
description: 'The ID of the relationship to update.',
|
|
320
|
+
},
|
|
321
|
+
...generic_1.upsertFields,
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
displayName: 'Delete Relationship',
|
|
326
|
+
name: 'deleteRelationship',
|
|
327
|
+
action: 'Delete a relationship',
|
|
328
|
+
description: 'Delete a relationship.',
|
|
329
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['delete'] } },
|
|
330
|
+
properties: [
|
|
331
|
+
{
|
|
332
|
+
displayName: 'ID',
|
|
333
|
+
name: 'id',
|
|
334
|
+
type: 'number',
|
|
335
|
+
default: 0,
|
|
336
|
+
description: 'The ID of the relationship to delete.',
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
},
|
|
340
|
+
// ======================================================================
|
|
341
|
+
// ACTIVITY
|
|
342
|
+
// ======================================================================
|
|
343
|
+
{
|
|
344
|
+
displayName: 'Get Activity',
|
|
345
|
+
name: 'getActivity',
|
|
346
|
+
action: 'Get an activity',
|
|
347
|
+
description: 'Retrieve an activity by ID.',
|
|
348
|
+
displayOptions: { show: { resource: ['activity'], operation: ['get'] } },
|
|
349
|
+
properties: [
|
|
350
|
+
{
|
|
351
|
+
displayName: 'ID',
|
|
352
|
+
name: 'id',
|
|
353
|
+
type: 'number',
|
|
354
|
+
default: 0,
|
|
355
|
+
description: 'The internal CiviCRM ID of the activity.',
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
displayName: 'Get Many Activities',
|
|
361
|
+
name: 'getManyActivities',
|
|
362
|
+
action: 'Get many activities',
|
|
363
|
+
description: 'Retrieve multiple activities.',
|
|
364
|
+
displayOptions: { show: { resource: ['activity'], operation: ['getMany'] } },
|
|
365
|
+
properties: [...generic_1.genericFields],
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
displayName: 'Create Activity',
|
|
369
|
+
name: 'createActivity',
|
|
370
|
+
action: 'Create an activity',
|
|
371
|
+
description: 'Create a new activity.',
|
|
372
|
+
displayOptions: { show: { resource: ['activity'], operation: ['create'] } },
|
|
373
|
+
properties: [...generic_1.upsertFields],
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
displayName: 'Update Activity',
|
|
377
|
+
name: 'updateActivity',
|
|
378
|
+
action: 'Update an activity',
|
|
379
|
+
description: 'Update an existing activity.',
|
|
380
|
+
displayOptions: { show: { resource: ['activity'], operation: ['update'] } },
|
|
381
|
+
properties: [
|
|
382
|
+
{
|
|
383
|
+
displayName: 'ID',
|
|
384
|
+
name: 'id',
|
|
385
|
+
type: 'number',
|
|
386
|
+
default: 0,
|
|
387
|
+
description: 'The ID of the activity to update.',
|
|
388
|
+
},
|
|
389
|
+
...generic_1.upsertFields,
|
|
390
|
+
],
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
displayName: 'Delete Activity',
|
|
394
|
+
name: 'deleteActivity',
|
|
395
|
+
action: 'Delete an activity',
|
|
396
|
+
description: 'Delete an activity.',
|
|
397
|
+
displayOptions: { show: { resource: ['activity'], operation: ['delete'] } },
|
|
398
|
+
properties: [
|
|
399
|
+
{
|
|
400
|
+
displayName: 'ID',
|
|
401
|
+
name: 'id',
|
|
402
|
+
type: 'number',
|
|
403
|
+
default: 0,
|
|
404
|
+
description: 'The ID of the activity to delete.',
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
},
|
|
408
|
+
],
|
|
64
409
|
credentials: [{ name: 'civiCrmApi', required: true }],
|
|
65
410
|
properties: [
|
|
66
411
|
//
|
|
@@ -76,6 +421,7 @@ class CiviCrm {
|
|
|
76
421
|
name: 'contactType',
|
|
77
422
|
type: 'options',
|
|
78
423
|
default: 'Individual',
|
|
424
|
+
description: 'Type of contact to create or search for.',
|
|
79
425
|
options: [
|
|
80
426
|
{ name: 'Individual', value: 'Individual' },
|
|
81
427
|
{ name: 'Organization', value: 'Organization' },
|
|
@@ -91,6 +437,7 @@ class CiviCrm {
|
|
|
91
437
|
name: 'emailLocation',
|
|
92
438
|
type: 'options',
|
|
93
439
|
default: 'Work',
|
|
440
|
+
description: 'Location type for the email address.',
|
|
94
441
|
options: [
|
|
95
442
|
{ name: 'Home', value: 'Home' },
|
|
96
443
|
{ name: 'Work', value: 'Work' },
|
|
@@ -103,6 +450,7 @@ class CiviCrm {
|
|
|
103
450
|
name: 'phoneLocation',
|
|
104
451
|
type: 'options',
|
|
105
452
|
default: 'Work',
|
|
453
|
+
description: 'Location type for the phone number.',
|
|
106
454
|
options: [
|
|
107
455
|
{ name: 'Home', value: 'Home' },
|
|
108
456
|
{ name: 'Work', value: 'Work' },
|
|
@@ -116,6 +464,7 @@ class CiviCrm {
|
|
|
116
464
|
name: 'addressLocation',
|
|
117
465
|
type: 'options',
|
|
118
466
|
default: 'Home',
|
|
467
|
+
description: 'Location type for the address.',
|
|
119
468
|
options: [
|
|
120
469
|
{ name: 'Home', value: 'Home' },
|
|
121
470
|
{ name: 'Work', value: 'Work' },
|
|
@@ -132,6 +481,7 @@ class CiviCrm {
|
|
|
132
481
|
name: 'isPrimary',
|
|
133
482
|
type: 'boolean',
|
|
134
483
|
default: true,
|
|
484
|
+
description: 'Whether this should be the primary email/phone/address for the contact.',
|
|
135
485
|
displayOptions: { show: { resource: ['contact'], operation: ['create', 'update'] } },
|
|
136
486
|
},
|
|
137
487
|
//
|
|
@@ -143,6 +493,7 @@ class CiviCrm {
|
|
|
143
493
|
type: 'number',
|
|
144
494
|
default: 0,
|
|
145
495
|
required: true,
|
|
496
|
+
description: 'The internal CiviCRM ID of the entity.',
|
|
146
497
|
displayOptions: {
|
|
147
498
|
show: {
|
|
148
499
|
operation: ['get', 'update', 'delete'],
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.upsertFields = exports.genericFields = void 0;
|
|
4
4
|
exports.genericFields = [
|
|
5
|
-
{ displayName: 'Return All', name: 'returnAll', type: 'boolean', default: false, displayOptions: { show: { operation: ['getMany'] } } },
|
|
6
|
-
{ displayName: 'Limit', name: 'limit', type: 'number', typeOptions: { minValue: 1, maxValue: 1000 }, default: 100, displayOptions: { show: { operation: ['getMany'], returnAll: [false] } } },
|
|
7
|
-
{ displayName: 'Where (JSON)', name: 'whereJson', type: 'string', default: '', placeholder: `[["first_name","=","Alice"]]`, displayOptions: { show: { operation: ['getMany'] } } },
|
|
5
|
+
{ displayName: 'Return All', name: 'returnAll', type: 'boolean', default: false, description: 'Whether to return all results or only up to a given limit.', displayOptions: { show: { operation: ['getMany'] } } },
|
|
6
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', typeOptions: { minValue: 1, maxValue: 1000 }, default: 100, description: 'Max number of results to return.', displayOptions: { show: { operation: ['getMany'], returnAll: [false] } } },
|
|
7
|
+
{ displayName: 'Where (JSON)', name: 'whereJson', type: 'string', default: '', placeholder: `[["first_name","=","Alice"]]`, description: 'JSON array of arrays for filtering. Example: [["first_name","=","Alice"], ["contact_type","=","Individual"]]', displayOptions: { show: { operation: ['getMany'] } } },
|
|
8
8
|
];
|
|
9
9
|
exports.upsertFields = [
|
|
10
|
-
{ displayName: 'Fields', name: 'fields', type: 'fixedCollection', typeOptions: { multipleValues: true }, default: {}, options: [{ name: 'field', displayName: 'Field', values: [{ displayName: 'Name', name: 'fieldName', type: 'string', default: '' }, { displayName: 'Value', name: 'fieldValue', type: 'string', default: '' }] }], displayOptions: { show: { operation: ['create', 'update'] } } }
|
|
10
|
+
{ displayName: 'Fields', name: 'fields', type: 'fixedCollection', typeOptions: { multipleValues: true }, default: {}, description: 'Fields to set for the entity.', options: [{ name: 'field', displayName: 'Field', values: [{ displayName: 'Name', name: 'fieldName', type: 'string', default: '', description: 'Name of the field (e.g. first_name).' }, { displayName: 'Value', name: 'fieldValue', type: 'string', default: '', description: 'Value to set.' }] }], displayOptions: { show: { operation: ['create', 'update'] } } }
|
|
11
11
|
];
|
|
@@ -11,6 +11,7 @@ exports.resourceProp = {
|
|
|
11
11
|
name: 'resource',
|
|
12
12
|
type: 'options',
|
|
13
13
|
default: 'contact',
|
|
14
|
+
description: 'The entity to operate on. Choose "Custom API Call" to access any CiviCRM APIv4 entity not listed.',
|
|
14
15
|
options: [
|
|
15
16
|
{ name: 'Contact', value: 'contact' },
|
|
16
17
|
{ name: 'Membership', value: 'membership' },
|
|
@@ -31,6 +32,7 @@ exports.operationProp = {
|
|
|
31
32
|
type: 'options',
|
|
32
33
|
default: 'getMany',
|
|
33
34
|
noDataExpression: true,
|
|
35
|
+
description: 'The action to perform on the selected resource.',
|
|
34
36
|
options: [
|
|
35
37
|
{ name: 'Create', value: 'create' },
|
|
36
38
|
{ name: 'Delete', value: 'delete' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixiam/n8n-nodes-civicrm",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"description": "Full-featured CiviCRM API v4 integration for n8n with support for Contacts, Memberships, Groups, Relationships, Activities and structured sub-entities like Email, Phone, and Address.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -90,6 +90,356 @@ export class CiviCrm implements INodeType {
|
|
|
90
90
|
defaults: { name: 'CiviCRM' },
|
|
91
91
|
inputs: ['main'],
|
|
92
92
|
outputs: ['main'],
|
|
93
|
+
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
usableAsTool: true,
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
actions: [
|
|
98
|
+
// ======================================================================
|
|
99
|
+
// CONTACT
|
|
100
|
+
// ======================================================================
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Get Contact',
|
|
103
|
+
name: 'getContact',
|
|
104
|
+
action: 'Get a contact',
|
|
105
|
+
description: 'Retrieve a contact from CiviCRM by ID or email.',
|
|
106
|
+
displayOptions: { show: { resource: ['contact'], operation: ['get'] } },
|
|
107
|
+
properties: [
|
|
108
|
+
{
|
|
109
|
+
displayName: 'ID',
|
|
110
|
+
name: 'id',
|
|
111
|
+
type: 'number',
|
|
112
|
+
default: 0,
|
|
113
|
+
description: 'The internal CiviCRM ID of the contact to retrieve.',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Get Many Contacts',
|
|
119
|
+
name: 'getManyContacts',
|
|
120
|
+
action: 'Get many contacts',
|
|
121
|
+
description: 'Retrieve multiple contacts from CiviCRM with filtering.',
|
|
122
|
+
displayOptions: { show: { resource: ['contact'], operation: ['getMany'] } },
|
|
123
|
+
properties: [...genericFields],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Create Contact',
|
|
127
|
+
name: 'createContact',
|
|
128
|
+
action: 'Create a contact',
|
|
129
|
+
description: 'Create a new contact in CiviCRM.',
|
|
130
|
+
displayOptions: { show: { resource: ['contact'], operation: ['create'] } },
|
|
131
|
+
properties: [...upsertFields],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
displayName: 'Update Contact',
|
|
135
|
+
name: 'updateContact',
|
|
136
|
+
action: 'Update a contact',
|
|
137
|
+
description: 'Update an existing contact in CiviCRM.',
|
|
138
|
+
displayOptions: { show: { resource: ['contact'], operation: ['update'] } },
|
|
139
|
+
properties: [
|
|
140
|
+
{
|
|
141
|
+
displayName: 'ID',
|
|
142
|
+
name: 'id',
|
|
143
|
+
type: 'number',
|
|
144
|
+
default: 0,
|
|
145
|
+
description: 'The ID of the contact to update.',
|
|
146
|
+
},
|
|
147
|
+
...upsertFields,
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
displayName: 'Delete Contact',
|
|
152
|
+
name: 'deleteContact',
|
|
153
|
+
action: 'Delete a contact',
|
|
154
|
+
description: 'Delete a contact from CiviCRM.',
|
|
155
|
+
displayOptions: { show: { resource: ['contact'], operation: ['delete'] } },
|
|
156
|
+
properties: [
|
|
157
|
+
{
|
|
158
|
+
displayName: 'ID',
|
|
159
|
+
name: 'id',
|
|
160
|
+
type: 'number',
|
|
161
|
+
default: 0,
|
|
162
|
+
description: 'The ID of the contact to delete.',
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// ======================================================================
|
|
168
|
+
// MEMBERSHIP
|
|
169
|
+
// ======================================================================
|
|
170
|
+
{
|
|
171
|
+
displayName: 'Get Membership',
|
|
172
|
+
name: 'getMembership',
|
|
173
|
+
action: 'Get a membership',
|
|
174
|
+
description: 'Retrieve a membership by ID.',
|
|
175
|
+
displayOptions: { show: { resource: ['membership'], operation: ['get'] } },
|
|
176
|
+
properties: [
|
|
177
|
+
{
|
|
178
|
+
displayName: 'ID',
|
|
179
|
+
name: 'id',
|
|
180
|
+
type: 'number',
|
|
181
|
+
default: 0,
|
|
182
|
+
description: 'The internal CiviCRM ID of the membership.',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
displayName: 'Get Many Memberships',
|
|
188
|
+
name: 'getManyMemberships',
|
|
189
|
+
action: 'Get many memberships',
|
|
190
|
+
description: 'Retrieve multiple memberships.',
|
|
191
|
+
displayOptions: { show: { resource: ['membership'], operation: ['getMany'] } },
|
|
192
|
+
properties: [...genericFields],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
displayName: 'Create Membership',
|
|
196
|
+
name: 'createMembership',
|
|
197
|
+
action: 'Create a membership',
|
|
198
|
+
description: 'Create a new membership.',
|
|
199
|
+
displayOptions: { show: { resource: ['membership'], operation: ['create'] } },
|
|
200
|
+
properties: [...upsertFields],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
displayName: 'Update Membership',
|
|
204
|
+
name: 'updateMembership',
|
|
205
|
+
action: 'Update a membership',
|
|
206
|
+
description: 'Update an existing membership.',
|
|
207
|
+
displayOptions: { show: { resource: ['membership'], operation: ['update'] } },
|
|
208
|
+
properties: [
|
|
209
|
+
{
|
|
210
|
+
displayName: 'ID',
|
|
211
|
+
name: 'id',
|
|
212
|
+
type: 'number',
|
|
213
|
+
default: 0,
|
|
214
|
+
description: 'The ID of the membership to update.',
|
|
215
|
+
},
|
|
216
|
+
...upsertFields,
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
displayName: 'Delete Membership',
|
|
221
|
+
name: 'deleteMembership',
|
|
222
|
+
action: 'Delete a membership',
|
|
223
|
+
description: 'Delete a membership.',
|
|
224
|
+
displayOptions: { show: { resource: ['membership'], operation: ['delete'] } },
|
|
225
|
+
properties: [
|
|
226
|
+
{
|
|
227
|
+
displayName: 'ID',
|
|
228
|
+
name: 'id',
|
|
229
|
+
type: 'number',
|
|
230
|
+
default: 0,
|
|
231
|
+
description: 'The ID of the membership to delete.',
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
// ======================================================================
|
|
237
|
+
// GROUP
|
|
238
|
+
// ======================================================================
|
|
239
|
+
{
|
|
240
|
+
displayName: 'Get Group',
|
|
241
|
+
name: 'getGroup',
|
|
242
|
+
action: 'Get a group',
|
|
243
|
+
description: 'Retrieve a group by ID.',
|
|
244
|
+
displayOptions: { show: { resource: ['group'], operation: ['get'] } },
|
|
245
|
+
properties: [
|
|
246
|
+
{
|
|
247
|
+
displayName: 'ID',
|
|
248
|
+
name: 'id',
|
|
249
|
+
type: 'number',
|
|
250
|
+
default: 0,
|
|
251
|
+
description: 'The internal CiviCRM ID of the group.',
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
displayName: 'Get Many Groups',
|
|
257
|
+
name: 'getManyGroups',
|
|
258
|
+
action: 'Get many groups',
|
|
259
|
+
description: 'Retrieve multiple groups.',
|
|
260
|
+
displayOptions: { show: { resource: ['group'], operation: ['getMany'] } },
|
|
261
|
+
properties: [...genericFields],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Create Group',
|
|
265
|
+
name: 'createGroup',
|
|
266
|
+
action: 'Create a group',
|
|
267
|
+
description: 'Create a new group.',
|
|
268
|
+
displayOptions: { show: { resource: ['group'], operation: ['create'] } },
|
|
269
|
+
properties: [...upsertFields],
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
displayName: 'Update Group',
|
|
273
|
+
name: 'updateGroup',
|
|
274
|
+
action: 'Update a group',
|
|
275
|
+
description: 'Update an existing group.',
|
|
276
|
+
displayOptions: { show: { resource: ['group'], operation: ['update'] } },
|
|
277
|
+
properties: [
|
|
278
|
+
{
|
|
279
|
+
displayName: 'ID',
|
|
280
|
+
name: 'id',
|
|
281
|
+
type: 'number',
|
|
282
|
+
default: 0,
|
|
283
|
+
description: 'The ID of the group to update.',
|
|
284
|
+
},
|
|
285
|
+
...upsertFields,
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
displayName: 'Delete Group',
|
|
290
|
+
name: 'deleteGroup',
|
|
291
|
+
action: 'Delete a group',
|
|
292
|
+
description: 'Delete a group.',
|
|
293
|
+
displayOptions: { show: { resource: ['group'], operation: ['delete'] } },
|
|
294
|
+
properties: [
|
|
295
|
+
{
|
|
296
|
+
displayName: 'ID',
|
|
297
|
+
name: 'id',
|
|
298
|
+
type: 'number',
|
|
299
|
+
default: 0,
|
|
300
|
+
description: 'The ID of the group to delete.',
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
// ======================================================================
|
|
306
|
+
// RELATIONSHIP
|
|
307
|
+
// ======================================================================
|
|
308
|
+
{
|
|
309
|
+
displayName: 'Get Relationship',
|
|
310
|
+
name: 'getRelationship',
|
|
311
|
+
action: 'Get a relationship',
|
|
312
|
+
description: 'Retrieve a relationship by ID.',
|
|
313
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['get'] } },
|
|
314
|
+
properties: [
|
|
315
|
+
{
|
|
316
|
+
displayName: 'ID',
|
|
317
|
+
name: 'id',
|
|
318
|
+
type: 'number',
|
|
319
|
+
default: 0,
|
|
320
|
+
description: 'The internal CiviCRM ID of the relationship.',
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
displayName: 'Get Many Relationships',
|
|
326
|
+
name: 'getManyRelationships',
|
|
327
|
+
action: 'Get many relationships',
|
|
328
|
+
description: 'Retrieve multiple relationships.',
|
|
329
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['getMany'] } },
|
|
330
|
+
properties: [...genericFields],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
displayName: 'Create Relationship',
|
|
334
|
+
name: 'createRelationship',
|
|
335
|
+
action: 'Create a relationship',
|
|
336
|
+
description: 'Create a new relationship.',
|
|
337
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['create'] } },
|
|
338
|
+
properties: [...upsertFields],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
displayName: 'Update Relationship',
|
|
342
|
+
name: 'updateRelationship',
|
|
343
|
+
action: 'Update a relationship',
|
|
344
|
+
description: 'Update an existing relationship.',
|
|
345
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['update'] } },
|
|
346
|
+
properties: [
|
|
347
|
+
{
|
|
348
|
+
displayName: 'ID',
|
|
349
|
+
name: 'id',
|
|
350
|
+
type: 'number',
|
|
351
|
+
default: 0,
|
|
352
|
+
description: 'The ID of the relationship to update.',
|
|
353
|
+
},
|
|
354
|
+
...upsertFields,
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
displayName: 'Delete Relationship',
|
|
359
|
+
name: 'deleteRelationship',
|
|
360
|
+
action: 'Delete a relationship',
|
|
361
|
+
description: 'Delete a relationship.',
|
|
362
|
+
displayOptions: { show: { resource: ['relationship'], operation: ['delete'] } },
|
|
363
|
+
properties: [
|
|
364
|
+
{
|
|
365
|
+
displayName: 'ID',
|
|
366
|
+
name: 'id',
|
|
367
|
+
type: 'number',
|
|
368
|
+
default: 0,
|
|
369
|
+
description: 'The ID of the relationship to delete.',
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
// ======================================================================
|
|
375
|
+
// ACTIVITY
|
|
376
|
+
// ======================================================================
|
|
377
|
+
{
|
|
378
|
+
displayName: 'Get Activity',
|
|
379
|
+
name: 'getActivity',
|
|
380
|
+
action: 'Get an activity',
|
|
381
|
+
description: 'Retrieve an activity by ID.',
|
|
382
|
+
displayOptions: { show: { resource: ['activity'], operation: ['get'] } },
|
|
383
|
+
properties: [
|
|
384
|
+
{
|
|
385
|
+
displayName: 'ID',
|
|
386
|
+
name: 'id',
|
|
387
|
+
type: 'number',
|
|
388
|
+
default: 0,
|
|
389
|
+
description: 'The internal CiviCRM ID of the activity.',
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
displayName: 'Get Many Activities',
|
|
395
|
+
name: 'getManyActivities',
|
|
396
|
+
action: 'Get many activities',
|
|
397
|
+
description: 'Retrieve multiple activities.',
|
|
398
|
+
displayOptions: { show: { resource: ['activity'], operation: ['getMany'] } },
|
|
399
|
+
properties: [...genericFields],
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
displayName: 'Create Activity',
|
|
403
|
+
name: 'createActivity',
|
|
404
|
+
action: 'Create an activity',
|
|
405
|
+
description: 'Create a new activity.',
|
|
406
|
+
displayOptions: { show: { resource: ['activity'], operation: ['create'] } },
|
|
407
|
+
properties: [...upsertFields],
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
displayName: 'Update Activity',
|
|
411
|
+
name: 'updateActivity',
|
|
412
|
+
action: 'Update an activity',
|
|
413
|
+
description: 'Update an existing activity.',
|
|
414
|
+
displayOptions: { show: { resource: ['activity'], operation: ['update'] } },
|
|
415
|
+
properties: [
|
|
416
|
+
{
|
|
417
|
+
displayName: 'ID',
|
|
418
|
+
name: 'id',
|
|
419
|
+
type: 'number',
|
|
420
|
+
default: 0,
|
|
421
|
+
description: 'The ID of the activity to update.',
|
|
422
|
+
},
|
|
423
|
+
...upsertFields,
|
|
424
|
+
],
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
displayName: 'Delete Activity',
|
|
428
|
+
name: 'deleteActivity',
|
|
429
|
+
action: 'Delete an activity',
|
|
430
|
+
description: 'Delete an activity.',
|
|
431
|
+
displayOptions: { show: { resource: ['activity'], operation: ['delete'] } },
|
|
432
|
+
properties: [
|
|
433
|
+
{
|
|
434
|
+
displayName: 'ID',
|
|
435
|
+
name: 'id',
|
|
436
|
+
type: 'number',
|
|
437
|
+
default: 0,
|
|
438
|
+
description: 'The ID of the activity to delete.',
|
|
439
|
+
},
|
|
440
|
+
],
|
|
441
|
+
},
|
|
442
|
+
],
|
|
93
443
|
credentials: [{ name: 'civiCrmApi', required: true }],
|
|
94
444
|
|
|
95
445
|
properties: [
|
|
@@ -107,6 +457,7 @@ export class CiviCrm implements INodeType {
|
|
|
107
457
|
name: 'contactType',
|
|
108
458
|
type: 'options',
|
|
109
459
|
default: 'Individual',
|
|
460
|
+
description: 'Type of contact to create or search for.',
|
|
110
461
|
options: [
|
|
111
462
|
{ name: 'Individual', value: 'Individual' },
|
|
112
463
|
{ name: 'Organization', value: 'Organization' },
|
|
@@ -123,6 +474,7 @@ export class CiviCrm implements INodeType {
|
|
|
123
474
|
name: 'emailLocation',
|
|
124
475
|
type: 'options',
|
|
125
476
|
default: 'Work',
|
|
477
|
+
description: 'Location type for the email address.',
|
|
126
478
|
options: [
|
|
127
479
|
{ name: 'Home', value: 'Home' },
|
|
128
480
|
{ name: 'Work', value: 'Work' },
|
|
@@ -135,6 +487,7 @@ export class CiviCrm implements INodeType {
|
|
|
135
487
|
name: 'phoneLocation',
|
|
136
488
|
type: 'options',
|
|
137
489
|
default: 'Work',
|
|
490
|
+
description: 'Location type for the phone number.',
|
|
138
491
|
options: [
|
|
139
492
|
{ name: 'Home', value: 'Home' },
|
|
140
493
|
{ name: 'Work', value: 'Work' },
|
|
@@ -148,6 +501,7 @@ export class CiviCrm implements INodeType {
|
|
|
148
501
|
name: 'addressLocation',
|
|
149
502
|
type: 'options',
|
|
150
503
|
default: 'Home',
|
|
504
|
+
description: 'Location type for the address.',
|
|
151
505
|
options: [
|
|
152
506
|
{ name: 'Home', value: 'Home' },
|
|
153
507
|
{ name: 'Work', value: 'Work' },
|
|
@@ -165,6 +519,7 @@ export class CiviCrm implements INodeType {
|
|
|
165
519
|
name: 'isPrimary',
|
|
166
520
|
type: 'boolean',
|
|
167
521
|
default: true,
|
|
522
|
+
description: 'Whether this should be the primary email/phone/address for the contact.',
|
|
168
523
|
displayOptions: { show: { resource: ['contact'], operation: ['create', 'update'] } },
|
|
169
524
|
},
|
|
170
525
|
|
|
@@ -177,6 +532,7 @@ export class CiviCrm implements INodeType {
|
|
|
177
532
|
type: 'number',
|
|
178
533
|
default: 0,
|
|
179
534
|
required: true,
|
|
535
|
+
description: 'The internal CiviCRM ID of the entity.',
|
|
180
536
|
displayOptions: {
|
|
181
537
|
show: {
|
|
182
538
|
operation: ['get', 'update', 'delete'],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export const genericFields: INodeProperties[] = [
|
|
3
|
-
{ displayName: 'Return All', name: 'returnAll', type: 'boolean', default: false, displayOptions: { show: { operation: ['getMany'] } } },
|
|
4
|
-
{ displayName: 'Limit', name: 'limit', type: 'number', typeOptions: { minValue: 1, maxValue: 1000 }, default: 100, displayOptions: { show: { operation: ['getMany'], returnAll: [false] } } },
|
|
5
|
-
{ displayName: 'Where (JSON)', name: 'whereJson', type: 'string', default: '', placeholder: `[["first_name","=","Alice"]]`, displayOptions: { show: { operation: ['getMany'] } } },
|
|
3
|
+
{ displayName: 'Return All', name: 'returnAll', type: 'boolean', default: false, description: 'Whether to return all results or only up to a given limit.', displayOptions: { show: { operation: ['getMany'] } } },
|
|
4
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', typeOptions: { minValue: 1, maxValue: 1000 }, default: 100, description: 'Max number of results to return.', displayOptions: { show: { operation: ['getMany'], returnAll: [false] } } },
|
|
5
|
+
{ displayName: 'Where (JSON)', name: 'whereJson', type: 'string', default: '', placeholder: `[["first_name","=","Alice"]]`, description: 'JSON array of arrays for filtering. Example: [["first_name","=","Alice"], ["contact_type","=","Individual"]]', displayOptions: { show: { operation: ['getMany'] } } },
|
|
6
6
|
];
|
|
7
7
|
export const upsertFields: INodeProperties[] = [
|
|
8
|
-
{ displayName: 'Fields', name: 'fields', type: 'fixedCollection', typeOptions: { multipleValues: true }, default: {}, options: [{ name:'field', displayName:'Field', values:[{displayName:'Name',name:'fieldName',type:'string',default:''},{displayName:'Value',name:'fieldValue',type:'string',default:''}]}], displayOptions: { show: { operation: ['create','update'] } } }
|
|
8
|
+
{ displayName: 'Fields', name: 'fields', type: 'fixedCollection', typeOptions: { multipleValues: true }, default: {}, description: 'Fields to set for the entity.', options: [{ name: 'field', displayName: 'Field', values: [{ displayName: 'Name', name: 'fieldName', type: 'string', default: '', description: 'Name of the field (e.g. first_name).' }, { displayName: 'Value', name: 'fieldValue', type: 'string', default: '', description: 'Value to set.' }] }], displayOptions: { show: { operation: ['create', 'update'] } } }
|
|
9
9
|
];
|
|
@@ -10,6 +10,7 @@ export const resourceProp: INodeProperties = {
|
|
|
10
10
|
name: 'resource',
|
|
11
11
|
type: 'options',
|
|
12
12
|
default: 'contact',
|
|
13
|
+
description: 'The entity to operate on. Choose "Custom API Call" to access any CiviCRM APIv4 entity not listed.',
|
|
13
14
|
options: [
|
|
14
15
|
{ name: 'Contact', value: 'contact' },
|
|
15
16
|
{ name: 'Membership', value: 'membership' },
|
|
@@ -31,6 +32,7 @@ export const operationProp: INodeProperties = {
|
|
|
31
32
|
type: 'options',
|
|
32
33
|
default: 'getMany',
|
|
33
34
|
noDataExpression: true,
|
|
35
|
+
description: 'The action to perform on the selected resource.',
|
|
34
36
|
options: [
|
|
35
37
|
{ name: 'Create', value: 'create' },
|
|
36
38
|
{ name: 'Delete', value: 'delete' },
|