@dereekb/zoho 12.6.20 → 12.7.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.
Files changed (52) hide show
  1. package/index.cjs.js +1786 -419
  2. package/index.esm.js +1678 -417
  3. package/nestjs/CHANGELOG.md +13 -0
  4. package/nestjs/package.json +1 -1
  5. package/nestjs/src/lib/accounts/accounts.api.js +3 -2
  6. package/nestjs/src/lib/accounts/accounts.api.js.map +1 -1
  7. package/nestjs/src/lib/accounts/accounts.config.d.ts +32 -0
  8. package/nestjs/src/lib/accounts/accounts.config.js +29 -4
  9. package/nestjs/src/lib/accounts/accounts.config.js.map +1 -1
  10. package/nestjs/src/lib/crm/crm.api.d.ts +42 -0
  11. package/nestjs/src/lib/crm/crm.api.js +115 -0
  12. package/nestjs/src/lib/crm/crm.api.js.map +1 -0
  13. package/nestjs/src/lib/crm/crm.config.d.ts +10 -0
  14. package/nestjs/src/lib/crm/crm.config.js +16 -0
  15. package/nestjs/src/lib/crm/crm.config.js.map +1 -0
  16. package/nestjs/src/lib/crm/crm.module.d.ts +24 -0
  17. package/nestjs/src/lib/crm/crm.module.js +61 -0
  18. package/nestjs/src/lib/crm/crm.module.js.map +1 -0
  19. package/nestjs/src/lib/crm/index.d.ts +3 -0
  20. package/nestjs/src/lib/crm/index.js +7 -0
  21. package/nestjs/src/lib/crm/index.js.map +1 -0
  22. package/nestjs/src/lib/recruit/recruit.api.d.ts +4 -4
  23. package/nestjs/src/lib/recruit/recruit.api.js +31 -31
  24. package/nestjs/src/lib/recruit/recruit.api.js.map +1 -1
  25. package/nestjs/src/lib/recruit/recruit.module.js +1 -1
  26. package/nestjs/src/lib/recruit/recruit.module.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/lib/accounts/accounts.api.d.ts +1 -1
  29. package/src/lib/crm/crm.api.d.ts +430 -0
  30. package/src/lib/crm/crm.api.notes.d.ts +40 -0
  31. package/src/lib/crm/crm.api.tags.d.ts +136 -0
  32. package/src/lib/crm/crm.config.d.ts +24 -0
  33. package/src/lib/crm/crm.criteria.d.ts +19 -0
  34. package/src/lib/crm/crm.d.ts +325 -0
  35. package/src/lib/crm/crm.error.api.d.ts +52 -0
  36. package/src/lib/crm/crm.factory.d.ts +22 -0
  37. package/src/lib/crm/crm.notes.d.ts +48 -0
  38. package/src/lib/crm/crm.tags.d.ts +40 -0
  39. package/src/lib/crm/index.d.ts +10 -0
  40. package/src/lib/index.d.ts +1 -0
  41. package/src/lib/recruit/index.d.ts +0 -1
  42. package/src/lib/recruit/recruit.api.candidates.d.ts +30 -6
  43. package/src/lib/recruit/recruit.api.d.ts +102 -22
  44. package/src/lib/recruit/recruit.api.notes.d.ts +30 -6
  45. package/src/lib/recruit/recruit.api.tags.d.ts +30 -6
  46. package/src/lib/recruit/recruit.criteria.d.ts +8 -44
  47. package/src/lib/recruit/recruit.d.ts +7 -3
  48. package/src/lib/recruit/recruit.error.api.d.ts +5 -1
  49. package/src/lib/shared/criteria.d.ts +55 -0
  50. package/src/lib/shared/criteria.util.d.ts +10 -0
  51. package/src/lib/zoho.error.api.d.ts +62 -4
  52. package/src/lib/recruit/recruit.criteria.util.d.ts +0 -10
package/index.cjs.js CHANGED
@@ -51,25 +51,25 @@ var functionBindNative = !fails$a(function () {
51
51
 
52
52
  var NATIVE_BIND$2 = functionBindNative;
53
53
 
54
- var call$c = Function.prototype.call;
54
+ var call$e = Function.prototype.call;
55
55
 
56
- var functionCall = NATIVE_BIND$2 ? call$c.bind(call$c) : function () {
57
- return call$c.apply(call$c, arguments);
56
+ var functionCall = NATIVE_BIND$2 ? call$e.bind(call$e) : function () {
57
+ return call$e.apply(call$e, arguments);
58
58
  };
59
59
 
60
60
  var objectPropertyIsEnumerable = {};
61
61
 
62
62
  var $propertyIsEnumerable = {}.propertyIsEnumerable;
63
63
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
64
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
64
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
65
65
 
66
66
  // Nashorn ~ JDK8 bug
67
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
67
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
68
68
 
69
69
  // `Object.prototype.propertyIsEnumerable` method implementation
70
70
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
71
71
  objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
72
- var descriptor = getOwnPropertyDescriptor$2(this, V);
72
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
73
73
  return !!descriptor && descriptor.enumerable;
74
74
  } : $propertyIsEnumerable;
75
75
 
@@ -85,30 +85,30 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
85
85
  var NATIVE_BIND$1 = functionBindNative;
86
86
 
87
87
  var FunctionPrototype$1 = Function.prototype;
88
- var call$b = FunctionPrototype$1.call;
89
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$b, call$b);
88
+ var call$d = FunctionPrototype$1.call;
89
+ var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$d, call$d);
90
90
 
91
91
  var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
92
92
  return function () {
93
- return call$b.apply(fn, arguments);
93
+ return call$d.apply(fn, arguments);
94
94
  };
95
95
  };
96
96
 
97
- var uncurryThis$a = functionUncurryThis;
97
+ var uncurryThis$d = functionUncurryThis;
98
98
 
99
- var toString$1 = uncurryThis$a({}.toString);
100
- var stringSlice$1 = uncurryThis$a(''.slice);
99
+ var toString$1 = uncurryThis$d({}.toString);
100
+ var stringSlice$1 = uncurryThis$d(''.slice);
101
101
 
102
102
  var classofRaw$2 = function (it) {
103
103
  return stringSlice$1(toString$1(it), 8, -1);
104
104
  };
105
105
 
106
- var uncurryThis$9 = functionUncurryThis;
106
+ var uncurryThis$c = functionUncurryThis;
107
107
  var fails$9 = fails$c;
108
- var classof$3 = classofRaw$2;
108
+ var classof$2 = classofRaw$2;
109
109
 
110
110
  var $Object$4 = Object;
111
- var split = uncurryThis$9(''.split);
111
+ var split = uncurryThis$c(''.split);
112
112
 
113
113
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
114
114
  var indexedObject = fails$9(function () {
@@ -116,7 +116,7 @@ var indexedObject = fails$9(function () {
116
116
  // eslint-disable-next-line no-prototype-builtins -- safe
117
117
  return !$Object$4('z').propertyIsEnumerable(0);
118
118
  }) ? function (it) {
119
- return classof$3(it) === 'String' ? split(it, '') : $Object$4(it);
119
+ return classof$2(it) === 'String' ? split(it, '') : $Object$4(it);
120
120
  } : $Object$4;
121
121
 
122
122
  // we can't use just `it == null` since of `document.all` special case
@@ -127,12 +127,12 @@ var isNullOrUndefined$3 = function (it) {
127
127
 
128
128
  var isNullOrUndefined$2 = isNullOrUndefined$3;
129
129
 
130
- var $TypeError$b = TypeError;
130
+ var $TypeError$a = TypeError;
131
131
 
132
132
  // `RequireObjectCoercible` abstract operation
133
133
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
134
134
  var requireObjectCoercible$2 = function (it) {
135
- if (isNullOrUndefined$2(it)) throw new $TypeError$b("Can't call method on " + it);
135
+ if (isNullOrUndefined$2(it)) throw new $TypeError$a("Can't call method on " + it);
136
136
  return it;
137
137
  };
138
138
 
@@ -169,13 +169,13 @@ var aFunction = function (argument) {
169
169
  return isCallable$c(argument) ? argument : undefined;
170
170
  };
171
171
 
172
- var getBuiltIn$3 = function (namespace, method) {
172
+ var getBuiltIn$4 = function (namespace, method) {
173
173
  return arguments.length < 2 ? aFunction(global$a[namespace]) : global$a[namespace] && global$a[namespace][method];
174
174
  };
175
175
 
176
- var uncurryThis$8 = functionUncurryThis;
176
+ var uncurryThis$b = functionUncurryThis;
177
177
 
178
- var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
178
+ var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
179
179
 
180
180
  var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
181
181
 
@@ -233,7 +233,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$1
233
233
  && !Symbol.sham
234
234
  && typeof Symbol.iterator == 'symbol';
235
235
 
236
- var getBuiltIn$2 = getBuiltIn$3;
236
+ var getBuiltIn$3 = getBuiltIn$4;
237
237
  var isCallable$b = isCallable$e;
238
238
  var isPrototypeOf$2 = objectIsPrototypeOf;
239
239
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
@@ -243,7 +243,7 @@ var $Object$3 = Object;
243
243
  var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
244
244
  return typeof it == 'symbol';
245
245
  } : function (it) {
246
- var $Symbol = getBuiltIn$2('Symbol');
246
+ var $Symbol = getBuiltIn$3('Symbol');
247
247
  return isCallable$b($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
248
248
  };
249
249
 
@@ -260,38 +260,38 @@ var tryToString$3 = function (argument) {
260
260
  var isCallable$a = isCallable$e;
261
261
  var tryToString$2 = tryToString$3;
262
262
 
263
- var $TypeError$a = TypeError;
263
+ var $TypeError$9 = TypeError;
264
264
 
265
265
  // `Assert: IsCallable(argument) is true`
266
- var aCallable$7 = function (argument) {
266
+ var aCallable$9 = function (argument) {
267
267
  if (isCallable$a(argument)) return argument;
268
- throw new $TypeError$a(tryToString$2(argument) + ' is not a function');
268
+ throw new $TypeError$9(tryToString$2(argument) + ' is not a function');
269
269
  };
270
270
 
271
- var aCallable$6 = aCallable$7;
271
+ var aCallable$8 = aCallable$9;
272
272
  var isNullOrUndefined$1 = isNullOrUndefined$3;
273
273
 
274
274
  // `GetMethod` abstract operation
275
275
  // https://tc39.es/ecma262/#sec-getmethod
276
276
  var getMethod$4 = function (V, P) {
277
277
  var func = V[P];
278
- return isNullOrUndefined$1(func) ? undefined : aCallable$6(func);
278
+ return isNullOrUndefined$1(func) ? undefined : aCallable$8(func);
279
279
  };
280
280
 
281
- var call$a = functionCall;
281
+ var call$c = functionCall;
282
282
  var isCallable$9 = isCallable$e;
283
283
  var isObject$5 = isObject$6;
284
284
 
285
- var $TypeError$9 = TypeError;
285
+ var $TypeError$8 = TypeError;
286
286
 
287
287
  // `OrdinaryToPrimitive` abstract operation
288
288
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
289
289
  var ordinaryToPrimitive$1 = function (input, pref) {
290
290
  var fn, val;
291
- if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$a(fn, input))) return val;
292
- if (isCallable$9(fn = input.valueOf) && !isObject$5(val = call$a(fn, input))) return val;
293
- if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$a(fn, input))) return val;
294
- throw new $TypeError$9("Can't convert object to primitive value");
291
+ if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$c(fn, input))) return val;
292
+ if (isCallable$9(fn = input.valueOf) && !isObject$5(val = call$c(fn, input))) return val;
293
+ if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$c(fn, input))) return val;
294
+ throw new $TypeError$8("Can't convert object to primitive value");
295
295
  };
296
296
 
297
297
  var sharedStore = {exports: {}};
@@ -339,27 +339,27 @@ var $Object$2 = Object;
339
339
 
340
340
  // `ToObject` abstract operation
341
341
  // https://tc39.es/ecma262/#sec-toobject
342
- var toObject$3 = function (argument) {
342
+ var toObject$2 = function (argument) {
343
343
  return $Object$2(requireObjectCoercible(argument));
344
344
  };
345
345
 
346
- var uncurryThis$7 = functionUncurryThis;
347
- var toObject$2 = toObject$3;
346
+ var uncurryThis$a = functionUncurryThis;
347
+ var toObject$1 = toObject$2;
348
348
 
349
- var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
349
+ var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
350
350
 
351
351
  // `HasOwnProperty` abstract operation
352
352
  // https://tc39.es/ecma262/#sec-hasownproperty
353
353
  // eslint-disable-next-line es/no-object-hasown -- safe
354
354
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
355
- return hasOwnProperty(toObject$2(it), key);
355
+ return hasOwnProperty(toObject$1(it), key);
356
356
  };
357
357
 
358
- var uncurryThis$6 = functionUncurryThis;
358
+ var uncurryThis$9 = functionUncurryThis;
359
359
 
360
360
  var id = 0;
361
361
  var postfix = Math.random();
362
- var toString = uncurryThis$6(1.0.toString);
362
+ var toString = uncurryThis$9(1.0.toString);
363
363
 
364
364
  var uid$2 = function (key) {
365
365
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
@@ -384,14 +384,14 @@ var wellKnownSymbol$8 = function (name) {
384
384
  } return WellKnownSymbolsStore[name];
385
385
  };
386
386
 
387
- var call$9 = functionCall;
387
+ var call$b = functionCall;
388
388
  var isObject$4 = isObject$6;
389
389
  var isSymbol$1 = isSymbol$2;
390
390
  var getMethod$3 = getMethod$4;
391
391
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
392
392
  var wellKnownSymbol$7 = wellKnownSymbol$8;
393
393
 
394
- var $TypeError$8 = TypeError;
394
+ var $TypeError$7 = TypeError;
395
395
  var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
396
396
 
397
397
  // `ToPrimitive` abstract operation
@@ -402,9 +402,9 @@ var toPrimitive$1 = function (input, pref) {
402
402
  var result;
403
403
  if (exoticToPrim) {
404
404
  if (pref === undefined) pref = 'default';
405
- result = call$9(exoticToPrim, input, pref);
405
+ result = call$b(exoticToPrim, input, pref);
406
406
  if (!isObject$4(result) || isSymbol$1(result)) return result;
407
- throw new $TypeError$8("Can't convert object to primitive value");
407
+ throw new $TypeError$7("Can't convert object to primitive value");
408
408
  }
409
409
  if (pref === undefined) pref = 'number';
410
410
  return ordinaryToPrimitive(input, pref);
@@ -431,20 +431,20 @@ var documentCreateElement$1 = function (it) {
431
431
  return EXISTS$1 ? document$1.createElement(it) : {};
432
432
  };
433
433
 
434
- var DESCRIPTORS$a = descriptors;
434
+ var DESCRIPTORS$9 = descriptors;
435
435
  var fails$7 = fails$c;
436
436
  var createElement = documentCreateElement$1;
437
437
 
438
438
  // Thanks to IE8 for its funny defineProperty
439
- var ie8DomDefine = !DESCRIPTORS$a && !fails$7(function () {
439
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$7(function () {
440
440
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
441
441
  return Object.defineProperty(createElement('div'), 'a', {
442
442
  get: function () { return 7; }
443
443
  }).a !== 7;
444
444
  });
445
445
 
446
- var DESCRIPTORS$9 = descriptors;
447
- var call$8 = functionCall;
446
+ var DESCRIPTORS$8 = descriptors;
447
+ var call$a = functionCall;
448
448
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
449
449
  var createPropertyDescriptor$2 = createPropertyDescriptor$3;
450
450
  var toIndexedObject$3 = toIndexedObject$4;
@@ -457,23 +457,23 @@ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
457
457
 
458
458
  // `Object.getOwnPropertyDescriptor` method
459
459
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
460
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
460
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
461
461
  O = toIndexedObject$3(O);
462
462
  P = toPropertyKey$1(P);
463
463
  if (IE8_DOM_DEFINE$1) try {
464
464
  return $getOwnPropertyDescriptor$1(O, P);
465
465
  } catch (error) { /* empty */ }
466
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$8(propertyIsEnumerableModule.f, O, P), O[P]);
466
+ if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$a(propertyIsEnumerableModule.f, O, P), O[P]);
467
467
  };
468
468
 
469
469
  var objectDefineProperty = {};
470
470
 
471
- var DESCRIPTORS$8 = descriptors;
471
+ var DESCRIPTORS$7 = descriptors;
472
472
  var fails$6 = fails$c;
473
473
 
474
474
  // V8 ~ Chrome 36-
