@crono-one/n8n-nodes-crono-public-api 0.1.3 → 1.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.
@@ -110,6 +110,7 @@ class CronoPublicApi {
110
110
  { name: 'Pipeline', value: 'pipeline' },
111
111
  { name: 'Strategy', value: 'strategy' },
112
112
  { name: 'Task', value: 'task' },
113
+ { name: 'Template', value: 'template' },
113
114
  { name: 'User', value: 'user' },
114
115
  ],
115
116
  default: 'company',
@@ -220,7 +221,21 @@ class CronoPublicApi {
220
221
  displayOptions: {
221
222
  show: { resource: ['list'] },
222
223
  },
223
- options: [{ name: 'Search', value: 'search', action: 'Search lists' }],
224
+ options: [
225
+ { name: 'Add Companies', value: 'addCompanies', action: 'Add companies to a list' },
226
+ { name: 'Add Contacts', value: 'addContacts', action: 'Add contacts to a list' },
227
+ { name: 'Add Sequences', value: 'addSequences', action: 'Add sequences to a list' },
228
+ { name: 'Add Templates', value: 'addTemplates', action: 'Add templates to a list' },
229
+ { name: 'Create', value: 'create', action: 'Create a list' },
230
+ { name: 'Delete', value: 'delete', action: 'Delete a list' },
231
+ { name: 'Get', value: 'get', action: 'Get a list' },
232
+ { name: 'Remove Companies', value: 'removeCompanies', action: 'Remove companies from a list' },
233
+ { name: 'Remove Contacts', value: 'removeContacts', action: 'Remove contacts from a list' },
234
+ { name: 'Remove Sequences', value: 'removeSequences', action: 'Remove sequences from a list' },
235
+ { name: 'Remove Templates', value: 'removeTemplates', action: 'Remove templates from a list' },
236
+ { name: 'Search', value: 'search', action: 'Search lists' },
237
+ { name: 'Update', value: 'update', action: 'Update a list' },
238
+ ],
224
239
  default: 'search',
225
240
  },
226
241
  {
@@ -243,8 +258,32 @@ class CronoPublicApi {
243
258
  show: { resource: ['strategy'] },
244
259
  },
245
260
  options: [
261
+ {
262
+ name: 'Add Contacts',
263
+ value: 'addContacts',
264
+ action: 'Add contacts to a strategy',
265
+ },
246
266
  { name: 'Search', value: 'search', action: 'Search strategies' },
247
267
  { name: 'Search Details', value: 'searchDetails', action: 'Search strategy details' },
268
+ {
269
+ name: 'Stop Contact Sequence',
270
+ value: 'stopContactSequence',
271
+ action: 'Stop sequence for a contact',
272
+ },
273
+ ],
274
+ default: 'search',
275
+ },
276
+ {
277
+ displayName: 'Operation',
278
+ name: 'operation',
279
+ type: 'options',
280
+ noDataExpression: true,
281
+ displayOptions: {
282
+ show: { resource: ['template'] },
283
+ },
284
+ options: [
285
+ { name: 'Get', value: 'get', action: 'Get a template' },
286
+ { name: 'Search', value: 'search', action: 'Search templates' },
248
287
  ],
249
288
  default: 'search',
250
289
  },
