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