475
475
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
476
- var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$6(function () {
476
+ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$6(function () {
477
477
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
478
478
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
479
479
  value: 42,
@@ -484,21 +484,21 @@ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$6(function () {
484
484
  var isObject$2 = isObject$6;
485
485
 
486
486
  var $String$1 = String;
487
- var $TypeError$7 = TypeError;
487
+ var $TypeError$6 = TypeError;
488
488
 
489
489
  // `Assert: Type(argument) is Object`
490
- var anObject$e = function (argument) {
490
+ var anObject$f = function (argument) {
491
491
  if (isObject$2(argument)) return argument;
492
- throw new $TypeError$7($String$1(argument) + ' is not an object');
492
+ throw new $TypeError$6($String$1(argument) + ' is not an object');
493
493
  };
494
494
 
495
- var DESCRIPTORS$7 = descriptors;
495
+ var DESCRIPTORS$6 = descriptors;
496
496
  var IE8_DOM_DEFINE = ie8DomDefine;
497
497
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
498
- var anObject$d = anObject$e;
498
+ var anObject$e = anObject$f;
499
499
  var toPropertyKey = toPropertyKey$2;
500
500
 
501
- var $TypeError$6 = TypeError;
501
+ var $TypeError$5 = TypeError;
502
502
  // eslint-disable-next-line es/no-object-defineproperty -- safe
503
503
  var $defineProperty = Object.defineProperty;
504
504
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -509,10 +509,10 @@ var WRITABLE = 'writable';
509
509
 
510
510
  // `Object.defineProperty` method
511
511
  // https://tc39.es/ecma262/#sec-object.defineproperty
512
- objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
513
- anObject$d(O);
512
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
513
+ anObject$e(O);
514
514
  P = toPropertyKey(P);
515
- anObject$d(Attributes);
515
+ anObject$e(Attributes);
516
516
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
517
517
  var current = $getOwnPropertyDescriptor(O, P);
518
518
  if (current && current[WRITABLE]) {
@@ -525,22 +525,22 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
525
525
  }
526
526
  } return $defineProperty(O, P, Attributes);
527
527
  } : $defineProperty : function defineProperty(O, P, Attributes) {
528
- anObject$d(O);
528
+ anObject$e(O);
529
529
  P = toPropertyKey(P);
530
- anObject$d(Attributes);
530
+ anObject$e(Attributes);
531
531
  if (IE8_DOM_DEFINE) try {
532
532
  return $defineProperty(O, P, Attributes);
533
533
  } catch (error) { /* empty */ }
534
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$6('Accessors not supported');
534
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$5('Accessors not supported');
535
535
  if ('value' in Attributes) O[P] = Attributes.value;
536
536
  return O;
537
537
  };
538
538
 
539
- var DESCRIPTORS$6 = descriptors;
539
+ var DESCRIPTORS$5 = descriptors;
540
540
  var definePropertyModule$4 = objectDefineProperty;
541
541
  var createPropertyDescriptor$1 = createPropertyDescriptor$3;
542
542
 
543
- var createNonEnumerableProperty$3 = DESCRIPTORS$6 ? function (object, key, value) {
543
+ var createNonEnumerableProperty$3 = DESCRIPTORS$5 ? function (object, key, value) {
544
544
  return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
545
545
  } : function (object, key, value) {
546
546
  object[key] = value;
@@ -549,17 +549,17 @@ var createNonEnumerableProperty$3 = DESCRIPTORS$6 ? function (object, key, value
549
549
 
550
550
  var makeBuiltIn$3 = {exports: {}};
551
551
 
552
- var DESCRIPTORS$5 = descriptors;
552
+ var DESCRIPTORS$4 = descriptors;
553
553
  var hasOwn$6 = hasOwnProperty_1;
554
554
 
555
555
  var FunctionPrototype = Function.prototype;
556
556
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
557
- var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
557
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
558
558
 
559
559
  var EXISTS = hasOwn$6(FunctionPrototype, 'name');
560
560
  // additional protection from minified / mangled / dropped function names
561
561
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
562
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype, 'name').configurable));
562
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
563
563
 
564
564
  var functionName = {
565
565
  EXISTS: EXISTS,
@@ -567,11 +567,11 @@ var functionName = {
567
567
  CONFIGURABLE: CONFIGURABLE
568
568
  };
569
569
 
570
- var uncurryThis$5 = functionUncurryThis;
570
+ var uncurryThis$8 = functionUncurryThis;
571
571
  var isCallable$8 = isCallable$e;
572
572
  var store$1 = sharedStoreExports;
573
573
 
574
- var functionToString = uncurryThis$5(Function.toString);
574
+ var functionToString = uncurryThis$8(Function.toString);
575
575
 
576
576
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
577
577
  if (!isCallable$8(store$1.inspectSource)) {
@@ -592,10 +592,10 @@ var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String
592
592
  var shared$1 = shared$3;
593
593
  var uid = uid$2;
594
594
 
595
- var keys = shared$1('keys');
595
+ var keys$1 = shared$1('keys');
596
596
 
597
597
  var sharedKey$3 = function (key) {
598
- return keys[key] || (keys[key] = uid(key));
598
+ return keys$1[key] || (keys$1[key] = uid(key));
599
599
  };
600
600
 
601
601
  var hiddenKeys$4 = {};
@@ -612,10 +612,10 @@ var hiddenKeys$3 = hiddenKeys$4;
612
612
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
613
613
  var TypeError$1 = global$3.TypeError;
614
614
  var WeakMap = global$3.WeakMap;
615
- var set, get, has;
615
+ var set, get, has$6;
616
616
 
617
617
  var enforce = function (it) {
618
- return has(it) ? get(it) : set(it, {});
618
+ return has$6(it) ? get(it) : set(it, {});
619
619
  };
620
620
 
621
621
  var getterFor = function (TYPE) {
@@ -643,7 +643,7 @@ if (NATIVE_WEAK_MAP || shared.state) {
643
643
  get = function (it) {
644
644
  return store.get(it) || {};
645
645
  };
646
- has = function (it) {
646
+ has$6 = function (it) {
647
647
  return store.has(it);
648
648
  };
649
649
  } else {
@@ -658,7 +658,7 @@ if (NATIVE_WEAK_MAP || shared.state) {
658
658
  get = function (it) {
659
659
  return hasOwn$5(it, STATE) ? it[STATE] : {};
660
660
  };
661
- has = function (it) {
661
+ has$6 = function (it) {
662
662
  return hasOwn$5(it, STATE);
663
663
  };
664
664
  }
@@ -666,16 +666,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
666
666
  var internalState = {
667
667
  set: set,
668
668
  get: get,
669
- has: has,
669
+ has: has$6,
670
670
  enforce: enforce,
671
671
  getterFor: getterFor
672
672
  };
673
673
 
674
- var uncurryThis$4 = functionUncurryThis;
674
+ var uncurryThis$7 = functionUncurryThis;
675
675
  var fails$5 = fails$c;
676
676
  var isCallable$6 = isCallable$e;
677
677
  var hasOwn$4 = hasOwnProperty_1;
678
- var DESCRIPTORS$4 = descriptors;
678
+ var DESCRIPTORS$3 = descriptors;
679
679
  var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
680
680
  var inspectSource = inspectSource$1;
681
681
  var InternalStateModule$1 = internalState;
@@ -685,11 +685,11 @@ var getInternalState = InternalStateModule$1.get;
685
685
  var $String = String;
686
686
  // eslint-disable-next-line es/no-object-defineproperty -- safe
687
687
  var defineProperty$1 = Object.defineProperty;
688
- var stringSlice = uncurryThis$4(''.slice);
689
- var replace = uncurryThis$4(''.replace);
690
- var join = uncurryThis$4([].join);
688
+ var stringSlice = uncurryThis$7(''.slice);
689
+ var replace = uncurryThis$7(''.replace);
690
+ var join = uncurryThis$7([].join);
691
691
 
692
- var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$5(function () {
692
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$5(function () {
693
693
  return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
694
694
  });
695
695
 
@@ -702,7 +702,7 @@ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
702
702
  if (options && options.getter) name = 'get ' + name;
703
703
  if (options && options.setter) name = 'set ' + name;
704
704
  if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
705
- if (DESCRIPTORS$4) defineProperty$1(value, 'name', { value: name, configurable: true });
705
+ if (DESCRIPTORS$3) defineProperty$1(value, 'name', { value: name, configurable: true });
706
706
  else value.name = name;
707
707
  }
708
708
  if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
@@ -710,7 +710,7 @@ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
710
710
  }
711
711
  try {
712
712
  if (options && hasOwn$4(options, 'constructor') && options.constructor) {
713
- if (DESCRIPTORS$4) defineProperty$1(value, 'prototype', { writable: false });
713
+ if (DESCRIPTORS$3) defineProperty$1(value, 'prototype', { writable: false });
714
714
  // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
715
715
  } else if (value.prototype) value.prototype = undefined;
716
716
  } catch (error) { /* empty */ }
@@ -773,33 +773,33 @@ var trunc = mathTrunc;
773
773
 
774
774
  // `ToIntegerOrInfinity` abstract operation
775
775
  // https://tc39.es/ecma262/#sec-tointegerorinfinity
776
- var toIntegerOrInfinity$2 = function (argument) {
776
+ var toIntegerOrInfinity$3 = function (argument) {
777
777
  var number = +argument;
778
778
  // eslint-disable-next-line no-self-compare -- NaN check
779
779
  return number !== number || number === 0 ? 0 : trunc(number);
780
780
  };
781
781
 
782
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
782
+ var toIntegerOrInfinity$2 = toIntegerOrInfinity$3;
783
783
 
784
- var max = Math.max;
784
+ var max$1 = Math.max;
785
785
  var min$1 = Math.min;
786
786
 
787
787
  // Helper for a popular repeating case of the spec:
788
788
  // Let integer be ? ToInteger(index).
789
789
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
790
790
  var toAbsoluteIndex$1 = function (index, length) {
791
- var integer = toIntegerOrInfinity$1(index);
792
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
791
+ var integer = toIntegerOrInfinity$2(index);
792
+ return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
793
793
  };
794
794
 
795
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
795
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$3;
796
796
 
797
797
  var min = Math.min;
798
798
 
799
799
  // `ToLength` abstract operation
800
800
  // https://tc39.es/ecma262/#sec-tolength
801
801
  var toLength$1 = function (argument) {
802
- var len = toIntegerOrInfinity(argument);
802
+ var len = toIntegerOrInfinity$1(argument);
803
803
  return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
804
804
  };
805
805
 
@@ -807,19 +807,19 @@ var toLength = toLength$1;
807
807
 
808
808
  // `LengthOfArrayLike` abstract operation
809
809
  // https://tc39.es/ecma262/#sec-lengthofarraylike
810
- var lengthOfArrayLike$3 = function (obj) {
810
+ var lengthOfArrayLike$2 = function (obj) {
811
811
  return toLength(obj.length);
812
812
  };
813
813
 
814
814
  var toIndexedObject$2 = toIndexedObject$4;
815
815
  var toAbsoluteIndex = toAbsoluteIndex$1;
816
- var lengthOfArrayLike$2 = lengthOfArrayLike$3;
816
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
817
817
 
818
818
  // `Array.prototype.{ indexOf, includes }` methods implementation
819
819
  var createMethod = function (IS_INCLUDES) {
820
820
  return function ($this, el, fromIndex) {
821
821
  var O = toIndexedObject$2($this);
822
- var length = lengthOfArrayLike$2(O);
822
+ var length = lengthOfArrayLike$1(O);
823
823
  if (length === 0) return !IS_INCLUDES && -1;
824
824
  var index = toAbsoluteIndex(fromIndex, length);
825
825
  var value;
@@ -845,13 +845,13 @@ var arrayIncludes = {
845
845
  indexOf: createMethod(false)
846
846
  };
847
847
 
848
- var uncurryThis$3 = functionUncurryThis;
848
+ var uncurryThis$6 = functionUncurryThis;
849
849
  var hasOwn$3 = hasOwnProperty_1;
850
850
  var toIndexedObject$1 = toIndexedObject$4;
851
851
  var indexOf = arrayIncludes.indexOf;
852
852
  var hiddenKeys$2 = hiddenKeys$4;
853
853
 
854
- var push = uncurryThis$3([].push);
854
+ var push = uncurryThis$6([].push);
855
855
 
856
856
  var objectKeysInternal = function (object, names) {
857
857
  var O = toIndexedObject$1(object);
@@ -894,17 +894,17 @@ var objectGetOwnPropertySymbols = {};
894
894
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
895
895
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
896
896
 
897
- var getBuiltIn$1 = getBuiltIn$3;
898
- var uncurryThis$2 = functionUncurryThis;
897
+ var getBuiltIn$2 = getBuiltIn$4;
898
+ var uncurryThis$5 = functionUncurryThis;
899
899
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
900
900
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
901
- var anObject$c = anObject$e;
901
+ var anObject$d = anObject$f;
902
902
 
903
- var concat = uncurryThis$2([].concat);
903
+ var concat = uncurryThis$5([].concat);
904
904
 
905
905
  // all object keys, includes non-enumerable and symbols
906
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
907
- var keys = getOwnPropertyNamesModule.f(anObject$c(it));
906
+ var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
907
+ var keys = getOwnPropertyNamesModule.f(anObject$d(it));
908
908
  var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
909
909
  return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
910
910
  };
@@ -950,7 +950,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
950
950
  var isForced_1 = isForced$1;
951
951
 
952
952
  var global$2 = global$b;
953
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
953
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
954
954
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
955
955
  var defineBuiltIn$2 = defineBuiltIn$3;
956
956
  var defineGlobalProperty = defineGlobalProperty$3;
@@ -987,7 +987,7 @@ var _export = function (options, source) {
987
987
  if (target) for (key in source) {
988
988
  sourceProperty = source[key];
989
989
  if (options.dontCallGetSet) {
990
- descriptor = getOwnPropertyDescriptor$1(target, key);
990
+ descriptor = getOwnPropertyDescriptor(target, key);
991
991
  targetProperty = descriptor && descriptor.value;
992
992
  } else targetProperty = target[key];
993
993
  FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
@@ -1004,104 +1004,18 @@ var _export = function (options, source) {
1004
1004
  }
1005
1005
  };
1006
1006
 
1007
- var classof$2 = classofRaw$2;
1008
-
1009
- // `IsArray` abstract operation
1010
- // https://tc39.es/ecma262/#sec-isarray
1011
- // eslint-disable-next-line es/no-array-isarray -- safe
1012
- var isArray$1 = Array.isArray || function isArray(argument) {
1013
- return classof$2(argument) === 'Array';
1014
- };
1015
-
1016
- var DESCRIPTORS$3 = descriptors;
1017
- var isArray = isArray$1;
1018
-
1019
- var $TypeError$5 = TypeError;
1020
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1021
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1022
-
1023
- // Safari < 13 does not throw an error in this case
1024
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$3 && !function () {
1025
- // makes no sense without proper strict mode support
1026
- if (this !== undefined) return true;
1027
- try {
1028
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1029
- Object.defineProperty([], 'length', { writable: false }).length = 1;
1030
- } catch (error) {
1031
- return error instanceof TypeError;
1032
- }
1033
- }();
1034
-
1035
- var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1036
- if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1037
- throw new $TypeError$5('Cannot set read only .length');
1038
- } return O.length = length;
1039
- } : function (O, length) {
1040
- return O.length = length;
1041
- };
1042
-
1043
- var $TypeError$4 = TypeError;
1044
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
1045
-
1046
- var doesNotExceedSafeInteger$1 = function (it) {
1047
- if (it > MAX_SAFE_INTEGER) throw $TypeError$4('Maximum allowed index exceeded');
1048
- return it;
1049
- };
1050
-
1051
- var $$5 = _export;
1052
- var toObject$1 = toObject$3;
1053
- var lengthOfArrayLike$1 = lengthOfArrayLike$3;
1054
- var setArrayLength = arraySetLength;
1055
- var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
1056
- var fails$3 = fails$c;
1057
-
1058
- var INCORRECT_TO_LENGTH = fails$3(function () {
1059
- return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
1060
- });
1061
-
1062
- // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
1063
- // https://bugs.chromium.org/p/v8/issues/detail?id=12681
1064
- var properErrorOnNonWritableLength = function () {
1065
- try {
1066
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1067
- Object.defineProperty([], 'length', { writable: false }).push();
1068
- } catch (error) {
1069
- return error instanceof TypeError;
1070
- }
1071
- };
1072
-
1073
- var FORCED$1 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
1074
-
1075
- // `Array.prototype.push` method
1076
- // https://tc39.es/ecma262/#sec-array.prototype.push
1077
- $$5({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
1078
- // eslint-disable-next-line no-unused-vars -- required for `.length`
1079
- push: function push(item) {
1080
- var O = toObject$1(this);
1081
- var len = lengthOfArrayLike$1(O);
1082
- var argCount = arguments.length;
1083
- doesNotExceedSafeInteger(len + argCount);
1084
- for (var i = 0; i < argCount; i++) {
1085
- O[len] = arguments[i];
1086
- len++;
1087
- }
1088
- setArrayLength(O, len);
1089
- return len;
1090
- }
1091
- });
1092
-
1093
1007
  var isPrototypeOf$1 = objectIsPrototypeOf;
1094
1008
 
1095
- var $TypeError$3 = TypeError;
1009
+ var $TypeError$4 = TypeError;
1096
1010
 
1097
1011
  var anInstance$1 = function (it, Prototype) {
1098
1012
  if (isPrototypeOf$1(Prototype, it)) return it;
1099
- throw new $TypeError$3('Incorrect invocation');
1013
+ throw new $TypeError$4('Incorrect invocation');
1100
1014
  };
1101
1015
 
1102
- var fails$2 = fails$c;
1016
+ var fails$3 = fails$c;
1103
1017
 
1104
- var correctPrototypeGetter = !fails$2(function () {
1018
+ var correctPrototypeGetter = !fails$3(function () {
1105
1019
  function F() { /* empty */ }
1106
1020
  F.prototype.constructor = null;
1107
1021
  // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
@@ -1110,7 +1024,7 @@ var correctPrototypeGetter = !fails$2(function () {
1110
1024
 
1111
1025
  var hasOwn$1 = hasOwnProperty_1;
1112
1026
  var isCallable$3 = isCallable$e;
1113
- var toObject = toObject$3;
1027
+ var toObject = toObject$2;
1114
1028
  var sharedKey$1 = sharedKey$3;
1115
1029
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1116
1030
 
@@ -1163,7 +1077,7 @@ var objectKeys$1 = Object.keys || function keys(O) {
1163
1077
  var DESCRIPTORS$1 = descriptors;
1164
1078
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1165
1079
  var definePropertyModule = objectDefineProperty;
1166
- var anObject$b = anObject$e;
1080
+ var anObject$c = anObject$f;
1167
1081
  var toIndexedObject = toIndexedObject$4;
1168
1082
  var objectKeys = objectKeys$1;
1169
1083
 
@@ -1171,7 +1085,7 @@ var objectKeys = objectKeys$1;
1171
1085
  // https://tc39.es/ecma262/#sec-object.defineproperties
1172
1086
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1173
1087
  objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1174
- anObject$b(O);
1088
+ anObject$c(O);
1175
1089
  var props = toIndexedObject(Properties);
1176
1090
  var keys = objectKeys(Properties);
1177
1091
  var length = keys.length;
@@ -1181,12 +1095,12 @@ objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.de
1181
1095
  return O;
1182
1096
  };
1183
1097
 
1184
- var getBuiltIn = getBuiltIn$3;
1098
+ var getBuiltIn$1 = getBuiltIn$4;
1185
1099
 
1186
- var html$1 = getBuiltIn('document', 'documentElement');
1100
+ var html$1 = getBuiltIn$1('document', 'documentElement');
1187
1101
 
1188
1102
  /* global ActiveXObject -- old IE, WSH */
1189
- var anObject$a = anObject$e;
1103
+ var anObject$b = anObject$f;
1190
1104
  var definePropertiesModule = objectDefineProperties;
1191
1105
  var enumBugKeys = enumBugKeys$3;
1192
1106
  var hiddenKeys = hiddenKeys$4;
@@ -1260,7 +1174,7 @@ hiddenKeys[IE_PROTO] = true;
1260
1174
  var objectCreate = Object.create || function create(O, Properties) {
1261
1175
  var result;
1262
1176
  if (O !== null) {
1263
- EmptyConstructor[PROTOTYPE] = anObject$a(O);
1177
+ EmptyConstructor[PROTOTYPE] = anObject$b(O);
1264
1178
  result = new EmptyConstructor();
1265
1179
  EmptyConstructor[PROTOTYPE] = null;
1266
1180
  // add "__proto__" for Object.getPrototypeOf polyfill
@@ -1269,7 +1183,7 @@ var objectCreate = Object.create || function create(O, Properties) {
1269
1183
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1270
1184
  };
1271
1185
 
1272
- var fails$1 = fails$c;
1186
+ var fails$2 = fails$c;
1273
1187
  var isCallable$2 = isCallable$e;
1274
1188
  var isObject = isObject$6;
1275
1189
  var getPrototypeOf$1 = objectGetPrototypeOf;
@@ -1294,7 +1208,7 @@ if ([].keys) {
1294
1208
  }
1295
1209
  }
1296
1210
 
1297
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$1(function () {
1211
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$2(function () {
1298
1212
  var test = {};
1299
1213
  // FF44- legacy iterators case
1300
1214
  return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
@@ -1315,15 +1229,15 @@ var iteratorsCore = {
1315
1229
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
1316
1230
  };
1317
1231
 
1318
- var $$4 = _export;
1232
+ var $$b = _export;
1319
1233
  var global$1 = global$b;
1320
1234
  var anInstance = anInstance$1;
1321
- var anObject$9 = anObject$e;
1235
+ var anObject$a = anObject$f;
1322
1236
  var isCallable$1 = isCallable$e;
1323
1237
  var getPrototypeOf = objectGetPrototypeOf;
1324
1238
  var defineBuiltInAccessor = defineBuiltInAccessor$1;
1325
1239
  var createProperty = createProperty$1;
1326
- var fails = fails$c;
1240
+ var fails$1 = fails$c;
1327
1241
  var hasOwn = hasOwnProperty_1;
1328
1242
  var wellKnownSymbol$5 = wellKnownSymbol$8;
1329
1243
  var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
@@ -1333,18 +1247,18 @@ var CONSTRUCTOR = 'constructor';
1333
1247
  var ITERATOR$2 = 'Iterator';
1334
1248
  var TO_STRING_TAG$3 = wellKnownSymbol$5('toStringTag');
1335
1249
 
1336
- var $TypeError$2 = TypeError;
1250
+ var $TypeError$3 = TypeError;
1337
1251
  var NativeIterator = global$1[ITERATOR$2];
1338
1252
 
1339
1253
  // FF56- have non-standard global helper `Iterator`
1340
1254
  var FORCED = !isCallable$1(NativeIterator)
1341
1255
  || NativeIterator.prototype !== IteratorPrototype$1
1342
1256
  // FF44- non-standard `Iterator` passes previous tests
1343
- || !fails(function () { NativeIterator({}); });
1257
+ || !fails$1(function () { NativeIterator({}); });
1344
1258
 
1345
1259
  var IteratorConstructor = function Iterator() {
1346
1260
  anInstance(this, IteratorPrototype$1);
1347
- if (getPrototypeOf(this) === IteratorPrototype$1) throw new $TypeError$2('Abstract class Iterator not directly constructable');
1261
+ if (getPrototypeOf(this) === IteratorPrototype$1) throw new $TypeError$3('Abstract class Iterator not directly constructable');
1348
1262
  };
1349
1263
 
1350
1264
  var defineIteratorPrototypeAccessor = function (key, value) {
@@ -1355,8 +1269,8 @@ var defineIteratorPrototypeAccessor = function (key, value) {
1355
1269
  return value;
1356
1270
  },
1357
1271
  set: function (replacement) {
1358
- anObject$9(this);
1359
- if (this === IteratorPrototype$1) throw new $TypeError$2("You can't redefine this property");
1272
+ anObject$a(this);
1273
+ if (this === IteratorPrototype$1) throw new $TypeError$3("You can't redefine this property");
1360
1274
  if (hasOwn(this, key)) this[key] = replacement;
1361
1275
  else createProperty(this, key, replacement);
1362
1276
  }
@@ -1374,13 +1288,13 @@ IteratorConstructor.prototype = IteratorPrototype$1;
1374
1288
 
1375
1289
  // `Iterator` constructor
1376
1290
  // https://github.com/tc39/proposal-iterator-helpers
1377
- $$4({ global: true, constructor: true, forced: FORCED }, {
1291
+ $$b({ global: true, constructor: true, forced: FORCED }, {
1378
1292
  Iterator: IteratorConstructor
1379
1293
  });
1380
1294
 
1381
1295
  // `GetIteratorDirect(obj)` abstract operation
1382
1296
  // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
1383
- var getIteratorDirect$5 = function (obj) {
1297
+ var getIteratorDirect$6 = function (obj) {
1384
1298
  return {
1385
1299
  iterator: obj,
1386
1300
  next: obj.next,
@@ -1401,31 +1315,31 @@ var createIterResultObject$1 = function (value, done) {
1401
1315
  return { value: value, done: done };
1402
1316
  };
1403
1317
 
1404
- var call$7 = functionCall;
1405
- var anObject$8 = anObject$e;
1318
+ var call$9 = functionCall;
1319
+ var anObject$9 = anObject$f;
1406
1320
  var getMethod$2 = getMethod$4;
1407
1321
 
1408
- var iteratorClose$4 = function (iterator, kind, value) {
1322
+ var iteratorClose$6 = function (iterator, kind, value) {
1409
1323
  var innerResult, innerError;
1410
- anObject$8(iterator);
1324
+ anObject$9(iterator);
1411
1325
  try {
1412
1326
  innerResult = getMethod$2(iterator, 'return');
1413
1327
  if (!innerResult) {
1414
1328
  if (kind === 'throw') throw value;
1415
1329
  return value;
1416
1330
  }
1417
- innerResult = call$7(innerResult, iterator);
1331
+ innerResult = call$9(innerResult, iterator);
1418
1332
  } catch (error) {
1419
1333
  innerError = true;
1420
1334
  innerResult = error;
1421
1335
  }
1422
1336
  if (kind === 'throw') throw value;
1423
1337
  if (innerError) throw innerResult;
1424
- anObject$8(innerResult);
1338
+ anObject$9(innerResult);
1425
1339
  return value;
1426
1340
  };
1427
1341
 
1428
- var call$6 = functionCall;
1342
+ var call$8 = functionCall;
1429
1343
  var create = objectCreate;
1430
1344
  var createNonEnumerableProperty = createNonEnumerableProperty$3;
1431
1345
  var defineBuiltIns = defineBuiltIns$1;
@@ -1434,7 +1348,7 @@ var InternalStateModule = internalState;
1434
1348
  var getMethod$1 = getMethod$4;
1435
1349
  var IteratorPrototype = iteratorsCore.IteratorPrototype;
1436
1350
  var createIterResultObject = createIterResultObject$1;
1437
- var iteratorClose$3 = iteratorClose$4;
1351
+ var iteratorClose$5 = iteratorClose$6;
1438
1352
 
1439
1353
  var TO_STRING_TAG$2 = wellKnownSymbol$4('toStringTag');
1440
1354
  var ITERATOR_HELPER = 'IteratorHelper';
@@ -1465,14 +1379,14 @@ var createIteratorProxyPrototype = function (IS_ITERATOR) {
1465
1379
  state.done = true;
1466
1380
  if (IS_ITERATOR) {
1467
1381
  var returnMethod = getMethod$1(iterator, 'return');
1468
- return returnMethod ? call$6(returnMethod, iterator) : createIterResultObject(undefined, true);
1382
+ return returnMethod ? call$8(returnMethod, iterator) : createIterResultObject(undefined, true);
1469
1383
  }
1470
1384
  if (state.inner) try {
1471
- iteratorClose$3(state.inner.iterator, 'normal');
1385
+ iteratorClose$5(state.inner.iterator, 'normal');
1472
1386
  } catch (error) {
1473
- return iteratorClose$3(iterator, 'throw', error);
1387
+ return iteratorClose$5(iterator, 'throw', error);
1474
1388
  }
1475
- iteratorClose$3(iterator, 'normal');
1389
+ iteratorClose$5(iterator, 'normal');
1476
1390
  return createIterResultObject(undefined, true);
1477
1391
  }
1478
1392
  });
@@ -1501,23 +1415,23 @@ var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) {
1501
1415
  return IteratorProxy;
1502
1416
  };
1503
1417
 
1504
- var anObject$7 = anObject$e;
1505
- var iteratorClose$2 = iteratorClose$4;
1418
+ var anObject$8 = anObject$f;
1419
+ var iteratorClose$4 = iteratorClose$6;
1506
1420
 
1507
1421
  // call something on iterator step with safe closing on error
1508
1422
  var callWithSafeIterationClosing$2 = function (iterator, fn, value, ENTRIES) {
1509
1423
  try {
1510
- return ENTRIES ? fn(anObject$7(value)[0], value[1]) : fn(value);
1424
+ return ENTRIES ? fn(anObject$8(value)[0], value[1]) : fn(value);
1511
1425
  } catch (error) {
1512
- iteratorClose$2(iterator, 'throw', error);
1426
+ iteratorClose$4(iterator, 'throw', error);
1513
1427
  }
1514
1428
  };
1515
1429
 
1516
- var $$3 = _export;
1517
- var call$5 = functionCall;
1518
- var aCallable$5 = aCallable$7;
1519
- var anObject$6 = anObject$e;
1520
- var getIteratorDirect$4 = getIteratorDirect$5;
1430
+ var $$a = _export;
1431
+ var call$7 = functionCall;
1432
+ var aCallable$7 = aCallable$9;
1433
+ var anObject$7 = anObject$f;
1434
+ var getIteratorDirect$5 = getIteratorDirect$6;
1521
1435
  var createIteratorProxy$2 = iteratorCreateProxy;
1522
1436
  var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$2;
1523
1437
  var IS_PURE$2 = isPure;
@@ -1528,7 +1442,7 @@ var IteratorProxy$2 = createIteratorProxy$2(function () {
1528
1442
  var next = this.next;
1529
1443
  var result, done, value;
1530
1444
  while (true) {
1531
- result = anObject$6(call$5(next, iterator));
1445
+ result = anObject$7(call$7(next, iterator));
1532
1446
  done = this.done = !!result.done;
1533
1447
  if (done) return;
1534
1448
  value = result.value;
@@ -1538,35 +1452,35 @@ var IteratorProxy$2 = createIteratorProxy$2(function () {
1538
1452
 
1539
1453
  // `Iterator.prototype.filter` method
1540
1454
  // https://github.com/tc39/proposal-iterator-helpers
1541
- $$3({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$2 }, {
1455
+ $$a({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$2 }, {
1542
1456
  filter: function filter(predicate) {
1543
- anObject$6(this);
1544
- aCallable$5(predicate);
1545
- return new IteratorProxy$2(getIteratorDirect$4(this), {
1457
+ anObject$7(this);
1458
+ aCallable$7(predicate);
1459
+ return new IteratorProxy$2(getIteratorDirect$5(this), {
1546
1460
  predicate: predicate
1547
1461
  });
1548
1462
  }
1549
1463
  });
1550
1464
 
1551
1465
  var classofRaw$1 = classofRaw$2;
1552
- var uncurryThis$1 = functionUncurryThis;
1466
+ var uncurryThis$4 = functionUncurryThis;
1553
1467
 
1554
1468
  var functionUncurryThisClause = function (fn) {
1555
1469
  // Nashorn bug:
1556
1470
  // https://github.com/zloirock/core-js/issues/1128
1557
1471
  // https://github.com/zloirock/core-js/issues/1130
1558
- if (classofRaw$1(fn) === 'Function') return uncurryThis$1(fn);
1472
+ if (classofRaw$1(fn) === 'Function') return uncurryThis$4(fn);
1559
1473
  };
1560
1474
 
1561
- var uncurryThis = functionUncurryThisClause;
1562
- var aCallable$4 = aCallable$7;
1475
+ var uncurryThis$3 = functionUncurryThisClause;
1476
+ var aCallable$6 = aCallable$9;
1563
1477
  var NATIVE_BIND = functionBindNative;
1564
1478
 
1565
- var bind$1 = uncurryThis(uncurryThis.bind);
1479
+ var bind$1 = uncurryThis$3(uncurryThis$3.bind);
1566
1480
 
1567
1481
  // optional / simple context binding
1568
1482
  var functionBindContext = function (fn, that) {
1569
- aCallable$4(fn);
1483
+ aCallable$6(fn);
1570
1484
  return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
1571
1485
  return fn.apply(that, arguments);
1572
1486
  };
@@ -1638,32 +1552,32 @@ var getIteratorMethod$3 = function (it) {
1638
1552
  || Iterators[classof(it)];
1639
1553
  };
1640
1554
 
1641
- var call$4 = functionCall;
1642
- var aCallable$3 = aCallable$7;
1643
- var anObject$5 = anObject$e;
1555
+ var call$6 = functionCall;
1556
+ var aCallable$5 = aCallable$9;
1557
+ var anObject$6 = anObject$f;
1644
1558
  var tryToString$1 = tryToString$3;
1645
1559
  var getIteratorMethod$2 = getIteratorMethod$3;
1646
1560
 
1647
- var $TypeError$1 = TypeError;
1561
+ var $TypeError$2 = TypeError;
1648
1562
 
1649
1563
  var getIterator$1 = function (argument, usingIterator) {
1650
1564
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod$2(argument) : usingIterator;
1651
- if (aCallable$3(iteratorMethod)) return anObject$5(call$4(iteratorMethod, argument));
1652
- throw new $TypeError$1(tryToString$1(argument) + ' is not iterable');
1565
+ if (aCallable$5(iteratorMethod)) return anObject$6(call$6(iteratorMethod, argument));
1566
+ throw new $TypeError$2(tryToString$1(argument) + ' is not iterable');
1653
1567
  };
1654
1568
 
1655
1569
  var bind = functionBindContext;
1656
- var call$3 = functionCall;
1657
- var anObject$4 = anObject$e;
1570
+ var call$5 = functionCall;
1571
+ var anObject$5 = anObject$f;
1658
1572
  var tryToString = tryToString$3;
1659
1573
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
1660
- var lengthOfArrayLike = lengthOfArrayLike$3;
1574
+ var lengthOfArrayLike = lengthOfArrayLike$2;
1661
1575
  var isPrototypeOf = objectIsPrototypeOf;
1662
1576
  var getIterator = getIterator$1;
1663
1577
  var getIteratorMethod$1 = getIteratorMethod$3;
1664
- var iteratorClose$1 = iteratorClose$4;
1578
+ var iteratorClose$3 = iteratorClose$6;
1665
1579
 
1666
- var $TypeError = TypeError;
1580
+ var $TypeError$1 = TypeError;
1667
1581
 
1668
1582
  var Result = function (stopped, result) {
1669
1583
  this.stopped = stopped;
@@ -1672,7 +1586,7 @@ var Result = function (stopped, result) {
1672
1586
 
1673
1587
  var ResultPrototype = Result.prototype;
1674
1588
 
1675
- var iterate$1 = function (iterable, unboundFunction, options) {
1589
+ var iterate$3 = function (iterable, unboundFunction, options) {
1676
1590
  var that = options && options.that;
1677
1591
  var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1678
1592
  var IS_RECORD = !!(options && options.IS_RECORD);
@@ -1682,13 +1596,13 @@ var iterate$1 = function (iterable, unboundFunction, options) {
1682
1596
  var iterator, iterFn, index, length, result, next, step;
1683
1597
 
1684
1598
  var stop = function (condition) {
1685
- if (iterator) iteratorClose$1(iterator, 'normal', condition);
1599
+ if (iterator) iteratorClose$3(iterator, 'normal', condition);
1686
1600
  return new Result(true, condition);
1687
1601
  };
1688
1602
 
1689
1603
  var callFn = function (value) {
1690
1604
  if (AS_ENTRIES) {
1691
- anObject$4(value);
1605
+ anObject$5(value);
1692
1606
  return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1693
1607
  } return INTERRUPTED ? fn(value, stop) : fn(value);
1694
1608
  };
@@ -1699,7 +1613,7 @@ var iterate$1 = function (iterable, unboundFunction, options) {
1699
1613
  iterator = iterable;
1700
1614
  } else {
1701
1615
  iterFn = getIteratorMethod$1(iterable);
1702
- if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
1616
+ if (!iterFn) throw new $TypeError$1(tryToString(iterable) + ' is not iterable');
1703
1617
  // optimisation for array iterators
1704
1618
  if (isArrayIteratorMethod(iterFn)) {
1705
1619
  for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
@@ -1711,31 +1625,31 @@ var iterate$1 = function (iterable, unboundFunction, options) {
1711
1625
  }
1712
1626
 
1713
1627
  next = IS_RECORD ? iterable.next : iterator.next;
1714
- while (!(step = call$3(next, iterator)).done) {
1628
+ while (!(step = call$5(next, iterator)).done) {
1715
1629
  try {
1716
1630
  result = callFn(step.value);
1717
1631
  } catch (error) {
1718
- iteratorClose$1(iterator, 'throw', error);
1632
+ iteratorClose$3(iterator, 'throw', error);
1719
1633
  }
1720
1634
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
1721
1635
  } return new Result(false);
1722
1636
  };
1723
1637
 
1724
- var $$2 = _export;
1725
- var iterate = iterate$1;
1726
- var aCallable$2 = aCallable$7;
1727
- var anObject$3 = anObject$e;
1728
- var getIteratorDirect$3 = getIteratorDirect$5;
1638
+ var $$9 = _export;
1639
+ var iterate$2 = iterate$3;
1640
+ var aCallable$4 = aCallable$9;
1641
+ var anObject$4 = anObject$f;
1642
+ var getIteratorDirect$4 = getIteratorDirect$6;
1729
1643
 
1730
1644
  // `Iterator.prototype.forEach` method
1731
1645
  // https://github.com/tc39/proposal-iterator-helpers
1732
- $$2({ target: 'Iterator', proto: true, real: true }, {
1646
+ $$9({ target: 'Iterator', proto: true, real: true }, {
1733
1647
  forEach: function forEach(fn) {
1734
- anObject$3(this);
1735
- aCallable$2(fn);
1736
- var record = getIteratorDirect$3(this);
1648
+ anObject$4(this);
1649
+ aCallable$4(fn);
1650
+ var record = getIteratorDirect$4(this);
1737
1651
  var counter = 0;
1738
- iterate(record, function (value) {
1652
+ iterate$2(record, function (value) {
1739
1653
  fn(value, counter++);
1740
1654
  }, { IS_RECORD: true });
1741
1655
  }
@@ -1820,25 +1734,25 @@ const ZOHO_RECRUIT_ATTACHMENTS_MODULE = 'Attachments';
1820
1734
  const isZohoRecruitValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
1821
1735
  const ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = 'Resume';
1822
1736
 
1823
- var call$2 = functionCall;
1824
- var anObject$2 = anObject$e;
1825
- var getIteratorDirect$2 = getIteratorDirect$5;
1737
+ var call$4 = functionCall;
1738
+ var anObject$3 = anObject$f;
1739
+ var getIteratorDirect$3 = getIteratorDirect$6;
1826
1740
  var getIteratorMethod = getIteratorMethod$3;
1827
1741
 
1828
1742
  var getIteratorFlattenable$1 = function (obj, stringHandling) {
1829
- if (!stringHandling || typeof obj !== 'string') anObject$2(obj);
1743
+ if (!stringHandling || typeof obj !== 'string') anObject$3(obj);
1830
1744
  var method = getIteratorMethod(obj);
1831
- return getIteratorDirect$2(anObject$2(method !== undefined ? call$2(method, obj) : obj));
1745
+ return getIteratorDirect$3(anObject$3(method !== undefined ? call$4(method, obj) : obj));
1832
1746
  };
1833
1747
 
1834
- var $$1 = _export;
1835
- var call$1 = functionCall;
1836
- var aCallable$1 = aCallable$7;
1837
- var anObject$1 = anObject$e;
1838
- var getIteratorDirect$1 = getIteratorDirect$5;
1748
+ var $$8 = _export;
1749
+ var call$3 = functionCall;
1750
+ var aCallable$3 = aCallable$9;
1751
+ var anObject$2 = anObject$f;
1752
+ var getIteratorDirect$2 = getIteratorDirect$6;
1839
1753
  var getIteratorFlattenable = getIteratorFlattenable$1;
1840
1754
  var createIteratorProxy$1 = iteratorCreateProxy;
1841
- var iteratorClose = iteratorClose$4;
1755
+ var iteratorClose$2 = iteratorClose$6;
1842
1756
  var IS_PURE$1 = isPure;
1843
1757
 
1844
1758
  var IteratorProxy$1 = createIteratorProxy$1(function () {
@@ -1848,44 +1762,44 @@ var IteratorProxy$1 = createIteratorProxy$1(function () {
1848
1762
 
1849
1763
  while (true) {
1850
1764
  if (inner = this.inner) try {
1851
- result = anObject$1(call$1(inner.next, inner.iterator));
1765
+ result = anObject$2(call$3(inner.next, inner.iterator));
1852
1766
  if (!result.done) return result.value;
1853
1767
  this.inner = null;
1854
- } catch (error) { iteratorClose(iterator, 'throw', error); }
1768
+ } catch (error) { iteratorClose$2(iterator, 'throw', error); }
1855
1769
 
1856
- result = anObject$1(call$1(this.next, iterator));
1770
+ result = anObject$2(call$3(this.next, iterator));
1857
1771
 
1858
1772
  if (this.done = !!result.done) return;
1859
1773
 
1860
1774
  try {
1861
1775
  this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false);
1862
- } catch (error) { iteratorClose(iterator, 'throw', error); }
1776
+ } catch (error) { iteratorClose$2(iterator, 'throw', error); }
1863
1777
  }
1864
1778
  });
1865
1779
 
1866
1780
  // `Iterator.prototype.flatMap` method
1867
1781
  // https://github.com/tc39/proposal-iterator-helpers
1868
- $$1({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
1782
+ $$8({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
1869
1783
  flatMap: function flatMap(mapper) {
1870
- anObject$1(this);
1871
- aCallable$1(mapper);
1872
- return new IteratorProxy$1(getIteratorDirect$1(this), {
1784
+ anObject$2(this);
1785
+ aCallable$3(mapper);
1786
+ return new IteratorProxy$1(getIteratorDirect$2(this), {
1873
1787
  mapper: mapper,
1874
1788
  inner: null
1875
1789
  });
1876
1790
  }
1877
1791
  });
1878
1792
 
1879
- var call = functionCall;
1880
- var aCallable = aCallable$7;
1881
- var anObject = anObject$e;
1882
- var getIteratorDirect = getIteratorDirect$5;
1793
+ var call$2 = functionCall;
1794
+ var aCallable$2 = aCallable$9;
1795
+ var anObject$1 = anObject$f;
1796
+ var getIteratorDirect$1 = getIteratorDirect$6;
1883
1797
  var createIteratorProxy = iteratorCreateProxy;
1884
1798
  var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
1885
1799
 
1886
1800
  var IteratorProxy = createIteratorProxy(function () {
1887
1801
  var iterator = this.iterator;
1888
- var result = anObject(call(this.next, iterator));
1802
+ var result = anObject$1(call$2(this.next, iterator));
1889
1803
  var done = this.done = !!result.done;
1890
1804
  if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
1891
1805
  });
@@ -1893,37 +1807,38 @@ var IteratorProxy = createIteratorProxy(function () {
1893
1807
  // `Iterator.prototype.map` method
1894
1808
  // https://github.com/tc39/proposal-iterator-helpers
1895
1809
  var iteratorMap = function map(mapper) {
1896
- anObject(this);
1897
- aCallable(mapper);
1898
- return new IteratorProxy(getIteratorDirect(this), {
1810
+ anObject$1(this);
1811
+ aCallable$2(mapper);
1812
+ return new IteratorProxy(getIteratorDirect$1(this), {
1899
1813
  mapper: mapper
1900
1814
  });
1901
1815
  };
1902
1816
 
1903
- var $ = _export;
1817
+ var $$7 = _export;
1904
1818
  var map = iteratorMap;
1905
1819
  var IS_PURE = isPure;
1906
1820
 
1907
1821
  // `Iterator.prototype.map` method
1908
1822
  // https://github.com/tc39/proposal-iterator-helpers
1909
- $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
1823
+ $$7({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
1910
1824
  map: map
1911
1825
  });
1912
1826
 
1913
1827
  /**
1914
1828
  * Can search up to 10 criteria at a time.
1915
1829
  *
1830
+ * https://www.zoho.com/crm/developer/docs/api/v8/search-records.html
1916
1831
  * https://www.zoho.com/recruit/developer-guide/apiv2/search-records.html
1917
1832
  *
1918
1833
  * "You can search for a maximum of 10 criteria (with the same or different column) with equals and starts_with conditions."
1919
1834
  */
1920
- const MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA = 10;
1835
+ const MAX_ZOHO_SEARCH_MODULE_RECORDS_CRITERIA = 10;
1921
1836
  /**
1922
- * Creates a ZohoRecruitSearchRecordsCriteriaString from a ZohoRecruitSearchRecordsCriteriaTree.
1837
+ * Creates a ZohoSearchRecordsCriteriaString from a ZohoSearchRecordsCriteriaTree.
1923
1838
  *
1924
1839
  * If the input tree is empty, returns undefined.
1925
1840
  */
1926
- function zohoRecruitSearchRecordsCriteriaString(input) {
1841
+ function zohoSearchRecordsCriteriaString(input) {
1927
1842
  let result;
1928
1843
  if (input != null) {
1929
1844
  switch (typeof input) {
@@ -1939,22 +1854,22 @@ function zohoRecruitSearchRecordsCriteriaString(input) {
1939
1854
  } else {
1940
1855
  tree = input;
1941
1856
  }
1942
- result = zohoRecruitSearchRecordsCriteriaStringForTree(tree);
1857
+ result = zohoSearchRecordsCriteriaStringForTree(tree);
1943
1858
  break;
1944
1859
  }
1945
1860
  }
1946
1861
  return result;
1947
1862
  }
1948
- function zohoRecruitSearchRecordsCriteriaStringForTree(tree) {
1863
+ function zohoSearchRecordsCriteriaStringForTree(tree) {
1949
1864
  function convertToString(value) {
1950
1865
  let result;
1951
1866
  if (typeof value === 'object') {
1952
1867
  // array of criteria entries
1953
1868
  if (Array.isArray(value)) {
1954
- result = value.map(zohoRecruitSearchRecordsCriteriaEntryToCriteriaString);
1869
+ result = value.map(zohoSearchRecordsCriteriaEntryToCriteriaString);
1955
1870
  } else if (value) {
1956
1871
  // criteria tree that first needs to be converted to a string
1957
- result = zohoRecruitSearchRecordsCriteriaStringForTree(value);
1872
+ result = zohoSearchRecordsCriteriaStringForTree(value);
1958
1873
  }
1959
1874
  } else {
1960
1875
  result = value;
@@ -1976,26 +1891,51 @@ function zohoRecruitSearchRecordsCriteriaStringForTree(tree) {
1976
1891
  return result;
1977
1892
  }
1978
1893
  /**
1979
- * Escape used for ZohoRecruitSearchRecordsCriteriaString
1894
+ * Escape used for ZohoSearchRecordsCriteriaString
1980
1895
  */
1981
1896
  const escapeZohoFieldValueForCriteriaString = util.escapeStringCharactersFunction({
1982
1897
  /**
1983
1898
  * Parenthesis and commas must be escaped using a backslash
1984
1899
  */
1985
1900
  escapeTargets: ['(', ')', ','],
1986
- escapeCharacter: char => `\\${char}`
1901
+ escapeCharacter: char => `\\\\${char}`
1987
1902
  });
1988
1903
  /**
1989
- * Converts the input entry to a ZohoRecruitSearchRecordsCriteriaString. Properly escapes any parenthesis or commas.
1904
+ * Converts the input entry to a ZohoSearchRecordsCriteriaString. Properly escapes any parenthesis or commas.
1990
1905
  *
1991
1906
  * @param entry
1992
1907
  * @returns
1993
1908
  */
1994
- function zohoRecruitSearchRecordsCriteriaEntryToCriteriaString(entry) {
1909
+ function zohoSearchRecordsCriteriaEntryToCriteriaString(entry) {
1995
1910
  const escapedValue = escapeZohoFieldValueForCriteriaString(entry.value);
1996
1911
  return `(${entry.field}:${entry.filter}:${escapedValue})`;
1997
1912
  }
1998
1913
 
1914
+ /**
1915
+ * Can search up to 10 criteria at a time.
1916
+ *
1917
+ * https://www.zoho.com/recruit/developer-guide/apiv2/search-records.html
1918
+ *
1919
+ * "You can search for a maximum of 10 criteria (with the same or different column) with equals and starts_with conditions."
1920
+ */
1921
+ const MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA = MAX_ZOHO_SEARCH_MODULE_RECORDS_CRITERIA;
1922
+ const zohoRecruitSearchRecordsCriteriaString = zohoSearchRecordsCriteriaString;
1923
+ const zohoRecruitSearchRecordsCriteriaStringForTree = zohoSearchRecordsCriteriaStringForTree;
1924
+ const zohoRecruitSearchRecordsCriteriaEntryToCriteriaString = zohoSearchRecordsCriteriaEntryToCriteriaString;
1925
+
1926
+ /**
1927
+ * Default place-holder used by the ZohoServerFetchResponseDataArrayError class.
1928
+ */
1929
+ const ZOHO_DATA_ARRAY_BLANK_ERROR_CODE = '__internal_data_array_blank_error';
1930
+ /**
1931
+ * Returns true if the input value is a ZohoServerErrorResponseDataArrayRef.
1932
+ *
1933
+ * @param value
1934
+ * @returns
1935
+ */
1936
+ function isZohoServerErrorResponseDataArrayRef(value) {
1937
+ return Array.isArray(value?.data);
1938
+ }
1999
1939
  /**
2000
1940
  * A code used in some cases to denote success.
2001
1941
  */
@@ -2038,23 +1978,45 @@ class ZohoServerError extends makeError.BaseError {
2038
1978
  * Zoho Server Error that includes the FetchResponseError
2039
1979
  */
2040
1980
  class ZohoServerFetchResponseError extends ZohoServerError {
2041
- constructor(data, responseError) {
1981
+ constructor(data, errorResponseData, responseError) {
2042
1982
  super(data);
2043
1983
  this.data = void 0;
1984
+ this.errorResponseData = void 0;
2044
1985
  this.responseError = void 0;
2045
1986
  this.data = data;
1987
+ this.errorResponseData = errorResponseData;
2046
1988
  this.responseError = responseError;
2047
1989
  }
2048
1990
  }
1991
+ /**
1992
+ * Used as a transient error for situations where there are potentially multiple errors within the data array returned.
1993
+ *
1994
+ * Zoho CRM returns a non-200 error as a result, but generally there is a partial success that can occur, with both
1995
+ * the successful and errored results returned within the data.
1996
+ */
1997
+ class ZohoServerFetchResponseDataArrayError extends ZohoServerFetchResponseError {
1998
+ constructor(errorResponseData, responseError) {
1999
+ super({
2000
+ code: ZOHO_DATA_ARRAY_BLANK_ERROR_CODE,
2001
+ message: 'Check data for individual errors.'
2002
+ }, errorResponseData, responseError);
2003
+ }
2004
+ get errorDataArray() {
2005
+ return this.errorResponseData.data;
2006
+ }
2007
+ }
2049
2008
  /**
2050
2009
  * Creates a logZohoServerErrorFunction that logs the error to console.
2051
2010
  *
2052
2011
  * @param zohoApiNamePrefix Prefix to use when logging. I.E. ZohoRecruitError, etc.
2053
2012
  * @returns
2054
2013
  */
2055
- function logZohoServerErrorFunction(zohoApiNamePrefix) {
2014
+ function logZohoServerErrorFunction(zohoApiNamePrefix, options) {
2015
+ const {
2016
+ logDataArrayErrors = false
2017
+ } = options ?? {};
2056
2018
  return error => {
2057
- if (error instanceof ZohoServerFetchResponseError) {
2019
+ if (error instanceof ZohoServerFetchResponseDataArrayError && !logDataArrayErrors) ; else if (error instanceof ZohoServerFetchResponseError) {
2058
2020
  console.log(`${zohoApiNamePrefix}Error(${error.responseError.response.status}): `, {
2059
2021
  error,
2060
2022
  errorData: error.data
@@ -2210,28 +2172,32 @@ class ZohoTooManyRequestsError extends ZohoServerFetchResponseError {
2210
2172
  */
2211
2173
  function parseZohoServerErrorResponseData(errorResponseData, responseError) {
2212
2174
  let result;
2213
- const error = tryFindZohoServerErrorData(errorResponseData, responseError);
2214
- if (error) {
2215
- const errorData = zohoServerErrorData(error);
2216
- switch (errorData.code) {
2217
- case ZOHO_INTERNAL_ERROR_CODE:
2218
- result = new ZohoInternalError(errorData, responseError);
2219
- break;
2220
- case ZOHO_INVALID_TOKEN_ERROR_CODE:
2221
- result = new ZohoInvalidTokenError(errorData, responseError);
2222
- break;
2223
- case ZOHO_INVALID_AUTHORIZATION_ERROR_CODE:
2224
- result = new ZohoInvalidAuthorizationError(errorData, responseError);
2225
- break;
2226
- case ZOHO_INVALID_QUERY_ERROR_CODE:
2227
- result = new ZohoInvalidQueryError(errorData, responseError);
2228
- break;
2229
- case ZOHO_TOO_MANY_REQUESTS_ERROR_CODE:
2230
- result = new ZohoTooManyRequestsError(errorData, responseError);
2231
- break;
2232
- default:
2233
- result = new ZohoServerFetchResponseError(errorData, responseError);
2234
- break;
2175
+ if (isZohoServerErrorResponseDataArrayRef(errorResponseData)) {
2176
+ result = new ZohoServerFetchResponseDataArrayError(errorResponseData, responseError);
2177
+ } else {
2178
+ const error = tryFindZohoServerErrorData(errorResponseData, responseError);
2179
+ if (error) {
2180
+ const errorData = zohoServerErrorData(error);
2181
+ switch (errorData.code) {
2182
+ case ZOHO_INTERNAL_ERROR_CODE:
2183
+ result = new ZohoInternalError(errorData, errorResponseData, responseError);
2184
+ break;
2185
+ case ZOHO_INVALID_TOKEN_ERROR_CODE:
2186
+ result = new ZohoInvalidTokenError(errorData, errorResponseData, responseError);
2187
+ break;
2188
+ case ZOHO_INVALID_AUTHORIZATION_ERROR_CODE:
2189
+ result = new ZohoInvalidAuthorizationError(errorData, errorResponseData, responseError);
2190
+ break;
2191
+ case ZOHO_INVALID_QUERY_ERROR_CODE:
2192
+ result = new ZohoInvalidQueryError(errorData, errorResponseData, responseError);
2193
+ break;
2194
+ case ZOHO_TOO_MANY_REQUESTS_ERROR_CODE:
2195
+ result = new ZohoTooManyRequestsError(errorData, errorResponseData, responseError);
2196
+ break;
2197
+ default:
2198
+ result = new ZohoServerFetchResponseError(errorData, errorResponseData, responseError);
2199
+ break;
2200
+ }
2235
2201
  }
2236
2202
  }
2237
2203
  return result;
@@ -2240,13 +2206,14 @@ function parseZohoServerErrorResponseData(errorResponseData, responseError) {
2240
2206
  * Attempts to retrieve an ZohoServerErrorResponseDataError from the input.
2241
2207
  *
2242
2208
  * Non-200 errors returned by the Zoho API are returned as the object directly instead of as an ZohoServerErrorResponseData directly.
2209
+ * Zoho CRM returns a ZohoServerErrorResponseDataArrayRef value for errors.
2243
2210
  *
2244
2211
  * @param errorResponseData
2245
2212
  * @param responseError
2246
2213
  * @returns
2247
2214
  */
2248
2215
  function tryFindZohoServerErrorData(errorResponseData, responseError) {
2249
- const error = errorResponseData.error ?? (!responseError.response.ok ? errorResponseData : undefined);
2216
+ const error = errorResponseData.error ?? errorResponseData.data?.[0] ?? (!responseError.response.ok ? errorResponseData : undefined);
2250
2217
  return error;
2251
2218
  }
2252
2219
 
@@ -2300,7 +2267,7 @@ function zohoRecruitRecordCrudError(error) {
2300
2267
  }
2301
2268
  return result;
2302
2269
  }
2303
- function assertRecordDataArrayResultHasContent(moduleName, recordId) {
2270
+ function assertZohoRecruitRecordDataArrayResultHasContent(moduleName, recordId) {
2304
2271
  return x => {
2305
2272
  if (x == null || !x.data?.length) {
2306
2273
  throw new ZohoRecruitRecordNoContentError(moduleName, recordId);
@@ -2334,6 +2301,11 @@ function parseZohoRecruitServerErrorResponseData(errorResponseData, responseErro
2334
2301
  }
2335
2302
  const interceptZohoRecruit200StatusWithErrorResponse = interceptZohoErrorResponseFactory(parseZohoRecruitServerErrorResponseData);
2336
2303
  const handleZohoRecruitErrorFetch = handleZohoErrorFetchFactory(parseZohoRecruitError, logZohoRecruitErrorToConsole);
2304
+ // MARK: Compat
2305
+ /**
2306
+ * @deprecated Use assertZohoRecruitRecordDataArrayResultHasContent instead.
2307
+ */
2308
+ const assertRecordDataArrayResultHasContent = assertZohoRecruitRecordDataArrayResultHasContent;
2337
2309
 
2338
2310
  // MARK: Insert/Update/Upsert Response
2339
2311
  /**
@@ -2347,7 +2319,7 @@ const ZOHO_RECRUIT_CRUD_FUNCTION_MAX_RECORDS_LIMIT = 100;
2347
2319
  *
2348
2320
  * @returns
2349
2321
  */
2350
- function updateRecordLikeFunction(context, fetchUrlPrefix, fetchMethod) {
2322
+ function updateRecordLikeFunction$1(context, fetchUrlPrefix, fetchMethod) {
2351
2323
  return ({
2352
2324
  data,
2353
2325
  module
@@ -2379,8 +2351,8 @@ function updateRecordLikeFunction(context, fetchUrlPrefix, fetchMethod) {
2379
2351
  * @param context
2380
2352
  * @returns
2381
2353
  */
2382
- function insertRecord(context) {
2383
- return updateRecordLikeFunction(context, '', 'POST');
2354
+ function zohoRecruitInsertRecord(context) {
2355
+ return updateRecordLikeFunction$1(context, '', 'POST');
2384
2356
  }
2385
2357
  /**
2386
2358
  * Updates or inserts one or more records in Recruit.
@@ -2390,8 +2362,8 @@ function insertRecord(context) {
2390
2362
  * @param context
2391
2363
  * @returns
2392
2364
  */
2393
- function upsertRecord(context) {
2394
- return updateRecordLikeFunction(context, '/upsert', 'POST');
2365
+ function zohoRecruitUpsertRecord(context) {
2366
+ return updateRecordLikeFunction$1(context, '/upsert', 'POST');
2395
2367
  }
2396
2368
  /**
2397
2369
  * Updates one or more records in Recruit.
@@ -2401,8 +2373,8 @@ function upsertRecord(context) {
2401
2373
  * @param context
2402
2374
  * @returns
2403
2375
  */
2404
- function updateRecord(context) {
2405
- return updateRecordLikeFunction(context, '', 'PUT');
2376
+ function zohoRecruitUpdateRecord(context) {
2377
+ return updateRecordLikeFunction$1(context, '', 'PUT');
2406
2378
  }
2407
2379
  /**
2408
2380
  * Deletes one or more records from the given module.
@@ -2412,7 +2384,7 @@ function updateRecord(context) {
2412
2384
  * @param context
2413
2385
  * @returns ZohoRecruitDeleteRecordFunction
2414
2386
  */
2415
- function deleteRecord(context) {
2387
+ function zohoRecruitDeleteRecord(context) {
2416
2388
  return ({
2417
2389
  ids,
2418
2390
  module,
@@ -2432,8 +2404,8 @@ function deleteRecord(context) {
2432
2404
  * @param context
2433
2405
  * @returns
2434
2406
  */
2435
- function getRecordById(context) {
2436
- return input => context.fetchJson(`/v2/${input.module}/${input.id}`, zohoRecruitApiFetchJsonInput('GET')).then(assertRecordDataArrayResultHasContent(input.module)).then(x => x.data[0]);
2407
+ function zohoRecruitGetRecordById(context) {
2408
+ return input => context.fetchJson(`/v2/${input.module}/${input.id}`, zohoRecruitApiFetchJsonInput('GET')).then(assertZohoRecruitRecordDataArrayResultHasContent(input.module)).then(x => x.data[0]);
2437
2409
  }
2438
2410
  /**
2439
2411
  * Retrieves records from the given module. Used for paginating across all records.
@@ -2443,7 +2415,7 @@ function getRecordById(context) {
2443
2415
  * @param context
2444
2416
  * @returns
2445
2417
  */
2446
- function getRecords(context) {
2418
+ function zohoRecruitGetRecords(context) {
2447
2419
  return input => context.fetchJson(`/v2/${input.module}?${zohoRecruitUrlSearchParamsMinusModule(input).toString()}`, zohoRecruitApiFetchJsonInput('GET'));
2448
2420
  }
2449
2421
  /**
@@ -2454,7 +2426,7 @@ function getRecords(context) {
2454
2426
  * @param context
2455
2427
  * @returns
2456
2428
  */
2457
- function searchRecords(context) {
2429
+ function zohoRecruitSearchRecords(context) {
2458
2430
  function searchRecordsUrlSearchParams(input) {
2459
2431
  const baseInput = {
2460
2432
  ...input
@@ -2477,8 +2449,8 @@ function searchRecords(context) {
2477
2449
  }
2478
2450
  });
2479
2451
  }
2480
- function searchRecordsPageFactory(context) {
2481
- return zohoFetchPageFactory(searchRecords(context));
2452
+ function zohoRecruitSearchRecordsPageFactory(context) {
2453
+ return zohoFetchPageFactory(zohoRecruitSearchRecords(context));
2482
2454
  }
2483
2455
  /**
2484
2456
  * Creates a ZohoRecruitGetRelatedRecordsFunctionFactory, which can be used to create ZohoRecruitGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
@@ -2488,7 +2460,7 @@ function searchRecordsPageFactory(context) {
2488
2460
  * @param context the ZohoRecruitContext to use
2489
2461
  * @returns a ZohoRecruitGetRelatedRecordsFunctionFactory
2490
2462
  */
2491
- function getRelatedRecordsFunctionFactory(context) {
2463
+ function zohoRecruitGetRelatedRecordsFunctionFactory(context) {
2492
2464
  return config => {
2493
2465
  const {
2494
2466
  targetModule,
@@ -2497,21 +2469,21 @@ function getRelatedRecordsFunctionFactory(context) {
2497
2469
  return input => context.fetchJson(`/v2/${input.module}/${input.id}/${targetModule}?${zohoRecruitUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoRecruitApiFetchJsonInput('GET')).then(x => x ?? (returnEmptyRecordsInsteadOfNull !== false ? emptyZohoPageResult() : x));
2498
2470
  };
2499
2471
  }
2500
- function getEmailsForRecord(context) {
2501
- return getRelatedRecordsFunctionFactory(context)({
2472
+ function zohoRecruitGetEmailsForRecord(context) {
2473
+ return zohoRecruitGetRelatedRecordsFunctionFactory(context)({
2502
2474
  targetModule: ZOHO_RECRUIT_EMAILS_MODULE
2503
2475
  });
2504
2476
  }
2505
- function getEmailsForRecordPageFactory(context) {
2506
- return zohoFetchPageFactory(getEmailsForRecord(context));
2477
+ function zohoRecruitGetEmailsForRecordPageFactory(context) {
2478
+ return zohoFetchPageFactory(zohoRecruitGetEmailsForRecord(context));
2507
2479
  }
2508
- function getAttachmentsForRecord(context) {
2509
- return getRelatedRecordsFunctionFactory(context)({
2480
+ function zohoRecruitGetAttachmentsForRecord(context) {
2481
+ return zohoRecruitGetRelatedRecordsFunctionFactory(context)({
2510
2482
  targetModule: ZOHO_RECRUIT_ATTACHMENTS_MODULE
2511
2483
  });
2512
2484
  }
2513
- function getAttachmentsForRecordPageFactory(context) {
2514
- return zohoFetchPageFactory(getAttachmentsForRecord(context));
2485
+ function zohoRecruitGetAttachmentsForRecordPageFactory(context) {
2486
+ return zohoFetchPageFactory(zohoRecruitGetAttachmentsForRecord(context));
2515
2487
  }
2516
2488
  /**
2517
2489
  * Maximum attachment size allowed by Zoho Recruit.
@@ -2527,7 +2499,7 @@ const ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE = 20 * 1024 * 1024;
2527
2499
  * @param context
2528
2500
  * @returns
2529
2501
  */
2530
- function uploadAttachmentForRecord(context) {
2502
+ function zohoRecruitUploadAttachmentForRecord(context) {
2531
2503
  return input => {
2532
2504
  const {
2533
2505
  attachmentCategoryId,
@@ -2590,7 +2562,7 @@ function uploadAttachmentForRecord(context) {
2590
2562
  * @param context
2591
2563
  * @returns
2592
2564
  */
2593
- function downloadAttachmentForRecord(context) {
2565
+ function zohoRecruitDownloadAttachmentForRecord(context) {
2594
2566
  return input => context.fetch(`/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
2595
2567
  method: 'GET'
2596
2568
  }).then(fetch.parseFetchFileResponse);
@@ -2603,7 +2575,7 @@ function downloadAttachmentForRecord(context) {
2603
2575
  * @param context
2604
2576
  * @returns
2605
2577
  */
2606
- function deleteAttachmentFromRecord(context) {
2578
+ function zohoRecruitDeleteAttachmentFromRecord(context) {
2607
2579
  return input => context.fetch(`/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
2608
2580
  method: 'DELETE'
2609
2581
  });
@@ -2626,7 +2598,7 @@ class ZohoRecruitExecuteRestApiFunctionError extends makeError.BaseError {
2626
2598
  * @param context
2627
2599
  * @returns
2628
2600
  */
2629
- function executeRestApiFunction(context) {
2601
+ function zohoRecruitExecuteRestApiFunction(context) {
2630
2602
  return input => {
2631
2603
  const inputSearchParams = fetch.makeUrlSearchParams(input.params);
2632
2604
  const inputSearchParamsString = inputSearchParams.toString();
@@ -2709,6 +2681,74 @@ function zohoRecruitMultiRecordResult(input, results) {
2709
2681
  };
2710
2682
  return result;
2711
2683
  }
2684
+ /**
2685
+ * @deprecated Use zohoRecruitInsertRecord instead.
2686
+ */
2687
+ const insertRecord = zohoRecruitInsertRecord;
2688
+ /**
2689
+ * @deprecated Use zohoRecruitUpdateRecord instead.
2690
+ */
2691
+ const updateRecord = zohoRecruitUpdateRecord;
2692
+ /**
2693
+ * @deprecated Use zohoRecruitUpsertRecord instead.
2694
+ */
2695
+ const upsertRecord = zohoRecruitUpsertRecord;
2696
+ /**
2697
+ * @deprecated Use zohoRecruitDeleteRecord instead.
2698
+ */
2699
+ const deleteRecord = zohoRecruitDeleteRecord;
2700
+ /**
2701
+ * @deprecated Use zohoRecruitGetRecordById instead.
2702
+ */
2703
+ const getRecordById = zohoRecruitGetRecordById;
2704
+ /**
2705
+ * @deprecated Use zohoRecruitGetRecords instead.
2706
+ */
2707
+ const getRecords = zohoRecruitGetRecords;
2708
+ /**
2709
+ * @deprecated Use zohoRecruitSearchRecords instead.
2710
+ */
2711
+ const searchRecords = zohoRecruitSearchRecords;
2712
+ /**
2713
+ * @deprecated Use zohoRecruitSearchRecordsPageFactory instead.
2714
+ */
2715
+ const searchRecordsPageFactory = zohoRecruitSearchRecordsPageFactory;
2716
+ /**
2717
+ * @deprecated Use zohoRecruitGetRelatedRecordsFunctionFactory instead.
2718
+ */
2719
+ const getRelatedRecordsFunctionFactory = zohoRecruitGetRelatedRecordsFunctionFactory;
2720
+ /**
2721
+ * @deprecated Use zohoRecruitGetEmailsForRecord instead.
2722
+ */
2723
+ const getEmailsForRecord = zohoRecruitGetEmailsForRecord;
2724
+ /**
2725
+ * @deprecated Use zohoRecruitGetEmailsForRecordPageFactory instead.
2726
+ */
2727
+ const getEmailsForRecordPageFactory = zohoRecruitGetEmailsForRecordPageFactory;
2728
+ /**
2729
+ * @deprecated Use zohoRecruitGetAttachmentsForRecord instead.
2730
+ */
2731
+ const getAttachmentsForRecord = zohoRecruitGetAttachmentsForRecord;
2732
+ /**
2733
+ * @deprecated Use zohoRecruitGetAttachmentsForRecordPageFactory instead.
2734
+ */
2735
+ const getAttachmentsForRecordPageFactory = zohoRecruitGetAttachmentsForRecordPageFactory;
2736
+ /**
2737
+ * @deprecated Use zohoRecruitUploadAttachmentForRecord instead.
2738
+ */
2739
+ const uploadAttachmentForRecord = zohoRecruitUploadAttachmentForRecord;
2740
+ /**
2741
+ * @deprecated Use zohoRecruitDownloadAttachmentForRecord instead.
2742
+ */
2743
+ const downloadAttachmentForRecord = zohoRecruitDownloadAttachmentForRecord;
2744
+ /**
2745
+ * @deprecated Use zohoRecruitDeleteAttachmentFromRecord instead.
2746
+ */
2747
+ const deleteAttachmentFromRecord = zohoRecruitDeleteAttachmentFromRecord;
2748
+ /**
2749
+ * @deprecated Use zohoRecruitExecuteRestApiFunction instead.
2750
+ */
2751
+ const executeRestApiFunction = zohoRecruitExecuteRestApiFunction;
2712
2752
 
2713
2753
  /**
2714
2754
  * Associates one or more candidates with one or more job openings.
@@ -2718,7 +2758,7 @@ function zohoRecruitMultiRecordResult(input, results) {
2718
2758
  * @param context
2719
2759
  * @returns
2720
2760
  */
2721
- function associateCandidateRecordsWithJobOpenings(context) {
2761
+ function zohoRecruitAssociateCandidateRecordsWithJobOpenings(context) {
2722
2762
  return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_CANDIDATES_MODULE}/actions/associate`, zohoRecruitApiFetchJsonInput('PUT', {
2723
2763
  data: util.asArray(input)
2724
2764
  })).then(x => {
@@ -2738,7 +2778,7 @@ function associateCandidateRecordsWithJobOpenings(context) {
2738
2778
  };
2739
2779
  });
2740
2780
  }
2741
- function searchAssociatedRecords(context) {
2781
+ function zohoRecruitSearchAssociatedRecords(context) {
2742
2782
  return input => {
2743
2783
  return context.fetchJson(`/v2/${input.module}/${input.id}/associate?${zohoRecruitUrlSearchParamsMinusIdAndModule(input).toString()}`, zohoRecruitApiFetchJsonInput('GET')).then(x => {
2744
2784
  const result = x ?? emptyZohoPageResult();
@@ -2746,8 +2786,8 @@ function searchAssociatedRecords(context) {
2746
2786
  });
2747
2787
  };
2748
2788
  }
2749
- function searchCandidateAssociatedJobOpeningRecords(context) {
2750
- const searchAssociatedRecordsFactory = searchAssociatedRecords(context);
2789
+ function zohoRecruitSearchCandidateAssociatedJobOpeningRecords(context) {
2790
+ const searchAssociatedRecordsFactory = zohoRecruitSearchAssociatedRecords(context);
2751
2791
  return input => {
2752
2792
  return searchAssociatedRecordsFactory({
2753
2793
  ...input,
@@ -2755,11 +2795,11 @@ function searchCandidateAssociatedJobOpeningRecords(context) {
2755
2795
  });
2756
2796
  };
2757
2797
  }
2758
- function searchCandidateAssociatedJobOpeningRecordsPageFactory(context) {
2759
- return zohoFetchPageFactory(searchCandidateAssociatedJobOpeningRecords(context));
2798
+ function zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory(context) {
2799
+ return zohoFetchPageFactory(zohoRecruitSearchCandidateAssociatedJobOpeningRecords(context));
2760
2800
  }
2761
- function searchJobOpeningAssociatedCandidateRecords(context, jobOpeningModuleName = ZOHO_RECRUIT_JOB_OPENINGS_MODULE) {
2762
- const searchAssociatedRecordsFactory = searchAssociatedRecords(context);
2801
+ function zohoRecruitSearchJobOpeningAssociatedCandidateRecords(context, jobOpeningModuleName = ZOHO_RECRUIT_JOB_OPENINGS_MODULE) {
2802
+ const searchAssociatedRecordsFactory = zohoRecruitSearchAssociatedRecords(context);
2763
2803
  return input => {
2764
2804
  return searchAssociatedRecordsFactory({
2765
2805
  ...input,
@@ -2767,34 +2807,59 @@ function searchJobOpeningAssociatedCandidateRecords(context, jobOpeningModuleNam
2767
2807
  });
2768
2808
  };
2769
2809
  }
2770
- function searchJobOpeningAssociatedCandidateRecordsPageFactory(context) {
2771
- return zohoFetchPageFactory(searchJobOpeningAssociatedCandidateRecords(context));
2810
+ function zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory(context) {
2811
+ return zohoFetchPageFactory(zohoRecruitSearchJobOpeningAssociatedCandidateRecords(context));
2772
2812
  }
2813
+ // MARK: Compat
2814
+ /**
2815
+ * @deprecated Use zohoRecruitAssociateCandidateRecordsWithJobOpenings instead.
2816
+ */
2817
+ const associateCandidateRecordsWithJobOpenings = zohoRecruitAssociateCandidateRecordsWithJobOpenings;
2818
+ /**
2819
+ * @deprecated Use zohoRecruitSearchAssociatedRecords instead.
2820
+ */
2821
+ const searchAssociatedRecords = zohoRecruitSearchAssociatedRecords;
2822
+ /**
2823
+ * @deprecated Use zohoRecruitSearchCandidateAssociatedJobOpeningRecords instead.
2824
+ */
2825
+ const searchCandidateAssociatedJobOpeningRecords = zohoRecruitSearchCandidateAssociatedJobOpeningRecords;
2826
+ /**
2827
+ * @deprecated Use zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory instead.
2828
+ */
2829
+ const searchCandidateAssociatedJobOpeningRecordsPageFactory = zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory;
2830
+ /**
2831
+ * @deprecated Use zohoRecruitSearchJobOpeningAssociatedCandidateRecords instead.
2832
+ */
2833
+ const searchJobOpeningAssociatedCandidateRecords = zohoRecruitSearchJobOpeningAssociatedCandidateRecords;
2834
+ /**
2835
+ * @deprecated Use zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory instead.
2836
+ */
2837
+ const searchJobOpeningAssociatedCandidateRecordsPageFactory = zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory;
2773
2838
 
2774
- function createNotes(context) {
2839
+ function zohoRecruitCreateNotes(context) {
2775
2840
  return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_NOTES_MODULE}`, zohoRecruitApiFetchJsonInput('POST', {
2776
2841
  data: input.data
2777
2842
  })).then(x => {
2778
2843
  return zohoRecruitMultiRecordResult(util.asArray(input.data), x.data);
2779
2844
  });
2780
2845
  }
2781
- function deleteNotes(context) {
2846
+ function zohoRecruitDeleteNotes(context) {
2782
2847
  return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_NOTES_MODULE}?${fetch.makeUrlSearchParams({
2783
2848
  ids: input.ids
2784
2849
  })}`, zohoRecruitApiFetchJsonInput('DELETE')).then(x => {
2785
2850
  return zohoRecruitMultiRecordResult(util.asArray(input.ids), x.data);
2786
2851
  });
2787
2852
  }
2788
- function getNotesForRecord(context) {
2789
- return getRelatedRecordsFunctionFactory(context)({
2853
+ function zohoRecruitGetNotesForRecord(context) {
2854
+ return zohoRecruitGetRelatedRecordsFunctionFactory(context)({
2790
2855
  targetModule: ZOHO_RECRUIT_NOTES_MODULE
2791
2856
  });
2792
2857
  }
2793
- function getNotesForRecordPageFactory(context) {
2794
- return zohoFetchPageFactory(getNotesForRecord(context));
2858
+ function zohoRecruitGetNotesForRecordPageFactory(context) {
2859
+ return zohoFetchPageFactory(zohoRecruitGetNotesForRecord(context));
2795
2860
  }
2796
- function createNotesForRecord(context) {
2797
- const createNotesInstance = createNotes(context);
2861
+ function zohoRecruitCreateNotesForRecord(context) {
2862
+ const createNotesInstance = zohoRecruitCreateNotes(context);
2798
2863
  return input => {
2799
2864
  const {
2800
2865
  module: se_module,
@@ -2811,8 +2876,29 @@ function createNotesForRecord(context) {
2811
2876
  return createNotesInstance(createNotesRequest);
2812
2877
  };
2813
2878
  }
2879
+ // MARK: Compat
2880
+ /**
2881
+ * @deprecated Use zohoRecruitCreateNotes instead.
2882
+ */
2883
+ const createNotes = zohoRecruitCreateNotes;
2884
+ /**
2885
+ * @deprecated Use zohoRecruitDeleteNotes instead.
2886
+ */
2887
+ const deleteNotes = zohoRecruitDeleteNotes;
2888
+ /**
2889
+ * @deprecated Use zohoRecruitGetNotesForRecord instead.
2890
+ */
2891
+ const getNotesForRecord = zohoRecruitGetNotesForRecord;
2892
+ /**
2893
+ * @deprecated Use zohoRecruitGetNotesForRecordPageFactory instead.
2894
+ */
2895
+ const getNotesForRecordPageFactory = zohoRecruitGetNotesForRecordPageFactory;
2896
+ /**
2897
+ * @deprecated Use zohoRecruitCreateNotesForRecord instead.
2898
+ */
2899
+ const createNotesForRecord = zohoRecruitCreateNotesForRecord;
2814
2900
 
2815
- function createTagsForModule(context) {
2901
+ function zohoRecruitCreateTagsForModule(context) {
2816
2902
  return input => context.fetchJson(`/v2/settings/tags?${fetch.makeUrlSearchParams({
2817
2903
  module: input.module
2818
2904
  })}`, zohoRecruitApiFetchJsonInput('POST', {
@@ -2841,7 +2927,7 @@ function createTagsForModule(context) {
2841
2927
  * @param context
2842
2928
  * @returns
2843
2929
  */
2844
- function getTagsForModule(context) {
2930
+ function zohoRecruitGetTagsForModule(context) {
2845
2931
  return input => context.fetchJson(`/v2/settings/tags?${fetch.makeUrlSearchParams({
2846
2932
  module: input.module,
2847
2933
  my_tags: input.my_tags
@@ -2853,8 +2939,8 @@ function getTagsForModule(context) {
2853
2939
  };
2854
2940
  });
2855
2941
  }
2856
- function getTagsForModulePageFactory(context) {
2857
- return zohoFetchPageFactory(getTagsForModule(context));
2942
+ function zohoRecruitGetTagsForModulePageFactory(context) {
2943
+ return zohoFetchPageFactory(zohoRecruitGetTagsForModule(context));
2858
2944
  }
2859
2945
  // MARK: Add Tag To Record
2860
2946
  /**
@@ -2869,7 +2955,7 @@ const ZOHO_RECRUIT_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED = 100;
2869
2955
  * @param context
2870
2956
  * @returns
2871
2957
  */
2872
- function addTagsToRecords(context) {
2958
+ function zohoRecruitAddTagsToRecords(context) {
2873
2959
  return input => {
2874
2960
  if (Array.isArray(input.ids) && input.ids.length > ZOHO_RECRUIT_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED) {
2875
2961
  throw new Error(`Cannot add tags to more than ${ZOHO_RECRUIT_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED} records at once.`);
@@ -2896,7 +2982,7 @@ const ZOHO_RECRUIT_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED = 100;
2896
2982
  * @param context
2897
2983
  * @returns
2898
2984
  */
2899
- function removeTagsFromRecords(context) {
2985
+ function zohoRecruitRemoveTagsFromRecords(context) {
2900
2986
  return input => {
2901
2987
  if (Array.isArray(input.ids) && input.ids.length > ZOHO_RECRUIT_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED) {
2902
2988
  throw new Error(`Cannot remove tags from more than ${ZOHO_RECRUIT_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED} records at once.`);
@@ -2910,25 +2996,27 @@ function removeTagsFromRecords(context) {
2910
2996
  });
2911
2997
  };
2912
2998
  }
2913
-
2999
+ // MARK: Compat
2914
3000
  /**
2915
- * Creates a ZohoRecruitSearchRecordsCriteriaEntryArray from an array of emails.
2916
- *
2917
- * @param emails Email or array of emails to search for.
2918
- * @param field Optional field name to use. Defaults to 'Email'.
2919
- * @returns Array of ZohoRecruitSearchRecordsCriteriaEntry
3001
+ * @deprecated Use zohoRecruitCreateTagsForModule instead.
2920
3002
  */
2921
- function zohoRecruitSearchRecordsCriteriaEntriesForEmails(emails, field = 'Email') {
2922
- const allEmails = util.asArray(emails);
2923
- return allEmails.map(email => {
2924
- const emailCriteria = {
2925
- field,
2926
- filter: 'equals',
2927
- value: email
2928
- };
2929
- return emailCriteria;
2930
- });
2931
- }
3003
+ const createTagsForModule = zohoRecruitCreateTagsForModule;
3004
+ /**
3005
+ * @deprecated Use zohoRecruitGetTagsForModule instead.
3006
+ */
3007
+ const getTagsForModule = zohoRecruitGetTagsForModule;
3008
+ /**
3009
+ * @deprecated Use zohoRecruitGetTagsForModulePageFactory instead.
3010
+ */
3011
+ const getTagsForModulePageFactory = zohoRecruitGetTagsForModulePageFactory;
3012
+ /**
3013
+ * @deprecated Use zohoRecruitAddTagsToRecords instead.
3014
+ */
3015
+ const addTagsToRecords = zohoRecruitAddTagsToRecords;
3016
+ /**
3017
+ * @deprecated Use zohoRecruitRemoveTagsFromRecords instead.
3018
+ */
3019
+ const removeTagsFromRecords = zohoRecruitRemoveTagsFromRecords;
2932
3020
 
2933
3021
  /**
2934
3022
  * Error in the following cases:
@@ -3119,13 +3207,1186 @@ function zohoRecruitFactory(factoryConfig) {
3119
3207
  */
3120
3208
  const ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH = 25;
3121
3209
 
3210
+ const ZOHO_CRM_SERVICE_NAME = 'crm';
3211
+ function zohoCrmConfigApiUrl(input) {
3212
+ switch (input) {
3213
+ case 'sandbox':
3214
+ return 'https://crmsandbox.zoho.com/crm';
3215
+ case 'production':
3216
+ return 'https://www.zohoapis.com/crm';
3217
+ default:
3218
+ return input;
3219
+ }
3220
+ }
3221
+
3122
3222
  /**
3123
- * Trades a refresh token for a new AccessToken
3124
- * @param context
3125
- * @returns
3223
+ * Leads module name
3224
+ */
3225
+ const ZOHO_CRM_LEADS_MODULE = 'Leads';
3226
+ /**
3227
+ * Contacts module name
3228
+ */
3229
+ const ZOHO_CRM_CONTACTS_MODULE = 'Contacts';
3230
+ /**
3231
+ * Tasks module name
3232
+ */
3233
+ const ZOHO_CRM_TASKS_MODULE = 'Tasks';
3234
+ /**
3235
+ * Notes module name
3236
+ */
3237
+ const ZOHO_CRM_NOTES_MODULE = 'Notes';
3238
+ /**
3239
+ * Emails module name
3240
+ */
3241
+ const ZOHO_CRM_EMAILS_MODULE = 'Emails';
3242
+ /**
3243
+ * Attachments module name
3244
+ */
3245
+ const ZOHO_CRM_ATTACHMENTS_MODULE = 'Attachments';
3246
+ /**
3247
+ * Returns true if it is a valid ZohoCrmValidUrl.
3126
3248
  */
3127
- function accessToken(context) {
3128
- return input => context.fetchJson(`/oauth/v2/token?grant_type=refresh_token&client_id=${input?.client?.clientId ?? context.config.clientId}&client_secret=${input?.client?.clientSecret ?? context.config.clientSecret}&refresh_token=${input?.refreshToken ?? context.config.refreshToken}`, zohoAccountsApiFetchJsonInput('POST'));
3249
+ const isZohoCrmValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
3250
+ const ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = 'Resume';
3251
+
3252
+ /**
3253
+ * Can search up to 10 criteria at a time.
3254
+ *
3255
+ * https://www.zoho.com/crm/developer/docs/api/v8/search-records.html
3256
+ *
3257
+ * "You can search for a maximum of 10 criteria (with the same or different column) with equals and starts_with conditions."
3258
+ */
3259
+ const MAX_ZOHO_CRM_SEARCH_MODULE_RECORDS_CRITERIA = MAX_ZOHO_SEARCH_MODULE_RECORDS_CRITERIA;
3260
+ const zohoCrmSearchRecordsCriteriaString = zohoSearchRecordsCriteriaString;
3261
+ const zohoCrmSearchRecordsCriteriaStringForTree = zohoSearchRecordsCriteriaStringForTree;
3262
+ const escapeZohoCrmFieldValueForCriteriaString = escapeZohoFieldValueForCriteriaString;
3263
+ const zohoCrmSearchRecordsCriteriaEntryToCriteriaString = zohoSearchRecordsCriteriaEntryToCriteriaString;
3264
+
3265
+ /**
3266
+ * Error code for when two records are already associated with each other.
3267
+ *
3268
+ * Example being a candidate and a job opening are already associated.
3269
+ */
3270
+ const ZOHO_CRM_ALREADY_ASSOCIATED_ERROR_CODE = 'ALREADY_ASSOCIATED';
3271
+ /**
3272
+ * Thrown when a record with the given id has no content. Typically also means it does not exist.
3273
+ */
3274
+ class ZohoCrmRecordNoContentError extends makeError.BaseError {
3275
+ constructor(moduleName, recordId) {
3276
+ super(`There was no content or matching records for the content. It may not exist.`);
3277
+ this.moduleName = void 0;
3278
+ this.recordId = void 0;
3279
+ this.moduleName = moduleName;
3280
+ this.recordId = recordId;
3281
+ }
3282
+ }
3283
+ class ZohoCrmRecordCrudError extends ZohoServerError {}
3284
+ class ZohoCrmRecordCrudMandatoryFieldNotFoundError extends ZohoCrmRecordCrudError {}
3285
+ class ZohoCrmRecordCrudDuplicateDataError extends ZohoCrmRecordCrudError {}
3286
+ class ZohoCrmRecordCrudInvalidDataError extends ZohoCrmRecordCrudError {
3287
+ get invalidFieldDetails() {
3288
+ return this.error.details;
3289
+ }
3290
+ }
3291
+ class ZohoCrmRecordCrudNoMatchingRecordError extends ZohoCrmRecordCrudInvalidDataError {}
3292
+ function zohoCrmRecordCrudError(error) {
3293
+ let result;
3294
+ switch (error.code) {
3295
+ case ZOHO_INVALID_DATA_ERROR_CODE:
3296
+ const invalidDataError = new ZohoCrmRecordCrudInvalidDataError(error);
3297
+ if (invalidDataError.invalidFieldDetails.api_name === 'id') {
3298
+ result = new ZohoCrmRecordCrudNoMatchingRecordError(error);
3299
+ } else {
3300
+ result = invalidDataError;
3301
+ }
3302
+ break;
3303
+ case ZOHO_MANDATORY_NOT_FOUND_ERROR_CODE:
3304
+ result = new ZohoCrmRecordCrudMandatoryFieldNotFoundError(error);
3305
+ break;
3306
+ case ZOHO_DUPLICATE_DATA_ERROR_CODE:
3307
+ result = new ZohoCrmRecordCrudDuplicateDataError(error);
3308
+ break;
3309
+ default:
3310
+ result = new ZohoCrmRecordCrudError(error);
3311
+ break;
3312
+ }
3313
+ return result;
3314
+ }
3315
+ function assertZohoCrmRecordDataArrayResultHasContent(moduleName, recordId) {
3316
+ return x => {
3317
+ if (x == null || !x.data?.length) {
3318
+ throw new ZohoCrmRecordNoContentError(moduleName, recordId);
3319
+ } else {
3320
+ return x;
3321
+ }
3322
+ };
3323
+ }
3324
+ const logZohoCrmErrorToConsole = logZohoServerErrorFunction('ZohoCrm', {
3325
+ logDataArrayErrors: false
3326
+ });
3327
+ async function parseZohoCrmError(responseError) {
3328
+ const data = await responseError.response.json().catch(x => undefined);
3329
+ let result;
3330
+ if (data) {
3331
+ result = parseZohoCrmServerErrorResponseData(data, responseError);
3332
+ }
3333
+ return result;
3334
+ }
3335
+ function parseZohoCrmServerErrorResponseData(errorResponseData, responseError) {
3336
+ let result;
3337
+ const error = tryFindZohoServerErrorData(errorResponseData, responseError);
3338
+ if (error) {
3339
+ const errorData = zohoServerErrorData(error);
3340
+ switch (errorData.code) {
3341
+ // TODO: Add crm-specific error codes here.
3342
+ default:
3343
+ result = parseZohoServerErrorResponseData(errorResponseData, responseError);
3344
+ break;
3345
+ }
3346
+ }
3347
+ return result;
3348
+ }
3349
+ const interceptZohoCrm200StatusWithErrorResponse = interceptZohoErrorResponseFactory(parseZohoCrmServerErrorResponseData);
3350
+ const handleZohoCrmErrorFetch = handleZohoErrorFetchFactory(parseZohoCrmError, logZohoCrmErrorToConsole);
3351
+
3352
+ // MARK: Insert/Update/Upsert Response
3353
+ /**
3354
+ * The maximum number of records allowed for most CRUD functions.
3355
+ *
3356
+ * This is a limit enforced by the Zoho Crm API
3357
+ */
3358
+ const ZOHO_CRM_CRUD_FUNCTION_MAX_RECORDS_LIMIT = 100;
3359
+ /**
3360
+ * The APIs for Insert, Upsert, and Update have the same structure.
3361
+ *
3362
+ * @returns
3363
+ */
3364
+ function updateRecordLikeFunction(context, fetchUrlPrefix, fetchMethod) {
3365
+ return ({
3366
+ data,
3367
+ module
3368
+ }) => context.fetchJson(`/v8/${module}${fetchUrlPrefix}`, zohoCrmApiFetchJsonInput(fetchMethod, {
3369
+ data: util.asArray(data)
3370
+ })).catch(zohoCrmCatchZohoCrmChangeObjectLikeResponseError).then(x => {
3371
+ const isInputMultipleItems = Array.isArray(data);
3372
+ const result = zohoCrmMultiRecordResult(util.asArray(data), x.data);
3373
+ if (isInputMultipleItems) {
3374
+ return result;
3375
+ } else {
3376
+ const {
3377
+ successItems,
3378
+ errorItems
3379
+ } = result;
3380
+ if (errorItems[0] != null) {
3381
+ throw zohoCrmRecordCrudError(errorItems[0].result);
3382
+ } else {
3383
+ return successItems[0].result.details;
3384
+ }
3385
+ }
3386
+ });
3387
+ }
3388
+ /**
3389
+ * Inserts one or more records into Crm.
3390
+ *
3391
+ * https://www.zoho.com/crm/developer-guide/apiv2/insert-records.html
3392
+ *
3393
+ * @param context
3394
+ * @returns
3395
+ */
3396
+ function zohoCrmInsertRecord(context) {
3397
+ return updateRecordLikeFunction(context, '', 'POST');
3398
+ }
3399
+ /**
3400
+ * Updates or inserts one or more records in Crm.
3401
+ *
3402
+ * https://www.zoho.com/crm/developer-guide/apiv2/upsert-records.html
3403
+ *
3404
+ * @param context
3405
+ * @returns
3406
+ */
3407
+ function zohoCrmUpsertRecord(context) {
3408
+ return updateRecordLikeFunction(context, '/upsert', 'POST');
3409
+ }
3410
+ /**
3411
+ * Updates one or more records in Crm.
3412
+ *
3413
+ * https://www.zoho.com/crm/developer-guide/apiv2/update-records.html
3414
+ *
3415
+ * @param context
3416
+ * @returns
3417
+ */
3418
+ function zohoCrmUpdateRecord(context) {
3419
+ return updateRecordLikeFunction(context, '', 'PUT');
3420
+ }
3421
+ /**
3422
+ * Deletes one or more records from the given module.
3423
+ *
3424
+ * https://www.zoho.com/crm/developer-guide/apiv2/delete-records.html
3425
+ *
3426
+ * @param context
3427
+ * @returns ZohoCrmDeleteRecordFunction
3428
+ */
3429
+ function zohoCrmDeleteRecord(context) {
3430
+ return ({
3431
+ ids,
3432
+ module,
3433
+ wf_trigger
3434
+ }) => {
3435
+ return context.fetchJson(`/v8/${module}?${fetch.makeUrlSearchParams({
3436
+ ids,
3437
+ wf_trigger
3438
+ })}`, zohoCrmApiFetchJsonInput('DELETE')).catch(zohoCrmCatchZohoCrmChangeObjectLikeResponseError).then(zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs);
3439
+ };
3440
+ }
3441
+ /**
3442
+ * Retrieves a specific record from the given module.
3443
+ *
3444
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-records.html
3445
+ *
3446
+ * @param context
3447
+ * @returns
3448
+ */
3449
+ function zohoCrmGetRecordById(context) {
3450
+ return input => context.fetchJson(`/v8/${input.module}/${input.id}`, zohoCrmApiFetchJsonInput('GET')).then(assertZohoCrmRecordDataArrayResultHasContent(input.module)).then(x => x.data[0]);
3451
+ }
3452
+ /**
3453
+ * Retrieves records from the given module. Used for paginating across all records.
3454
+ *
3455
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-records.html
3456
+ *
3457
+ * @param context
3458
+ * @returns
3459
+ */
3460
+ function zohoCrmGetRecords(context) {
3461
+ return input => context.fetchJson(`/v8/${input.module}?${zohoCrmUrlSearchParamsMinusModule(input).toString()}`, zohoCrmApiFetchJsonInput('GET'));
3462
+ }
3463
+ /**
3464
+ * Searches records from the given module.
3465
+ *
3466
+ * https://www.zoho.com/crm/developer-guide/apiv2/search-records.html
3467
+ *
3468
+ * @param context
3469
+ * @returns
3470
+ */
3471
+ function zohoCrmSearchRecords(context) {
3472
+ function searchRecordsUrlSearchParams(input) {
3473
+ const baseInput = {
3474
+ ...input
3475
+ };
3476
+ delete baseInput.criteria;
3477
+ if (input.criteria != null) {
3478
+ const criteriaString = zohoCrmSearchRecordsCriteriaString(input.criteria);
3479
+ baseInput.criteria = criteriaString;
3480
+ }
3481
+ if (!baseInput.word && !input.cvid && !input.criteria && !input.email && !input.phone) {
3482
+ throw new Error('At least one of word, cvid, criteria, email, or phone must be provided');
3483
+ }
3484
+ const urlParams = zohoCrmUrlSearchParamsMinusModule(baseInput);
3485
+ return urlParams;
3486
+ }
3487
+ return input => context.fetchJson(`/v8/${input.module}/search?${searchRecordsUrlSearchParams(input).toString()}`, zohoCrmApiFetchJsonInput('GET')).then(x => x ?? {
3488
+ data: [],
3489
+ info: {
3490
+ more_records: false
3491
+ }
3492
+ });
3493
+ }
3494
+ function zohoCrmSearchRecordsPageFactory(context) {
3495
+ return zohoFetchPageFactory(zohoCrmSearchRecords(context));
3496
+ }
3497
+ /**
3498
+ * Creates a ZohoCrmGetRelatedRecordsFunctionFactory, which can be used to create ZohoCrmGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
3499
+ *
3500
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-related-records.html
3501
+ *
3502
+ * @param context the ZohoCrmContext to use
3503
+ * @returns a ZohoCrmGetRelatedRecordsFunctionFactory
3504
+ */
3505
+ function zohoCrmGetRelatedRecordsFunctionFactory(context) {
3506
+ return config => {
3507
+ const {
3508
+ targetModule,
3509
+ returnEmptyRecordsInsteadOfNull = true
3510
+ } = config;
3511
+ return input => context.fetchJson(`/v8/${input.module}/${input.id}/${targetModule}?${zohoCrmUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoCrmApiFetchJsonInput('GET')).then(x => x ?? (returnEmptyRecordsInsteadOfNull !== false ? emptyZohoPageResult() : x));
3512
+ };
3513
+ }
3514
+ function zohoCrmGetEmailsForRecord(context) {
3515
+ const getEmailsFactory = zohoCrmGetRelatedRecordsFunctionFactory(context)({
3516
+ targetModule: ZOHO_CRM_EMAILS_MODULE
3517
+ });
3518
+ return input => getEmailsFactory(input).then(x => {
3519
+ const data = x.data ?? x.Emails;
3520
+ return {
3521
+ ...x,
3522
+ data
3523
+ };
3524
+ });
3525
+ }
3526
+ function zohoCrmGetEmailsForRecordPageFactory(context) {
3527
+ return zohoFetchPageFactory(zohoCrmGetEmailsForRecord(context));
3528
+ }
3529
+ function zohoCrmGetAttachmentsForRecord(context) {
3530
+ return zohoCrmGetRelatedRecordsFunctionFactory(context)({
3531
+ targetModule: ZOHO_CRM_ATTACHMENTS_MODULE
3532
+ });
3533
+ }
3534
+ function zohoCrmGetAttachmentsForRecordPageFactory(context) {
3535
+ return zohoFetchPageFactory(zohoCrmGetAttachmentsForRecord(context));
3536
+ }
3537
+ /**
3538
+ * Maximum attachment size allowed by Zoho Crm.
3539
+ *
3540
+ * 20MB
3541
+ */
3542
+ const ZOHO_CRM_ATTACHMENT_MAX_SIZE = 20 * 1024 * 1024;
3543
+ /**
3544
+ * Uploads an attachment to a record.
3545
+ *
3546
+ * https://www.zoho.com/crm/developer-guide/apiv2/upload-attachment.html
3547
+ *
3548
+ * @param context
3549
+ * @returns
3550
+ */
3551
+ function zohoCrmUploadAttachmentForRecord(context) {
3552
+ return input => {
3553
+ const {
3554
+ attachmentCategoryId,
3555
+ attachmentCategoryName,
3556
+ formData
3557
+ } = input;
3558
+ const urlParams = {
3559
+ attachments_category_id: util.joinStringsWithCommas(attachmentCategoryId),
3560
+ attachments_category: util.joinStringsWithCommas(attachmentCategoryName),
3561
+ attachment_url: input.attachmentUrl
3562
+ };
3563
+ if (!urlParams.attachments_category_id?.length && !urlParams.attachments_category?.length) {
3564
+ throw new Error('attachmentCategoryId or attachmentCategoryName must be provided and not empty.');
3565
+ }
3566
+ if (formData != null) {
3567
+ delete urlParams.attachment_url;
3568
+ }
3569
+ const url = `https://crmsandbox.zoho.com/crm/v8/${input.module}/${input.id}/${ZOHO_CRM_ATTACHMENTS_MODULE}?${fetch.makeUrlSearchParams(urlParams).toString()}`;
3570
+ let response;
3571
+ if (urlParams.attachment_url) {
3572
+ response = context.fetch(url, {
3573
+ method: 'POST'
3574
+ });
3575
+ } else if (formData != null) {
3576
+ throw new Error('unsupported currently. Use the attachmentUrl parameter instead.');
3577
+ // There is something weird going on with sending requests this way and zoho's server is rejecting it.
3578
+ /*
3579
+ response = context.fetch(url, {
3580
+ method: 'POST',
3581
+ headers: {
3582
+ 'Content-Type': 'multipart/form-data',
3583
+ 'content-length': '210'
3584
+ },
3585
+ body: formData
3586
+ });
3587
+ */
3588
+ /*
3589
+ const fullUrl = (context.config.apiUrl as string) + url;
3590
+ const accessToken = await context.accessTokenStringFactory();
3591
+ response = fetch(fullUrl, {
3592
+ headers: {
3593
+ Authorization: `Bearer ${accessToken}`
3594
+ },
3595
+ body: formData,
3596
+ method: 'POST'
3597
+ });
3598
+ console.log({ response });
3599
+ */
3600
+ } else {
3601
+ throw new Error('body or attachmentUrl must be provided.');
3602
+ }
3603
+ return response;
3604
+ };
3605
+ }
3606
+ /**
3607
+ * Downloads an attachment from a record.
3608
+ *
3609
+ * https://www.zoho.com/crm/developer-guide/apiv2/download-attachments.html
3610
+ *
3611
+ * @param context
3612
+ * @returns
3613
+ */
3614
+ function zohoCrmDownloadAttachmentForRecord(context) {
3615
+ return input => context.fetch(`/v8/${input.module}/${input.id}/${ZOHO_CRM_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
3616
+ method: 'GET'
3617
+ }).then(fetch.parseFetchFileResponse);
3618
+ }
3619
+ /**
3620
+ * Deletes an attachment from a record.
3621
+ *
3622
+ * https://www.zoho.com/crm/developer-guide/apiv2/delete-attachments.html
3623
+ *
3624
+ * @param context
3625
+ * @returns
3626
+ */
3627
+ function zohoCrmDeleteAttachmentFromRecord(context) {
3628
+ return input => context.fetch(`/v8/${input.module}/${input.id}/${ZOHO_CRM_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
3629
+ method: 'DELETE'
3630
+ });
3631
+ }
3632
+ class ZohoCrmExecuteRestApiFunctionError extends makeError.BaseError {
3633
+ constructor(error) {
3634
+ super(`An error occured during the execution of the function. Code: ${error.code}, Message: ${error.message}`);
3635
+ this.error = void 0;
3636
+ this.error = error;
3637
+ }
3638
+ }
3639
+ /**
3640
+ * Creates a ZohoCrmExecuteRestApiFunctionFunction
3641
+ *
3642
+ * OAuth Details:
3643
+ * - https://www.zoho.com/crm/developer/docs/functions/serverless-fn-oauth.html#OAuth2
3644
+ * - There is no documentation for ZohoCrm specifically, but it seems to behave the same way
3645
+ * - You will need the following scopes: ZohoCrm.functions.execute.READ,ZohoCrm.functions.execute.CREATE
3646
+ *
3647
+ * @param context
3648
+ * @returns
3649
+ */
3650
+ function zohoCrmExecuteRestApiFunction(context) {
3651
+ return input => {
3652
+ const inputSearchParams = fetch.makeUrlSearchParams(input.params);
3653
+ const inputSearchParamsString = inputSearchParams.toString();
3654
+ const isSpecificRequest = Boolean(input.apiKey);
3655
+ const urlParams = (isSpecificRequest ? `auth_type=apikey&zapikey=${input.apiKey}` : 'auth_type=oauth') + (inputSearchParamsString ? `&${inputSearchParamsString}` : '');
3656
+ const relativeUrl = `/v8/functions/${input.functionName}/actions/execute?${urlParams}`;
3657
+ const baseUrl = isSpecificRequest && input.apiUrl != null ? zohoCrmConfigApiUrl(input.apiUrl) : '';
3658
+ const url = `${baseUrl}${relativeUrl}`;
3659
+ return context.fetchJson(url, zohoCrmApiFetchJsonInput('POST')).then(x => {
3660
+ if (x.code === 'success') {
3661
+ return x.details;
3662
+ } else {
3663
+ throw new ZohoCrmExecuteRestApiFunctionError(x);
3664
+ }
3665
+ });
3666
+ };
3667
+ }
3668
+ // MARK: Util
3669
+ function zohoCrmUrlSearchParamsMinusModule(...input) {
3670
+ return fetch.makeUrlSearchParams(input, {
3671
+ omitKeys: 'module'
3672
+ });
3673
+ }
3674
+ function zohoCrmUrlSearchParamsMinusIdAndModule(...input) {
3675
+ return fetch.makeUrlSearchParams(input, {
3676
+ omitKeys: ['id', 'module']
3677
+ });
3678
+ }
3679
+ /**
3680
+ * @deprecated use makeUrlSearchParams instead.
3681
+ */
3682
+ const zohoCrmUrlSearchParams = fetch.makeUrlSearchParams;
3683
+ function zohoCrmApiFetchJsonInput(method, body) {
3684
+ const result = {
3685
+ method,
3686
+ body: body ?? undefined
3687
+ };
3688
+ return result;
3689
+ }
3690
+ // MARK: Results
3691
+ /**
3692
+ * Catches ZohoServerFetchResponseDataArrayError and returns the error data array as the response data, as each data element will have the error details.
3693
+ *
3694
+ * Use to catch errors from functions that return ZohoCrmChangeObjectLikeResponse and pass the result to zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs.
3695
+ */
3696
+ function zohoCrmCatchZohoCrmChangeObjectLikeResponseError(e) {
3697
+ let result;
3698
+ if (e instanceof ZohoServerFetchResponseDataArrayError) {
3699
+ result = {
3700
+ data: e.errorDataArray
3701
+ };
3702
+ } else {
3703
+ throw e;
3704
+ }
3705
+ return result;
3706
+ }
3707
+ function zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs(response) {
3708
+ const {
3709
+ data
3710
+ } = response;
3711
+ const successItems = [];
3712
+ const errorItems = [];
3713
+ data.forEach(x => {
3714
+ if (x.status === ZOHO_SUCCESS_STATUS) {
3715
+ successItems.push(x);
3716
+ } else {
3717
+ errorItems.push(x);
3718
+ }
3719
+ });
3720
+ const result = {
3721
+ ...response,
3722
+ successItems,
3723
+ errorItems
3724
+ };
3725
+ return result;
3726
+ }
3727
+ function zohoCrmMultiRecordResult(input, results) {
3728
+ const successItems = [];
3729
+ const errorItems = [];
3730
+ input.forEach((x, i) => {
3731
+ const result = results[i];
3732
+ if (result.status === ZOHO_SUCCESS_STATUS) {
3733
+ successItems.push({
3734
+ input: x,
3735
+ result: result
3736
+ });
3737
+ } else {
3738
+ errorItems.push({
3739
+ input: x,
3740
+ result: result
3741
+ });
3742
+ }
3743
+ });
3744
+ const result = {
3745
+ successItems,
3746
+ errorItems
3747
+ };
3748
+ return result;
3749
+ }
3750
+
3751
+ function zohoCrmCreateNotes(context) {
3752
+ return input => context.fetchJson(`/v2/${ZOHO_CRM_NOTES_MODULE}`, zohoCrmApiFetchJsonInput('POST', {
3753
+ data: input.data
3754
+ })).then(x => {
3755
+ return zohoCrmMultiRecordResult(util.asArray(input.data), x.data);
3756
+ });
3757
+ }
3758
+ function zohoCrmDeleteNotes(context) {
3759
+ return input => context.fetchJson(`/v2/${ZOHO_CRM_NOTES_MODULE}?${fetch.makeUrlSearchParams({
3760
+ ids: input.ids
3761
+ })}`, zohoCrmApiFetchJsonInput('DELETE')).then(x => {
3762
+ return zohoCrmMultiRecordResult(util.asArray(input.ids), x.data);
3763
+ });
3764
+ }
3765
+ function zohoCrmGetNotesForRecord(context) {
3766
+ return zohoCrmGetRelatedRecordsFunctionFactory(context)({
3767
+ targetModule: ZOHO_CRM_NOTES_MODULE
3768
+ });
3769
+ }
3770
+ function zohoCrmGetNotesForRecordPageFactory(context) {
3771
+ return zohoFetchPageFactory(zohoCrmGetNotesForRecord(context));
3772
+ }
3773
+ /**
3774
+ * https://www.zoho.com/crm/developer/docs/api/v8/create-notes.html
3775
+ *
3776
+ * @param context
3777
+ * @returns
3778
+ */
3779
+ function zohoCrmCreateNotesForRecord(context) {
3780
+ const createNotesInstance = zohoCrmCreateNotes(context);
3781
+ return input => {
3782
+ const {
3783
+ module: se_module,
3784
+ id: Parent_Id,
3785
+ notes
3786
+ } = input;
3787
+ const createNotesRequest = {
3788
+ data: util.asArray(notes).map(x => ({
3789
+ ...x,
3790
+ se_module,
3791
+ Parent_Id
3792
+ }))
3793
+ };
3794
+ return createNotesInstance(createNotesRequest);
3795
+ };
3796
+ }
3797
+
3798
+ var uncurryThis$2 = functionUncurryThis;
3799
+
3800
+ // eslint-disable-next-line es/no-set -- safe
3801
+ var SetPrototype$1 = Set.prototype;
3802
+
3803
+ var setHelpers = {
3804
+ // eslint-disable-next-line es/no-set -- safe
3805
+ Set: Set,
3806
+ add: uncurryThis$2(SetPrototype$1.add),
3807
+ has: uncurryThis$2(SetPrototype$1.has),
3808
+ remove: uncurryThis$2(SetPrototype$1['delete']),
3809
+ proto: SetPrototype$1
3810
+ };
3811
+
3812
+ var has$5 = setHelpers.has;
3813
+
3814
+ // Perform ? RequireInternalSlot(M, [[SetData]])
3815
+ var aSet$7 = function (it) {
3816
+ has$5(it);
3817
+ return it;
3818
+ };
3819
+
3820
+ var call$1 = functionCall;
3821
+
3822
+ var iterateSimple$7 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
3823
+ var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
3824
+ var next = record.next;
3825
+ var step, result;
3826
+ while (!(step = call$1(next, iterator)).done) {
3827
+ result = fn(step.value);
3828
+ if (result !== undefined) return result;
3829
+ }
3830
+ };
3831
+
3832
+ var uncurryThis$1 = functionUncurryThis;
3833
+ var iterateSimple$6 = iterateSimple$7;
3834
+ var SetHelpers$5 = setHelpers;
3835
+
3836
+ var Set$3 = SetHelpers$5.Set;
3837
+ var SetPrototype = SetHelpers$5.proto;
3838
+ var forEach = uncurryThis$1(SetPrototype.forEach);
3839
+ var keys = uncurryThis$1(SetPrototype.keys);
3840
+ var next = keys(new Set$3()).next;
3841
+
3842
+ var setIterate = function (set, fn, interruptible) {
3843
+ return interruptible ? iterateSimple$6({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
3844
+ };
3845
+
3846
+ var SetHelpers$4 = setHelpers;
3847
+ var iterate$1 = setIterate;
3848
+
3849
+ var Set$2 = SetHelpers$4.Set;
3850
+ var add$3 = SetHelpers$4.add;
3851
+
3852
+ var setClone = function (set) {
3853
+ var result = new Set$2();
3854
+ iterate$1(set, function (it) {
3855
+ add$3(result, it);
3856
+ });
3857
+ return result;
3858
+ };
3859
+
3860
+ var uncurryThis = functionUncurryThis;
3861
+ var aCallable$1 = aCallable$9;
3862
+
3863
+ var functionUncurryThisAccessor = function (object, key, method) {
3864
+ try {
3865
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
3866
+ return uncurryThis(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
3867
+ } catch (error) { /* empty */ }
3868
+ };
3869
+
3870
+ var uncurryThisAccessor = functionUncurryThisAccessor;
3871
+ var SetHelpers$3 = setHelpers;
3872
+
3873
+ var setSize = uncurryThisAccessor(SetHelpers$3.proto, 'size', 'get') || function (set) {
3874
+ return set.size;
3875
+ };
3876
+
3877
+ var aCallable = aCallable$9;
3878
+ var anObject = anObject$f;
3879
+ var call = functionCall;
3880
+ var toIntegerOrInfinity = toIntegerOrInfinity$3;
3881
+ var getIteratorDirect = getIteratorDirect$6;
3882
+
3883
+ var INVALID_SIZE = 'Invalid size';
3884
+ var $RangeError = RangeError;
3885
+ var $TypeError = TypeError;
3886
+ var max = Math.max;
3887
+
3888
+ var SetRecord = function (set, intSize) {
3889
+ this.set = set;
3890
+ this.size = max(intSize, 0);
3891
+ this.has = aCallable(set.has);
3892
+ this.keys = aCallable(set.keys);
3893
+ };
3894
+
3895
+ SetRecord.prototype = {
3896
+ getIterator: function () {
3897
+ return getIteratorDirect(anObject(call(this.keys, this.set)));
3898
+ },
3899
+ includes: function (it) {
3900
+ return call(this.has, this.set, it);
3901
+ }
3902
+ };
3903
+
3904
+ // `GetSetRecord` abstract operation
3905
+ // https://tc39.es/proposal-set-methods/#sec-getsetrecord
3906
+ var getSetRecord$7 = function (obj) {
3907
+ anObject(obj);
3908
+ var numSize = +obj.size;
3909
+ // NOTE: If size is undefined, then numSize will be NaN
3910
+ // eslint-disable-next-line no-self-compare -- NaN check
3911
+ if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
3912
+ var intSize = toIntegerOrInfinity(numSize);
3913
+ if (intSize < 0) throw new $RangeError(INVALID_SIZE);
3914
+ return new SetRecord(obj, intSize);
3915
+ };
3916
+
3917
+ var aSet$6 = aSet$7;
3918
+ var SetHelpers$2 = setHelpers;
3919
+ var clone$2 = setClone;
3920
+ var size$4 = setSize;
3921
+ var getSetRecord$6 = getSetRecord$7;
3922
+ var iterateSet$2 = setIterate;
3923
+ var iterateSimple$5 = iterateSimple$7;
3924
+
3925
+ var has$4 = SetHelpers$2.has;
3926
+ var remove$1 = SetHelpers$2.remove;
3927
+
3928
+ // `Set.prototype.difference` method
3929
+ // https://github.com/tc39/proposal-set-methods
3930
+ var setDifference = function difference(other) {
3931
+ var O = aSet$6(this);
3932
+ var otherRec = getSetRecord$6(other);
3933
+ var result = clone$2(O);
3934
+ if (size$4(O) <= otherRec.size) iterateSet$2(O, function (e) {
3935
+ if (otherRec.includes(e)) remove$1(result, e);
3936
+ });
3937
+ else iterateSimple$5(otherRec.getIterator(), function (e) {
3938
+ if (has$4(O, e)) remove$1(result, e);
3939
+ });
3940
+ return result;
3941
+ };
3942
+
3943
+ var getBuiltIn = getBuiltIn$4;
3944
+
3945
+ var createSetLike = function (size) {
3946
+ return {
3947
+ size: size,
3948
+ has: function () {
3949
+ return false;
3950
+ },
3951
+ keys: function () {
3952
+ return {
3953
+ next: function () {
3954
+ return { done: true };
3955
+ }
3956
+ };
3957
+ }
3958
+ };
3959
+ };
3960
+
3961
+ var setMethodAcceptSetLike$7 = function (name) {
3962
+ var Set = getBuiltIn('Set');
3963
+ try {
3964
+ new Set()[name](createSetLike(0));
3965
+ try {
3966
+ // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it
3967
+ // https://github.com/tc39/proposal-set-methods/pull/88
3968
+ new Set()[name](createSetLike(-1));
3969
+ return false;
3970
+ } catch (error2) {
3971
+ return true;
3972
+ }
3973
+ } catch (error) {
3974
+ return false;
3975
+ }
3976
+ };
3977
+
3978
+ var $$6 = _export;
3979
+ var difference = setDifference;
3980
+ var setMethodAcceptSetLike$6 = setMethodAcceptSetLike$7;
3981
+
3982
+ // `Set.prototype.difference` method
3983
+ // https://github.com/tc39/proposal-set-methods
3984
+ $$6({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
3985
+ difference: difference
3986
+ });
3987
+
3988
+ var aSet$5 = aSet$7;
3989
+ var SetHelpers$1 = setHelpers;
3990
+ var size$3 = setSize;
3991
+ var getSetRecord$5 = getSetRecord$7;
3992
+ var iterateSet$1 = setIterate;
3993
+ var iterateSimple$4 = iterateSimple$7;
3994
+
3995
+ var Set$1 = SetHelpers$1.Set;
3996
+ var add$2 = SetHelpers$1.add;
3997
+ var has$3 = SetHelpers$1.has;
3998
+
3999
+ // `Set.prototype.intersection` method
4000
+ // https://github.com/tc39/proposal-set-methods
4001
+ var setIntersection = function intersection(other) {
4002
+ var O = aSet$5(this);
4003
+ var otherRec = getSetRecord$5(other);
4004
+ var result = new Set$1();
4005
+
4006
+ if (size$3(O) > otherRec.size) {
4007
+ iterateSimple$4(otherRec.getIterator(), function (e) {
4008
+ if (has$3(O, e)) add$2(result, e);
4009
+ });
4010
+ } else {
4011
+ iterateSet$1(O, function (e) {
4012
+ if (otherRec.includes(e)) add$2(result, e);
4013
+ });
4014
+ }
4015
+
4016
+ return result;
4017
+ };
4018
+
4019
+ var $$5 = _export;
4020
+ var fails = fails$c;
4021
+ var intersection = setIntersection;
4022
+ var setMethodAcceptSetLike$5 = setMethodAcceptSetLike$7;
4023
+
4024
+ var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails(function () {
4025
+ // eslint-disable-next-line es/no-array-from, es/no-set -- testing
4026
+ return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
4027
+ });
4028
+
4029
+ // `Set.prototype.intersection` method
4030
+ // https://github.com/tc39/proposal-set-methods
4031
+ $$5({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
4032
+ intersection: intersection
4033
+ });
4034
+
4035
+ var aSet$4 = aSet$7;
4036
+ var has$2 = setHelpers.has;
4037
+ var size$2 = setSize;
4038
+ var getSetRecord$4 = getSetRecord$7;
4039
+ var iterateSet = setIterate;
4040
+ var iterateSimple$3 = iterateSimple$7;
4041
+ var iteratorClose$1 = iteratorClose$6;
4042
+
4043
+ // `Set.prototype.isDisjointFrom` method
4044
+ // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
4045
+ var setIsDisjointFrom = function isDisjointFrom(other) {
4046
+ var O = aSet$4(this);
4047
+ var otherRec = getSetRecord$4(other);
4048
+ if (size$2(O) <= otherRec.size) return iterateSet(O, function (e) {
4049
+ if (otherRec.includes(e)) return false;
4050
+ }, true) !== false;
4051
+ var iterator = otherRec.getIterator();
4052
+ return iterateSimple$3(iterator, function (e) {
4053
+ if (has$2(O, e)) return iteratorClose$1(iterator, 'normal', false);
4054
+ }) !== false;
4055
+ };
4056
+
4057
+ var $$4 = _export;
4058
+ var isDisjointFrom = setIsDisjointFrom;
4059
+ var setMethodAcceptSetLike$4 = setMethodAcceptSetLike$7;
4060
+
4061
+ // `Set.prototype.isDisjointFrom` method
4062
+ // https://github.com/tc39/proposal-set-methods
4063
+ $$4({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
4064
+ isDisjointFrom: isDisjointFrom
4065
+ });
4066
+
4067
+ var aSet$3 = aSet$7;
4068
+ var size$1 = setSize;
4069
+ var iterate = setIterate;
4070
+ var getSetRecord$3 = getSetRecord$7;
4071
+
4072
+ // `Set.prototype.isSubsetOf` method
4073
+ // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
4074
+ var setIsSubsetOf = function isSubsetOf(other) {
4075
+ var O = aSet$3(this);
4076
+ var otherRec = getSetRecord$3(other);
4077
+ if (size$1(O) > otherRec.size) return false;
4078
+ return iterate(O, function (e) {
4079
+ if (!otherRec.includes(e)) return false;
4080
+ }, true) !== false;
4081
+ };
4082
+
4083
+ var $$3 = _export;
4084
+ var isSubsetOf = setIsSubsetOf;
4085
+ var setMethodAcceptSetLike$3 = setMethodAcceptSetLike$7;
4086
+
4087
+ // `Set.prototype.isSubsetOf` method
4088
+ // https://github.com/tc39/proposal-set-methods
4089
+ $$3({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
4090
+ isSubsetOf: isSubsetOf
4091
+ });
4092
+
4093
+ var aSet$2 = aSet$7;
4094
+ var has$1 = setHelpers.has;
4095
+ var size = setSize;
4096
+ var getSetRecord$2 = getSetRecord$7;
4097
+ var iterateSimple$2 = iterateSimple$7;
4098
+ var iteratorClose = iteratorClose$6;
4099
+
4100
+ // `Set.prototype.isSupersetOf` method
4101
+ // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
4102
+ var setIsSupersetOf = function isSupersetOf(other) {
4103
+ var O = aSet$2(this);
4104
+ var otherRec = getSetRecord$2(other);
4105
+ if (size(O) < otherRec.size) return false;
4106
+ var iterator = otherRec.getIterator();
4107
+ return iterateSimple$2(iterator, function (e) {
4108
+ if (!has$1(O, e)) return iteratorClose(iterator, 'normal', false);
4109
+ }) !== false;
4110
+ };
4111
+
4112
+ var $$2 = _export;
4113
+ var isSupersetOf = setIsSupersetOf;
4114
+ var setMethodAcceptSetLike$2 = setMethodAcceptSetLike$7;
4115
+
4116
+ // `Set.prototype.isSupersetOf` method
4117
+ // https://github.com/tc39/proposal-set-methods
4118
+ $$2({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
4119
+ isSupersetOf: isSupersetOf
4120
+ });
4121
+
4122
+ var aSet$1 = aSet$7;
4123
+ var SetHelpers = setHelpers;
4124
+ var clone$1 = setClone;
4125
+ var getSetRecord$1 = getSetRecord$7;
4126
+ var iterateSimple$1 = iterateSimple$7;
4127
+
4128
+ var add$1 = SetHelpers.add;
4129
+ var has = SetHelpers.has;
4130
+ var remove = SetHelpers.remove;
4131
+
4132
+ // `Set.prototype.symmetricDifference` method
4133
+ // https://github.com/tc39/proposal-set-methods
4134
+ var setSymmetricDifference = function symmetricDifference(other) {
4135
+ var O = aSet$1(this);
4136
+ var keysIter = getSetRecord$1(other).getIterator();
4137
+ var result = clone$1(O);
4138
+ iterateSimple$1(keysIter, function (e) {
4139
+ if (has(O, e)) remove(result, e);
4140
+ else add$1(result, e);
4141
+ });
4142
+ return result;
4143
+ };
4144
+
4145
+ var $$1 = _export;
4146
+ var symmetricDifference = setSymmetricDifference;
4147
+ var setMethodAcceptSetLike$1 = setMethodAcceptSetLike$7;
4148
+
4149
+ // `Set.prototype.symmetricDifference` method
4150
+ // https://github.com/tc39/proposal-set-methods
4151
+ $$1({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
4152
+ symmetricDifference: symmetricDifference
4153
+ });
4154
+
4155
+ var aSet = aSet$7;
4156
+ var add = setHelpers.add;
4157
+ var clone = setClone;
4158
+ var getSetRecord = getSetRecord$7;
4159
+ var iterateSimple = iterateSimple$7;
4160
+
4161
+ // `Set.prototype.union` method
4162
+ // https://github.com/tc39/proposal-set-methods
4163
+ var setUnion = function union(other) {
4164
+ var O = aSet(this);
4165
+ var keysIter = getSetRecord(other).getIterator();
4166
+ var result = clone(O);
4167
+ iterateSimple(keysIter, function (it) {
4168
+ add(result, it);
4169
+ });
4170
+ return result;
4171
+ };
4172
+
4173
+ var $ = _export;
4174
+ var union = setUnion;
4175
+ var setMethodAcceptSetLike = setMethodAcceptSetLike$7;
4176
+
4177
+ // `Set.prototype.union` method
4178
+ // https://github.com/tc39/proposal-set-methods
4179
+ $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
4180
+ union: union
4181
+ });
4182
+
4183
+ function zohoCrmCreateTagsForModule(context) {
4184
+ return input => context.fetchJson(`/v8/settings/tags?${fetch.makeUrlSearchParams({
4185
+ module: input.module
4186
+ })}`, zohoCrmApiFetchJsonInput('POST', {
4187
+ tags: util.asArray(input.tags)
4188
+ })).catch(e => {
4189
+ let result;
4190
+ if (e instanceof ZohoServerFetchResponseError) {
4191
+ const tags = e.data?.tags;
4192
+ if (Array.isArray(tags)) {
4193
+ result = {
4194
+ tags
4195
+ };
4196
+ }
4197
+ }
4198
+ if (!result) {
4199
+ throw e;
4200
+ }
4201
+ return result;
4202
+ }).then(x => {
4203
+ const result = zohoCrmMultiRecordResult(util.asArray(input.tags), x.tags);
4204
+ const {
4205
+ included: duplicateErrorItems,
4206
+ excluded: otherErrorItems
4207
+ } = util.separateValues(result.errorItems, x => {
4208
+ return x.result.code === ZOHO_DUPLICATE_DATA_ERROR_CODE;
4209
+ });
4210
+ return {
4211
+ ...result,
4212
+ errorItems: otherErrorItems,
4213
+ duplicateErrorItems,
4214
+ allErrorItems: result.errorItems
4215
+ };
4216
+ });
4217
+ }
4218
+ /**
4219
+ * Returns the list of tags within a module.
4220
+ *
4221
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-tag-list.html
4222
+ *
4223
+ * @param context
4224
+ * @returns
4225
+ */
4226
+ function zohoCrmGetTagsForModule(context) {
4227
+ return input => context.fetchJson(`/v8/settings/tags?${fetch.makeUrlSearchParams({
4228
+ module: input.module,
4229
+ my_tags: input.my_tags
4230
+ })}`, zohoCrmApiFetchJsonInput('GET')).then(x => {
4231
+ // NOTE: This doesn't follow the api documentation, and instead is a normal page result except it has "tags" instead of "data".
4232
+ return {
4233
+ ...x,
4234
+ data: x.tags
4235
+ };
4236
+ });
4237
+ }
4238
+ function zohoCrmGetTagsForModulePageFactory(context) {
4239
+ return zohoFetchPageFactory(zohoCrmGetTagsForModule(context));
4240
+ }
4241
+ // MARK: Add Tag To Record
4242
+ /**
4243
+ * Limit enforced by Zoho Crm
4244
+ */
4245
+ const ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED = 100;
4246
+ /**
4247
+ * Adds one or more tags to one or more records.
4248
+ *
4249
+ * https://www.zoho.com/crm/developer-guide/apiv2/add-tags.html
4250
+ *
4251
+ * @param context
4252
+ * @returns
4253
+ */
4254
+ function zohoCrmAddTagsToRecords(context) {
4255
+ return input => {
4256
+ return context.fetchJson(`/v8/${input.module}/actions/add_tags`, zohoCrmApiFetchJsonInput('POST', zohoCrmAddTagsToRecordsRequestBody(input))).then(x => {
4257
+ const resultInputMap = x.data.map(() => input); // assign "input" to each value for now
4258
+ return zohoCrmMultiRecordResult(resultInputMap, x.data);
4259
+ });
4260
+ };
4261
+ }
4262
+ function zohoCrmAddTagsToRecordsRequestBody(input) {
4263
+ if (Array.isArray(input.ids) && input.ids.length > ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED) {
4264
+ throw new Error(`Cannot add/remove tags from more than ${ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED} records at once.`);
4265
+ }
4266
+ const tags = [...util.asArray(input.tags)];
4267
+ const tagNames = new Set(tags.map(x => x.name));
4268
+ if (input.tag_names) {
4269
+ util.asArray(input.tag_names).forEach(x => {
4270
+ if (!tagNames.has(x)) {
4271
+ tags.push({
4272
+ name: x
4273
+ });
4274
+ tagNames.add(x);
4275
+ }
4276
+ });
4277
+ }
4278
+ return {
4279
+ tags,
4280
+ ids: util.asArray(input.ids)
4281
+ };
4282
+ }
4283
+ // MARK: Remove Tag From Record
4284
+ /**
4285
+ * Limit enforced by Zoho Crm
4286
+ */
4287
+ const ZOHO_CRM_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED = 100;
4288
+ /**
4289
+ * Removes one or more tags from one or more records.
4290
+ *
4291
+ * https://www.zoho.com/crm/developer-guide/apiv2/remove-tags.html
4292
+ *
4293
+ * @param context
4294
+ * @returns
4295
+ */
4296
+ function zohoCrmRemoveTagsFromRecords(context) {
4297
+ return input => {
4298
+ return context.fetchJson(`/v8/${input.module}/actions/remove_tags`, zohoCrmApiFetchJsonInput('POST', zohoCrmAddTagsToRecordsRequestBody(input))).then(x => {
4299
+ const resultInputMap = x.data.map(() => input); // assign "input" to each value for now
4300
+ return zohoCrmMultiRecordResult(resultInputMap, x.data);
4301
+ });
4302
+ };
4303
+ }
4304
+
4305
+ function zohoCrmFactory(factoryConfig) {
4306
+ const {
4307
+ accountsContext
4308
+ } = factoryConfig;
4309
+ const accessTokenStringFactory = zohoAccessTokenStringFactory(accountsContext.loadAccessToken);
4310
+ const fetchHandler = zohoRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
4311
+ const {
4312
+ logZohoServerErrorFunction,
4313
+ fetchFactory = input => fetch.fetchApiFetchService.makeFetch({
4314
+ baseUrl: input.apiUrl,
4315
+ baseRequest: async () => ({
4316
+ headers: {
4317
+ 'Content-Type': 'application/json',
4318
+ Authorization: `Bearer ${await accessTokenStringFactory()}`
4319
+ }
4320
+ }),
4321
+ fetchHandler,
4322
+ timeout: 20 * 1000,
4323
+ // 20 second timeout
4324
+ requireOkResponse: true,
4325
+ // enforce ok response
4326
+ useTimeout: true // use timeout
4327
+ })
4328
+ } = factoryConfig;
4329
+ return config => {
4330
+ if (!config.apiUrl) {
4331
+ throw new Error('ZohoConfig missing api url.');
4332
+ }
4333
+ const apiUrl = zohoCrmConfigApiUrl(config.apiUrl);
4334
+ const baseFetch = fetchFactory({
4335
+ apiUrl
4336
+ });
4337
+ const fetch$1 = handleZohoCrmErrorFetch(baseFetch, logZohoServerErrorFunction, x => {
4338
+ if (x instanceof ZohoInvalidTokenError) {
4339
+ accountsContext.loadAccessToken.resetAccessToken();
4340
+ }
4341
+ });
4342
+ const fetchJson = fetch.fetchJsonFunction(fetch$1, {
4343
+ interceptJsonResponse: interceptZohoCrm200StatusWithErrorResponse,
4344
+ // intercept errors that return status 200
4345
+ handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
4346
+ });
4347
+ const crmContext = {
4348
+ fetch: fetch$1,
4349
+ fetchJson,
4350
+ accessTokenStringFactory,
4351
+ config: {
4352
+ ...config,
4353
+ apiUrl
4354
+ },
4355
+ zohoRateLimiter: fetchHandler._rateLimiter
4356
+ };
4357
+ const zohoCrm = {
4358
+ crmContext
4359
+ };
4360
+ return zohoCrm;
4361
+ };
4362
+ }
4363
+
4364
+ /**
4365
+ * Maximum length of ZohoCrmTagName
4366
+ */
4367
+ const ZOHO_CRM_TAG_NAME_MAX_LENGTH = 25;
4368
+
4369
+ /**
4370
+ * Trades a refresh token for a new AccessToken
4371
+ * @param context
4372
+ * @returns
4373
+ */
4374
+ function zohoAccountsAccessToken(context) {
4375
+ return input => {
4376
+ const {
4377
+ clientId: configClientId,
4378
+ clientSecret: configClientSecret,
4379
+ refreshToken: configRefreshToken
4380
+ } = context.config;
4381
+ const {
4382
+ client,
4383
+ refreshToken: inputRefreshToken
4384
+ } = input ?? {};
4385
+ const clientId = client?.clientId ?? configClientId;
4386
+ const clientSecret = client?.clientSecret ?? configClientSecret;
4387
+ const refreshToken = inputRefreshToken ?? configRefreshToken;
4388
+ return context.fetchJson(`/oauth/v2/token?grant_type=refresh_token&client_id=${clientId}&client_secret=${clientSecret}&refresh_token=${refreshToken}`, zohoAccountsApiFetchJsonInput('POST'));
4389
+ };
3129
4390
  }
3130
4391
  function zohoAccountsApiFetchJsonInput(method, body) {
3131
4392
  const result = {
@@ -3192,7 +4453,7 @@ function zohoAccountsFactory(factoryConfig) {
3192
4453
  api_domain,
3193
4454
  scope,
3194
4455
  expires_in
3195
- } = await accessToken(accountsContext)();
4456
+ } = await zohoAccountsAccessToken(accountsContext)();
3196
4457
  const result = {
3197
4458
  accessToken: access_token,
3198
4459
  apiDomain: api_domain,
@@ -3298,10 +4559,26 @@ function zohoDateTimeString(date) {
3298
4559
  exports.DEFAULT_ZOHO_API_RATE_LIMIT = DEFAULT_ZOHO_API_RATE_LIMIT;
3299
4560
  exports.DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD = DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD;
3300
4561
  exports.DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION;
4562
+ exports.MAX_ZOHO_CRM_SEARCH_MODULE_RECORDS_CRITERIA = MAX_ZOHO_CRM_SEARCH_MODULE_RECORDS_CRITERIA;
3301
4563
  exports.MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA = MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA;
3302
4564
  exports.ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE = ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE;
3303
4565
  exports.ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE = ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE;
3304
4566
  exports.ZOHO_ACCOUNTS_US_API_URL = ZOHO_ACCOUNTS_US_API_URL;
4567
+ exports.ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED = ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED;
4568
+ exports.ZOHO_CRM_ALREADY_ASSOCIATED_ERROR_CODE = ZOHO_CRM_ALREADY_ASSOCIATED_ERROR_CODE;
4569
+ exports.ZOHO_CRM_ATTACHMENTS_MODULE = ZOHO_CRM_ATTACHMENTS_MODULE;
4570
+ exports.ZOHO_CRM_ATTACHMENT_MAX_SIZE = ZOHO_CRM_ATTACHMENT_MAX_SIZE;
4571
+ exports.ZOHO_CRM_CONTACTS_MODULE = ZOHO_CRM_CONTACTS_MODULE;
4572
+ exports.ZOHO_CRM_CRUD_FUNCTION_MAX_RECORDS_LIMIT = ZOHO_CRM_CRUD_FUNCTION_MAX_RECORDS_LIMIT;
4573
+ exports.ZOHO_CRM_EMAILS_MODULE = ZOHO_CRM_EMAILS_MODULE;
4574
+ exports.ZOHO_CRM_LEADS_MODULE = ZOHO_CRM_LEADS_MODULE;
4575
+ exports.ZOHO_CRM_NOTES_MODULE = ZOHO_CRM_NOTES_MODULE;
4576
+ exports.ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME;
4577
+ exports.ZOHO_CRM_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED = ZOHO_CRM_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED;
4578
+ exports.ZOHO_CRM_SERVICE_NAME = ZOHO_CRM_SERVICE_NAME;
4579
+ exports.ZOHO_CRM_TAG_NAME_MAX_LENGTH = ZOHO_CRM_TAG_NAME_MAX_LENGTH;
4580
+ exports.ZOHO_CRM_TASKS_MODULE = ZOHO_CRM_TASKS_MODULE;
4581
+ exports.ZOHO_DATA_ARRAY_BLANK_ERROR_CODE = ZOHO_DATA_ARRAY_BLANK_ERROR_CODE;
3305
4582
  exports.ZOHO_DUPLICATE_DATA_ERROR_CODE = ZOHO_DUPLICATE_DATA_ERROR_CODE;
3306
4583
  exports.ZOHO_ERROR_STATUS = ZOHO_ERROR_STATUS;
3307
4584
  exports.ZOHO_FAILURE_ERROR_CODE = ZOHO_FAILURE_ERROR_CODE;
@@ -3333,6 +4610,13 @@ exports.ZOHO_TOO_MANY_REQUESTS_ERROR_CODE = ZOHO_TOO_MANY_REQUESTS_ERROR_CODE;
3333
4610
  exports.ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE = ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE;
3334
4611
  exports.ZohoAccountsAccessTokenError = ZohoAccountsAccessTokenError;
3335
4612
  exports.ZohoAccountsAuthFailureError = ZohoAccountsAuthFailureError;
4613
+ exports.ZohoCrmExecuteRestApiFunctionError = ZohoCrmExecuteRestApiFunctionError;
4614
+ exports.ZohoCrmRecordCrudDuplicateDataError = ZohoCrmRecordCrudDuplicateDataError;
4615
+ exports.ZohoCrmRecordCrudError = ZohoCrmRecordCrudError;
4616
+ exports.ZohoCrmRecordCrudInvalidDataError = ZohoCrmRecordCrudInvalidDataError;
4617
+ exports.ZohoCrmRecordCrudMandatoryFieldNotFoundError = ZohoCrmRecordCrudMandatoryFieldNotFoundError;
4618
+ exports.ZohoCrmRecordCrudNoMatchingRecordError = ZohoCrmRecordCrudNoMatchingRecordError;
4619
+ exports.ZohoCrmRecordNoContentError = ZohoCrmRecordNoContentError;
3336
4620
  exports.ZohoInternalError = ZohoInternalError;
3337
4621
  exports.ZohoInvalidAuthorizationError = ZohoInvalidAuthorizationError;
3338
4622
  exports.ZohoInvalidQueryError = ZohoInvalidQueryError;
@@ -3345,11 +4629,13 @@ exports.ZohoRecruitRecordCrudMandatoryFieldNotFoundError = ZohoRecruitRecordCrud
3345
4629
  exports.ZohoRecruitRecordCrudNoMatchingRecordError = ZohoRecruitRecordCrudNoMatchingRecordError;
3346
4630
  exports.ZohoRecruitRecordNoContentError = ZohoRecruitRecordNoContentError;
3347
4631
  exports.ZohoServerError = ZohoServerError;
4632
+ exports.ZohoServerFetchResponseDataArrayError = ZohoServerFetchResponseDataArrayError;
3348
4633
  exports.ZohoServerFetchResponseError = ZohoServerFetchResponseError;
3349
4634
  exports.ZohoTooManyRequestsError = ZohoTooManyRequestsError;
3350
- exports.accessToken = accessToken;
3351
4635
  exports.addTagsToRecords = addTagsToRecords;
3352
4636
  exports.assertRecordDataArrayResultHasContent = assertRecordDataArrayResultHasContent;
4637
+ exports.assertZohoCrmRecordDataArrayResultHasContent = assertZohoCrmRecordDataArrayResultHasContent;
4638
+ exports.assertZohoRecruitRecordDataArrayResultHasContent = assertZohoRecruitRecordDataArrayResultHasContent;
3353
4639
  exports.associateCandidateRecordsWithJobOpenings = associateCandidateRecordsWithJobOpenings;
3354
4640
  exports.createNotes = createNotes;
3355
4641
  exports.createNotesForRecord = createNotesForRecord;
@@ -3359,7 +4645,7 @@ exports.deleteNotes = deleteNotes;
3359
4645
  exports.deleteRecord = deleteRecord;
3360
4646
  exports.downloadAttachmentForRecord = downloadAttachmentForRecord;
3361
4647
  exports.emptyZohoPageResult = emptyZohoPageResult;
3362
- exports.escapeZohoFieldValueForCriteriaString = escapeZohoFieldValueForCriteriaString;
4648
+ exports.escapeZohoCrmFieldValueForCriteriaString = escapeZohoCrmFieldValueForCriteriaString;
3363
4649
  exports.executeRestApiFunction = executeRestApiFunction;
3364
4650
  exports.getAttachmentsForRecord = getAttachmentsForRecord;
3365
4651
  exports.getAttachmentsForRecordPageFactory = getAttachmentsForRecordPageFactory;
@@ -3373,18 +4659,25 @@ exports.getRelatedRecordsFunctionFactory = getRelatedRecordsFunctionFactory;
3373
4659
  exports.getTagsForModule = getTagsForModule;
3374
4660
  exports.getTagsForModulePageFactory = getTagsForModulePageFactory;
3375
4661
  exports.handleZohoAccountsErrorFetch = handleZohoAccountsErrorFetch;
4662
+ exports.handleZohoCrmErrorFetch = handleZohoCrmErrorFetch;
3376
4663
  exports.handleZohoErrorFetchFactory = handleZohoErrorFetchFactory;
3377
4664
  exports.handleZohoRecruitErrorFetch = handleZohoRecruitErrorFetch;
3378
4665
  exports.insertRecord = insertRecord;
3379
4666
  exports.interceptZohoAccounts200StatusWithErrorResponse = interceptZohoAccounts200StatusWithErrorResponse;
4667
+ exports.interceptZohoCrm200StatusWithErrorResponse = interceptZohoCrm200StatusWithErrorResponse;
3380
4668
  exports.interceptZohoErrorResponseFactory = interceptZohoErrorResponseFactory;
3381
4669
  exports.interceptZohoRecruit200StatusWithErrorResponse = interceptZohoRecruit200StatusWithErrorResponse;
4670
+ exports.isZohoCrmValidUrl = isZohoCrmValidUrl;
3382
4671
  exports.isZohoRecruitValidUrl = isZohoRecruitValidUrl;
4672
+ exports.isZohoServerErrorResponseDataArrayRef = isZohoServerErrorResponseDataArrayRef;
3383
4673
  exports.logZohoAccountsErrorToConsole = logZohoAccountsErrorToConsole;
4674
+ exports.logZohoCrmErrorToConsole = logZohoCrmErrorToConsole;
3384
4675
  exports.logZohoRecruitErrorToConsole = logZohoRecruitErrorToConsole;
3385
4676
  exports.logZohoServerErrorFunction = logZohoServerErrorFunction;
3386
4677
  exports.parseZohoAccountsError = parseZohoAccountsError;
3387
4678
  exports.parseZohoAccountsServerErrorResponseData = parseZohoAccountsServerErrorResponseData;
4679
+ exports.parseZohoCrmError = parseZohoCrmError;
4680
+ exports.parseZohoCrmServerErrorResponseData = parseZohoCrmServerErrorResponseData;
3388
4681
  exports.parseZohoRecruitError = parseZohoRecruitError;
3389
4682
  exports.parseZohoRecruitServerErrorResponseData = parseZohoRecruitServerErrorResponseData;
3390
4683
  exports.parseZohoServerErrorResponseData = parseZohoServerErrorResponseData;
@@ -3402,24 +4695,98 @@ exports.updateRecord = updateRecord;
3402
4695
  exports.uploadAttachmentForRecord = uploadAttachmentForRecord;
3403
4696
  exports.upsertRecord = upsertRecord;
3404
4697
  exports.zohoAccessTokenStringFactory = zohoAccessTokenStringFactory;
4698
+ exports.zohoAccountsAccessToken = zohoAccountsAccessToken;
3405
4699
  exports.zohoAccountsApiFetchJsonInput = zohoAccountsApiFetchJsonInput;
3406
4700
  exports.zohoAccountsConfigApiUrl = zohoAccountsConfigApiUrl;
3407
4701
  exports.zohoAccountsFactory = zohoAccountsFactory;
3408
4702
  exports.zohoAccountsZohoAccessTokenFactory = zohoAccountsZohoAccessTokenFactory;
4703
+ exports.zohoCrmAddTagsToRecords = zohoCrmAddTagsToRecords;
4704
+ exports.zohoCrmAddTagsToRecordsRequestBody = zohoCrmAddTagsToRecordsRequestBody;
4705
+ exports.zohoCrmApiFetchJsonInput = zohoCrmApiFetchJsonInput;
4706
+ exports.zohoCrmCatchZohoCrmChangeObjectLikeResponseError = zohoCrmCatchZohoCrmChangeObjectLikeResponseError;
4707
+ exports.zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs = zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs;
4708
+ exports.zohoCrmConfigApiUrl = zohoCrmConfigApiUrl;
4709
+ exports.zohoCrmCreateNotes = zohoCrmCreateNotes;
4710
+ exports.zohoCrmCreateNotesForRecord = zohoCrmCreateNotesForRecord;
4711
+ exports.zohoCrmCreateTagsForModule = zohoCrmCreateTagsForModule;
4712
+ exports.zohoCrmDeleteAttachmentFromRecord = zohoCrmDeleteAttachmentFromRecord;
4713
+ exports.zohoCrmDeleteNotes = zohoCrmDeleteNotes;
4714
+ exports.zohoCrmDeleteRecord = zohoCrmDeleteRecord;
4715
+ exports.zohoCrmDownloadAttachmentForRecord = zohoCrmDownloadAttachmentForRecord;
4716
+ exports.zohoCrmExecuteRestApiFunction = zohoCrmExecuteRestApiFunction;
4717
+ exports.zohoCrmFactory = zohoCrmFactory;
4718
+ exports.zohoCrmGetAttachmentsForRecord = zohoCrmGetAttachmentsForRecord;
4719
+ exports.zohoCrmGetAttachmentsForRecordPageFactory = zohoCrmGetAttachmentsForRecordPageFactory;
4720
+ exports.zohoCrmGetEmailsForRecord = zohoCrmGetEmailsForRecord;
4721
+ exports.zohoCrmGetEmailsForRecordPageFactory = zohoCrmGetEmailsForRecordPageFactory;
4722
+ exports.zohoCrmGetNotesForRecord = zohoCrmGetNotesForRecord;
4723
+ exports.zohoCrmGetNotesForRecordPageFactory = zohoCrmGetNotesForRecordPageFactory;
4724
+ exports.zohoCrmGetRecordById = zohoCrmGetRecordById;
4725
+ exports.zohoCrmGetRecords = zohoCrmGetRecords;
4726
+ exports.zohoCrmGetRelatedRecordsFunctionFactory = zohoCrmGetRelatedRecordsFunctionFactory;
4727
+ exports.zohoCrmGetTagsForModule = zohoCrmGetTagsForModule;
4728
+ exports.zohoCrmGetTagsForModulePageFactory = zohoCrmGetTagsForModulePageFactory;
4729
+ exports.zohoCrmInsertRecord = zohoCrmInsertRecord;
4730
+ exports.zohoCrmMultiRecordResult = zohoCrmMultiRecordResult;
4731
+ exports.zohoCrmRecordCrudError = zohoCrmRecordCrudError;
4732
+ exports.zohoCrmRemoveTagsFromRecords = zohoCrmRemoveTagsFromRecords;
4733
+ exports.zohoCrmSearchRecords = zohoCrmSearchRecords;
4734
+ exports.zohoCrmSearchRecordsCriteriaEntryToCriteriaString = zohoCrmSearchRecordsCriteriaEntryToCriteriaString;
4735
+ exports.zohoCrmSearchRecordsCriteriaString = zohoCrmSearchRecordsCriteriaString;
4736
+ exports.zohoCrmSearchRecordsCriteriaStringForTree = zohoCrmSearchRecordsCriteriaStringForTree;
4737
+ exports.zohoCrmSearchRecordsPageFactory = zohoCrmSearchRecordsPageFactory;
4738
+ exports.zohoCrmUpdateRecord = zohoCrmUpdateRecord;
4739
+ exports.zohoCrmUploadAttachmentForRecord = zohoCrmUploadAttachmentForRecord;
4740
+ exports.zohoCrmUpsertRecord = zohoCrmUpsertRecord;
4741
+ exports.zohoCrmUrlSearchParams = zohoCrmUrlSearchParams;
4742
+ exports.zohoCrmUrlSearchParamsMinusIdAndModule = zohoCrmUrlSearchParamsMinusIdAndModule;
4743
+ exports.zohoCrmUrlSearchParamsMinusModule = zohoCrmUrlSearchParamsMinusModule;
3409
4744
  exports.zohoDateTimeString = zohoDateTimeString;
3410
4745
  exports.zohoFetchPageFactory = zohoFetchPageFactory;
3411
4746
  exports.zohoRateLimitHeaderDetails = zohoRateLimitHeaderDetails;
3412
4747
  exports.zohoRateLimitedFetchHandler = zohoRateLimitedFetchHandler;
4748
+ exports.zohoRecruitAddTagsToRecords = zohoRecruitAddTagsToRecords;
3413
4749
  exports.zohoRecruitApiFetchJsonInput = zohoRecruitApiFetchJsonInput;
4750
+ exports.zohoRecruitAssociateCandidateRecordsWithJobOpenings = zohoRecruitAssociateCandidateRecordsWithJobOpenings;
3414
4751
  exports.zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs = zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs;
3415
4752
  exports.zohoRecruitConfigApiUrl = zohoRecruitConfigApiUrl;
4753
+ exports.zohoRecruitCreateNotes = zohoRecruitCreateNotes;
4754
+ exports.zohoRecruitCreateNotesForRecord = zohoRecruitCreateNotesForRecord;
4755
+ exports.zohoRecruitCreateTagsForModule = zohoRecruitCreateTagsForModule;
4756
+ exports.zohoRecruitDeleteAttachmentFromRecord = zohoRecruitDeleteAttachmentFromRecord;
4757
+ exports.zohoRecruitDeleteNotes = zohoRecruitDeleteNotes;
4758
+ exports.zohoRecruitDeleteRecord = zohoRecruitDeleteRecord;
4759
+ exports.zohoRecruitDownloadAttachmentForRecord = zohoRecruitDownloadAttachmentForRecord;
4760
+ exports.zohoRecruitExecuteRestApiFunction = zohoRecruitExecuteRestApiFunction;
3416
4761
  exports.zohoRecruitFactory = zohoRecruitFactory;
4762
+ exports.zohoRecruitGetAttachmentsForRecord = zohoRecruitGetAttachmentsForRecord;
4763
+ exports.zohoRecruitGetAttachmentsForRecordPageFactory = zohoRecruitGetAttachmentsForRecordPageFactory;
4764
+ exports.zohoRecruitGetEmailsForRecord = zohoRecruitGetEmailsForRecord;
4765
+ exports.zohoRecruitGetEmailsForRecordPageFactory = zohoRecruitGetEmailsForRecordPageFactory;
4766
+ exports.zohoRecruitGetNotesForRecord = zohoRecruitGetNotesForRecord;
4767
+ exports.zohoRecruitGetNotesForRecordPageFactory = zohoRecruitGetNotesForRecordPageFactory;
4768
+ exports.zohoRecruitGetRecordById = zohoRecruitGetRecordById;
4769
+ exports.zohoRecruitGetRecords = zohoRecruitGetRecords;
4770
+ exports.zohoRecruitGetRelatedRecordsFunctionFactory = zohoRecruitGetRelatedRecordsFunctionFactory;
4771
+ exports.zohoRecruitGetTagsForModule = zohoRecruitGetTagsForModule;
4772
+ exports.zohoRecruitGetTagsForModulePageFactory = zohoRecruitGetTagsForModulePageFactory;
4773
+ exports.zohoRecruitInsertRecord = zohoRecruitInsertRecord;
3417
4774
  exports.zohoRecruitMultiRecordResult = zohoRecruitMultiRecordResult;
3418
4775
  exports.zohoRecruitRecordCrudError = zohoRecruitRecordCrudError;
3419
- exports.zohoRecruitSearchRecordsCriteriaEntriesForEmails = zohoRecruitSearchRecordsCriteriaEntriesForEmails;
4776
+ exports.zohoRecruitRemoveTagsFromRecords = zohoRecruitRemoveTagsFromRecords;
4777
+ exports.zohoRecruitSearchAssociatedRecords = zohoRecruitSearchAssociatedRecords;
4778
+ exports.zohoRecruitSearchCandidateAssociatedJobOpeningRecords = zohoRecruitSearchCandidateAssociatedJobOpeningRecords;
4779
+ exports.zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory = zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory;
4780
+ exports.zohoRecruitSearchJobOpeningAssociatedCandidateRecords = zohoRecruitSearchJobOpeningAssociatedCandidateRecords;
4781
+ exports.zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory = zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory;
4782
+ exports.zohoRecruitSearchRecords = zohoRecruitSearchRecords;
3420
4783
  exports.zohoRecruitSearchRecordsCriteriaEntryToCriteriaString = zohoRecruitSearchRecordsCriteriaEntryToCriteriaString;
3421
4784
  exports.zohoRecruitSearchRecordsCriteriaString = zohoRecruitSearchRecordsCriteriaString;
3422
4785
  exports.zohoRecruitSearchRecordsCriteriaStringForTree = zohoRecruitSearchRecordsCriteriaStringForTree;
4786
+ exports.zohoRecruitSearchRecordsPageFactory = zohoRecruitSearchRecordsPageFactory;
4787
+ exports.zohoRecruitUpdateRecord = zohoRecruitUpdateRecord;
4788
+ exports.zohoRecruitUploadAttachmentForRecord = zohoRecruitUploadAttachmentForRecord;
4789
+ exports.zohoRecruitUpsertRecord = zohoRecruitUpsertRecord;
3423
4790
  exports.zohoRecruitUrlSearchParams = zohoRecruitUrlSearchParams;
3424
4791
  exports.zohoRecruitUrlSearchParamsMinusIdAndModule = zohoRecruitUrlSearchParamsMinusIdAndModule;
3425
4792
  exports.zohoRecruitUrlSearchParamsMinusModule = zohoRecruitUrlSearchParamsMinusModule;