@@ -296,7 +335,20 @@ class CronoPublicApi {
296
335
  required: true,
297
336
  displayOptions: {
298
337
  show: {
299
- resource: ['company', 'contact', 'deal', 'note', 'activity'],
338
+ resource: ['company', 'contact', 'deal', 'note', 'activity', 'template'],
339
+ operation: ['get'],
340
+ },
341
+ },
342
+ },
343
+ {
344
+ displayName: 'List ID',
345
+ name: 'listId',
346
+ type: 'number',
347
+ default: 0,
348
+ required: true,
349
+ displayOptions: {
350
+ show: {
351
+ resource: ['list'],
300
352
  operation: ['get'],
301
353
  },
302
354
  },
@@ -383,6 +435,7 @@ class CronoPublicApi {
383
435
  'activity',
384
436
  'list',
385
437
  'strategy',
438
+ 'template',
386
439
  'externalProperty',
387
440
  'user',
388
441
  'task',
@@ -407,6 +460,7 @@ class CronoPublicApi {
407
460
  'activity',
408
461
  'list',
409
462
  'strategy',
463
+ 'template',
410
464
  'externalProperty',
411
465
  'user',
412
466
  'task',
@@ -424,8 +478,8 @@ class CronoPublicApi {
424
478
  default: false,
425
479
  displayOptions: {
426
480
  show: {
427
- resource: ['company', 'contact', 'deal', 'note', 'task'],
428
- operation: ['create', 'update', 'import'],
481
+ resource: ['company', 'contact', 'deal', 'note', 'task', 'list', 'strategy'],
482
+ operation: ['create', 'update', 'import', 'addContacts', 'stopContactSequence'],
429
483
  },
430
484
  },
431
485
  description: 'Whether to send a raw JSON data payload',
@@ -437,8 +491,8 @@ class CronoPublicApi {
437
491
  default: {},
438
492
  displayOptions: {
439
493
  show: {
440
- resource: ['company', 'contact', 'deal', 'note', 'task'],
441
- operation: ['create', 'update', 'import'],
494
+ resource: ['company', 'contact', 'deal', 'note', 'task', 'list', 'strategy'],
495
+ operation: ['create', 'update', 'import', 'addContacts', 'stopContactSequence'],
442
496
  useRawJsonData: [true],
443
497
  },
444
498
  },
@@ -455,8 +509,8 @@ class CronoPublicApi {
455
509
  default: [],
456
510
  displayOptions: {
457
511
  show: {
458
- resource: ['company', 'contact', 'deal', 'note', 'task'],
459
- operation: ['create', 'update', 'import'],
512
+ resource: ['company', 'contact', 'deal', 'note', 'task', 'list', 'strategy'],
513
+ operation: ['create', 'update', 'import', 'addContacts', 'stopContactSequence'],
460
514
  useRawJsonData: [false],
461
515
  },
462
516
  },
@@ -495,6 +549,7 @@ class CronoPublicApi {
495
549
  'activity',
496
550
  'list',
497
551
  'strategy',
552
+ 'template',
498
553
  'externalProperty',
499
554
  'user',
500
555
  'task',
@@ -713,8 +768,8 @@ class CronoPublicApi {
713
768
  },
714
769
  },
715
770
  {
716
- displayName: 'Owner ID',
717
- name: 'companyCreateOwnerId',
771
+ displayName: 'User ID',
772
+ name: 'companyCreateUserId',
718
773
  type: 'string',
719
774
  default: '',
720
775
  displayOptions: {
@@ -726,10 +781,10 @@ class CronoPublicApi {
726
781
  },
727
782
  },
728
783
  {
729
- displayName: 'User ID',
730
- name: 'companyCreateUserId',
731
- type: 'number',
732
- default: 0,
784
+ displayName: 'Generate AI Variables (JSON)',
785
+ name: 'companyCreateGenerateAiVariables',
786
+ type: 'json',
787
+ default: {},
733
788
  displayOptions: {
734
789
  show: {
735
790
  resource: ['company'],
@@ -737,6 +792,7 @@ class CronoPublicApi {
737
792
  useRawJsonData: [false],
738
793
  },
739
794
  },
795
+ description: 'Generate AI variables request payload',
740
796
  },
741
797
  {
742
798
  displayName: 'Name',
@@ -879,8 +935,8 @@ class CronoPublicApi {
879
935
  {
880
936
  displayName: 'User ID',
881
937
  name: 'companyUpdateUserId',
882
- type: 'number',
883
- default: 0,
938
+ type: 'string',
939
+ default: '',
884
940
  displayOptions: {
885
941
  show: {
886
942
  resource: ['company'],
@@ -1405,8 +1461,8 @@ class CronoPublicApi {
1405
1461
  {
1406
1462
  displayName: 'User ID',
1407
1463
  name: 'contactCreateUserId',
1408
- type: 'number',
1409
- default: 0,
1464
+ type: 'string',
1465
+ default: '',
1410
1466
  displayOptions: {
1411
1467
  show: {
1412
1468
  resource: ['contact'],
@@ -1571,8 +1627,8 @@ class CronoPublicApi {
1571
1627
  {
1572
1628
  displayName: 'User ID',
1573
1629
  name: 'contactUpdateUserId',
1574
- type: 'number',
1575
- default: 0,
1630
+ type: 'string',
1631
+ default: '',
1576
1632
  displayOptions: {
1577
1633
  show: {
1578
1634
  resource: ['contact'],
@@ -1954,8 +2010,8 @@ class CronoPublicApi {
1954
2010
  {
1955
2011
  displayName: 'User ID',
1956
2012
  name: 'dealCreateUserId',
1957
- type: 'number',
1958
- default: 0,
2013
+ type: 'string',
2014
+ default: '',
1959
2015
  displayOptions: {
1960
2016
  show: {
1961
2017
  resource: ['deal'],
@@ -2113,8 +2169,8 @@ class CronoPublicApi {
2113
2169
  {
2114
2170
  displayName: 'User ID',
2115
2171
  name: 'dealUpdateUserId',
2116
- type: 'number',
2117
- default: 0,
2172
+ type: 'string',
2173
+ default: '',
2118
2174
  displayOptions: {
2119
2175
  show: {
2120
2176
  resource: ['deal'],
@@ -2205,7 +2261,6 @@ class CronoPublicApi {
2205
2261
  name: 'taskCreateProspectId',
2206
2262
  type: 'string',
2207
2263
  default: '',
2208
- required: true,
2209
2264
  displayOptions: {
2210
2265
  show: {
2211
2266
  resource: ['task'],
@@ -2256,7 +2311,7 @@ class CronoPublicApi {
2256
2311
  displayName: 'Subtype',
2257
2312
  name: 'taskCreateSubtype',
2258
2313
  type: 'options',
2259
- default: 'LinkedinInvitation',
2314
+ default: '',
2260
2315
  displayOptions: {
2261
2316
  show: {
2262
2317
  resource: ['task'],
@@ -2270,6 +2325,7 @@ class CronoPublicApi {
2270
2325
  { name: 'LinkedIn Message', value: 'LinkedinMessage' },
2271
2326
  { name: 'LinkedIn Profile View', value: 'LinkedinProfileView' },
2272
2327
  { name: 'LinkedIn Voice Note', value: 'LinkedinVoiceNote' },
2328
+ { name: 'None', value: '' },
2273
2329
  ],
2274
2330
  description: 'Task subtype',
2275
2331
  },
@@ -2314,6 +2370,20 @@ class CronoPublicApi {
2314
2370
  },
2315
2371
  description: 'Opportunity ID linked to the task',
2316
2372
  },
2373
+ {
2374
+ displayName: 'Assign To User',
2375
+ name: 'taskCreateAssignToUser',
2376
+ type: 'boolean',
2377
+ default: false,
2378
+ displayOptions: {
2379
+ show: {
2380
+ resource: ['task'],
2381
+ operation: ['create'],
2382
+ useRawJsonData: [false],
2383
+ },
2384
+ },
2385
+ description: 'Whether the task should be assigned to the selected user',
2386
+ },
2317
2387
  {
2318
2388
  displayName: 'Subject',
2319
2389
  name: 'taskCreateSubject',
@@ -2464,7 +2534,7 @@ class CronoPublicApi {
2464
2534
  displayName: 'Type',
2465
2535
  name: 'taskSearchType',
2466
2536
  type: 'options',
2467
- default: 'Generic',
2537
+ default: '',
2468
2538
  displayOptions: {
2469
2539
  show: {
2470
2540
  resource: ['task'],
@@ -2478,6 +2548,7 @@ class CronoPublicApi {
2478
2548
  { name: 'Generic', value: 'Generic' },
2479
2549
  { name: 'InMail', value: 'InMail' },
2480
2550
  { name: 'LinkedIn', value: 'Linkedin' },
2551
+ { name: 'None', value: '' },
2481
2552
  ],
2482
2553
  description: 'Task type',
2483
2554
  },
@@ -2485,7 +2556,7 @@ class CronoPublicApi {
2485
2556
  displayName: 'Subtype',
2486
2557
  name: 'taskSearchSubtype',
2487
2558
  type: 'options',
2488
- default: 'LinkedinInvitation',
2559
+ default: '',
2489
2560
  displayOptions: {
2490
2561
  show: {
2491
2562
  resource: ['task'],
@@ -2499,6 +2570,7 @@ class CronoPublicApi {
2499
2570
  { name: 'LinkedIn Message', value: 'LinkedinMessage' },
2500
2571
  { name: 'LinkedIn Profile View', value: 'LinkedinProfileView' },
2501
2572
  { name: 'LinkedIn Voice Note', value: 'LinkedinVoiceNote' },
2573
+ { name: 'None', value: '' },
2502
2574
  ],
2503
2575
  description: 'Task subtype',
2504
2576
  },
@@ -2523,6 +2595,27 @@ class CronoPublicApi {
2523
2595
  ],
2524
2596
  description: 'Task types',
2525
2597
  },
2598
+ {
2599
+ displayName: 'Subtypes',
2600
+ name: 'taskSearchSubtypes',
2601
+ type: 'multiOptions',
2602
+ default: [],
2603
+ displayOptions: {
2604
+ show: {
2605
+ resource: ['task'],
2606
+ operation: ['search'],
2607
+ useRawJsonSearch: [false],
2608
+ },
2609
+ },
2610
+ options: [
2611
+ { name: 'LinkedIn Invitation', value: 'LinkedinInvitation' },
2612
+ { name: 'LinkedIn Like Last Post', value: 'LinkedinLikeLastPost' },
2613
+ { name: 'LinkedIn Message', value: 'LinkedinMessage' },
2614
+ { name: 'LinkedIn Profile View', value: 'LinkedinProfileView' },
2615
+ { name: 'LinkedIn Voice Note', value: 'LinkedinVoiceNote' },
2616
+ ],
2617
+ description: 'Task subtypes',
2618
+ },
2526
2619
  {
2527
2620
  displayName: 'Since',
2528
2621
  name: 'taskSearchSince',
@@ -2750,6 +2843,86 @@ class CronoPublicApi {
2750
2843
  },
2751
2844
  description: 'Lead external property filters',
2752
2845
  },
2846
+ {
2847
+ displayName: 'With Prospect Score',
2848
+ name: 'taskSearchWithProspectScore',
2849
+ type: 'boolean',
2850
+ default: false,
2851
+ displayOptions: {
2852
+ show: {
2853
+ resource: ['task'],
2854
+ operation: ['search'],
2855
+ useRawJsonSearch: [false],
2856
+ },
2857
+ },
2858
+ },
2859
+ {
2860
+ displayName: 'With Account Score',
2861
+ name: 'taskSearchWithAccountScore',
2862
+ type: 'boolean',
2863
+ default: false,
2864
+ displayOptions: {
2865
+ show: {
2866
+ resource: ['task'],
2867
+ operation: ['search'],
2868
+ useRawJsonSearch: [false],
2869
+ },
2870
+ },
2871
+ },
2872
+ {
2873
+ displayName: 'Lead Score Levels',
2874
+ name: 'taskSearchLeadScoreLevels',
2875
+ type: 'multiOptions',
2876
+ default: [],
2877
+ displayOptions: {
2878
+ show: {
2879
+ resource: ['task'],
2880
+ operation: ['search'],
2881
+ useRawJsonSearch: [false],
2882
+ },
2883
+ },
2884
+ options: [
2885
+ { name: 'High', value: 'High' },
2886
+ { name: 'Low', value: 'Low' },
2887
+ { name: 'Medium', value: 'Medium' },
2888
+ ],
2889
+ },
2890
+ {
2891
+ displayName: 'Prospect Score Levels',
2892
+ name: 'taskSearchProspectScoreLevels',
2893
+ type: 'multiOptions',
2894
+ default: [],
2895
+ displayOptions: {
2896
+ show: {
2897
+ resource: ['task'],
2898
+ operation: ['search'],
2899
+ useRawJsonSearch: [false],
2900
+ },
2901
+ },
2902
+ options: [
2903
+ { name: 'High', value: 'High' },
2904
+ { name: 'Low', value: 'Low' },
2905
+ { name: 'Medium', value: 'Medium' },
2906
+ ],
2907
+ },
2908
+ {
2909
+ displayName: 'Account Score Levels',
2910
+ name: 'taskSearchAccountScoreLevels',
2911
+ type: 'multiOptions',
2912
+ default: [],
2913
+ displayOptions: {
2914
+ show: {
2915
+ resource: ['task'],
2916
+ operation: ['search'],
2917
+ useRawJsonSearch: [false],
2918
+ },
2919
+ },
2920
+ options: [
2921
+ { name: 'High', value: 'High' },
2922
+ { name: 'Low', value: 'Low' },
2923
+ { name: 'Medium', value: 'Medium' },
2924
+ ],
2925
+ },
2753
2926
  {
2754
2927
  displayName: 'Name',
2755
2928
  name: 'companySearchName',
@@ -3215,7 +3388,7 @@ class CronoPublicApi {
3215
3388
  },
3216
3389
  },
3217
3390
  {
3218
- displayName: 'Include Tasks',
3391
+ displayName: 'Include Tasks Analytics',
3219
3392
  name: 'companySearchIncludeTasks',
3220
3393
  type: 'boolean',
3221
3394
  default: false,
@@ -3227,6 +3400,19 @@ class CronoPublicApi {
3227
3400
  },
3228
3401
  },
3229
3402
  },
3403
+ {
3404
+ displayName: 'Include User',
3405
+ name: 'companySearchIncludeUser',
3406
+ type: 'boolean',
3407
+ default: false,
3408
+ displayOptions: {
3409
+ show: {
3410
+ resource: ['company'],
3411
+ operation: ['search'],
3412
+ useRawJsonSearch: [false],
3413
+ },
3414
+ },
3415
+ },
3230
3416
  {
3231
3417
  displayName: 'Name',
3232
3418
  name: 'contactSearchName',
@@ -3272,8 +3458,8 @@ class CronoPublicApi {
3272
3458
  {
3273
3459
  displayName: 'User ID',
3274
3460
  name: 'contactSearchUserId',
3275
- type: 'number',
3276
- default: 0,
3461
+ type: 'string',
3462
+ default: '',
3277
3463
  displayOptions: {
3278
3464
  show: {
3279
3465
  resource: ['contact'],
@@ -3910,7 +4096,7 @@ class CronoPublicApi {
3910
4096
  description: 'Owner user ID',
3911
4097
  },
3912
4098
  {
3913
- displayName: 'Stage',
4099
+ displayName: 'Stages',
3914
4100
  name: 'dealSearchStage',
3915
4101
  type: 'string',
3916
4102
  default: '',
@@ -3921,7 +4107,7 @@ class CronoPublicApi {
3921
4107
  useRawJsonSearch: [false],
3922
4108
  },
3923
4109
  },
3924
- description: 'Deal stage',
4110
+ description: 'Comma-separated list of deal stages',
3925
4111
  },
3926
4112
  {
3927
4113
  displayName: 'Pipeline',
@@ -3937,20 +4123,6 @@ class CronoPublicApi {
3937
4123
  },
3938
4124
  description: 'Deal pipeline',
3939
4125
  },
3940
- {
3941
- displayName: 'Object IDs',
3942
- name: 'dealSearchObjectIds',
3943
- type: 'string',
3944
- default: '',
3945
- displayOptions: {
3946
- show: {
3947
- resource: ['deal'],
3948
- operation: ['search'],
3949
- useRawJsonSearch: [false],
3950
- },
3951
- },
3952
- description: 'Comma-separated list of deal object IDs',
3953
- },
3954
4126
  {
3955
4127
  displayName: 'Limit',
3956
4128
  name: 'dealSearchLimit',
@@ -4039,8 +4211,8 @@ class CronoPublicApi {
4039
4211
  description: 'Maximum last modified date',
4040
4212
  },
4041
4213
  {
4042
- displayName: 'Close Date Min',
4043
- name: 'dealSearchCloseDateMin',
4214
+ displayName: 'Last Activity Date Min',
4215
+ name: 'dealSearchLastActivityDateMin',
4044
4216
  type: 'dateTime',
4045
4217
  default: '',
4046
4218
  displayOptions: {
@@ -4050,11 +4222,11 @@ class CronoPublicApi {
4050
4222
  useRawJsonSearch: [false],
4051
4223
  },
4052
4224
  },
4053
- description: 'Minimum close date',
4225
+ description: 'Minimum last activity date',
4054
4226
  },
4055
4227
  {
4056
- displayName: 'Close Date Max',
4057
- name: 'dealSearchCloseDateMax',
4228
+ displayName: 'Last Activity Date Max',
4229
+ name: 'dealSearchLastActivityDateMax',
4058
4230
  type: 'dateTime',
4059
4231
  default: '',
4060
4232
  displayOptions: {
@@ -4064,53 +4236,13 @@ class CronoPublicApi {
4064
4236
  useRawJsonSearch: [false],
4065
4237
  },
4066
4238
  },
4067
- description: 'Maximum close date',
4068
- },
4069
- {
4070
- displayName: 'Is Closed',
4071
- name: 'dealSearchIsClosed',
4072
- type: 'boolean',
4073
- default: false,
4074
- displayOptions: {
4075
- show: {
4076
- resource: ['deal'],
4077
- operation: ['search'],
4078
- useRawJsonSearch: [false],
4079
- },
4080
- },
4081
- },
4082
- {
4083
- displayName: 'Is Won',
4084
- name: 'dealSearchIsWon',
4085
- type: 'boolean',
4086
- default: false,
4087
- displayOptions: {
4088
- show: {
4089
- resource: ['deal'],
4090
- operation: ['search'],
4091
- useRawJsonSearch: [false],
4092
- },
4093
- },
4094
- },
4095
- {
4096
- displayName: 'Amount Min',
4097
- name: 'dealSearchAmountMin',
4098
- type: 'number',
4099
- default: 0,
4100
- displayOptions: {
4101
- show: {
4102
- resource: ['deal'],
4103
- operation: ['search'],
4104
- useRawJsonSearch: [false],
4105
- },
4106
- },
4107
- description: 'Minimum amount',
4239
+ description: 'Maximum last activity date',
4108
4240
  },
4109
4241
  {
4110
- displayName: 'Amount Max',
4111
- name: 'dealSearchAmountMax',
4112
- type: 'number',
4113
- default: 0,
4242
+ displayName: 'Close Date Min',
4243
+ name: 'dealSearchCloseDateMin',
4244
+ type: 'dateTime',
4245
+ default: '',
4114
4246
  displayOptions: {
4115
4247
  show: {
4116
4248
  resource: ['deal'],
@@ -4118,13 +4250,13 @@ class CronoPublicApi {
4118
4250
  useRawJsonSearch: [false],
4119
4251
  },
4120
4252
  },
4121
- description: 'Maximum amount',
4253
+ description: 'Minimum close date',
4122
4254
  },
4123
4255
  {
4124
- displayName: 'Active',
4125
- name: 'dealSearchActive',
4126
- type: 'boolean',
4127
- default: false,
4256
+ displayName: 'Close Date Max',
4257
+ name: 'dealSearchCloseDateMax',
4258
+ type: 'dateTime',
4259
+ default: '',
4128
4260
  displayOptions: {
4129
4261
  show: {
4130
4262
  resource: ['deal'],
@@ -4132,6 +4264,7 @@ class CronoPublicApi {
4132
4264
  useRawJsonSearch: [false],
4133
4265
  },
4134
4266
  },
4267
+ description: 'Maximum close date',
4135
4268
  },
4136
4269
  {
4137
4270
  displayName: 'Year',
@@ -4209,21 +4342,47 @@ class CronoPublicApi {
4209
4342
  },
4210
4343
  },
4211
4344
  {
4212
- displayName: 'Description Contains',
4213
- name: 'noteSearchDescriptionContains',
4214
- type: 'string',
4215
- default: '',
4345
+ displayName: 'Include External Values',
4346
+ name: 'dealSearchIncludeExternalValues',
4347
+ type: 'boolean',
4348
+ default: false,
4216
4349
  displayOptions: {
4217
4350
  show: {
4218
- resource: ['note'],
4351
+ resource: ['deal'],
4219
4352
  operation: ['search'],
4220
4353
  useRawJsonSearch: [false],
4221
4354
  },
4222
4355
  },
4223
- description: 'Text to match in note content',
4224
4356
  },
4225
4357
  {
4226
- displayName: 'Account ID',
4358
+ displayName: 'Include User',
4359
+ name: 'dealSearchIncludeUser',
4360
+ type: 'boolean',
4361
+ default: false,
4362
+ displayOptions: {
4363
+ show: {
4364
+ resource: ['deal'],
4365
+ operation: ['search'],
4366
+ useRawJsonSearch: [false],
4367
+ },
4368
+ },
4369
+ },
4370
+ {
4371
+ displayName: 'Description Contains',
4372
+ name: 'noteSearchDescriptionContains',
4373
+ type: 'string',
4374
+ default: '',
4375
+ displayOptions: {
4376
+ show: {
4377
+ resource: ['note'],
4378
+ operation: ['search'],
4379
+ useRawJsonSearch: [false],
4380
+ },
4381
+ },
4382
+ description: 'Text to match in note content',
4383
+ },
4384
+ {
4385
+ displayName: 'Account ID',
4227
4386
  name: 'noteSearchAccountId',
4228
4387
  type: 'string',
4229
4388
  default: '',
@@ -4378,6 +4537,19 @@ class CronoPublicApi {
4378
4537
  },
4379
4538
  },
4380
4539
  },
4540
+ {
4541
+ displayName: 'Include User',
4542
+ name: 'noteSearchIncludeUser',
4543
+ type: 'boolean',
4544
+ default: false,
4545
+ displayOptions: {
4546
+ show: {
4547
+ resource: ['note'],
4548
+ operation: ['search'],
4549
+ useRawJsonSearch: [false],
4550
+ },
4551
+ },
4552
+ },
4381
4553
  {
4382
4554
  displayName: 'Include Account',
4383
4555
  name: 'noteSearchIncludeAccount',
@@ -4705,6 +4877,19 @@ class CronoPublicApi {
4705
4877
  },
4706
4878
  },
4707
4879
  },
4880
+ {
4881
+ displayName: 'Include User',
4882
+ name: 'activitySearchIncludeUser',
4883
+ type: 'boolean',
4884
+ default: false,
4885
+ displayOptions: {
4886
+ show: {
4887
+ resource: ['activity'],
4888
+ operation: ['search'],
4889
+ useRawJsonSearch: [false],
4890
+ },
4891
+ },
4892
+ },
4708
4893
  {
4709
4894
  displayName: 'Include Account',
4710
4895
  name: 'activitySearchIncludeAccount',
@@ -4770,6 +4955,19 @@ class CronoPublicApi {
4770
4955
  },
4771
4956
  },
4772
4957
  },
4958
+ {
4959
+ displayName: 'Include Template Title',
4960
+ name: 'activitySearchIncludeTemplateTitle',
4961
+ type: 'boolean',
4962
+ default: false,
4963
+ displayOptions: {
4964
+ show: {
4965
+ resource: ['activity'],
4966
+ operation: ['search'],
4967
+ useRawJsonSearch: [false],
4968
+ },
4969
+ },
4970
+ },
4773
4971
  {
4774
4972
  displayName: 'Include Prospect',
4775
4973
  name: 'activitySearchIncludeProspect',
@@ -5401,6 +5599,20 @@ class CronoPublicApi {
5401
5599
  },
5402
5600
  description: 'User email',
5403
5601
  },
5602
+ {
5603
+ displayName: 'Name',
5604
+ name: 'userSearchName',
5605
+ type: 'string',
5606
+ default: '',
5607
+ displayOptions: {
5608
+ show: {
5609
+ resource: ['user'],
5610
+ operation: ['search'],
5611
+ useRawJsonSearch: [false],
5612
+ },
5613
+ },
5614
+ description: 'User name',
5615
+ },
5404
5616
  {
5405
5617
  displayName: 'Active',
5406
5618
  name: 'userSearchActive',
@@ -5447,173 +5659,600 @@ class CronoPublicApi {
5447
5659
  description: 'Number of results to skip',
5448
5660
  },
5449
5661
  {
5450
- displayName: 'Import Type',
5451
- name: 'importType',
5452
- type: 'options',
5662
+ displayName: 'Name',
5663
+ name: 'listCreateName',
5664
+ type: 'string',
5453
5665
  default: '',
5666
+ required: true,
5454
5667
  displayOptions: {
5455
5668
  show: {
5456
- resource: ['import'],
5457
- operation: ['getAll'],
5669
+ resource: ['list'],
5670
+ operation: ['create'],
5671
+ useRawJsonData: [false],
5672
+ },
5673
+ },
5674
+ description: 'List name',
5675
+ },
5676
+ {
5677
+ displayName: 'Type',
5678
+ name: 'listCreateType',
5679
+ type: 'options',
5680
+ default: 'Account',
5681
+ displayOptions: {
5682
+ show: {
5683
+ resource: ['list'],
5684
+ operation: ['create'],
5685
+ useRawJsonData: [false],
5458
5686
  },
5459
5687
  },
5460
5688
  options: [
5461
5689
  { name: 'Account', value: 'Account' },
5462
- { name: 'All', value: '' },
5463
5690
  { name: 'Lead', value: 'Lead' },
5464
- { name: 'Opportunity', value: 'Opportunity' },
5465
5691
  { name: 'Prospect', value: 'Prospect' },
5692
+ { name: 'Strategy', value: 'Strategy' },
5693
+ { name: 'Template', value: 'Template' },
5466
5694
  ],
5467
- description: 'Filter imports by table type',
5695
+ description: 'List table type',
5468
5696
  },
5469
5697
  {
5470
- displayName: 'Import Status',
5471
- name: 'importStatus',
5472
- type: 'options',
5698
+ displayName: 'Shared',
5699
+ name: 'listCreateShared',
5700
+ type: 'boolean',
5701
+ default: false,
5702
+ displayOptions: {
5703
+ show: {
5704
+ resource: ['list'],
5705
+ operation: ['create'],
5706
+ useRawJsonData: [false],
5707
+ },
5708
+ },
5709
+ description: 'Whether the list is shared',
5710
+ },
5711
+ {
5712
+ displayName: 'Shared Users IDs',
5713
+ name: 'listCreateSharedUsersIds',
5714
+ type: 'string',
5473
5715
  default: '',
5474
5716
  displayOptions: {
5475
5717
  show: {
5476
- resource: ['import'],
5477
- operation: ['getAll'],
5718
+ resource: ['list'],
5719
+ operation: ['create'],
5720
+ useRawJsonData: [false],
5478
5721
  },
5479
5722
  },
5480
- options: [
5481
- { name: 'All', value: '' },
5482
- { name: 'Completed', value: 'Completed' },
5483
- { name: 'Completed With Errors', value: 'CompletedWithErrors' },
5484
- { name: 'On Going', value: 'OnGoing' },
5485
- { name: 'Started', value: 'Started' },
5486
- { name: 'Stop Completed', value: 'StopCompleted' },
5487
- { name: 'Stop Request From User', value: 'StopRequestFromUser' },
5488
- ],
5489
- description: 'Filter imports by status',
5723
+ description: 'Comma-separated user IDs to share the list with',
5490
5724
  },
5491
- ],
5492
- };
5493
- }
5494
- async execute() {
5495
- var _a, _b;
5496
- const items = this.getInputData();
5497
- const returnData = [];
5498
- for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
5499
- const resource = this.getNodeParameter('resource', itemIndex);
5500
- const operation = this.getNodeParameter('operation', itemIndex);
5501
- const apiVersion = this.getNodeParameter('apiVersion', itemIndex, '1');
5502
- const basePath = `/api/v${apiVersion}`;
5503
- const useRawJsonData = this.getNodeParameter('useRawJsonData', itemIndex, false);
5504
- const useRawJsonSearch = this.getNodeParameter('useRawJsonSearch', itemIndex, false);
5505
- let endpoint = '';
5506
- let method = 'GET';
5507
- let qs = {};
5508
- let body;
5509
- if (operation === 'getAll') {
5510
- const limit = this.getNodeParameter('limit', itemIndex, 50);
5511
- const offset = this.getNodeParameter('offset', itemIndex, 0);
5512
- qs = { limit, offset };
5513
- }
5514
- switch (resource) {
5515
- case 'company': {
5516
- endpoint = `${basePath}/Accounts`;
5517
- if (operation === 'get') {
5518
- method = 'GET';
5519
- const objectId = this.getNodeParameter('objectId', itemIndex);
5520
- endpoint = `${endpoint}/${objectId}`;
5521
- qs = getJsonParameter(this, 'includeOptions', itemIndex);
5522
- }
5523
- else if (operation === 'getAll') {
5524
- method = 'GET';
5525
- const includeOptions = getJsonParameter(this, 'includeOptions', itemIndex);
5526
- qs = { ...qs, ...includeOptions };
5527
- }
5528
- else if (operation === 'search') {
5529
- method = 'POST';
5530
- endpoint = `${endpoint}/search`;
5531
- if (useRawJsonSearch) {
5532
- body = getJsonParameter(this, 'search', itemIndex);
5533
- }
5534
- else {
5535
- const searchBody = {};
5536
- addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('companySearchName', itemIndex, ''));
5537
- const status = this.getNodeParameter('companySearchStatus', itemIndex, []);
5538
- if (status.length) {
5539
- searchBody.Status = status;
5540
- }
5541
- const externalProperties = getJsonParameter(this, 'companySearchExternalProperties', itemIndex, {});
5542
- if (Object.keys(externalProperties).length) {
5543
- searchBody.ExternalProperties = externalProperties;
5544
- }
5545
- const externalPropertyNumericFilters = getJsonParameter(this, 'companySearchExternalPropertyNumericFilters', itemIndex, {});
5546
- if (Object.keys(externalPropertyNumericFilters).length) {
5547
- searchBody.ExternalPropertyNumericFilters = externalPropertyNumericFilters;
5548
- }
5549
- const externalPropertyEmptyIds = parseCsv(this.getNodeParameter('companySearchExternalPropertyEmptyIds', itemIndex, ''));
5550
- if (externalPropertyEmptyIds.length) {
5551
- searchBody.ExternalPropertyEmptyIds = externalPropertyEmptyIds.map((id) => parseInt(id, 10));
5552
- }
5553
- addIfNotEmpty(searchBody, 'Industry', this.getNodeParameter('companySearchIndustry', itemIndex, ''));
5554
- addIfNotEmpty(searchBody, 'Country', this.getNodeParameter('companySearchCountry', itemIndex, ''));
5555
- const numberOfEmployeesMin = this.getNodeParameter('companySearchNumberOfEmployeesMin', itemIndex, 0);
5556
- if (numberOfEmployeesMin) {
5557
- searchBody.NumberOfEmployeesMin = numberOfEmployeesMin;
5558
- }
5559
- const numberOfEmployeesMax = this.getNodeParameter('companySearchNumberOfEmployeesMax', itemIndex, 0);
5560
- if (numberOfEmployeesMax) {
5561
- searchBody.NumberOfEmployeesMax = numberOfEmployeesMax;
5562
- }
5563
- addIfNotEmpty(searchBody, 'CurrentSolution', this.getNodeParameter('companySearchCurrentSolution', itemIndex, ''));
5564
- addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('companySearchUserId', itemIndex, ''));
5565
- if (this.getNodeParameter('companySearchNoUser', itemIndex, false)) {
5566
- searchBody.NoUser = true;
5567
- }
5568
- addIfNotEmpty(searchBody, 'CreatedDateMin', this.getNodeParameter('companySearchCreatedDateMin', itemIndex, ''));
5569
- addIfNotEmpty(searchBody, 'CreatedDateMax', this.getNodeParameter('companySearchCreatedDateMax', itemIndex, ''));
5570
- addIfNotEmpty(searchBody, 'LastActivityDateMin', this.getNodeParameter('companySearchLastActivityDateMin', itemIndex, ''));
5571
- addIfNotEmpty(searchBody, 'LastActivityDateMax', this.getNodeParameter('companySearchLastActivityDateMax', itemIndex, ''));
5572
- addIfNotEmpty(searchBody, 'LastModifiedDateMin', this.getNodeParameter('companySearchLastModifiedDateMin', itemIndex, ''));
5573
- addIfNotEmpty(searchBody, 'LastModifiedDateMax', this.getNodeParameter('companySearchLastModifiedDateMax', itemIndex, ''));
5574
- if (this.getNodeParameter('companySearchHasLinkedin', itemIndex, false)) {
5575
- searchBody.HasLinkedin = true;
5576
- }
5577
- if (this.getNodeParameter('companySearchHasWebsite', itemIndex, false)) {
5578
- searchBody.HasWebsite = true;
5579
- }
5580
- if (this.getNodeParameter('companySearchHasPhone', itemIndex, false)) {
5581
- searchBody.HasPhone = true;
5582
- }
5583
- if (this.getNodeParameter('companySearchHasActivities', itemIndex, false)) {
5584
- searchBody.HasActivities = true;
5585
- }
5586
- if (this.getNodeParameter('companySearchHasReplies', itemIndex, false)) {
5587
- searchBody.HasReplies = true;
5588
- }
5589
- if (this.getNodeParameter('companySearchHasActiveTasks', itemIndex, false)) {
5590
- searchBody.HasActiveTasks = true;
5591
- }
5592
- if (this.getNodeParameter('companySearchHasEmailsOpened', itemIndex, false)) {
5593
- searchBody.HasEmailsOpened = true;
5594
- }
5595
- if (this.getNodeParameter('companySearchHasClickedLinks', itemIndex, false)) {
5596
- searchBody.HasClickedLinks = true;
5597
- }
5598
- const cleanEmptyName = this.getNodeParameter('companySearchCleanEmptyName', itemIndex, true);
5599
- searchBody.CleanEmptyName = cleanEmptyName;
5600
- addIfNotEmpty(searchBody, 'Sort', this.getNodeParameter('companySearchSort', itemIndex, ''));
5601
- const includes = {};
5602
- if (this.getNodeParameter('companySearchIncludeExternalValuesNoTags', itemIndex, false)) {
5603
- includes.WithExternalValuesNoTags = true;
5604
- }
5605
- if (this.getNodeParameter('companySearchIncludeTags', itemIndex, false)) {
5606
- includes.WithTags = true;
5607
- }
5608
- if (this.getNodeParameter('companySearchIncludeTasks', itemIndex, false)) {
5609
- includes.WithTasks = true;
5610
- }
5611
- if (Object.keys(includes).length) {
5612
- searchBody.Includes = includes;
5613
- }
5614
- const pagination = {};
5615
- addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('companySearchLimit', itemIndex, 50));
5616
- addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('companySearchOffset', itemIndex, 0));
5725
+ {
5726
+ displayName: 'Object IDs',
5727
+ name: 'listCreateObjectIds',
5728
+ type: 'string',
5729
+ default: '',
5730
+ displayOptions: {
5731
+ show: {
5732
+ resource: ['list'],
5733
+ operation: ['create'],
5734
+ useRawJsonData: [false],
5735
+ },
5736
+ },
5737
+ description: 'Comma-separated object IDs for Account/Prospect lists',
5738
+ },
5739
+ {
5740
+ displayName: 'IDs',
5741
+ name: 'listCreateIds',
5742
+ type: 'string',
5743
+ default: '',
5744
+ displayOptions: {
5745
+ show: {
5746
+ resource: ['list'],
5747
+ operation: ['create'],
5748
+ useRawJsonData: [false],
5749
+ },
5750
+ },
5751
+ description: 'Comma-separated numeric IDs for Template/Strategy lists',
5752
+ },
5753
+ {
5754
+ displayName: 'List ID',
5755
+ name: 'listUpdateId',
5756
+ type: 'number',
5757
+ default: 0,
5758
+ required: true,
5759
+ displayOptions: {
5760
+ show: {
5761
+ resource: ['list'],
5762
+ operation: ['update'],
5763
+ useRawJsonData: [false],
5764
+ },
5765
+ },
5766
+ description: 'ID of the list to update',
5767
+ },
5768
+ {
5769
+ displayName: 'Name',
5770
+ name: 'listUpdateName',
5771
+ type: 'string',
5772
+ default: '',
5773
+ displayOptions: {
5774
+ show: {
5775
+ resource: ['list'],
5776
+ operation: ['update'],
5777
+ useRawJsonData: [false],
5778
+ },
5779
+ },
5780
+ description: 'New list name',
5781
+ },
5782
+ {
5783
+ displayName: 'Shared',
5784
+ name: 'listUpdateShared',
5785
+ type: 'boolean',
5786
+ default: false,
5787
+ displayOptions: {
5788
+ show: {
5789
+ resource: ['list'],
5790
+ operation: ['update'],
5791
+ useRawJsonData: [false],
5792
+ },
5793
+ },
5794
+ description: 'Whether the list is shared',
5795
+ },
5796
+ {
5797
+ displayName: 'Shared Users IDs',
5798
+ name: 'listUpdateSharedUsersIds',
5799
+ type: 'string',
5800
+ default: '',
5801
+ displayOptions: {
5802
+ show: {
5803
+ resource: ['list'],
5804
+ operation: ['update'],
5805
+ useRawJsonData: [false],
5806
+ },
5807
+ },
5808
+ description: 'Comma-separated user IDs to share the list with',
5809
+ },
5810
+ {
5811
+ displayName: 'List ID',
5812
+ name: 'listDeleteListId',
5813
+ type: 'number',
5814
+ default: 0,
5815
+ required: true,
5816
+ displayOptions: {
5817
+ show: {
5818
+ resource: ['list'],
5819
+ operation: ['delete'],
5820
+ },
5821
+ },
5822
+ description: 'ID of the list to delete',
5823
+ },
5824
+ {
5825
+ displayName: 'List ID',
5826
+ name: 'listEntityListId',
5827
+ type: 'number',
5828
+ default: 0,
5829
+ required: true,
5830
+ displayOptions: {
5831
+ show: {
5832
+ resource: ['list'],
5833
+ operation: [
5834
+ 'addContacts',
5835
+ 'removeContacts',
5836
+ 'addCompanies',
5837
+ 'removeCompanies',
5838
+ 'addTemplates',
5839
+ 'removeTemplates',
5840
+ 'addSequences',
5841
+ 'removeSequences',
5842
+ ],
5843
+ },
5844
+ },
5845
+ description: 'Target list ID',
5846
+ },
5847
+ {
5848
+ displayName: 'Object IDs',
5849
+ name: 'listEntityObjectIds',
5850
+ type: 'string',
5851
+ default: '',
5852
+ required: true,
5853
+ displayOptions: {
5854
+ show: {
5855
+ resource: ['list'],
5856
+ operation: ['addContacts', 'removeContacts', 'addCompanies', 'removeCompanies'],
5857
+ },
5858
+ },
5859
+ description: 'Comma-separated object IDs',
5860
+ },
5861
+ {
5862
+ displayName: 'IDs',
5863
+ name: 'listEntityIds',
5864
+ type: 'string',
5865
+ default: '',
5866
+ required: true,
5867
+ displayOptions: {
5868
+ show: {
5869
+ resource: ['list'],
5870
+ operation: ['addTemplates', 'removeTemplates', 'addSequences', 'removeSequences'],
5871
+ },
5872
+ },
5873
+ description: 'Comma-separated numeric IDs',
5874
+ },
5875
+ {
5876
+ displayName: 'Strategy ID',
5877
+ name: 'strategyAddContactsStrategyId',
5878
+ type: 'number',
5879
+ default: 0,
5880
+ required: true,
5881
+ displayOptions: {
5882
+ show: {
5883
+ resource: ['strategy'],
5884
+ operation: ['addContacts'],
5885
+ useRawJsonData: [false],
5886
+ },
5887
+ },
5888
+ description: 'Strategy ID to enroll contacts into',
5889
+ },
5890
+ {
5891
+ displayName: 'Prospect IDs',
5892
+ name: 'strategyAddContactsProspectIds',
5893
+ type: 'string',
5894
+ default: '',
5895
+ displayOptions: {
5896
+ show: {
5897
+ resource: ['strategy'],
5898
+ operation: ['addContacts'],
5899
+ useRawJsonData: [false],
5900
+ },
5901
+ },
5902
+ description: 'Comma-separated prospect object IDs',
5903
+ },
5904
+ {
5905
+ displayName: 'Prospect ID',
5906
+ name: 'strategyStopContactProspectId',
5907
+ type: 'string',
5908
+ default: '',
5909
+ required: true,
5910
+ displayOptions: {
5911
+ show: {
5912
+ resource: ['strategy'],
5913
+ operation: ['stopContactSequence'],
5914
+ useRawJsonData: [false],
5915
+ },
5916
+ },
5917
+ description: 'Prospect object ID whose sequence must be stopped',
5918
+ },
5919
+ {
5920
+ displayName: 'Title',
5921
+ name: 'templateSearchTitle',
5922
+ type: 'string',
5923
+ default: '',
5924
+ displayOptions: {
5925
+ show: {
5926
+ resource: ['template'],
5927
+ operation: ['search'],
5928
+ useRawJsonSearch: [false],
5929
+ },
5930
+ },
5931
+ description: 'Template title filter',
5932
+ },
5933
+ {
5934
+ displayName: 'Type',
5935
+ name: 'templateSearchType',
5936
+ type: 'options',
5937
+ default: '',
5938
+ displayOptions: {
5939
+ show: {
5940
+ resource: ['template'],
5941
+ operation: ['search'],
5942
+ useRawJsonSearch: [false],
5943
+ },
5944
+ },
5945
+ options: [
5946
+ { name: 'All', value: '' },
5947
+ { name: 'Email', value: 'Email' },
5948
+ { name: 'In Mail', value: 'InMail' },
5949
+ { name: 'Invitation', value: 'Invitation' },
5950
+ { name: 'Linkedin', value: 'Linkedin' },
5951
+ { name: 'Script', value: 'Script' },
5952
+ { name: 'Voice Note', value: 'VoiceNote' },
5953
+ ],
5954
+ description: 'Template type filter',
5955
+ },
5956
+ {
5957
+ displayName: 'Language',
5958
+ name: 'templateSearchLanguage',
5959
+ type: 'string',
5960
+ default: '',
5961
+ displayOptions: {
5962
+ show: {
5963
+ resource: ['template'],
5964
+ operation: ['search'],
5965
+ useRawJsonSearch: [false],
5966
+ },
5967
+ },
5968
+ description: 'Language filter',
5969
+ },
5970
+ {
5971
+ displayName: 'Shared',
5972
+ name: 'templateSearchShared',
5973
+ type: 'boolean',
5974
+ default: false,
5975
+ displayOptions: {
5976
+ show: {
5977
+ resource: ['template'],
5978
+ operation: ['search'],
5979
+ useRawJsonSearch: [false],
5980
+ },
5981
+ },
5982
+ description: 'Whether template is shared',
5983
+ },
5984
+ {
5985
+ displayName: 'Archived',
5986
+ name: 'templateSearchArchived',
5987
+ type: 'boolean',
5988
+ default: false,
5989
+ displayOptions: {
5990
+ show: {
5991
+ resource: ['template'],
5992
+ operation: ['search'],
5993
+ useRawJsonSearch: [false],
5994
+ },
5995
+ },
5996
+ description: 'Whether template is archived',
5997
+ },
5998
+ {
5999
+ displayName: 'User ID',
6000
+ name: 'templateSearchUserId',
6001
+ type: 'string',
6002
+ default: '',
6003
+ displayOptions: {
6004
+ show: {
6005
+ resource: ['template'],
6006
+ operation: ['search'],
6007
+ useRawJsonSearch: [false],
6008
+ },
6009
+ },
6010
+ description: 'Owner user ID filter',
6011
+ },
6012
+ {
6013
+ displayName: 'Include User',
6014
+ name: 'templateSearchIncludeUser',
6015
+ type: 'boolean',
6016
+ default: false,
6017
+ displayOptions: {
6018
+ show: {
6019
+ resource: ['template'],
6020
+ operation: ['search'],
6021
+ useRawJsonSearch: [false],
6022
+ },
6023
+ },
6024
+ description: 'Whether to include template owner user',
6025
+ },
6026
+ {
6027
+ displayName: 'Include Template Tags',
6028
+ name: 'templateSearchIncludeTemplateTags',
6029
+ type: 'boolean',
6030
+ default: false,
6031
+ displayOptions: {
6032
+ show: {
6033
+ resource: ['template'],
6034
+ operation: ['search'],
6035
+ useRawJsonSearch: [false],
6036
+ },
6037
+ },
6038
+ description: 'Whether to include template tags',
6039
+ },
6040
+ {
6041
+ displayName: 'Include Lists',
6042
+ name: 'templateSearchIncludeCronoLists',
6043
+ type: 'boolean',
6044
+ default: false,
6045
+ displayOptions: {
6046
+ show: {
6047
+ resource: ['template'],
6048
+ operation: ['search'],
6049
+ useRawJsonSearch: [false],
6050
+ },
6051
+ },
6052
+ description: 'Whether to include linked lists',
6053
+ },
6054
+ {
6055
+ displayName: 'Limit',
6056
+ name: 'templateSearchLimit',
6057
+ type: 'number',
6058
+ typeOptions: {
6059
+ minValue: 1,
6060
+ },
6061
+ default: 50,
6062
+ displayOptions: {
6063
+ show: {
6064
+ resource: ['template'],
6065
+ operation: ['search'],
6066
+ useRawJsonSearch: [false],
6067
+ },
6068
+ },
6069
+ description: 'Max number of results to return',
6070
+ },
6071
+ {
6072
+ displayName: 'Offset',
6073
+ name: 'templateSearchOffset',
6074
+ type: 'number',
6075
+ default: 0,
6076
+ displayOptions: {
6077
+ show: {
6078
+ resource: ['template'],
6079
+ operation: ['search'],
6080
+ useRawJsonSearch: [false],
6081
+ },
6082
+ },
6083
+ description: 'Number of results to skip',
6084
+ },
6085
+ {
6086
+ displayName: 'Import Type',
6087
+ name: 'importType',
6088
+ type: 'options',
6089
+ default: '',
6090
+ displayOptions: {
6091
+ show: {
6092
+ resource: ['import'],
6093
+ operation: ['getAll'],
6094
+ },
6095
+ },
6096
+ options: [
6097
+ { name: 'Account', value: 'Account' },
6098
+ { name: 'All', value: '' },
6099
+ { name: 'Lead', value: 'Lead' },
6100
+ { name: 'Opportunity', value: 'Opportunity' },
6101
+ { name: 'Prospect', value: 'Prospect' },
6102
+ ],
6103
+ description: 'Filter imports by table type',
6104
+ },
6105
+ {
6106
+ displayName: 'Import Status',
6107
+ name: 'importStatus',
6108
+ type: 'options',
6109
+ default: '',
6110
+ displayOptions: {
6111
+ show: {
6112
+ resource: ['import'],
6113
+ operation: ['getAll'],
6114
+ },
6115
+ },
6116
+ options: [
6117
+ { name: 'All', value: '' },
6118
+ { name: 'Completed', value: 'Completed' },
6119
+ { name: 'Completed With Errors', value: 'CompletedWithErrors' },
6120
+ { name: 'On Going', value: 'OnGoing' },
6121
+ { name: 'Started', value: 'Started' },
6122
+ { name: 'Stop Completed', value: 'StopCompleted' },
6123
+ { name: 'Stop Request From User', value: 'StopRequestFromUser' },
6124
+ ],
6125
+ description: 'Filter imports by status',
6126
+ },
6127
+ ],
6128
+ };
6129
+ }
6130
+ async execute() {
6131
+ var _a, _b;
6132
+ const items = this.getInputData();
6133
+ const returnData = [];
6134
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
6135
+ const resource = this.getNodeParameter('resource', itemIndex);
6136
+ const operation = this.getNodeParameter('operation', itemIndex);
6137
+ const apiVersion = this.getNodeParameter('apiVersion', itemIndex, '1');
6138
+ const basePath = `/api/v${apiVersion}`;
6139
+ const useRawJsonData = this.getNodeParameter('useRawJsonData', itemIndex, false);
6140
+ const useRawJsonSearch = this.getNodeParameter('useRawJsonSearch', itemIndex, false);
6141
+ let endpoint = '';
6142
+ let method = 'GET';
6143
+ let qs = {};
6144
+ let body;
6145
+ if (operation === 'getAll') {
6146
+ const limit = this.getNodeParameter('limit', itemIndex, 50);
6147
+ const offset = this.getNodeParameter('offset', itemIndex, 0);
6148
+ qs = { limit, offset };
6149
+ }
6150
+ switch (resource) {
6151
+ case 'company': {
6152
+ endpoint = `${basePath}/Accounts`;
6153
+ if (operation === 'get') {
6154
+ method = 'GET';
6155
+ const objectId = this.getNodeParameter('objectId', itemIndex);
6156
+ endpoint = `${endpoint}/${objectId}`;
6157
+ qs = getJsonParameter(this, 'includeOptions', itemIndex);
6158
+ }
6159
+ else if (operation === 'getAll') {
6160
+ method = 'GET';
6161
+ const includeOptions = getJsonParameter(this, 'includeOptions', itemIndex);
6162
+ qs = { ...qs, ...includeOptions };
6163
+ }
6164
+ else if (operation === 'search') {
6165
+ method = 'POST';
6166
+ endpoint = `${endpoint}/search`;
6167
+ if (useRawJsonSearch) {
6168
+ body = getJsonParameter(this, 'search', itemIndex);
6169
+ }
6170
+ else {
6171
+ const searchBody = {};
6172
+ addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('companySearchName', itemIndex, ''));
6173
+ const status = this.getNodeParameter('companySearchStatus', itemIndex, []);
6174
+ if (status.length) {
6175
+ searchBody.Status = status;
6176
+ }
6177
+ const externalProperties = getJsonParameter(this, 'companySearchExternalProperties', itemIndex, {});
6178
+ if (Object.keys(externalProperties).length) {
6179
+ searchBody.ExternalProperties = externalProperties;
6180
+ }
6181
+ const externalPropertyNumericFilters = getJsonParameter(this, 'companySearchExternalPropertyNumericFilters', itemIndex, {});
6182
+ if (Object.keys(externalPropertyNumericFilters).length) {
6183
+ searchBody.ExternalPropertyNumericFilters = externalPropertyNumericFilters;
6184
+ }
6185
+ const externalPropertyEmptyIds = parseCsv(this.getNodeParameter('companySearchExternalPropertyEmptyIds', itemIndex, ''));
6186
+ if (externalPropertyEmptyIds.length) {
6187
+ searchBody.ExternalPropertyEmptyIds = externalPropertyEmptyIds.map((id) => parseInt(id, 10));
6188
+ }
6189
+ addIfNotEmpty(searchBody, 'Industry', this.getNodeParameter('companySearchIndustry', itemIndex, ''));
6190
+ addIfNotEmpty(searchBody, 'Country', this.getNodeParameter('companySearchCountry', itemIndex, ''));
6191
+ const numberOfEmployeesMin = this.getNodeParameter('companySearchNumberOfEmployeesMin', itemIndex, 0);
6192
+ if (numberOfEmployeesMin) {
6193
+ searchBody.NumberOfEmployeesMin = numberOfEmployeesMin;
6194
+ }
6195
+ const numberOfEmployeesMax = this.getNodeParameter('companySearchNumberOfEmployeesMax', itemIndex, 0);
6196
+ if (numberOfEmployeesMax) {
6197
+ searchBody.NumberOfEmployeesMax = numberOfEmployeesMax;
6198
+ }
6199
+ addIfNotEmpty(searchBody, 'CurrentSolution', this.getNodeParameter('companySearchCurrentSolution', itemIndex, ''));
6200
+ addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('companySearchUserId', itemIndex, ''));
6201
+ if (this.getNodeParameter('companySearchNoUser', itemIndex, false)) {
6202
+ searchBody.NoUser = true;
6203
+ }
6204
+ addIfNotEmpty(searchBody, 'CreatedDateMin', this.getNodeParameter('companySearchCreatedDateMin', itemIndex, ''));
6205
+ addIfNotEmpty(searchBody, 'CreatedDateMax', this.getNodeParameter('companySearchCreatedDateMax', itemIndex, ''));
6206
+ addIfNotEmpty(searchBody, 'LastActivityDateMin', this.getNodeParameter('companySearchLastActivityDateMin', itemIndex, ''));
6207
+ addIfNotEmpty(searchBody, 'LastActivityDateMax', this.getNodeParameter('companySearchLastActivityDateMax', itemIndex, ''));
6208
+ addIfNotEmpty(searchBody, 'LastModifiedDateMin', this.getNodeParameter('companySearchLastModifiedDateMin', itemIndex, ''));
6209
+ addIfNotEmpty(searchBody, 'LastModifiedDateMax', this.getNodeParameter('companySearchLastModifiedDateMax', itemIndex, ''));
6210
+ if (this.getNodeParameter('companySearchHasLinkedin', itemIndex, false)) {
6211
+ searchBody.HasLinkedin = true;
6212
+ }
6213
+ if (this.getNodeParameter('companySearchHasWebsite', itemIndex, false)) {
6214
+ searchBody.HasWebsite = true;
6215
+ }
6216
+ if (this.getNodeParameter('companySearchHasPhone', itemIndex, false)) {
6217
+ searchBody.HasPhone = true;
6218
+ }
6219
+ if (this.getNodeParameter('companySearchHasActivities', itemIndex, false)) {
6220
+ searchBody.HasActivities = true;
6221
+ }
6222
+ if (this.getNodeParameter('companySearchHasReplies', itemIndex, false)) {
6223
+ searchBody.HasReplies = true;
6224
+ }
6225
+ if (this.getNodeParameter('companySearchHasActiveTasks', itemIndex, false)) {
6226
+ searchBody.HasActiveTasks = true;
6227
+ }
6228
+ if (this.getNodeParameter('companySearchHasEmailsOpened', itemIndex, false)) {
6229
+ searchBody.HasEmailsOpened = true;
6230
+ }
6231
+ if (this.getNodeParameter('companySearchHasClickedLinks', itemIndex, false)) {
6232
+ searchBody.HasClickedLinks = true;
6233
+ }
6234
+ const cleanEmptyName = this.getNodeParameter('companySearchCleanEmptyName', itemIndex, true);
6235
+ searchBody.CleanEmptyName = cleanEmptyName;
6236
+ addIfNotEmpty(searchBody, 'Sort', this.getNodeParameter('companySearchSort', itemIndex, ''));
6237
+ const includes = {};
6238
+ if (this.getNodeParameter('companySearchIncludeExternalValuesNoTags', itemIndex, false)) {
6239
+ includes.WithExternalValuesNoTags = true;
6240
+ }
6241
+ if (this.getNodeParameter('companySearchIncludeTags', itemIndex, false)) {
6242
+ includes.WithTags = true;
6243
+ }
6244
+ if (this.getNodeParameter('companySearchIncludeTasks', itemIndex, false)) {
6245
+ includes.WithTasksAnalytics = true;
6246
+ }
6247
+ if (this.getNodeParameter('companySearchIncludeUser', itemIndex, false)) {
6248
+ includes.WithUser = true;
6249
+ }
6250
+ if (Object.keys(includes).length) {
6251
+ searchBody.Includes = includes;
6252
+ }
6253
+ const pagination = {};
6254
+ addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('companySearchLimit', itemIndex, 50));
6255
+ addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('companySearchOffset', itemIndex, 0));
5617
6256
  if (Object.keys(pagination).length) {
5618
6257
  searchBody.Pagination = pagination;
5619
6258
  }
@@ -5646,15 +6285,15 @@ class CronoPublicApi {
5646
6285
  if (Object.keys(externalValues).length) {
5647
6286
  data.ExternalValues = externalValues;
5648
6287
  }
5649
- addIfNotEmpty(data, 'OwnerId', this.getNodeParameter('companyCreateOwnerId', itemIndex, ''));
5650
- const userId = this.getNodeParameter('companyCreateUserId', itemIndex, 0);
5651
- if (userId) {
5652
- data.UserId = userId;
5653
- }
6288
+ addIfNotEmpty(data, 'UserId', this.getNodeParameter('companyCreateUserId', itemIndex, ''));
5654
6289
  const listId = this.getNodeParameter('companyCreateListId', itemIndex, 0);
5655
6290
  if (listId) {
5656
6291
  data.ListId = listId;
5657
6292
  }
6293
+ const generateAiVariables = getJsonParameter(this, 'companyCreateGenerateAiVariables', itemIndex, {});
6294
+ if (Object.keys(generateAiVariables).length) {
6295
+ data.GenerateAiVariables = generateAiVariables;
6296
+ }
5658
6297
  Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
5659
6298
  }
5660
6299
  const scrapeOptions = getJsonParameter(this, 'scrapeOptions', itemIndex, {});
@@ -5682,10 +6321,7 @@ class CronoPublicApi {
5682
6321
  if (Object.keys(externalValues).length) {
5683
6322
  data.ExternalValues = externalValues;
5684
6323
  }
5685
- const userId = this.getNodeParameter('companyUpdateUserId', itemIndex, 0);
5686
- if (userId) {
5687
- data.UserId = userId;
5688
- }
6324
+ addIfNotEmpty(data, 'UserId', this.getNodeParameter('companyUpdateUserId', itemIndex, ''));
5689
6325
  Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
5690
6326
  }
5691
6327
  body = { data };
@@ -5768,10 +6404,7 @@ class CronoPublicApi {
5768
6404
  if (objectIds.length) {
5769
6405
  searchBody.ObjectIds = objectIds;
5770
6406
  }
5771
- const userId = this.getNodeParameter('contactSearchUserId', itemIndex, 0);
5772
- if (userId) {
5773
- searchBody.UserId = userId;
5774
- }
6407
+ addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('contactSearchUserId', itemIndex, ''));
5775
6408
  addIfNotEmpty(searchBody, 'Industry', this.getNodeParameter('contactSearchIndustry', itemIndex, ''));
5776
6409
  addIfNotEmpty(searchBody, 'Location', this.getNodeParameter('contactSearchLocation', itemIndex, ''));
5777
6410
  const actualStatus = this.getNodeParameter('contactSearchActualStatus', itemIndex, []);
@@ -5926,10 +6559,7 @@ class CronoPublicApi {
5926
6559
  if (Object.keys(generateAiVariables).length) {
5927
6560
  data.GenerateAiVariables = generateAiVariables;
5928
6561
  }
5929
- const userId = this.getNodeParameter('contactCreateUserId', itemIndex, 0);
5930
- if (userId) {
5931
- data.UserId = userId;
5932
- }
6562
+ addIfNotEmpty(data, 'UserId', this.getNodeParameter('contactCreateUserId', itemIndex, ''));
5933
6563
  addIfNotEmpty(data, 'CountryCode', this.getNodeParameter('contactCreateCountryCode', itemIndex, ''));
5934
6564
  addIfNotEmpty(data, 'TimeZone', this.getNodeParameter('contactCreateTimeZone', itemIndex, ''));
5935
6565
  const listId = this.getNodeParameter('contactCreateListId', itemIndex, 0);
@@ -5962,10 +6592,7 @@ class CronoPublicApi {
5962
6592
  if (Object.keys(externalValues).length) {
5963
6593
  data.ExternalValues = externalValues;
5964
6594
  }
5965
- const userId = this.getNodeParameter('contactUpdateUserId', itemIndex, 0);
5966
- if (userId) {
5967
- data.UserId = userId;
5968
- }
6595
+ addIfNotEmpty(data, 'UserId', this.getNodeParameter('contactUpdateUserId', itemIndex, ''));
5969
6596
  addIfNotEmpty(data, 'CountryCode', this.getNodeParameter('contactUpdateCountryCode', itemIndex, ''));
5970
6597
  Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
5971
6598
  }
@@ -6069,11 +6696,10 @@ class CronoPublicApi {
6069
6696
  addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('dealSearchName', itemIndex, ''));
6070
6697
  addIfNotEmpty(searchBody, 'AccountId', this.getNodeParameter('dealSearchAccountId', itemIndex, ''));
6071
6698
  addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('dealSearchUserId', itemIndex, ''));
6072
- addIfNotEmpty(searchBody, 'Stage', this.getNodeParameter('dealSearchStage', itemIndex, ''));
6073
6699
  addIfNotEmpty(searchBody, 'Pipeline', this.getNodeParameter('dealSearchPipeline', itemIndex, ''));
6074
- const objectIds = parseCsv(this.getNodeParameter('dealSearchObjectIds', itemIndex, ''));
6075
- if (objectIds.length) {
6076
- searchBody.ObjectIds = objectIds;
6700
+ const stages = parseCsv(this.getNodeParameter('dealSearchStage', itemIndex, ''));
6701
+ if (stages.length) {
6702
+ searchBody.Stages = stages;
6077
6703
  }
6078
6704
  const pagination = {};
6079
6705
  addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('dealSearchLimit', itemIndex, 50));
@@ -6085,25 +6711,10 @@ class CronoPublicApi {
6085
6711
  addIfNotEmpty(searchBody, 'CreatedDateMax', this.getNodeParameter('dealSearchCreatedDateMax', itemIndex, ''));
6086
6712
  addIfNotEmpty(searchBody, 'LastModifiedDateMin', this.getNodeParameter('dealSearchLastModifiedDateMin', itemIndex, ''));
6087
6713
  addIfNotEmpty(searchBody, 'LastModifiedDateMax', this.getNodeParameter('dealSearchLastModifiedDateMax', itemIndex, ''));
6714
+ addIfNotEmpty(searchBody, 'LastActivityDateMin', this.getNodeParameter('dealSearchLastActivityDateMin', itemIndex, ''));
6715
+ addIfNotEmpty(searchBody, 'LastActivityDateMax', this.getNodeParameter('dealSearchLastActivityDateMax', itemIndex, ''));
6088
6716
  addIfNotEmpty(searchBody, 'CloseDateMin', this.getNodeParameter('dealSearchCloseDateMin', itemIndex, ''));
6089
6717
  addIfNotEmpty(searchBody, 'CloseDateMax', this.getNodeParameter('dealSearchCloseDateMax', itemIndex, ''));
6090
- if (this.getNodeParameter('dealSearchIsWon', itemIndex, false)) {
6091
- searchBody.IsWon = true;
6092
- }
6093
- if (this.getNodeParameter('dealSearchIsClosed', itemIndex, false)) {
6094
- searchBody.IsClosed = true;
6095
- }
6096
- const amountMin = this.getNodeParameter('dealSearchAmountMin', itemIndex, 0);
6097
- if (amountMin) {
6098
- searchBody.AmountMin = amountMin;
6099
- }
6100
- const amountMax = this.getNodeParameter('dealSearchAmountMax', itemIndex, 0);
6101
- if (amountMax) {
6102
- searchBody.AmountMax = amountMax;
6103
- }
6104
- if (this.getNodeParameter('dealSearchActive', itemIndex, false)) {
6105
- searchBody.Active = true;
6106
- }
6107
6718
  const year = this.getNodeParameter('dealSearchYear', itemIndex, 0);
6108
6719
  if (year) {
6109
6720
  searchBody.Year = year;
@@ -6117,6 +6728,12 @@ class CronoPublicApi {
6117
6728
  if (this.getNodeParameter('dealSearchIncludeAccount', itemIndex, false)) {
6118
6729
  includes.WithAccount = true;
6119
6730
  }
6731
+ if (this.getNodeParameter('dealSearchIncludeExternalValues', itemIndex, false)) {
6732
+ includes.WithExternalValues = true;
6733
+ }
6734
+ if (this.getNodeParameter('dealSearchIncludeUser', itemIndex, false)) {
6735
+ includes.WithUser = true;
6736
+ }
6120
6737
  if (Object.keys(includes).length) {
6121
6738
  searchBody.Includes = includes;
6122
6739
  }
@@ -6144,10 +6761,7 @@ class CronoPublicApi {
6144
6761
  if (Object.keys(externalValues).length) {
6145
6762
  data.ExternalValues = externalValues;
6146
6763
  }
6147
- const userId = this.getNodeParameter('dealCreateUserId', itemIndex, 0);
6148
- if (userId) {
6149
- data.UserId = userId;
6150
- }
6764
+ addIfNotEmpty(data, 'UserId', this.getNodeParameter('dealCreateUserId', itemIndex, ''));
6151
6765
  Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
6152
6766
  }
6153
6767
  body = { data };
@@ -6178,10 +6792,7 @@ class CronoPublicApi {
6178
6792
  if (Object.keys(externalValues).length) {
6179
6793
  data.ExternalValues = externalValues;
6180
6794
  }
6181
- const userId = this.getNodeParameter('dealUpdateUserId', itemIndex, 0);
6182
- if (userId) {
6183
- data.UserId = userId;
6184
- }
6795
+ addIfNotEmpty(data, 'UserId', this.getNodeParameter('dealUpdateUserId', itemIndex, ''));
6185
6796
  Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
6186
6797
  }
6187
6798
  body = { data };
@@ -6231,6 +6842,9 @@ class CronoPublicApi {
6231
6842
  searchBody.Active = true;
6232
6843
  }
6233
6844
  const includes = {};
6845
+ if (this.getNodeParameter('noteSearchIncludeUser', itemIndex, false)) {
6846
+ includes.WithUser = true;
6847
+ }
6234
6848
  if (this.getNodeParameter('noteSearchIncludeAccount', itemIndex, false)) {
6235
6849
  includes.WithAccount = true;
6236
6850
  }
@@ -6294,6 +6908,10 @@ class CronoPublicApi {
6294
6908
  if (types.length) {
6295
6909
  searchBody.Types = types;
6296
6910
  }
6911
+ const subtypes = this.getNodeParameter('taskSearchSubtypes', itemIndex, []);
6912
+ if (subtypes.length) {
6913
+ searchBody.Subtypes = subtypes;
6914
+ }
6297
6915
  addIfNotEmpty(searchBody, 'Since', this.getNodeParameter('taskSearchSince', itemIndex, ''));
6298
6916
  addIfNotEmpty(searchBody, 'To', this.getNodeParameter('taskSearchTo', itemIndex, ''));
6299
6917
  if (this.getNodeParameter('taskSearchAutomatic', itemIndex, false)) {
@@ -6341,6 +6959,24 @@ class CronoPublicApi {
6341
6959
  if (Object.keys(leadExternalProperties).length) {
6342
6960
  searchBody.LeadExternalProperties = leadExternalProperties;
6343
6961
  }
6962
+ if (this.getNodeParameter('taskSearchWithProspectScore', itemIndex, false)) {
6963
+ searchBody.WithProspectScore = true;
6964
+ }
6965
+ if (this.getNodeParameter('taskSearchWithAccountScore', itemIndex, false)) {
6966
+ searchBody.WithAccountScore = true;
6967
+ }
6968
+ const leadScoreLevels = this.getNodeParameter('taskSearchLeadScoreLevels', itemIndex, []);
6969
+ if (leadScoreLevels.length) {
6970
+ searchBody.LeadScoreLevels = leadScoreLevels;
6971
+ }
6972
+ const prospectScoreLevels = this.getNodeParameter('taskSearchProspectScoreLevels', itemIndex, []);
6973
+ if (prospectScoreLevels.length) {
6974
+ searchBody.ProspectScoreLevels = prospectScoreLevels;
6975
+ }
6976
+ const accountScoreLevels = this.getNodeParameter('taskSearchAccountScoreLevels', itemIndex, []);
6977
+ if (accountScoreLevels.length) {
6978
+ searchBody.AccountScoreLevels = accountScoreLevels;
6979
+ }
6344
6980
  Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
6345
6981
  body = searchBody;
6346
6982
  }
@@ -6360,10 +6996,11 @@ class CronoPublicApi {
6360
6996
  if (templateId) {
6361
6997
  data.TemplateId = templateId;
6362
6998
  }
6363
- if (this.getNodeParameter('taskCreateAutomatic', itemIndex, false)) {
6364
- data.Automatic = true;
6365
- }
6999
+ data.Automatic = this.getNodeParameter('taskCreateAutomatic', itemIndex, false);
6366
7000
  addIfNotEmpty(data, 'OpportunityId', this.getNodeParameter('taskCreateOpportunityId', itemIndex, ''));
7001
+ if (this.getNodeParameter('taskCreateAssignToUser', itemIndex, false)) {
7002
+ data.AssignToUser = true;
7003
+ }
6367
7004
  addIfNotEmpty(data, 'Subject', this.getNodeParameter('taskCreateSubject', itemIndex, ''));
6368
7005
  addIfNotEmpty(data, 'Description', this.getNodeParameter('taskCreateDescription', itemIndex, ''));
6369
7006
  addIfNotEmpty(data, 'PersonalizedSubject', this.getNodeParameter('taskCreatePersonalizedSubject', itemIndex, ''));
@@ -6423,6 +7060,9 @@ class CronoPublicApi {
6423
7060
  searchBody.CronoObjectId = cronoObjectId;
6424
7061
  }
6425
7062
  const includes = {};
7063
+ if (this.getNodeParameter('activitySearchIncludeUser', itemIndex, false)) {
7064
+ includes.WithUser = true;
7065
+ }
6426
7066
  if (this.getNodeParameter('activitySearchIncludeAccount', itemIndex, false)) {
6427
7067
  includes.WithAccount = true;
6428
7068
  }
@@ -6441,6 +7081,9 @@ class CronoPublicApi {
6441
7081
  if (this.getNodeParameter('activitySearchIncludeOpportunity', itemIndex, false)) {
6442
7082
  includes.WithOpportunity = true;
6443
7083
  }
7084
+ if (this.getNodeParameter('activitySearchIncludeTemplateTitle', itemIndex, false)) {
7085
+ includes.WithTemplateTitle = true;
7086
+ }
6444
7087
  if (Object.keys(includes).length) {
6445
7088
  searchBody.Include = includes;
6446
7089
  }
@@ -6451,34 +7094,110 @@ class CronoPublicApi {
6451
7094
  break;
6452
7095
  }
6453
7096
  case 'list': {
6454
- method = 'POST';
6455
- endpoint = `${basePath}/CronoLists/search`;
6456
- if (useRawJsonSearch) {
6457
- body = getJsonParameter(this, 'search', itemIndex);
7097
+ endpoint = `${basePath}/CronoLists`;
7098
+ if (operation === 'get') {
7099
+ method = 'GET';
7100
+ const listId = this.getNodeParameter('listId', itemIndex);
7101
+ endpoint = `${endpoint}/${listId}`;
6458
7102
  }
6459
- else {
6460
- const searchBody = {};
6461
- addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('listSearchName', itemIndex, ''));
6462
- addIfNotEmpty(searchBody, 'AccountId', this.getNodeParameter('listSearchAccountId', itemIndex, ''));
6463
- addIfNotEmpty(searchBody, 'ProspectId', this.getNodeParameter('listSearchProspectId', itemIndex, ''));
6464
- const strategyId = this.getNodeParameter('listSearchStrategyId', itemIndex, 0);
6465
- if (strategyId) {
6466
- searchBody.StrategyId = strategyId;
7103
+ else if (operation === 'search') {
7104
+ method = 'POST';
7105
+ endpoint = `${endpoint}/search`;
7106
+ if (useRawJsonSearch) {
7107
+ body = getJsonParameter(this, 'search', itemIndex);
7108
+ }
7109
+ else {
7110
+ const searchBody = {};
7111
+ addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('listSearchName', itemIndex, ''));
7112
+ addIfNotEmpty(searchBody, 'AccountId', this.getNodeParameter('listSearchAccountId', itemIndex, ''));
7113
+ addIfNotEmpty(searchBody, 'ProspectId', this.getNodeParameter('listSearchProspectId', itemIndex, ''));
7114
+ const strategyId = this.getNodeParameter('listSearchStrategyId', itemIndex, 0);
7115
+ if (strategyId) {
7116
+ searchBody.StrategyId = strategyId;
7117
+ }
7118
+ const templateId = this.getNodeParameter('listSearchTemplateId', itemIndex, 0);
7119
+ if (templateId) {
7120
+ searchBody.TemplateId = templateId;
7121
+ }
7122
+ const pagination = {};
7123
+ addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('listSearchLimit', itemIndex, 50));
7124
+ addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('listSearchOffset', itemIndex, 0));
7125
+ if (Object.keys(pagination).length) {
7126
+ searchBody.Pagination = pagination;
7127
+ }
7128
+ addIfNotEmpty(searchBody, 'Type', this.getNodeParameter('listSearchType', itemIndex, 'Account'));
7129
+ addIfNotEmpty(searchBody, 'SortType', this.getNodeParameter('listSearchSortType', itemIndex, ''));
7130
+ Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
7131
+ body = searchBody;
6467
7132
  }
6468
- const templateId = this.getNodeParameter('listSearchTemplateId', itemIndex, 0);
6469
- if (templateId) {
6470
- searchBody.TemplateId = templateId;
7133
+ }
7134
+ else if (operation === 'create') {
7135
+ method = 'POST';
7136
+ const data = useRawJsonData
7137
+ ? getJsonParameter(this, 'data', itemIndex)
7138
+ : {};
7139
+ if (!useRawJsonData) {
7140
+ addIfNotEmpty(data, 'Name', this.getNodeParameter('listCreateName', itemIndex, ''));
7141
+ addIfNotEmpty(data, 'Type', this.getNodeParameter('listCreateType', itemIndex, 'Account'));
7142
+ if (this.getNodeParameter('listCreateShared', itemIndex, false)) {
7143
+ data.Shared = true;
7144
+ }
7145
+ const sharedUsersIds = parseCsv(this.getNodeParameter('listCreateSharedUsersIds', itemIndex, ''));
7146
+ if (sharedUsersIds.length) {
7147
+ data.SharedUsersIds = sharedUsersIds.map((id) => parseInt(id, 10));
7148
+ }
7149
+ const objectIds = parseCsv(this.getNodeParameter('listCreateObjectIds', itemIndex, ''));
7150
+ if (objectIds.length) {
7151
+ data.ObjectIds = objectIds;
7152
+ }
7153
+ const ids = parseCsv(this.getNodeParameter('listCreateIds', itemIndex, ''));
7154
+ if (ids.length) {
7155
+ data.Ids = ids.map((id) => parseInt(id, 10));
7156
+ }
7157
+ Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
6471
7158
  }
6472
- const pagination = {};
6473
- addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('listSearchLimit', itemIndex, 50));
6474
- addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('listSearchOffset', itemIndex, 0));
6475
- if (Object.keys(pagination).length) {
6476
- searchBody.Pagination = pagination;
7159
+ body = { data };
7160
+ }
7161
+ else if (operation === 'update') {
7162
+ method = 'PATCH';
7163
+ const data = useRawJsonData
7164
+ ? getJsonParameter(this, 'data', itemIndex)
7165
+ : {};
7166
+ if (!useRawJsonData) {
7167
+ const listUpdateId = this.getNodeParameter('listUpdateId', itemIndex, 0);
7168
+ if (listUpdateId) {
7169
+ data.Id = listUpdateId;
7170
+ }
7171
+ addIfNotEmpty(data, 'Name', this.getNodeParameter('listUpdateName', itemIndex, ''));
7172
+ if (this.getNodeParameter('listUpdateShared', itemIndex, false)) {
7173
+ data.Shared = true;
7174
+ }
7175
+ const sharedUsersIds = parseCsv(this.getNodeParameter('listUpdateSharedUsersIds', itemIndex, ''));
7176
+ if (sharedUsersIds.length) {
7177
+ data.SharedUsersIds = sharedUsersIds.map((id) => parseInt(id, 10));
7178
+ }
7179
+ Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
6477
7180
  }
6478
- addIfNotEmpty(searchBody, 'Type', this.getNodeParameter('listSearchType', itemIndex, 'Account'));
6479
- addIfNotEmpty(searchBody, 'SortType', this.getNodeParameter('listSearchSortType', itemIndex, ''));
6480
- Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
6481
- body = searchBody;
7181
+ body = { data };
7182
+ }
7183
+ else if (operation === 'delete') {
7184
+ method = 'DELETE';
7185
+ const listId = this.getNodeParameter('listDeleteListId', itemIndex, 0);
7186
+ body = { listId };
7187
+ }
7188
+ else if (['addContacts', 'removeContacts', 'addCompanies', 'removeCompanies'].includes(operation)) {
7189
+ method = operation.startsWith('remove') ? 'DELETE' : 'POST';
7190
+ endpoint = `${endpoint}/${operation.includes('Contacts') ? 'Prospect' : 'Account'}`;
7191
+ const listId = this.getNodeParameter('listEntityListId', itemIndex, 0);
7192
+ const objectIds = parseCsv(this.getNodeParameter('listEntityObjectIds', itemIndex, ''));
7193
+ body = { listId, objectIds };
7194
+ }
7195
+ else if (['addTemplates', 'removeTemplates', 'addSequences', 'removeSequences'].includes(operation)) {
7196
+ method = operation.startsWith('remove') ? 'DELETE' : 'POST';
7197
+ endpoint = `${endpoint}/${operation.includes('Templates') ? 'Template' : 'Strategy'}`;
7198
+ const listId = this.getNodeParameter('listEntityListId', itemIndex, 0);
7199
+ const ids = parseCsv(this.getNodeParameter('listEntityIds', itemIndex, ''));
7200
+ body = { listId, ids: ids.map((id) => parseInt(id, 10)) };
6482
7201
  }
6483
7202
  break;
6484
7203
  }
@@ -6488,76 +7207,160 @@ class CronoPublicApi {
6488
7207
  break;
6489
7208
  }
6490
7209
  case 'strategy': {
6491
- method = 'POST';
6492
- endpoint = `${basePath}/Strategies/${operation === 'searchDetails' ? 'details' : 'search'}`;
6493
- if (useRawJsonSearch) {
6494
- body = getJsonParameter(this, 'search', itemIndex);
6495
- }
6496
- else if (operation === 'searchDetails') {
6497
- const searchBody = {};
6498
- const strategyId = this.getNodeParameter('strategyDetailsStrategyId', itemIndex, 0);
6499
- searchBody.StrategyId = strategyId;
6500
- addIfNotEmpty(searchBody, 'Text', this.getNodeParameter('strategyDetailsText', itemIndex, ''));
6501
- const pagination = {};
6502
- addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('strategyDetailsLimit', itemIndex, 50));
6503
- addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('strategyDetailsOffset', itemIndex, 0));
6504
- if (Object.keys(pagination).length) {
6505
- searchBody.Pagination = pagination;
6506
- }
6507
- addIfNotEmpty(searchBody, 'Sort', this.getNodeParameter('strategyDetailsSort', itemIndex, 'ContactsAsc'));
6508
- addIfNotEmpty(searchBody, 'Status', this.getNodeParameter('strategyDetailsStatus', itemIndex, ''));
6509
- const onlySpecificTask = this.getNodeParameter('strategyDetailsOnlySpecificTask', itemIndex, []);
6510
- if (onlySpecificTask.length) {
6511
- searchBody.OnlySpecificTask = onlySpecificTask;
6512
- }
6513
- if (this.getNodeParameter('strategyDetailsOnlyMySequences', itemIndex, false)) {
6514
- searchBody.OnlyMySequences = true;
7210
+ endpoint = `${basePath}/Strategies`;
7211
+ if (operation === 'addContacts') {
7212
+ method = 'POST';
7213
+ endpoint = `${endpoint}/prospects`;
7214
+ const data = useRawJsonData
7215
+ ? getJsonParameter(this, 'data', itemIndex)
7216
+ : {};
7217
+ if (!useRawJsonData) {
7218
+ const strategyId = this.getNodeParameter('strategyAddContactsStrategyId', itemIndex, 0);
7219
+ if (strategyId) {
7220
+ data.StrategyId = strategyId;
7221
+ }
7222
+ const prospectIds = parseCsv(this.getNodeParameter('strategyAddContactsProspectIds', itemIndex, ''));
7223
+ if (prospectIds.length) {
7224
+ data.ProspectIds = prospectIds;
7225
+ }
7226
+ Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
6515
7227
  }
6516
- if (this.getNodeParameter('strategyDetailsOnlyMyProspects', itemIndex, false)) {
6517
- searchBody.OnlyMyProspects = true;
7228
+ body = { data };
7229
+ }
7230
+ else if (operation === 'stopContactSequence') {
7231
+ method = 'POST';
7232
+ endpoint = `${endpoint}/prospects/stop`;
7233
+ const data = useRawJsonData
7234
+ ? getJsonParameter(this, 'data', itemIndex)
7235
+ : {};
7236
+ if (!useRawJsonData) {
7237
+ addIfNotEmpty(data, 'ProspectId', this.getNodeParameter('strategyStopContactProspectId', itemIndex, ''));
7238
+ Object.assign(data, getAdditionalFields(this, 'dataAdditionalFields', itemIndex));
6518
7239
  }
6519
- Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
6520
- body = searchBody;
7240
+ body = { data };
6521
7241
  }
6522
7242
  else {
6523
- const searchBody = {};
6524
- addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('strategySearchName', itemIndex, ''));
6525
- addIfNotEmpty(searchBody, 'AccountId', this.getNodeParameter('strategySearchAccountId', itemIndex, ''));
6526
- addIfNotEmpty(searchBody, 'ProspectId', this.getNodeParameter('strategySearchProspectId', itemIndex, ''));
6527
- addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('strategySearchUserId', itemIndex, ''));
6528
- const ids = parseCsv(this.getNodeParameter('strategySearchIds', itemIndex, ''));
6529
- if (ids.length) {
6530
- searchBody.Ids = ids;
6531
- }
6532
- const pagination = {};
6533
- addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('strategySearchLimit', itemIndex, 50));
6534
- addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('strategySearchOffset', itemIndex, 0));
6535
- if (Object.keys(pagination).length) {
6536
- searchBody.Pagination = pagination;
6537
- }
6538
- addIfNotEmpty(searchBody, 'Sort', this.getNodeParameter('strategySearchSort', itemIndex, ''));
6539
- const strategyTags = getJsonParameter(this, 'strategySearchTags', itemIndex, {});
6540
- if (Object.keys(strategyTags).length) {
6541
- searchBody.StrategyTags = strategyTags;
6542
- }
6543
- const includeOptions = {};
6544
- if (this.getNodeParameter('strategySearchIncludeActiveSequenceInstances', itemIndex, false)) {
6545
- includeOptions.WithActiveSequenceInstances = true;
7243
+ method = 'POST';
7244
+ endpoint = `${endpoint}/${operation === 'searchDetails' ? 'details' : 'search'}`;
7245
+ if (useRawJsonSearch) {
7246
+ body = getJsonParameter(this, 'search', itemIndex);
6546
7247
  }
6547
- if (this.getNodeParameter('strategySearchIncludeAnalytics', itemIndex, false)) {
6548
- includeOptions.WithAnalytics = true;
7248
+ else if (operation === 'searchDetails') {
7249
+ const searchBody = {};
7250
+ const strategyId = this.getNodeParameter('strategyDetailsStrategyId', itemIndex, 0);
7251
+ searchBody.StrategyId = strategyId;
7252
+ addIfNotEmpty(searchBody, 'Text', this.getNodeParameter('strategyDetailsText', itemIndex, ''));
7253
+ const pagination = {};
7254
+ addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('strategyDetailsLimit', itemIndex, 50));
7255
+ addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('strategyDetailsOffset', itemIndex, 0));
7256
+ if (Object.keys(pagination).length) {
7257
+ searchBody.Pagination = pagination;
7258
+ }
7259
+ addIfNotEmpty(searchBody, 'Sort', this.getNodeParameter('strategyDetailsSort', itemIndex, 'ContactsAsc'));
7260
+ addIfNotEmpty(searchBody, 'Status', this.getNodeParameter('strategyDetailsStatus', itemIndex, ''));
7261
+ const onlySpecificTask = this.getNodeParameter('strategyDetailsOnlySpecificTask', itemIndex, []);
7262
+ if (onlySpecificTask.length) {
7263
+ searchBody.OnlySpecificTask = onlySpecificTask;
7264
+ }
7265
+ if (this.getNodeParameter('strategyDetailsOnlyMySequences', itemIndex, false)) {
7266
+ searchBody.OnlyMySequences = true;
7267
+ }
7268
+ if (this.getNodeParameter('strategyDetailsOnlyMyProspects', itemIndex, false)) {
7269
+ searchBody.OnlyMyProspects = true;
7270
+ }
7271
+ Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
7272
+ body = searchBody;
6549
7273
  }
6550
- if (this.getNodeParameter('strategySearchIncludeSequence', itemIndex, false)) {
6551
- includeOptions.WithSequence = true;
7274
+ else {
7275
+ const searchBody = {};
7276
+ addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('strategySearchName', itemIndex, ''));
7277
+ addIfNotEmpty(searchBody, 'AccountId', this.getNodeParameter('strategySearchAccountId', itemIndex, ''));
7278
+ addIfNotEmpty(searchBody, 'ProspectId', this.getNodeParameter('strategySearchProspectId', itemIndex, ''));
7279
+ addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('strategySearchUserId', itemIndex, ''));
7280
+ const ids = parseCsv(this.getNodeParameter('strategySearchIds', itemIndex, ''));
7281
+ if (ids.length) {
7282
+ searchBody.Ids = ids;
7283
+ }
7284
+ const pagination = {};
7285
+ addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('strategySearchLimit', itemIndex, 50));
7286
+ addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('strategySearchOffset', itemIndex, 0));
7287
+ if (Object.keys(pagination).length) {
7288
+ searchBody.Pagination = pagination;
7289
+ }
7290
+ addIfNotEmpty(searchBody, 'Sort', this.getNodeParameter('strategySearchSort', itemIndex, ''));
7291
+ const strategyTags = getJsonParameter(this, 'strategySearchTags', itemIndex, {});
7292
+ if (Object.keys(strategyTags).length) {
7293
+ searchBody.StrategyTags = strategyTags;
7294
+ }
7295
+ const includeOptions = {};
7296
+ if (this.getNodeParameter('strategySearchIncludeActiveSequenceInstances', itemIndex, false)) {
7297
+ includeOptions.WithActiveSequenceInstances = true;
7298
+ }
7299
+ if (this.getNodeParameter('strategySearchIncludeAnalytics', itemIndex, false)) {
7300
+ includeOptions.WithAnalytics = true;
7301
+ }
7302
+ if (this.getNodeParameter('strategySearchIncludeSequence', itemIndex, false)) {
7303
+ includeOptions.WithSequence = true;
7304
+ }
7305
+ if (this.getNodeParameter('strategySearchIncludeUsers', itemIndex, false)) {
7306
+ includeOptions.WithUsers = true;
7307
+ }
7308
+ if (Object.keys(includeOptions).length) {
7309
+ searchBody.IncludeOptions = includeOptions;
7310
+ }
7311
+ Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
7312
+ body = searchBody;
6552
7313
  }
6553
- if (this.getNodeParameter('strategySearchIncludeUsers', itemIndex, false)) {
6554
- includeOptions.WithUsers = true;
7314
+ }
7315
+ break;
7316
+ }
7317
+ case 'template': {
7318
+ endpoint = `${basePath}/Templates`;
7319
+ if (operation === 'get') {
7320
+ method = 'GET';
7321
+ const objectId = this.getNodeParameter('objectId', itemIndex);
7322
+ endpoint = `${endpoint}/${objectId}`;
7323
+ }
7324
+ else if (operation === 'search') {
7325
+ method = 'POST';
7326
+ endpoint = `${endpoint}/search`;
7327
+ if (useRawJsonSearch) {
7328
+ body = getJsonParameter(this, 'search', itemIndex);
6555
7329
  }
6556
- if (Object.keys(includeOptions).length) {
6557
- searchBody.IncludeOptions = includeOptions;
7330
+ else {
7331
+ const searchBody = {};
7332
+ addIfNotEmpty(searchBody, 'Title', this.getNodeParameter('templateSearchTitle', itemIndex, ''));
7333
+ addIfNotEmpty(searchBody, 'Type', this.getNodeParameter('templateSearchType', itemIndex, ''));
7334
+ addIfNotEmpty(searchBody, 'Language', this.getNodeParameter('templateSearchLanguage', itemIndex, ''));
7335
+ if (this.getNodeParameter('templateSearchShared', itemIndex, false)) {
7336
+ searchBody.Shared = true;
7337
+ }
7338
+ if (this.getNodeParameter('templateSearchArchived', itemIndex, false)) {
7339
+ searchBody.Archived = true;
7340
+ }
7341
+ addIfNotEmpty(searchBody, 'UserId', this.getNodeParameter('templateSearchUserId', itemIndex, ''));
7342
+ const include = {};
7343
+ if (this.getNodeParameter('templateSearchIncludeUser', itemIndex, false)) {
7344
+ include.WithUser = true;
7345
+ }
7346
+ if (this.getNodeParameter('templateSearchIncludeTemplateTags', itemIndex, false)) {
7347
+ include.WithTemplateTags = true;
7348
+ }
7349
+ if (this.getNodeParameter('templateSearchIncludeCronoLists', itemIndex, false)) {
7350
+ include.WithCronoLists = true;
7351
+ }
7352
+ if (Object.keys(include).length) {
7353
+ searchBody.Include = include;
7354
+ }
7355
+ const pagination = {};
7356
+ addIfNotEmpty(pagination, 'Limit', this.getNodeParameter('templateSearchLimit', itemIndex, 50));
7357
+ addIfNotEmpty(pagination, 'Offset', this.getNodeParameter('templateSearchOffset', itemIndex, 0));
7358
+ if (Object.keys(pagination).length) {
7359
+ searchBody.Pagination = pagination;
7360
+ }
7361
+ Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
7362
+ body = searchBody;
6558
7363
  }
6559
- Object.assign(searchBody, getAdditionalFields(this, 'searchAdditionalFields', itemIndex));
6560
- body = searchBody;
6561
7364
  }
6562
7365
  break;
6563
7366
  }
@@ -6615,6 +7418,7 @@ class CronoPublicApi {
6615
7418
  else {
6616
7419
  const searchBody = {};
6617
7420
  addIfNotEmpty(searchBody, 'Email', this.getNodeParameter('userSearchEmail', itemIndex, ''));
7421
+ addIfNotEmpty(searchBody, 'Name', this.getNodeParameter('userSearchName', itemIndex, ''));
6618
7422
  if (this.getNodeParameter('userSearchActive', itemIndex, false)) {
6619
7423
  searchBody.Active = true;
6620
7424
  }
@@ -6656,7 +7460,7 @@ class CronoPublicApi {
6656
7460
  });
6657
7461
  }
6658
7462
  const responseData = await cronoApiRequest.call(this, method, endpoint, qs, body);
6659
- returnData.push({ json: responseData });
7463
+ returnData.push({ json: responseData, pairedItem: { item: itemIndex } });
6660
7464
  }
6661
7465
  return [returnData];
6662
7466
  }