n8n-nodes-perfexcrm 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,569 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ticketFields = exports.ticketOperations = void 0;
4
+ exports.ticketOperations = [
5
+ {
6
+ displayName: 'Operation',
7
+ name: 'operation',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ displayOptions: {
11
+ show: {
12
+ resource: ['ticket'],
13
+ },
14
+ },
15
+ options: [
16
+ {
17
+ name: 'Add Reply',
18
+ value: 'addReply',
19
+ description: 'Add a reply to a ticket',
20
+ action: 'Add reply to ticket',
21
+ },
22
+ {
23
+ name: 'Create',
24
+ value: 'create',
25
+ description: 'Create a new ticket',
26
+ action: 'Create a ticket',
27
+ },
28
+ {
29
+ name: 'Delete',
30
+ value: 'delete',
31
+ description: 'Delete a ticket',
32
+ action: 'Delete a ticket',
33
+ },
34
+ {
35
+ name: 'Get',
36
+ value: 'get',
37
+ description: 'Get a ticket',
38
+ action: 'Get a ticket',
39
+ },
40
+ {
41
+ name: 'Get Many',
42
+ value: 'getAll',
43
+ description: 'Get many tickets',
44
+ action: 'Get many tickets',
45
+ },
46
+ {
47
+ name: 'Update',
48
+ value: 'update',
49
+ description: 'Update a ticket',
50
+ action: 'Update a ticket',
51
+ },
52
+ ],
53
+ default: 'create',
54
+ },
55
+ ];
56
+ exports.ticketFields = [
57
+ /* -------------------------------------------------------------------------- */
58
+ /* ticket:create */
59
+ /* -------------------------------------------------------------------------- */
60
+ {
61
+ displayName: 'Subject',
62
+ name: 'subject',
63
+ type: 'string',
64
+ required: true,
65
+ default: '',
66
+ displayOptions: {
67
+ show: {
68
+ resource: ['ticket'],
69
+ operation: ['create'],
70
+ },
71
+ },
72
+ description: 'Ticket subject',
73
+ },
74
+ {
75
+ displayName: 'Department',
76
+ name: 'department',
77
+ type: 'string',
78
+ required: true,
79
+ default: '',
80
+ displayOptions: {
81
+ show: {
82
+ resource: ['ticket'],
83
+ operation: ['create'],
84
+ },
85
+ },
86
+ description: 'Department ID',
87
+ },
88
+ {
89
+ displayName: 'Additional Fields',
90
+ name: 'additionalFields',
91
+ type: 'collection',
92
+ placeholder: 'Add Field',
93
+ default: {},
94
+ displayOptions: {
95
+ show: {
96
+ resource: ['ticket'],
97
+ operation: ['create'],
98
+ },
99
+ },
100
+ options: [
101
+ {
102
+ displayName: 'Message',
103
+ name: 'message',
104
+ type: 'string',
105
+ typeOptions: {
106
+ alwaysOpenEditWindow: true,
107
+ },
108
+ default: '',
109
+ description: 'Ticket message',
110
+ },
111
+ {
112
+ displayName: 'Priority',
113
+ name: 'priority',
114
+ type: 'options',
115
+ options: [
116
+ {
117
+ name: 'Low',
118
+ value: 1,
119
+ },
120
+ {
121
+ name: 'Medium',
122
+ value: 2,
123
+ },
124
+ {
125
+ name: 'High',
126
+ value: 3,
127
+ },
128
+ {
129
+ name: 'Urgent',
130
+ value: 4,
131
+ },
132
+ ],
133
+ default: 2,
134
+ description: 'Ticket priority',
135
+ },
136
+ {
137
+ displayName: 'Status',
138
+ name: 'status',
139
+ type: 'options',
140
+ options: [
141
+ {
142
+ name: 'Open',
143
+ value: 1,
144
+ },
145
+ {
146
+ name: 'In Progress',
147
+ value: 2,
148
+ },
149
+ {
150
+ name: 'Answered',
151
+ value: 3,
152
+ },
153
+ {
154
+ name: 'On Hold',
155
+ value: 4,
156
+ },
157
+ {
158
+ name: 'Closed',
159
+ value: 5,
160
+ },
161
+ ],
162
+ default: 1,
163
+ description: 'Ticket status',
164
+ },
165
+ {
166
+ displayName: 'Customer ID',
167
+ name: 'userid',
168
+ type: 'string',
169
+ default: '',
170
+ description: 'Customer ID',
171
+ },
172
+ {
173
+ displayName: 'Contact ID',
174
+ name: 'contactid',
175
+ type: 'string',
176
+ default: '',
177
+ description: 'Contact ID',
178
+ },
179
+ {
180
+ displayName: 'Email',
181
+ name: 'email',
182
+ type: 'string',
183
+ default: '',
184
+ description: 'Email address',
185
+ },
186
+ {
187
+ displayName: 'Name',
188
+ name: 'name',
189
+ type: 'string',
190
+ default: '',
191
+ description: 'Name',
192
+ },
193
+ {
194
+ displayName: 'Service',
195
+ name: 'service',
196
+ type: 'string',
197
+ default: '',
198
+ description: 'Service ID',
199
+ },
200
+ {
201
+ displayName: 'Assigned',
202
+ name: 'assigned',
203
+ type: 'string',
204
+ default: '',
205
+ description: 'Staff ID to assign ticket to',
206
+ },
207
+ ],
208
+ },
209
+ /* -------------------------------------------------------------------------- */
210
+ /* ticket:get */
211
+ /* -------------------------------------------------------------------------- */
212
+ {
213
+ displayName: 'Ticket ID',
214
+ name: 'ticketId',
215
+ type: 'string',
216
+ required: true,
217
+ default: '',
218
+ displayOptions: {
219
+ show: {
220
+ resource: ['ticket'],
221
+ operation: ['get'],
222
+ },
223
+ },
224
+ description: 'The ID of the ticket',
225
+ },
226
+ {
227
+ displayName: 'Options',
228
+ name: 'options',
229
+ type: 'collection',
230
+ placeholder: 'Add Option',
231
+ default: {},
232
+ displayOptions: {
233
+ show: {
234
+ resource: ['ticket'],
235
+ operation: ['get'],
236
+ },
237
+ },
238
+ options: [
239
+ {
240
+ displayName: 'Include Replies',
241
+ name: 'includeReplies',
242
+ type: 'boolean',
243
+ default: false,
244
+ description: 'Whether to include ticket replies',
245
+ },
246
+ ],
247
+ },
248
+ /* -------------------------------------------------------------------------- */
249
+ /* ticket:getAll */
250
+ /* -------------------------------------------------------------------------- */
251
+ {
252
+ displayName: 'Return All',
253
+ name: 'returnAll',
254
+ type: 'boolean',
255
+ displayOptions: {
256
+ show: {
257
+ resource: ['ticket'],
258
+ operation: ['getAll'],
259
+ },
260
+ },
261
+ default: false,
262
+ description: 'Whether to return all results or only up to a given limit',
263
+ },
264
+ {
265
+ displayName: 'Limit',
266
+ name: 'limit',
267
+ type: 'number',
268
+ displayOptions: {
269
+ show: {
270
+ resource: ['ticket'],
271
+ operation: ['getAll'],
272
+ returnAll: [false],
273
+ },
274
+ },
275
+ typeOptions: {
276
+ minValue: 1,
277
+ },
278
+ default: 50,
279
+ description: 'Max number of results to return',
280
+ },
281
+ {
282
+ displayName: 'Filters',
283
+ name: 'filters',
284
+ type: 'collection',
285
+ placeholder: 'Add Filter',
286
+ default: {},
287
+ displayOptions: {
288
+ show: {
289
+ resource: ['ticket'],
290
+ operation: ['getAll'],
291
+ },
292
+ },
293
+ options: [
294
+ {
295
+ displayName: 'Status',
296
+ name: 'status',
297
+ type: 'options',
298
+ options: [
299
+ {
300
+ name: 'All',
301
+ value: '',
302
+ },
303
+ {
304
+ name: 'Open',
305
+ value: 'open',
306
+ },
307
+ {
308
+ name: 'In Progress',
309
+ value: '2',
310
+ },
311
+ {
312
+ name: 'Answered',
313
+ value: '3',
314
+ },
315
+ {
316
+ name: 'On Hold',
317
+ value: '4',
318
+ },
319
+ {
320
+ name: 'Closed',
321
+ value: '5',
322
+ },
323
+ ],
324
+ default: '',
325
+ description: 'Filter by status',
326
+ },
327
+ {
328
+ displayName: 'Department',
329
+ name: 'department',
330
+ type: 'string',
331
+ default: '',
332
+ description: 'Department ID',
333
+ },
334
+ {
335
+ displayName: 'Priority',
336
+ name: 'priority',
337
+ type: 'options',
338
+ options: [
339
+ {
340
+ name: 'All',
341
+ value: '',
342
+ },
343
+ {
344
+ name: 'Low',
345
+ value: '1',
346
+ },
347
+ {
348
+ name: 'Medium',
349
+ value: '2',
350
+ },
351
+ {
352
+ name: 'High',
353
+ value: '3',
354
+ },
355
+ {
356
+ name: 'Urgent',
357
+ value: '4',
358
+ },
359
+ ],
360
+ default: '',
361
+ description: 'Filter by priority',
362
+ },
363
+ {
364
+ displayName: 'Customer ID',
365
+ name: 'customer_id',
366
+ type: 'string',
367
+ default: '',
368
+ description: 'Filter by customer ID',
369
+ },
370
+ ],
371
+ },
372
+ /* -------------------------------------------------------------------------- */
373
+ /* ticket:update */
374
+ /* -------------------------------------------------------------------------- */
375
+ {
376
+ displayName: 'Ticket ID',
377
+ name: 'ticketId',
378
+ type: 'string',
379
+ required: true,
380
+ default: '',
381
+ displayOptions: {
382
+ show: {
383
+ resource: ['ticket'],
384
+ operation: ['update'],
385
+ },
386
+ },
387
+ description: 'The ID of the ticket',
388
+ },
389
+ {
390
+ displayName: 'Update Fields',
391
+ name: 'updateFields',
392
+ type: 'collection',
393
+ placeholder: 'Add Field',
394
+ default: {},
395
+ displayOptions: {
396
+ show: {
397
+ resource: ['ticket'],
398
+ operation: ['update'],
399
+ },
400
+ },
401
+ options: [
402
+ {
403
+ displayName: 'Subject',
404
+ name: 'subject',
405
+ type: 'string',
406
+ default: '',
407
+ description: 'Ticket subject',
408
+ },
409
+ {
410
+ displayName: 'Department',
411
+ name: 'department',
412
+ type: 'string',
413
+ default: '',
414
+ description: 'Department ID',
415
+ },
416
+ {
417
+ displayName: 'Priority',
418
+ name: 'priority',
419
+ type: 'options',
420
+ options: [
421
+ {
422
+ name: 'Low',
423
+ value: 1,
424
+ },
425
+ {
426
+ name: 'Medium',
427
+ value: 2,
428
+ },
429
+ {
430
+ name: 'High',
431
+ value: 3,
432
+ },
433
+ {
434
+ name: 'Urgent',
435
+ value: 4,
436
+ },
437
+ ],
438
+ default: 2,
439
+ description: 'Ticket priority',
440
+ },
441
+ {
442
+ displayName: 'Status',
443
+ name: 'status',
444
+ type: 'options',
445
+ options: [
446
+ {
447
+ name: 'Open',
448
+ value: 1,
449
+ },
450
+ {
451
+ name: 'In Progress',
452
+ value: 2,
453
+ },
454
+ {
455
+ name: 'Answered',
456
+ value: 3,
457
+ },
458
+ {
459
+ name: 'On Hold',
460
+ value: 4,
461
+ },
462
+ {
463
+ name: 'Closed',
464
+ value: 5,
465
+ },
466
+ ],
467
+ default: 1,
468
+ description: 'Ticket status',
469
+ },
470
+ {
471
+ displayName: 'Message',
472
+ name: 'message',
473
+ type: 'string',
474
+ typeOptions: {
475
+ alwaysOpenEditWindow: true,
476
+ },
477
+ default: '',
478
+ description: 'Ticket message',
479
+ },
480
+ {
481
+ displayName: 'Assigned',
482
+ name: 'assigned',
483
+ type: 'string',
484
+ default: '',
485
+ description: 'Staff ID to assign ticket to',
486
+ },
487
+ ],
488
+ },
489
+ /* -------------------------------------------------------------------------- */
490
+ /* ticket:delete */
491
+ /* -------------------------------------------------------------------------- */
492
+ {
493
+ displayName: 'Ticket ID',
494
+ name: 'ticketId',
495
+ type: 'string',
496
+ required: true,
497
+ default: '',
498
+ displayOptions: {
499
+ show: {
500
+ resource: ['ticket'],
501
+ operation: ['delete'],
502
+ },
503
+ },
504
+ description: 'The ID of the ticket',
505
+ },
506
+ /* -------------------------------------------------------------------------- */
507
+ /* ticket:addReply */
508
+ /* -------------------------------------------------------------------------- */
509
+ {
510
+ displayName: 'Ticket ID',
511
+ name: 'ticketId',
512
+ type: 'string',
513
+ required: true,
514
+ default: '',
515
+ displayOptions: {
516
+ show: {
517
+ resource: ['ticket'],
518
+ operation: ['addReply'],
519
+ },
520
+ },
521
+ description: 'The ID of the ticket',
522
+ },
523
+ {
524
+ displayName: 'Message',
525
+ name: 'message',
526
+ type: 'string',
527
+ typeOptions: {
528
+ alwaysOpenEditWindow: true,
529
+ },
530
+ required: true,
531
+ default: '',
532
+ displayOptions: {
533
+ show: {
534
+ resource: ['ticket'],
535
+ operation: ['addReply'],
536
+ },
537
+ },
538
+ description: 'Reply message',
539
+ },
540
+ {
541
+ displayName: 'Additional Fields',
542
+ name: 'additionalFields',
543
+ type: 'collection',
544
+ placeholder: 'Add Field',
545
+ default: {},
546
+ displayOptions: {
547
+ show: {
548
+ resource: ['ticket'],
549
+ operation: ['addReply'],
550
+ },
551
+ },
552
+ options: [
553
+ {
554
+ displayName: 'Name',
555
+ name: 'name',
556
+ type: 'string',
557
+ default: '',
558
+ description: 'Name of the person replying',
559
+ },
560
+ {
561
+ displayName: 'Email',
562
+ name: 'email',
563
+ type: 'string',
564
+ default: '',
565
+ description: 'Email of the person replying',
566
+ },
567
+ ],
568
+ },
569
+ ];
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "n8n-nodes-perfexcrm",
3
+ "version": "0.1.0",
4
+ "description": "n8n nodes for PerfexCRM API and Webhooks integration",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n",
8
+ "perfexcrm",
9
+ "crm",
10
+ "api",
11
+ "webhooks"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://github.com/obstechnologies/n8n-nodes-perfexcrm",
15
+ "author": {
16
+ "name": "OBS Technologies",
17
+ "email": "support@obstechnologies.com"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/obstechnologies/n8n-nodes-perfexcrm.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/obstechnologies/n8n-nodes-perfexcrm/issues"
25
+ },
26
+ "engines": {
27
+ "node": ">=14.0.0"
28
+ },
29
+ "main": "index.js",
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "dev": "tsc --watch",
33
+ "format": "prettier nodes/**/*.ts credentials/**/*.ts --write",
34
+ "lint": "eslint nodes/**/*.ts credentials/**/*.ts --ext .ts",
35
+ "lintfix": "eslint nodes/**/*.ts credentials/**/*.ts --ext .ts --fix",
36
+ "prepublishOnly": "npm run build"
37
+ },
38
+ "files": [
39
+ "dist"
40
+ ],
41
+ "n8n": {
42
+ "n8nNodesApiVersion": 1,
43
+ "credentials": [
44
+ "dist/credentials/PerfexCrmApi.credentials.js"
45
+ ],
46
+ "nodes": [
47
+ "dist/nodes/PerfexCrm/PerfexCrm.node.js",
48
+ "dist/nodes/PerfexCrm/PerfexCrmTrigger.node.js"
49
+ ]
50
+ },
51
+ "devDependencies": {
52
+ "@types/express": "^4.17.6",
53
+ "@types/request-promise-native": "~1.0.15",
54
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
55
+ "@typescript-eslint/parser": "^5.29.0",
56
+ "eslint": "^8.0.0",
57
+ "eslint-plugin-n8n-nodes-base": "^1.5.4",
58
+ "n8n-core": "^1.0.0",
59
+ "n8n-workflow": "^1.0.0",
60
+ "prettier": "^2.7.1",
61
+ "typescript": "^4.8.4"
62
+ }
63
+ }