@dereekb/zoho 13.8.0 → 13.9.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 (38) hide show
  1. package/cli/LICENSE +21 -0
  2. package/cli/index.js +4 -0
  3. package/cli/package.json +20 -0
  4. package/index.cjs.js +2537 -228
  5. package/index.esm.js +2474 -229
  6. package/nestjs/index.cjs.js +852 -191
  7. package/nestjs/index.esm.js +849 -193
  8. package/nestjs/package.json +5 -5
  9. package/nestjs/src/lib/desk/desk.api.d.ts +213 -0
  10. package/nestjs/src/lib/desk/desk.config.d.ts +27 -0
  11. package/nestjs/src/lib/desk/desk.module.d.ts +62 -0
  12. package/nestjs/src/lib/desk/index.d.ts +3 -0
  13. package/nestjs/src/lib/index.d.ts +1 -0
  14. package/package.json +12 -5
  15. package/src/lib/desk/desk.agent.d.ts +45 -0
  16. package/src/lib/desk/desk.api.activities.d.ts +43 -0
  17. package/src/lib/desk/desk.api.agents.d.ts +91 -0
  18. package/src/lib/desk/desk.api.attachments.d.ts +47 -0
  19. package/src/lib/desk/desk.api.comments.d.ts +86 -0
  20. package/src/lib/desk/desk.api.contacts.d.ts +81 -0
  21. package/src/lib/desk/desk.api.departments.d.ts +47 -0
  22. package/src/lib/desk/desk.api.followers.d.ts +57 -0
  23. package/src/lib/desk/desk.api.page.d.ts +72 -0
  24. package/src/lib/desk/desk.api.tags.d.ts +102 -0
  25. package/src/lib/desk/desk.api.threads.d.ts +60 -0
  26. package/src/lib/desk/desk.api.tickets.d.ts +227 -0
  27. package/src/lib/desk/desk.api.time.d.ts +109 -0
  28. package/src/lib/desk/desk.config.d.ts +75 -0
  29. package/src/lib/desk/desk.contact.d.ts +50 -0
  30. package/src/lib/desk/desk.d.ts +44 -0
  31. package/src/lib/desk/desk.department.d.ts +27 -0
  32. package/src/lib/desk/desk.error.api.d.ts +33 -0
  33. package/src/lib/desk/desk.factory.d.ts +47 -0
  34. package/src/lib/desk/desk.limit.d.ts +39 -0
  35. package/src/lib/desk/desk.ticket.d.ts +308 -0
  36. package/src/lib/desk/index.d.ts +21 -0
  37. package/src/lib/index.d.ts +1 -0
  38. package/src/lib/zoho.limit.d.ts +66 -10
package/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { getNextPageNumber, isStandardInternetAccessibleWebsiteUrl, escapeString
2
2
  import { fetchPageFactory, FetchResponseError, makeUrlSearchParams, parseFetchFileResponse, FetchRequestFactoryError, rateLimitedFetchHandler, fetchJsonFunction, returnNullHandleFetchJsonParseErrorFunction, fetchApiFetchService } from '@dereekb/util/fetch';
3
3
  import { BaseError } from 'make-error';
4
4
 
5
- function _define_property$h(obj, key, value) {
5
+ function _define_property$s(obj, key, value) {
6
6
  if (key in obj) {
7
7
  Object.defineProperty(obj, key, {
8
8
  value: value,
@@ -15,7 +15,7 @@ function _define_property$h(obj, key, value) {
15
15
  }
16
16
  return obj;
17
17
  }
18
- function _object_spread$d(target) {
18
+ function _object_spread$o(target) {
19
19
  for(var i = 1; i < arguments.length; i++){
20
20
  var source = arguments[i] != null ? arguments[i] : {};
21
21
  var ownKeys = Object.keys(source);
@@ -25,12 +25,12 @@ function _object_spread$d(target) {
25
25
  }));
26
26
  }
27
27
  ownKeys.forEach(function(key) {
28
- _define_property$h(target, key, source[key]);
28
+ _define_property$s(target, key, source[key]);
29
29
  });
30
30
  }
31
31
  return target;
32
32
  }
33
- function ownKeys$c(object, enumerableOnly) {
33
+ function ownKeys$n(object, enumerableOnly) {
34
34
  var keys = Object.keys(object);
35
35
  if (Object.getOwnPropertySymbols) {
36
36
  var symbols = Object.getOwnPropertySymbols(object);
@@ -38,12 +38,12 @@ function ownKeys$c(object, enumerableOnly) {
38
38
  }
39
39
  return keys;
40
40
  }
41
- function _object_spread_props$c(target, source) {
41
+ function _object_spread_props$n(target, source) {
42
42
  source = source != null ? source : {};
43
43
  if (Object.getOwnPropertyDescriptors) {
44
44
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
45
45
  } else {
46
- ownKeys$c(Object(source)).forEach(function(key) {
46
+ ownKeys$n(Object(source)).forEach(function(key) {
47
47
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
48
48
  });
49
49
  }
@@ -87,7 +87,7 @@ function _object_spread_props$c(target, source) {
87
87
  * }
88
88
  * ```
89
89
  */ function zohoFetchPageFactory(fetch, defaults) {
90
- return fetchPageFactory(_object_spread_props$c(_object_spread$d({}, defaults), {
90
+ return fetchPageFactory(_object_spread_props$n(_object_spread$o({}, defaults), {
91
91
  fetch: fetch,
92
92
  readFetchPageResultInfo: function readFetchPageResultInfo(result) {
93
93
  var _ref;
@@ -98,7 +98,7 @@ function _object_spread_props$c(target, source) {
98
98
  },
99
99
  buildInputForNextPage: function buildInputForNextPage(pageResult, input, options) {
100
100
  var _options_maxItemsPerPage;
101
- return _object_spread_props$c(_object_spread$d({}, input), {
101
+ return _object_spread_props$n(_object_spread$o({}, input), {
102
102
  page: getNextPageNumber(pageResult),
103
103
  per_page: (_options_maxItemsPerPage = options.maxItemsPerPage) !== null && _options_maxItemsPerPage !== void 0 ? _options_maxItemsPerPage : input.per_page
104
104
  });
@@ -323,7 +323,7 @@ function _assert_this_initialized$5(self) {
323
323
  }
324
324
  return self;
325
325
  }
326
- function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
326
+ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
327
327
  try {
328
328
  var info = gen[key](arg);
329
329
  var value = info.value;
@@ -337,16 +337,16 @@ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
337
337
  Promise.resolve(value).then(_next, _throw);
338
338
  }
339
339
  }
340
- function _async_to_generator$9(fn) {
340
+ function _async_to_generator$b(fn) {
341
341
  return function() {
342
342
  var self = this, args = arguments;
343
343
  return new Promise(function(resolve, reject) {
344
344
  var gen = fn.apply(self, args);
345
345
  function _next(value) {
346
- asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
346
+ asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
347
347
  }
348
348
  function _throw(err) {
349
- asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
349
+ asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
350
350
  }
351
351
  _next(undefined);
352
352
  });
@@ -374,7 +374,7 @@ function _create_class$2(Constructor, protoProps, staticProps) {
374
374
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
375
375
  return Constructor;
376
376
  }
377
- function _define_property$g(obj, key, value) {
377
+ function _define_property$r(obj, key, value) {
378
378
  if (key in obj) {
379
379
  Object.defineProperty(obj, key, {
380
380
  value: value,
@@ -406,7 +406,7 @@ function _inherits$5(subClass, superClass) {
406
406
  });
407
407
  if (superClass) _set_prototype_of$5(subClass, superClass);
408
408
  }
409
- function _instanceof$5(left, right) {
409
+ function _instanceof$6(left, right) {
410
410
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
411
411
  return !!right[Symbol.hasInstance](left);
412
412
  } else {
@@ -438,7 +438,7 @@ function _is_native_reflect_construct$5() {
438
438
  return !!result;
439
439
  })();
440
440
  }
441
- function _ts_generator$9(thisArg, body) {
441
+ function _ts_generator$b(thisArg, body) {
442
442
  var f, y, t, _ = {
443
443
  label: 0,
444
444
  sent: function() {
@@ -584,7 +584,7 @@ function _ts_generator$9(thisArg, body) {
584
584
  var _this;
585
585
  _this = _call_super$5(this, ZohoServerError, [
586
586
  error.message
587
- ]), _define_property$g(_this, "error", void 0);
587
+ ]), _define_property$r(_this, "error", void 0);
588
588
  _this.error = error;
589
589
  return _this;
590
590
  }
@@ -607,7 +607,7 @@ function _ts_generator$9(thisArg, body) {
607
607
  var _this;
608
608
  _this = _call_super$5(this, ZohoServerFetchResponseError, [
609
609
  data
610
- ]), _define_property$g(_this, "data", void 0), _define_property$g(_this, "errorResponseData", void 0), _define_property$g(_this, "responseError", void 0);
610
+ ]), _define_property$r(_this, "data", void 0), _define_property$r(_this, "errorResponseData", void 0), _define_property$r(_this, "responseError", void 0);
611
611
  _this.data = data;
612
612
  _this.errorResponseData = errorResponseData;
613
613
  _this.responseError = responseError;
@@ -652,12 +652,12 @@ function _ts_generator$9(thisArg, body) {
652
652
  */ function logZohoServerErrorFunction(zohoApiNamePrefix, options) {
653
653
  var _ref = options !== null && options !== void 0 ? options : {}, _ref_logDataArrayErrors = _ref.logDataArrayErrors, logDataArrayErrors = _ref_logDataArrayErrors === void 0 ? false : _ref_logDataArrayErrors;
654
654
  return function(error) {
655
- if (_instanceof$5(error, ZohoServerFetchResponseDataArrayError) && !logDataArrayErrors) ; else if (_instanceof$5(error, ZohoServerFetchResponseError)) {
655
+ if (_instanceof$6(error, ZohoServerFetchResponseDataArrayError) && !logDataArrayErrors) ; else if (_instanceof$6(error, ZohoServerFetchResponseError)) {
656
656
  console.log("".concat(zohoApiNamePrefix, "Error(").concat(error.responseError.response.status, "): "), {
657
657
  error: error,
658
658
  errorData: error.data
659
659
  });
660
- } else if (_instanceof$5(error, ZohoServerError)) {
660
+ } else if (_instanceof$6(error, ZohoServerError)) {
661
661
  console.log("".concat(zohoApiNamePrefix, "Error(code:").concat(error.code, "): "), {
662
662
  error: error
663
663
  });
@@ -678,9 +678,9 @@ function _ts_generator$9(thisArg, body) {
678
678
  return function(fetch) {
679
679
  var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultLogError, onError = arguments.length > 2 ? arguments[2] : void 0;
680
680
  return function(x, y) {
681
- return _async_to_generator$9(function() {
681
+ return _async_to_generator$b(function() {
682
682
  var e, error;
683
- return _ts_generator$9(this, function(_state) {
683
+ return _ts_generator$b(this, function(_state) {
684
684
  switch(_state.label){
685
685
  case 0:
686
686
  _state.trys.push([
@@ -700,7 +700,7 @@ function _ts_generator$9(thisArg, body) {
700
700
  ]; // await to catch thrown errors
701
701
  case 2:
702
702
  e = _state.sent();
703
- if (!_instanceof$5(e, FetchResponseError)) return [
703
+ if (!_instanceof$6(e, FetchResponseError)) return [
704
704
  3,
705
705
  4
706
706
  ];
@@ -929,7 +929,7 @@ function _assert_this_initialized$4(self) {
929
929
  }
930
930
  return self;
931
931
  }
932
- function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
932
+ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
933
933
  try {
934
934
  var info = gen[key](arg);
935
935
  var value = info.value;
@@ -943,16 +943,16 @@ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
943
943
  Promise.resolve(value).then(_next, _throw);
944
944
  }
945
945
  }
946
- function _async_to_generator$8(fn) {
946
+ function _async_to_generator$a(fn) {
947
947
  return function() {
948
948
  var self = this, args = arguments;
949
949
  return new Promise(function(resolve, reject) {
950
950
  var gen = fn.apply(self, args);
951
951
  function _next(value) {
952
- asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
952
+ asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
953
953
  }
954
954
  function _throw(err) {
955
- asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
955
+ asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
956
956
  }
957
957
  _next(undefined);
958
958
  });
@@ -980,7 +980,7 @@ function _create_class$1(Constructor, protoProps, staticProps) {
980
980
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
981
981
  return Constructor;
982
982
  }
983
- function _define_property$f(obj, key, value) {
983
+ function _define_property$q(obj, key, value) {
984
984
  if (key in obj) {
985
985
  Object.defineProperty(obj, key, {
986
986
  value: value,
@@ -1037,7 +1037,7 @@ function _is_native_reflect_construct$4() {
1037
1037
  return !!result;
1038
1038
  })();
1039
1039
  }
1040
- function _ts_generator$8(thisArg, body) {
1040
+ function _ts_generator$a(thisArg, body) {
1041
1041
  var f, y, t, _ = {
1042
1042
  label: 0,
1043
1043
  sent: function() {
@@ -1150,7 +1150,7 @@ function _ts_generator$8(thisArg, body) {
1150
1150
  var _this;
1151
1151
  _this = _call_super$4(this, ZohoRecruitRecordNoContentError, [
1152
1152
  "There was no content or matching records for the content. It may not exist."
1153
- ]), _define_property$f(_this, "moduleName", void 0), _define_property$f(_this, "recordId", void 0);
1153
+ ]), _define_property$q(_this, "moduleName", void 0), _define_property$q(_this, "recordId", void 0);
1154
1154
  _this.moduleName = moduleName;
1155
1155
  _this.recordId = recordId;
1156
1156
  return _this;
@@ -1270,9 +1270,9 @@ function _ts_generator$8(thisArg, body) {
1270
1270
  * @param responseError - The fetch response error to parse
1271
1271
  * @returns Parsed Zoho server error, or undefined if parsing fails
1272
1272
  */ function parseZohoRecruitError(responseError) {
1273
- return _async_to_generator$8(function() {
1273
+ return _async_to_generator$a(function() {
1274
1274
  var data, result;
1275
- return _ts_generator$8(this, function(_state) {
1275
+ return _ts_generator$a(this, function(_state) {
1276
1276
  switch(_state.label){
1277
1277
  case 0:
1278
1278
  return [
@@ -1340,7 +1340,7 @@ function _class_call_check$3(instance, Constructor) {
1340
1340
  throw new TypeError("Cannot call a class as a function");
1341
1341
  }
1342
1342
  }
1343
- function _define_property$e(obj, key, value) {
1343
+ function _define_property$p(obj, key, value) {
1344
1344
  if (key in obj) {
1345
1345
  Object.defineProperty(obj, key, {
1346
1346
  value: value,
@@ -1372,7 +1372,7 @@ function _inherits$3(subClass, superClass) {
1372
1372
  });
1373
1373
  if (superClass) _set_prototype_of$3(subClass, superClass);
1374
1374
  }
1375
- function _object_spread$c(target) {
1375
+ function _object_spread$n(target) {
1376
1376
  for(var i = 1; i < arguments.length; i++){
1377
1377
  var source = arguments[i] != null ? arguments[i] : {};
1378
1378
  var ownKeys = Object.keys(source);
@@ -1382,12 +1382,12 @@ function _object_spread$c(target) {
1382
1382
  }));
1383
1383
  }
1384
1384
  ownKeys.forEach(function(key) {
1385
- _define_property$e(target, key, source[key]);
1385
+ _define_property$p(target, key, source[key]);
1386
1386
  });
1387
1387
  }
1388
1388
  return target;
1389
1389
  }
1390
- function ownKeys$b(object, enumerableOnly) {
1390
+ function ownKeys$m(object, enumerableOnly) {
1391
1391
  var keys = Object.keys(object);
1392
1392
  if (Object.getOwnPropertySymbols) {
1393
1393
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1395,12 +1395,12 @@ function ownKeys$b(object, enumerableOnly) {
1395
1395
  }
1396
1396
  return keys;
1397
1397
  }
1398
- function _object_spread_props$b(target, source) {
1398
+ function _object_spread_props$m(target, source) {
1399
1399
  source = source != null ? source : {};
1400
1400
  if (Object.getOwnPropertyDescriptors) {
1401
1401
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1402
1402
  } else {
1403
- ownKeys$b(Object(source)).forEach(function(key) {
1403
+ ownKeys$m(Object(source)).forEach(function(key) {
1404
1404
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1405
1405
  });
1406
1406
  }
@@ -1702,7 +1702,7 @@ function _is_native_reflect_construct$3() {
1702
1702
  * @see https://www.zoho.com/recruit/developer-guide/apiv2/search-records.html
1703
1703
  */ function zohoRecruitSearchRecords(context) {
1704
1704
  function searchRecordsUrlSearchParams(input) {
1705
- var baseInput = _object_spread$c({}, input);
1705
+ var baseInput = _object_spread$n({}, input);
1706
1706
  delete baseInput.criteria;
1707
1707
  if (input.criteria != null) {
1708
1708
  var criteriaString = zohoRecruitSearchRecordsCriteriaString(input.criteria);
@@ -2055,7 +2055,7 @@ function _is_native_reflect_construct$3() {
2055
2055
  var _this;
2056
2056
  _this = _call_super$3(this, ZohoRecruitExecuteRestApiFunctionError, [
2057
2057
  "An error occured during the execution of the function. Code: ".concat(error.code, ", Message: ").concat(error.message)
2058
- ]), _define_property$e(_this, "error", void 0);
2058
+ ]), _define_property$p(_this, "error", void 0);
2059
2059
  _this.error = error;
2060
2060
  return _this;
2061
2061
  }
@@ -2189,7 +2189,7 @@ function _is_native_reflect_construct$3() {
2189
2189
  errorItems.push(x);
2190
2190
  }
2191
2191
  });
2192
- var result = _object_spread_props$b(_object_spread$c({}, response), {
2192
+ var result = _object_spread_props$m(_object_spread$n({}, response), {
2193
2193
  successItems: successItems,
2194
2194
  errorItems: errorItems
2195
2195
  });
@@ -2283,7 +2283,7 @@ function _is_native_reflect_construct$3() {
2283
2283
  * @deprecated Use zohoRecruitExecuteRestApiFunction instead.
2284
2284
  */ var executeRestApiFunction = zohoRecruitExecuteRestApiFunction;
2285
2285
 
2286
- function _define_property$d(obj, key, value) {
2286
+ function _define_property$o(obj, key, value) {
2287
2287
  if (key in obj) {
2288
2288
  Object.defineProperty(obj, key, {
2289
2289
  value: value,
@@ -2296,7 +2296,7 @@ function _define_property$d(obj, key, value) {
2296
2296
  }
2297
2297
  return obj;
2298
2298
  }
2299
- function _object_spread$b(target) {
2299
+ function _object_spread$m(target) {
2300
2300
  for(var i = 1; i < arguments.length; i++){
2301
2301
  var source = arguments[i] != null ? arguments[i] : {};
2302
2302
  var ownKeys = Object.keys(source);
@@ -2306,12 +2306,12 @@ function _object_spread$b(target) {
2306
2306
  }));
2307
2307
  }
2308
2308
  ownKeys.forEach(function(key) {
2309
- _define_property$d(target, key, source[key]);
2309
+ _define_property$o(target, key, source[key]);
2310
2310
  });
2311
2311
  }
2312
2312
  return target;
2313
2313
  }
2314
- function ownKeys$a(object, enumerableOnly) {
2314
+ function ownKeys$l(object, enumerableOnly) {
2315
2315
  var keys = Object.keys(object);
2316
2316
  if (Object.getOwnPropertySymbols) {
2317
2317
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2319,12 +2319,12 @@ function ownKeys$a(object, enumerableOnly) {
2319
2319
  }
2320
2320
  return keys;
2321
2321
  }
2322
- function _object_spread_props$a(target, source) {
2322
+ function _object_spread_props$l(target, source) {
2323
2323
  source = source != null ? source : {};
2324
2324
  if (Object.getOwnPropertyDescriptors) {
2325
2325
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2326
2326
  } else {
2327
- ownKeys$a(Object(source)).forEach(function(key) {
2327
+ ownKeys$l(Object(source)).forEach(function(key) {
2328
2328
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2329
2329
  });
2330
2330
  }
@@ -2351,7 +2351,7 @@ function _object_spread_props$a(target, source) {
2351
2351
  var _separateValues = separateValues(result.errorItems, function(x) {
2352
2352
  return x.result.code === ZOHO_FAILURE_ERROR_CODE && x.result.details.error[0].code === ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE;
2353
2353
  }), alreadyAssociatedErrorItems = _separateValues.included, otherErrorItems = _separateValues.excluded;
2354
- return _object_spread_props$a(_object_spread$b({}, result), {
2354
+ return _object_spread_props$l(_object_spread$m({}, result), {
2355
2355
  errorItems: otherErrorItems,
2356
2356
  alreadyAssociatedErrorItems: alreadyAssociatedErrorItems,
2357
2357
  allErrorItems: result.errorItems
@@ -2380,7 +2380,7 @@ function _object_spread_props$a(target, source) {
2380
2380
  */ function zohoRecruitSearchCandidateAssociatedJobOpeningRecords(context) {
2381
2381
  var searchAssociatedRecordsFactory = zohoRecruitSearchAssociatedRecords(context);
2382
2382
  return function(input) {
2383
- return searchAssociatedRecordsFactory(_object_spread_props$a(_object_spread$b({}, input), {
2383
+ return searchAssociatedRecordsFactory(_object_spread_props$l(_object_spread$m({}, input), {
2384
2384
  module: ZOHO_RECRUIT_CANDIDATES_MODULE
2385
2385
  }));
2386
2386
  };
@@ -2403,7 +2403,7 @@ function _object_spread_props$a(target, source) {
2403
2403
  var jobOpeningModuleName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ZOHO_RECRUIT_JOB_OPENINGS_MODULE;
2404
2404
  var searchAssociatedRecordsFactory = zohoRecruitSearchAssociatedRecords(context);
2405
2405
  return function(input) {
2406
- return searchAssociatedRecordsFactory(_object_spread_props$a(_object_spread$b({}, input), {
2406
+ return searchAssociatedRecordsFactory(_object_spread_props$l(_object_spread$m({}, input), {
2407
2407
  module: jobOpeningModuleName
2408
2408
  }));
2409
2409
  };
@@ -2417,7 +2417,7 @@ function _object_spread_props$a(target, source) {
2417
2417
  return zohoFetchPageFactory(zohoRecruitSearchJobOpeningAssociatedCandidateRecords(context));
2418
2418
  }
2419
2419
 
2420
- function _define_property$c(obj, key, value) {
2420
+ function _define_property$n(obj, key, value) {
2421
2421
  if (key in obj) {
2422
2422
  Object.defineProperty(obj, key, {
2423
2423
  value: value,
@@ -2430,7 +2430,7 @@ function _define_property$c(obj, key, value) {
2430
2430
  }
2431
2431
  return obj;
2432
2432
  }
2433
- function _object_spread$a(target) {
2433
+ function _object_spread$l(target) {
2434
2434
  for(var i = 1; i < arguments.length; i++){
2435
2435
  var source = arguments[i] != null ? arguments[i] : {};
2436
2436
  var ownKeys = Object.keys(source);
@@ -2440,12 +2440,12 @@ function _object_spread$a(target) {
2440
2440
  }));
2441
2441
  }
2442
2442
  ownKeys.forEach(function(key) {
2443
- _define_property$c(target, key, source[key]);
2443
+ _define_property$n(target, key, source[key]);
2444
2444
  });
2445
2445
  }
2446
2446
  return target;
2447
2447
  }
2448
- function ownKeys$9(object, enumerableOnly) {
2448
+ function ownKeys$k(object, enumerableOnly) {
2449
2449
  var keys = Object.keys(object);
2450
2450
  if (Object.getOwnPropertySymbols) {
2451
2451
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2453,12 +2453,12 @@ function ownKeys$9(object, enumerableOnly) {
2453
2453
  }
2454
2454
  return keys;
2455
2455
  }
2456
- function _object_spread_props$9(target, source) {
2456
+ function _object_spread_props$k(target, source) {
2457
2457
  source = source != null ? source : {};
2458
2458
  if (Object.getOwnPropertyDescriptors) {
2459
2459
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2460
2460
  } else {
2461
- ownKeys$9(Object(source)).forEach(function(key) {
2461
+ ownKeys$k(Object(source)).forEach(function(key) {
2462
2462
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2463
2463
  });
2464
2464
  }
@@ -2586,7 +2586,7 @@ function _object_spread_props$9(target, source) {
2586
2586
  var se_module = input.module, Parent_Id = input.id, notes = input.notes;
2587
2587
  var createNotesRequest = {
2588
2588
  data: asArray(notes).map(function(x) {
2589
- return _object_spread_props$9(_object_spread$a({}, x), {
2589
+ return _object_spread_props$k(_object_spread$l({}, x), {
2590
2590
  se_module: se_module,
2591
2591
  Parent_Id: Parent_Id
2592
2592
  });
@@ -2612,7 +2612,7 @@ function _object_spread_props$9(target, source) {
2612
2612
  * @deprecated Use zohoRecruitCreateNotesForRecord instead.
2613
2613
  */ var createNotesForRecord = zohoRecruitCreateNotesForRecord;
2614
2614
 
2615
- function _define_property$b(obj, key, value) {
2615
+ function _define_property$m(obj, key, value) {
2616
2616
  if (key in obj) {
2617
2617
  Object.defineProperty(obj, key, {
2618
2618
  value: value,
@@ -2625,7 +2625,7 @@ function _define_property$b(obj, key, value) {
2625
2625
  }
2626
2626
  return obj;
2627
2627
  }
2628
- function _object_spread$9(target) {
2628
+ function _object_spread$k(target) {
2629
2629
  for(var i = 1; i < arguments.length; i++){
2630
2630
  var source = arguments[i] != null ? arguments[i] : {};
2631
2631
  var ownKeys = Object.keys(source);
@@ -2635,12 +2635,12 @@ function _object_spread$9(target) {
2635
2635
  }));
2636
2636
  }
2637
2637
  ownKeys.forEach(function(key) {
2638
- _define_property$b(target, key, source[key]);
2638
+ _define_property$m(target, key, source[key]);
2639
2639
  });
2640
2640
  }
2641
2641
  return target;
2642
2642
  }
2643
- function ownKeys$8(object, enumerableOnly) {
2643
+ function ownKeys$j(object, enumerableOnly) {
2644
2644
  var keys = Object.keys(object);
2645
2645
  if (Object.getOwnPropertySymbols) {
2646
2646
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2648,12 +2648,12 @@ function ownKeys$8(object, enumerableOnly) {
2648
2648
  }
2649
2649
  return keys;
2650
2650
  }
2651
- function _object_spread_props$8(target, source) {
2651
+ function _object_spread_props$j(target, source) {
2652
2652
  source = source != null ? source : {};
2653
2653
  if (Object.getOwnPropertyDescriptors) {
2654
2654
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2655
2655
  } else {
2656
- ownKeys$8(Object(source)).forEach(function(key) {
2656
+ ownKeys$j(Object(source)).forEach(function(key) {
2657
2657
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2658
2658
  });
2659
2659
  }
@@ -2693,7 +2693,7 @@ function _object_spread_props$8(target, source) {
2693
2693
  var _separateValues = separateValues(result.errorItems, function(x) {
2694
2694
  return x.result.code === ZOHO_DUPLICATE_DATA_ERROR_CODE;
2695
2695
  }), duplicateErrorItems = _separateValues.included, otherErrorItems = _separateValues.excluded;
2696
- return _object_spread_props$8(_object_spread$9({}, result), {
2696
+ return _object_spread_props$j(_object_spread$k({}, result), {
2697
2697
  errorItems: otherErrorItems,
2698
2698
  duplicateErrorItems: duplicateErrorItems,
2699
2699
  allErrorItems: result.errorItems
@@ -2727,7 +2727,7 @@ function _object_spread_props$8(target, source) {
2727
2727
  my_tags: input.my_tags
2728
2728
  })), zohoRecruitApiFetchJsonInput('GET')).then(function(x) {
2729
2729
  // NOTE: This doesn't follow the api documentation, and instead is a normal page result except it has "tags" instead of "data".
2730
- return _object_spread_props$8(_object_spread$9({}, x), {
2730
+ return _object_spread_props$j(_object_spread$k({}, x), {
2731
2731
  data: x.tags
2732
2732
  });
2733
2733
  });
@@ -2851,7 +2851,7 @@ function _assert_this_initialized$2(self) {
2851
2851
  }
2852
2852
  return self;
2853
2853
  }
2854
- function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
2854
+ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
2855
2855
  try {
2856
2856
  var info = gen[key](arg);
2857
2857
  var value = info.value;
@@ -2865,16 +2865,16 @@ function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
2865
2865
  Promise.resolve(value).then(_next, _throw);
2866
2866
  }
2867
2867
  }
2868
- function _async_to_generator$7(fn) {
2868
+ function _async_to_generator$9(fn) {
2869
2869
  return function() {
2870
2870
  var self = this, args = arguments;
2871
2871
  return new Promise(function(resolve, reject) {
2872
2872
  var gen = fn.apply(self, args);
2873
2873
  function _next(value) {
2874
- asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
2874
+ asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
2875
2875
  }
2876
2876
  function _throw(err) {
2877
- asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
2877
+ asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
2878
2878
  }
2879
2879
  _next(undefined);
2880
2880
  });
@@ -2889,7 +2889,7 @@ function _class_call_check$2(instance, Constructor) {
2889
2889
  throw new TypeError("Cannot call a class as a function");
2890
2890
  }
2891
2891
  }
2892
- function _define_property$a(obj, key, value) {
2892
+ function _define_property$l(obj, key, value) {
2893
2893
  if (key in obj) {
2894
2894
  Object.defineProperty(obj, key, {
2895
2895
  value: value,
@@ -2946,7 +2946,7 @@ function _is_native_reflect_construct$2() {
2946
2946
  return !!result;
2947
2947
  })();
2948
2948
  }
2949
- function _ts_generator$7(thisArg, body) {
2949
+ function _ts_generator$9(thisArg, body) {
2950
2950
  var f, y, t, _ = {
2951
2951
  label: 0,
2952
2952
  sent: function() {
@@ -3059,7 +3059,7 @@ var ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE = 'invalid_client';
3059
3059
  var _this;
3060
3060
  _this = _call_super$2(this, ZohoAccountsAccessTokenError, [
3061
3061
  "ZohoAccountsAccessTokenError: ".concat(errorCode)
3062
- ]), _define_property$a(_this, "errorCode", void 0);
3062
+ ]), _define_property$l(_this, "errorCode", void 0);
3063
3063
  _this.errorCode = errorCode;
3064
3064
  return _this;
3065
3065
  }
@@ -3074,7 +3074,7 @@ var ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE = 'invalid_client';
3074
3074
  var _this;
3075
3075
  _this = _call_super$2(this, ZohoAccountsAuthFailureError, [
3076
3076
  "Failed to retrieve proper authentication for the API call. Reason: ".concat(reason)
3077
- ]), _define_property$a(_this, "reason", void 0);
3077
+ ]), _define_property$l(_this, "reason", void 0);
3078
3078
  _this.reason = reason;
3079
3079
  return _this;
3080
3080
  }
@@ -3087,9 +3087,9 @@ var logZohoAccountsErrorToConsole = logZohoServerErrorFunction('ZohoAccounts');
3087
3087
  * @param responseError - The fetch response error to parse
3088
3088
  * @returns The parsed Zoho server error, or undefined if the response could not be parsed
3089
3089
  */ function parseZohoAccountsError(responseError) {
3090
- return _async_to_generator$7(function() {
3090
+ return _async_to_generator$9(function() {
3091
3091
  var data, result;
3092
- return _ts_generator$7(this, function(_state) {
3092
+ return _ts_generator$9(this, function(_state) {
3093
3093
  switch(_state.label){
3094
3094
  case 0:
3095
3095
  return [
@@ -3137,7 +3137,7 @@ var logZohoAccountsErrorToConsole = logZohoServerErrorFunction('ZohoAccounts');
3137
3137
  var interceptZohoAccounts200StatusWithErrorResponse = interceptZohoErrorResponseFactory(parseZohoAccountsServerErrorResponseData);
3138
3138
  var handleZohoAccountsErrorFetch = handleZohoErrorFetchFactory(parseZohoAccountsError, logZohoAccountsErrorToConsole);
3139
3139
 
3140
- function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
3140
+ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
3141
3141
  try {
3142
3142
  var info = gen[key](arg);
3143
3143
  var value = info.value;
@@ -3151,22 +3151,22 @@ function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
3151
3151
  Promise.resolve(value).then(_next, _throw);
3152
3152
  }
3153
3153
  }
3154
- function _async_to_generator$6(fn) {
3154
+ function _async_to_generator$8(fn) {
3155
3155
  return function() {
3156
3156
  var self = this, args = arguments;
3157
3157
  return new Promise(function(resolve, reject) {
3158
3158
  var gen = fn.apply(self, args);
3159
3159
  function _next(value) {
3160
- asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
3160
+ asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
3161
3161
  }
3162
3162
  function _throw(err) {
3163
- asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
3163
+ asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
3164
3164
  }
3165
3165
  _next(undefined);
3166
3166
  });
3167
3167
  };
3168
3168
  }
3169
- function _ts_generator$6(thisArg, body) {
3169
+ function _ts_generator$8(thisArg, body) {
3170
3170
  var f, y, t, _ = {
3171
3171
  label: 0,
3172
3172
  sent: function() {
@@ -3272,9 +3272,9 @@ function _ts_generator$6(thisArg, body) {
3272
3272
  * @returns A factory function that resolves to the access token string
3273
3273
  */ function zohoAccessTokenStringFactory(zohoAccessTokenFactory) {
3274
3274
  return function() {
3275
- return _async_to_generator$6(function() {
3275
+ return _async_to_generator$8(function() {
3276
3276
  var token;
3277
- return _ts_generator$6(this, function(_state) {
3277
+ return _ts_generator$8(this, function(_state) {
3278
3278
  switch(_state.label){
3279
3279
  case 0:
3280
3280
  return [
@@ -3296,36 +3296,88 @@ function _ts_generator$6(thisArg, body) {
3296
3296
  };
3297
3297
  }
3298
3298
 
3299
+ function _define_property$k(obj, key, value) {
3300
+ if (key in obj) {
3301
+ Object.defineProperty(obj, key, {
3302
+ value: value,
3303
+ enumerable: true,
3304
+ configurable: true,
3305
+ writable: true
3306
+ });
3307
+ } else {
3308
+ obj[key] = value;
3309
+ }
3310
+ return obj;
3311
+ }
3312
+ function _object_spread$j(target) {
3313
+ for(var i = 1; i < arguments.length; i++){
3314
+ var source = arguments[i] != null ? arguments[i] : {};
3315
+ var ownKeys = Object.keys(source);
3316
+ if (typeof Object.getOwnPropertySymbols === "function") {
3317
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
3318
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
3319
+ }));
3320
+ }
3321
+ ownKeys.forEach(function(key) {
3322
+ _define_property$k(target, key, source[key]);
3323
+ });
3324
+ }
3325
+ return target;
3326
+ }
3327
+ function ownKeys$i(object, enumerableOnly) {
3328
+ var keys = Object.keys(object);
3329
+ if (Object.getOwnPropertySymbols) {
3330
+ var symbols = Object.getOwnPropertySymbols(object);
3331
+ keys.push.apply(keys, symbols);
3332
+ }
3333
+ return keys;
3334
+ }
3335
+ function _object_spread_props$i(target, source) {
3336
+ source = source != null ? source : {};
3337
+ if (Object.getOwnPropertyDescriptors) {
3338
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3339
+ } else {
3340
+ ownKeys$i(Object(source)).forEach(function(key) {
3341
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3342
+ });
3343
+ }
3344
+ return target;
3345
+ }
3299
3346
  /**
3300
3347
  * Default handler that logs a warning to the console when the Zoho API rate limit is exceeded.
3301
3348
  *
3302
- * @param headers - Rate limit details extracted from the Zoho API response headers
3303
- */ var DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION(headers) {
3304
- console.warn("zohoRateLimitedFetchHandler(): Too many requests made. The limit is ".concat(headers.limit, " requests per reset period. Will be reset at ").concat(headers.resetAt, "."));
3349
+ * @param details - Rate limit details extracted from the Zoho API response headers
3350
+ */ var DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION(details) {
3351
+ var limit = 'limit' in details ? details.limit : undefined;
3352
+ var resetAt = 'resetAt' in details ? details.resetAt : undefined;
3353
+ var limitMessage = limit != null ? ' The limit is ' + String(limit) + ' requests per reset period.' : '';
3354
+ var resetMessage = resetAt != null ? ' Will be reset at ' + String(resetAt) + '.' : '';
3355
+ console.warn('zohoRateLimitedFetchHandler(): Too many requests made.' + limitMessage + resetMessage);
3305
3356
  };
3306
3357
  /**
3307
- * Creates a {@link ZohoRateLimitedFetchHandler} that throttles outgoing requests based on
3308
- * Zoho's rate limit headers (`X-RATELIMIT-LIMIT`, `X-RATELIMIT-REMAINING`, `X-RATELIMIT-RESET`).
3358
+ * Creates a {@link ZohoRateLimitedFetchHandler} using a configurable header reader function.
3309
3359
  *
3360
+ * This is the core rate limiter factory that all service-specific wrappers delegate to.
3310
3361
  * The handler uses an exponential backoff strategy with the following behavior:
3311
3362
  * - Rate limiting begins after 10% of the allowed requests have been made (`startLimitAt`)
3312
3363
  * - Wait times increase exponentially (rate 1.08) as more requests are made, capped at 10 seconds
3313
- * - On each response, the limiter updates its remaining count and reset time from headers
3314
- * - When the API returns a different limit than configured, the limiter dynamically adjusts
3364
+ * - On each response, the limiter updates its remaining count and reset time via the provided reader
3365
+ * - When the API reports a different limit than configured, the limiter dynamically adjusts
3315
3366
  * - On 429 responses, the request is automatically retried after the rate limiter delay
3316
3367
  * - The limiter is disabled when responses lack rate limit headers (e.g., error responses)
3317
3368
  *
3318
- * @param config - Optional configuration for rate limit, reset period, and 429 handling
3369
+ * @param config - Configuration including the service-specific header reader, rate limit, reset period, and 429 handling
3319
3370
  * @returns A rate-limited fetch handler with the underlying rate limiter accessible via `_rateLimiter`
3320
- */ function zohoRateLimitedFetchHandler(config) {
3321
- var _ref, _ref1, _ref2;
3322
- var onTooManyRequests = (config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== false ? (_ref = config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== null && _ref !== void 0 ? _ref : DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION : undefined;
3323
- var defaultLimit = (_ref1 = config === null || config === void 0 ? void 0 : config.maxRateLimit) !== null && _ref1 !== void 0 ? _ref1 : DEFAULT_ZOHO_API_RATE_LIMIT;
3324
- var defaultResetPeriod = (_ref2 = config === null || config === void 0 ? void 0 : config.resetPeriod) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD;
3371
+ */ function makeZohoRateLimitedFetchHandler(config) {
3372
+ var _config_onTooManyRequests, _config_maxRateLimit, _config_resetPeriod;
3373
+ var readRateLimitDetails = config.readRateLimitDetails;
3374
+ var onTooManyRequests = config.onTooManyRequests !== false ? (_config_onTooManyRequests = config.onTooManyRequests) !== null && _config_onTooManyRequests !== void 0 ? _config_onTooManyRequests : DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION : undefined;
3375
+ var defaultLimit = (_config_maxRateLimit = config.maxRateLimit) !== null && _config_maxRateLimit !== void 0 ? _config_maxRateLimit : DEFAULT_ZOHO_API_RATE_LIMIT;
3376
+ var defaultResetPeriod = (_config_resetPeriod = config.resetPeriod) !== null && _config_resetPeriod !== void 0 ? _config_resetPeriod : DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD;
3325
3377
  /**
3326
3378
  * Builds a rate limiter config derived from the given limit.
3327
3379
  * Called once at initialization with `defaultLimit`, and again dynamically
3328
- * when the API's `X-RATELIMIT-LIMIT` header reports a different value.
3380
+ * when the API's response headers report a different limit value.
3329
3381
  *
3330
3382
  * @param limit - Maximum number of requests allowed per reset period
3331
3383
  * @param resetAt - Optional date when the rate limit window resets
@@ -3345,37 +3397,36 @@ function _ts_generator$6(thisArg, body) {
3345
3397
  var rateLimiter = resetPeriodPromiseRateLimiter(defaultConfig);
3346
3398
  return rateLimitedFetchHandler({
3347
3399
  rateLimiter: rateLimiter,
3348
- maxRetries: config === null || config === void 0 ? void 0 : config.maxRetries,
3400
+ maxRetries: config.maxRetries,
3349
3401
  /**
3350
- * Inspects each response for Zoho rate limit headers and updates the limiter accordingly.
3351
- * Returns `true` to signal a retry when a 429 status is received.
3402
+ * Inspects each response for rate limit headers via the configured reader and updates
3403
+ * the limiter accordingly. Returns `true` to signal a retry when a 429 status is received.
3352
3404
  *
3353
3405
  * @param response - The HTTP response to inspect for rate limit headers
3354
3406
  * @param fetchResponseError - Optional fetch error if the response was an error
3355
3407
  * @returns Whether the request should be retried
3356
3408
  */ updateWithResponse: function updateWithResponse(response, fetchResponseError) {
3357
- var hasLimitHeader = response.headers.has(ZOHO_RATE_LIMIT_REMAINING_HEADER);
3409
+ var details = readRateLimitDetails(response.headers);
3358
3410
  var shouldRetry = false;
3359
3411
  var enabled = false;
3360
- if (hasLimitHeader) {
3361
- var headerDetails = zohoRateLimitHeaderDetails(response.headers);
3362
- if (headerDetails) {
3363
- var limit = headerDetails.limit, resetAt = headerDetails.resetAt, remaining = headerDetails.remaining;
3364
- if (limit && limit !== defaultLimit) {
3365
- var newConfig = configForLimit(limit, resetAt);
3366
- rateLimiter.setConfig(newConfig, false);
3367
- }
3368
- rateLimiter.setRemainingLimit(remaining);
3412
+ if (details) {
3413
+ var remaining = details.remaining, limit = details.limit, resetAt = details.resetAt;
3414
+ if (limit != null && limit !== defaultLimit) {
3415
+ var newConfig = configForLimit(limit, resetAt !== null && resetAt !== void 0 ? resetAt : undefined);
3416
+ rateLimiter.setConfig(newConfig, false);
3417
+ }
3418
+ rateLimiter.setRemainingLimit(remaining);
3419
+ if (resetAt) {
3369
3420
  rateLimiter.setNextResetAt(resetAt);
3370
- enabled = true;
3371
- // only retry if it's a TOO MANY REQUESTS error
3372
- if (response.status === ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
3373
- shouldRetry = true;
3374
- try {
3375
- void (onTooManyRequests === null || onTooManyRequests === void 0 ? void 0 : onTooManyRequests(headerDetails, response, fetchResponseError));
3376
- } catch (unused) {
3377
- /* ignored */ }
3378
- }
3421
+ }
3422
+ enabled = true;
3423
+ // only retry if it's a TOO MANY REQUESTS error
3424
+ if (response.status === ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
3425
+ shouldRetry = true;
3426
+ try {
3427
+ void (onTooManyRequests === null || onTooManyRequests === void 0 ? void 0 : onTooManyRequests(details, response, fetchResponseError));
3428
+ } catch (unused) {
3429
+ /* ignored */ }
3379
3430
  }
3380
3431
  }
3381
3432
  rateLimiter.setEnabled(enabled);
@@ -3383,12 +3434,44 @@ function _ts_generator$6(thisArg, body) {
3383
3434
  }
3384
3435
  });
3385
3436
  }
3437
+ /**
3438
+ * Creates a {@link ZohoRateLimitedFetchHandler} that throttles outgoing requests based on
3439
+ * Zoho's CRM/Recruit/Sign rate limit headers (`X-RATELIMIT-LIMIT`, `X-RATELIMIT-REMAINING`, `X-RATELIMIT-RESET`).
3440
+ *
3441
+ * This is a convenience wrapper around {@link makeZohoRateLimitedFetchHandler} pre-configured
3442
+ * with the standard Zoho rate limit header reader.
3443
+ *
3444
+ * @param config - Optional configuration for rate limit, reset period, and 429 handling
3445
+ * @returns A rate-limited fetch handler with the underlying rate limiter accessible via `_rateLimiter`
3446
+ */ function zohoRateLimitedFetchHandler(config) {
3447
+ return makeZohoRateLimitedFetchHandler(_object_spread_props$i(_object_spread$j({}, config), {
3448
+ readRateLimitDetails: zohoStandardRateLimitDetailsReader
3449
+ }));
3450
+ }
3451
+ /**
3452
+ * Reads rate limit details from standard Zoho API response headers (`X-RATELIMIT-*`).
3453
+ * Used by CRM, Recruit, and Sign services.
3454
+ *
3455
+ * @param headers - HTTP response headers
3456
+ * @returns Parsed rate limit details, or null if headers are absent
3457
+ */ function zohoStandardRateLimitDetailsReader(headers) {
3458
+ var details = zohoRateLimitHeaderDetails(headers);
3459
+ var result;
3460
+ if (details) {
3461
+ result = {
3462
+ remaining: details.remaining,
3463
+ limit: details.limit,
3464
+ resetAt: details.resetAt
3465
+ };
3466
+ }
3467
+ return result;
3468
+ }
3386
3469
  // MARK: Compat
3387
3470
  /**
3388
3471
  * @deprecated use DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION instead.
3389
3472
  */ var DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
3390
3473
 
3391
- function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
3474
+ function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
3392
3475
  try {
3393
3476
  var info = gen[key](arg);
3394
3477
  var value = info.value;
@@ -3402,22 +3485,22 @@ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
3402
3485
  Promise.resolve(value).then(_next, _throw);
3403
3486
  }
3404
3487
  }
3405
- function _async_to_generator$5(fn) {
3488
+ function _async_to_generator$7(fn) {
3406
3489
  return function() {
3407
3490
  var self = this, args = arguments;
3408
3491
  return new Promise(function(resolve, reject) {
3409
3492
  var gen = fn.apply(self, args);
3410
3493
  function _next(value) {
3411
- asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
3494
+ asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
3412
3495
  }
3413
3496
  function _throw(err) {
3414
- asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
3497
+ asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
3415
3498
  }
3416
3499
  _next(undefined);
3417
3500
  });
3418
3501
  };
3419
3502
  }
3420
- function _define_property$9(obj, key, value) {
3503
+ function _define_property$j(obj, key, value) {
3421
3504
  if (key in obj) {
3422
3505
  Object.defineProperty(obj, key, {
3423
3506
  value: value,
@@ -3430,14 +3513,14 @@ function _define_property$9(obj, key, value) {
3430
3513
  }
3431
3514
  return obj;
3432
3515
  }
3433
- function _instanceof$4(left, right) {
3516
+ function _instanceof$5(left, right) {
3434
3517
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3435
3518
  return !!right[Symbol.hasInstance](left);
3436
3519
  } else {
3437
3520
  return left instanceof right;
3438
3521
  }
3439
3522
  }
3440
- function _object_spread$8(target) {
3523
+ function _object_spread$i(target) {
3441
3524
  for(var i = 1; i < arguments.length; i++){
3442
3525
  var source = arguments[i] != null ? arguments[i] : {};
3443
3526
  var ownKeys = Object.keys(source);
@@ -3447,12 +3530,12 @@ function _object_spread$8(target) {
3447
3530
  }));
3448
3531
  }
3449
3532
  ownKeys.forEach(function(key) {
3450
- _define_property$9(target, key, source[key]);
3533
+ _define_property$j(target, key, source[key]);
3451
3534
  });
3452
3535
  }
3453
3536
  return target;
3454
3537
  }
3455
- function ownKeys$7(object, enumerableOnly) {
3538
+ function ownKeys$h(object, enumerableOnly) {
3456
3539
  var keys = Object.keys(object);
3457
3540
  if (Object.getOwnPropertySymbols) {
3458
3541
  var symbols = Object.getOwnPropertySymbols(object);
@@ -3460,18 +3543,18 @@ function ownKeys$7(object, enumerableOnly) {
3460
3543
  }
3461
3544
  return keys;
3462
3545
  }
3463
- function _object_spread_props$7(target, source) {
3546
+ function _object_spread_props$h(target, source) {
3464
3547
  source = source != null ? source : {};
3465
3548
  if (Object.getOwnPropertyDescriptors) {
3466
3549
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3467
3550
  } else {
3468
- ownKeys$7(Object(source)).forEach(function(key) {
3551
+ ownKeys$h(Object(source)).forEach(function(key) {
3469
3552
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3470
3553
  });
3471
3554
  }
3472
3555
  return target;
3473
3556
  }
3474
- function _ts_generator$5(thisArg, body) {
3557
+ function _ts_generator$7(thisArg, body) {
3475
3558
  var f, y, t, _ = {
3476
3559
  label: 0,
3477
3560
  sent: function() {
@@ -3602,9 +3685,9 @@ function _ts_generator$5(thisArg, body) {
3602
3685
  return fetchApiFetchService.makeFetch({
3603
3686
  baseUrl: input.apiUrl,
3604
3687
  baseRequest: function baseRequest() {
3605
- return _async_to_generator$5(function() {
3688
+ return _async_to_generator$7(function() {
3606
3689
  var _tmp, _tmp1, _, _1;
3607
- return _ts_generator$5(this, function(_state) {
3690
+ return _ts_generator$7(this, function(_state) {
3608
3691
  switch(_state.label){
3609
3692
  case 0:
3610
3693
  _tmp = {};
@@ -3642,7 +3725,7 @@ function _ts_generator$5(thisArg, body) {
3642
3725
  apiUrl: apiUrl
3643
3726
  });
3644
3727
  var fetch = handleZohoRecruitErrorFetch(baseFetch, logZohoServerErrorFunction, function(x) {
3645
- if (_instanceof$4(x, ZohoInvalidTokenError)) {
3728
+ if (_instanceof$5(x, ZohoInvalidTokenError)) {
3646
3729
  void accountsContext.loadAccessToken.resetAccessToken();
3647
3730
  }
3648
3731
  });
@@ -3654,7 +3737,7 @@ function _ts_generator$5(thisArg, body) {
3654
3737
  fetch: fetch,
3655
3738
  fetchJson: fetchJson,
3656
3739
  accessTokenStringFactory: accessTokenStringFactory,
3657
- config: _object_spread_props$7(_object_spread$8({}, config), {
3740
+ config: _object_spread_props$h(_object_spread$i({}, config), {
3658
3741
  apiUrl: apiUrl
3659
3742
  }),
3660
3743
  zohoRateLimiter: fetchHandler._rateLimiter
@@ -3751,7 +3834,7 @@ function _assert_this_initialized$1(self) {
3751
3834
  }
3752
3835
  return self;
3753
3836
  }
3754
- function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
3837
+ function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
3755
3838
  try {
3756
3839
  var info = gen[key](arg);
3757
3840
  var value = info.value;
@@ -3765,16 +3848,16 @@ function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
3765
3848
  Promise.resolve(value).then(_next, _throw);
3766
3849
  }
3767
3850
  }
3768
- function _async_to_generator$4(fn) {
3851
+ function _async_to_generator$6(fn) {
3769
3852
  return function() {
3770
3853
  var self = this, args = arguments;
3771
3854
  return new Promise(function(resolve, reject) {
3772
3855
  var gen = fn.apply(self, args);
3773
3856
  function _next(value) {
3774
- asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
3857
+ asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
3775
3858
  }
3776
3859
  function _throw(err) {
3777
- asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
3860
+ asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
3778
3861
  }
3779
3862
  _next(undefined);
3780
3863
  });
@@ -3802,7 +3885,7 @@ function _create_class(Constructor, protoProps, staticProps) {
3802
3885
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3803
3886
  return Constructor;
3804
3887
  }
3805
- function _define_property$8(obj, key, value) {
3888
+ function _define_property$i(obj, key, value) {
3806
3889
  if (key in obj) {
3807
3890
  Object.defineProperty(obj, key, {
3808
3891
  value: value,
@@ -3859,7 +3942,7 @@ function _is_native_reflect_construct$1() {
3859
3942
  return !!result;
3860
3943
  })();
3861
3944
  }
3862
- function _ts_generator$4(thisArg, body) {
3945
+ function _ts_generator$6(thisArg, body) {
3863
3946
  var f, y, t, _ = {
3864
3947
  label: 0,
3865
3948
  sent: function() {
@@ -3972,7 +4055,7 @@ function _ts_generator$4(thisArg, body) {
3972
4055
  var _this;
3973
4056
  _this = _call_super$1(this, ZohoCrmRecordNoContentError, [
3974
4057
  "There was no content or matching records for the content. It may not exist."
3975
- ]), _define_property$8(_this, "moduleName", void 0), _define_property$8(_this, "recordId", void 0);
4058
+ ]), _define_property$i(_this, "moduleName", void 0), _define_property$i(_this, "recordId", void 0);
3976
4059
  _this.moduleName = moduleName;
3977
4060
  _this.recordId = recordId;
3978
4061
  return _this;
@@ -4094,9 +4177,9 @@ function _ts_generator$4(thisArg, body) {
4094
4177
  * @param responseError - The fetch response error to parse
4095
4178
  * @returns The parsed Zoho server error, or undefined if the response could not be parsed
4096
4179
  */ function parseZohoCrmError(responseError) {
4097
- return _async_to_generator$4(function() {
4180
+ return _async_to_generator$6(function() {
4098
4181
  var data, result;
4099
- return _ts_generator$4(this, function(_state) {
4182
+ return _ts_generator$6(this, function(_state) {
4100
4183
  switch(_state.label){
4101
4184
  case 0:
4102
4185
  return [
@@ -4160,7 +4243,7 @@ function _class_call_check(instance, Constructor) {
4160
4243
  throw new TypeError("Cannot call a class as a function");
4161
4244
  }
4162
4245
  }
4163
- function _define_property$7(obj, key, value) {
4246
+ function _define_property$h(obj, key, value) {
4164
4247
  if (key in obj) {
4165
4248
  Object.defineProperty(obj, key, {
4166
4249
  value: value,
@@ -4192,14 +4275,14 @@ function _inherits(subClass, superClass) {
4192
4275
  });
4193
4276
  if (superClass) _set_prototype_of(subClass, superClass);
4194
4277
  }
4195
- function _instanceof$3(left, right) {
4278
+ function _instanceof$4(left, right) {
4196
4279
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
4197
4280
  return !!right[Symbol.hasInstance](left);
4198
4281
  } else {
4199
4282
  return left instanceof right;
4200
4283
  }
4201
4284
  }
4202
- function _object_spread$7(target) {
4285
+ function _object_spread$h(target) {
4203
4286
  for(var i = 1; i < arguments.length; i++){
4204
4287
  var source = arguments[i] != null ? arguments[i] : {};
4205
4288
  var ownKeys = Object.keys(source);
@@ -4209,12 +4292,12 @@ function _object_spread$7(target) {
4209
4292
  }));
4210
4293
  }
4211
4294
  ownKeys.forEach(function(key) {
4212
- _define_property$7(target, key, source[key]);
4295
+ _define_property$h(target, key, source[key]);
4213
4296
  });
4214
4297
  }
4215
4298
  return target;
4216
4299
  }
4217
- function ownKeys$6(object, enumerableOnly) {
4300
+ function ownKeys$g(object, enumerableOnly) {
4218
4301
  var keys = Object.keys(object);
4219
4302
  if (Object.getOwnPropertySymbols) {
4220
4303
  var symbols = Object.getOwnPropertySymbols(object);
@@ -4222,12 +4305,12 @@ function ownKeys$6(object, enumerableOnly) {
4222
4305
  }
4223
4306
  return keys;
4224
4307
  }
4225
- function _object_spread_props$6(target, source) {
4308
+ function _object_spread_props$g(target, source) {
4226
4309
  source = source != null ? source : {};
4227
4310
  if (Object.getOwnPropertyDescriptors) {
4228
4311
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4229
4312
  } else {
4230
- ownKeys$6(Object(source)).forEach(function(key) {
4313
+ ownKeys$g(Object(source)).forEach(function(key) {
4231
4314
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4232
4315
  });
4233
4316
  }
@@ -4530,7 +4613,7 @@ function _is_native_reflect_construct() {
4530
4613
  * @see https://www.zoho.com/crm/developer-guide/apiv2/search-records.html
4531
4614
  */ function zohoCrmSearchRecords(context) {
4532
4615
  function searchRecordsUrlSearchParams(input) {
4533
- var baseInput = _object_spread$7({}, input);
4616
+ var baseInput = _object_spread$h({}, input);
4534
4617
  delete baseInput.criteria;
4535
4618
  if (input.criteria != null) {
4536
4619
  var criteriaString = zohoCrmSearchRecordsCriteriaString(input.criteria);
@@ -4646,7 +4729,7 @@ function _is_native_reflect_construct() {
4646
4729
  return getEmailsFactory(input).then(function(x) {
4647
4730
  var _x_data;
4648
4731
  var data = (_x_data = x.data) !== null && _x_data !== void 0 ? _x_data : x.Emails;
4649
- return _object_spread_props$6(_object_spread$7({}, x), {
4732
+ return _object_spread_props$g(_object_spread$h({}, x), {
4650
4733
  data: data
4651
4734
  });
4652
4735
  });
@@ -4863,7 +4946,7 @@ function _is_native_reflect_construct() {
4863
4946
  var _this;
4864
4947
  _this = _call_super(this, ZohoCrmExecuteRestApiFunctionError, [
4865
4948
  "An error occured during the execution of the function. Code: ".concat(error.code, ", Message: ").concat(error.message)
4866
- ]), _define_property$7(_this, "error", void 0);
4949
+ ]), _define_property$h(_this, "error", void 0);
4867
4950
  _this.error = error;
4868
4951
  return _this;
4869
4952
  }
@@ -4977,7 +5060,7 @@ function _is_native_reflect_construct() {
4977
5060
  * @returns The error data array wrapped as a change object response
4978
5061
  */ function zohoCrmCatchZohoCrmChangeObjectLikeResponseError(e) {
4979
5062
  var result;
4980
- if (_instanceof$3(e, ZohoServerFetchResponseDataArrayError)) {
5063
+ if (_instanceof$4(e, ZohoServerFetchResponseDataArrayError)) {
4981
5064
  result = {
4982
5065
  data: e.errorDataArray
4983
5066
  };
@@ -5018,7 +5101,7 @@ function _is_native_reflect_construct() {
5018
5101
  errorItems.push(x);
5019
5102
  }
5020
5103
  });
5021
- var result = _object_spread_props$6(_object_spread$7({}, response), {
5104
+ var result = _object_spread_props$g(_object_spread$h({}, response), {
5022
5105
  successItems: successItems,
5023
5106
  errorItems: errorItems
5024
5107
  });
@@ -5061,7 +5144,7 @@ function _is_native_reflect_construct() {
5061
5144
  return result;
5062
5145
  }
5063
5146
 
5064
- function _define_property$6(obj, key, value) {
5147
+ function _define_property$g(obj, key, value) {
5065
5148
  if (key in obj) {
5066
5149
  Object.defineProperty(obj, key, {
5067
5150
  value: value,
@@ -5074,7 +5157,7 @@ function _define_property$6(obj, key, value) {
5074
5157
  }
5075
5158
  return obj;
5076
5159
  }
5077
- function _object_spread$6(target) {
5160
+ function _object_spread$g(target) {
5078
5161
  for(var i = 1; i < arguments.length; i++){
5079
5162
  var source = arguments[i] != null ? arguments[i] : {};
5080
5163
  var ownKeys = Object.keys(source);
@@ -5084,12 +5167,12 @@ function _object_spread$6(target) {
5084
5167
  }));
5085
5168
  }
5086
5169
  ownKeys.forEach(function(key) {
5087
- _define_property$6(target, key, source[key]);
5170
+ _define_property$g(target, key, source[key]);
5088
5171
  });
5089
5172
  }
5090
5173
  return target;
5091
5174
  }
5092
- function ownKeys$5(object, enumerableOnly) {
5175
+ function ownKeys$f(object, enumerableOnly) {
5093
5176
  var keys = Object.keys(object);
5094
5177
  if (Object.getOwnPropertySymbols) {
5095
5178
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5097,12 +5180,12 @@ function ownKeys$5(object, enumerableOnly) {
5097
5180
  }
5098
5181
  return keys;
5099
5182
  }
5100
- function _object_spread_props$5(target, source) {
5183
+ function _object_spread_props$f(target, source) {
5101
5184
  source = source != null ? source : {};
5102
5185
  if (Object.getOwnPropertyDescriptors) {
5103
5186
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5104
5187
  } else {
5105
- ownKeys$5(Object(source)).forEach(function(key) {
5188
+ ownKeys$f(Object(source)).forEach(function(key) {
5106
5189
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5107
5190
  });
5108
5191
  }
@@ -5169,7 +5252,7 @@ function _object_spread_props$5(target, source) {
5169
5252
  var se_module = input.module, Parent_Id = input.id, notes = input.notes;
5170
5253
  var createNotesRequest = {
5171
5254
  data: asArray(notes).map(function(x) {
5172
- return _object_spread_props$5(_object_spread$6({}, x), {
5255
+ return _object_spread_props$f(_object_spread$g({}, x), {
5173
5256
  se_module: se_module,
5174
5257
  Parent_Id: Parent_Id
5175
5258
  });
@@ -5187,7 +5270,7 @@ function _array_like_to_array(arr, len) {
5187
5270
  function _array_without_holes(arr) {
5188
5271
  if (Array.isArray(arr)) return _array_like_to_array(arr);
5189
5272
  }
5190
- function _define_property$5(obj, key, value) {
5273
+ function _define_property$f(obj, key, value) {
5191
5274
  if (key in obj) {
5192
5275
  Object.defineProperty(obj, key, {
5193
5276
  value: value,
@@ -5200,7 +5283,7 @@ function _define_property$5(obj, key, value) {
5200
5283
  }
5201
5284
  return obj;
5202
5285
  }
5203
- function _instanceof$2(left, right) {
5286
+ function _instanceof$3(left, right) {
5204
5287
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5205
5288
  return !!right[Symbol.hasInstance](left);
5206
5289
  } else {
@@ -5213,7 +5296,7 @@ function _iterable_to_array(iter) {
5213
5296
  function _non_iterable_spread() {
5214
5297
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5215
5298
  }
5216
- function _object_spread$5(target) {
5299
+ function _object_spread$f(target) {
5217
5300
  for(var i = 1; i < arguments.length; i++){
5218
5301
  var source = arguments[i] != null ? arguments[i] : {};
5219
5302
  var ownKeys = Object.keys(source);
@@ -5223,12 +5306,12 @@ function _object_spread$5(target) {
5223
5306
  }));
5224
5307
  }
5225
5308
  ownKeys.forEach(function(key) {
5226
- _define_property$5(target, key, source[key]);
5309
+ _define_property$f(target, key, source[key]);
5227
5310
  });
5228
5311
  }
5229
5312
  return target;
5230
5313
  }
5231
- function ownKeys$4(object, enumerableOnly) {
5314
+ function ownKeys$e(object, enumerableOnly) {
5232
5315
  var keys = Object.keys(object);
5233
5316
  if (Object.getOwnPropertySymbols) {
5234
5317
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5236,12 +5319,12 @@ function ownKeys$4(object, enumerableOnly) {
5236
5319
  }
5237
5320
  return keys;
5238
5321
  }
5239
- function _object_spread_props$4(target, source) {
5322
+ function _object_spread_props$e(target, source) {
5240
5323
  source = source != null ? source : {};
5241
5324
  if (Object.getOwnPropertyDescriptors) {
5242
5325
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5243
5326
  } else {
5244
- ownKeys$4(Object(source)).forEach(function(key) {
5327
+ ownKeys$e(Object(source)).forEach(function(key) {
5245
5328
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5246
5329
  });
5247
5330
  }
@@ -5271,7 +5354,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5271
5354
  tags: asArray(input.tags)
5272
5355
  })).catch(function(e) {
5273
5356
  var result;
5274
- if (_instanceof$2(e, ZohoServerFetchResponseError)) {
5357
+ if (_instanceof$3(e, ZohoServerFetchResponseError)) {
5275
5358
  var _e_data;
5276
5359
  var tags = (_e_data = e.data) === null || _e_data === void 0 ? void 0 : _e_data.tags;
5277
5360
  if (Array.isArray(tags)) {
@@ -5289,7 +5372,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5289
5372
  var _separateValues = separateValues(result.errorItems, function(x) {
5290
5373
  return x.result.code === ZOHO_DUPLICATE_DATA_ERROR_CODE;
5291
5374
  }), duplicateErrorItems = _separateValues.included, otherErrorItems = _separateValues.excluded;
5292
- return _object_spread_props$4(_object_spread$5({}, result), {
5375
+ return _object_spread_props$e(_object_spread$f({}, result), {
5293
5376
  errorItems: otherErrorItems,
5294
5377
  duplicateErrorItems: duplicateErrorItems,
5295
5378
  allErrorItems: result.errorItems
@@ -5327,7 +5410,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5327
5410
  my_tags: input.my_tags
5328
5411
  })), zohoCrmApiFetchJsonInput('GET')).then(function(x) {
5329
5412
  // NOTE: This doesn't follow the api documentation, and instead is a normal page result except it has "tags" instead of "data".
5330
- return _object_spread_props$4(_object_spread$5({}, x), {
5413
+ return _object_spread_props$e(_object_spread$f({}, x), {
5331
5414
  data: x.tags
5332
5415
  });
5333
5416
  });
@@ -5412,7 +5495,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5412
5495
  };
5413
5496
  }
5414
5497
 
5415
- function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
5498
+ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
5416
5499
  try {
5417
5500
  var info = gen[key](arg);
5418
5501
  var value = info.value;
@@ -5426,22 +5509,22 @@ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
5426
5509
  Promise.resolve(value).then(_next, _throw);
5427
5510
  }
5428
5511
  }
5429
- function _async_to_generator$3(fn) {
5512
+ function _async_to_generator$5(fn) {
5430
5513
  return function() {
5431
5514
  var self = this, args = arguments;
5432
5515
  return new Promise(function(resolve, reject) {
5433
5516
  var gen = fn.apply(self, args);
5434
5517
  function _next(value) {
5435
- asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
5518
+ asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
5436
5519
  }
5437
5520
  function _throw(err) {
5438
- asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
5521
+ asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
5439
5522
  }
5440
5523
  _next(undefined);
5441
5524
  });
5442
5525
  };
5443
5526
  }
5444
- function _define_property$4(obj, key, value) {
5527
+ function _define_property$e(obj, key, value) {
5445
5528
  if (key in obj) {
5446
5529
  Object.defineProperty(obj, key, {
5447
5530
  value: value,
@@ -5454,14 +5537,14 @@ function _define_property$4(obj, key, value) {
5454
5537
  }
5455
5538
  return obj;
5456
5539
  }
5457
- function _instanceof$1(left, right) {
5540
+ function _instanceof$2(left, right) {
5458
5541
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5459
5542
  return !!right[Symbol.hasInstance](left);
5460
5543
  } else {
5461
5544
  return left instanceof right;
5462
5545
  }
5463
5546
  }
5464
- function _object_spread$4(target) {
5547
+ function _object_spread$e(target) {
5465
5548
  for(var i = 1; i < arguments.length; i++){
5466
5549
  var source = arguments[i] != null ? arguments[i] : {};
5467
5550
  var ownKeys = Object.keys(source);
@@ -5471,12 +5554,12 @@ function _object_spread$4(target) {
5471
5554
  }));
5472
5555
  }
5473
5556
  ownKeys.forEach(function(key) {
5474
- _define_property$4(target, key, source[key]);
5557
+ _define_property$e(target, key, source[key]);
5475
5558
  });
5476
5559
  }
5477
5560
  return target;
5478
5561
  }
5479
- function ownKeys$3(object, enumerableOnly) {
5562
+ function ownKeys$d(object, enumerableOnly) {
5480
5563
  var keys = Object.keys(object);
5481
5564
  if (Object.getOwnPropertySymbols) {
5482
5565
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5484,18 +5567,18 @@ function ownKeys$3(object, enumerableOnly) {
5484
5567
  }
5485
5568
  return keys;
5486
5569
  }
5487
- function _object_spread_props$3(target, source) {
5570
+ function _object_spread_props$d(target, source) {
5488
5571
  source = source != null ? source : {};
5489
5572
  if (Object.getOwnPropertyDescriptors) {
5490
5573
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5491
5574
  } else {
5492
- ownKeys$3(Object(source)).forEach(function(key) {
5575
+ ownKeys$d(Object(source)).forEach(function(key) {
5493
5576
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5494
5577
  });
5495
5578
  }
5496
5579
  return target;
5497
5580
  }
5498
- function _ts_generator$3(thisArg, body) {
5581
+ function _ts_generator$5(thisArg, body) {
5499
5582
  var f, y, t, _ = {
5500
5583
  label: 0,
5501
5584
  sent: function() {
@@ -5626,9 +5709,9 @@ function _ts_generator$3(thisArg, body) {
5626
5709
  return fetchApiFetchService.makeFetch({
5627
5710
  baseUrl: input.apiUrl,
5628
5711
  baseRequest: function baseRequest() {
5629
- return _async_to_generator$3(function() {
5712
+ return _async_to_generator$5(function() {
5630
5713
  var _tmp, _tmp1, _, _1;
5631
- return _ts_generator$3(this, function(_state) {
5714
+ return _ts_generator$5(this, function(_state) {
5632
5715
  switch(_state.label){
5633
5716
  case 0:
5634
5717
  _tmp = {};
@@ -5666,7 +5749,7 @@ function _ts_generator$3(thisArg, body) {
5666
5749
  apiUrl: apiUrl
5667
5750
  });
5668
5751
  var fetch = handleZohoCrmErrorFetch(baseFetch, logZohoServerErrorFunction, function(x) {
5669
- if (_instanceof$1(x, ZohoInvalidTokenError)) {
5752
+ if (_instanceof$2(x, ZohoInvalidTokenError)) {
5670
5753
  void accountsContext.loadAccessToken.resetAccessToken();
5671
5754
  }
5672
5755
  });
@@ -5678,7 +5761,7 @@ function _ts_generator$3(thisArg, body) {
5678
5761
  fetch: fetch,
5679
5762
  fetchJson: fetchJson,
5680
5763
  accessTokenStringFactory: accessTokenStringFactory,
5681
- config: _object_spread_props$3(_object_spread$4({}, config), {
5764
+ config: _object_spread_props$d(_object_spread$e({}, config), {
5682
5765
  apiUrl: apiUrl
5683
5766
  }),
5684
5767
  zohoRateLimiter: fetchHandler._rateLimiter
@@ -5694,7 +5777,7 @@ function _ts_generator$3(thisArg, body) {
5694
5777
  * Maximum length of ZohoCrmTagName
5695
5778
  */ var ZOHO_CRM_TAG_NAME_MAX_LENGTH = 25;
5696
5779
 
5697
- function _define_property$3(obj, key, value) {
5780
+ function _define_property$d(obj, key, value) {
5698
5781
  if (key in obj) {
5699
5782
  Object.defineProperty(obj, key, {
5700
5783
  value: value,
@@ -5707,7 +5790,7 @@ function _define_property$3(obj, key, value) {
5707
5790
  }
5708
5791
  return obj;
5709
5792
  }
5710
- function _object_spread$3(target) {
5793
+ function _object_spread$d(target) {
5711
5794
  for(var i = 1; i < arguments.length; i++){
5712
5795
  var source = arguments[i] != null ? arguments[i] : {};
5713
5796
  var ownKeys = Object.keys(source);
@@ -5717,12 +5800,12 @@ function _object_spread$3(target) {
5717
5800
  }));
5718
5801
  }
5719
5802
  ownKeys.forEach(function(key) {
5720
- _define_property$3(target, key, source[key]);
5803
+ _define_property$d(target, key, source[key]);
5721
5804
  });
5722
5805
  }
5723
5806
  return target;
5724
5807
  }
5725
- function ownKeys$2(object, enumerableOnly) {
5808
+ function ownKeys$c(object, enumerableOnly) {
5726
5809
  var keys = Object.keys(object);
5727
5810
  if (Object.getOwnPropertySymbols) {
5728
5811
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5730,12 +5813,12 @@ function ownKeys$2(object, enumerableOnly) {
5730
5813
  }
5731
5814
  return keys;
5732
5815
  }
5733
- function _object_spread_props$2(target, source) {
5816
+ function _object_spread_props$c(target, source) {
5734
5817
  source = source != null ? source : {};
5735
5818
  if (Object.getOwnPropertyDescriptors) {
5736
5819
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5737
5820
  } else {
5738
- ownKeys$2(Object(source)).forEach(function(key) {
5821
+ ownKeys$c(Object(source)).forEach(function(key) {
5739
5822
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5740
5823
  });
5741
5824
  }
@@ -5763,7 +5846,7 @@ function _object_spread_props$2(target, source) {
5763
5846
  * }
5764
5847
  * ```
5765
5848
  */ function zohoSignFetchPageFactory(fetch, defaults) {
5766
- return fetchPageFactory(_object_spread_props$2(_object_spread$3({}, defaults), {
5849
+ return fetchPageFactory(_object_spread_props$c(_object_spread$d({}, defaults), {
5767
5850
  fetch: fetch,
5768
5851
  readFetchPageResultInfo: function readFetchPageResultInfo(result) {
5769
5852
  var _ref;
@@ -5778,7 +5861,7 @@ function _object_spread_props$2(target, source) {
5778
5861
  var previousPageContext = previousResult === null || previousResult === void 0 ? void 0 : previousResult.page_context;
5779
5862
  var rowCount = (_ref = (_ref1 = (_options_maxItemsPerPage = options.maxItemsPerPage) !== null && _options_maxItemsPerPage !== void 0 ? _options_maxItemsPerPage : input.row_count) !== null && _ref1 !== void 0 ? _ref1 : previousPageContext === null || previousPageContext === void 0 ? void 0 : previousPageContext.row_count) !== null && _ref !== void 0 ? _ref : 20;
5780
5863
  var nextStartIndex = ((_ref2 = (_ref3 = previousPageContext === null || previousPageContext === void 0 ? void 0 : previousPageContext.start_index) !== null && _ref3 !== void 0 ? _ref3 : input.start_index) !== null && _ref2 !== void 0 ? _ref2 : 1) + rowCount;
5781
- return _object_spread_props$2(_object_spread$3({}, input), {
5864
+ return _object_spread_props$c(_object_spread$d({}, input), {
5782
5865
  start_index: nextStartIndex,
5783
5866
  row_count: rowCount
5784
5867
  });
@@ -5786,7 +5869,7 @@ function _object_spread_props$2(target, source) {
5786
5869
  }));
5787
5870
  }
5788
5871
 
5789
- function _define_property$2(obj, key, value) {
5872
+ function _define_property$c(obj, key, value) {
5790
5873
  if (key in obj) {
5791
5874
  Object.defineProperty(obj, key, {
5792
5875
  value: value,
@@ -5799,7 +5882,7 @@ function _define_property$2(obj, key, value) {
5799
5882
  }
5800
5883
  return obj;
5801
5884
  }
5802
- function _object_spread$2(target) {
5885
+ function _object_spread$c(target) {
5803
5886
  for(var i = 1; i < arguments.length; i++){
5804
5887
  var source = arguments[i] != null ? arguments[i] : {};
5805
5888
  var ownKeys = Object.keys(source);
@@ -5809,12 +5892,12 @@ function _object_spread$2(target) {
5809
5892
  }));
5810
5893
  }
5811
5894
  ownKeys.forEach(function(key) {
5812
- _define_property$2(target, key, source[key]);
5895
+ _define_property$c(target, key, source[key]);
5813
5896
  });
5814
5897
  }
5815
5898
  return target;
5816
5899
  }
5817
- function _object_without_properties(source, excluded) {
5900
+ function _object_without_properties$8(source, excluded) {
5818
5901
  if (source == null) return {};
5819
5902
  var target = {}, sourceKeys, key, i;
5820
5903
  if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
@@ -5827,7 +5910,7 @@ function _object_without_properties(source, excluded) {
5827
5910
  }
5828
5911
  return target;
5829
5912
  }
5830
- target = _object_without_properties_loose(source, excluded);
5913
+ target = _object_without_properties_loose$8(source, excluded);
5831
5914
  if (Object.getOwnPropertySymbols) {
5832
5915
  sourceKeys = Object.getOwnPropertySymbols(source);
5833
5916
  for(i = 0; i < sourceKeys.length; i++){
@@ -5839,7 +5922,7 @@ function _object_without_properties(source, excluded) {
5839
5922
  }
5840
5923
  return target;
5841
5924
  }
5842
- function _object_without_properties_loose(source, excluded) {
5925
+ function _object_without_properties_loose$8(source, excluded) {
5843
5926
  if (source == null) return {};
5844
5927
  var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
5845
5928
  for(i = 0; i < sourceKeys.length; i++){
@@ -5905,11 +5988,11 @@ function _object_without_properties_loose(source, excluded) {
5905
5988
  * @see https://www.zoho.com/sign/api/document-managment/get-document-list.html
5906
5989
  */ function zohoSignGetDocuments(context) {
5907
5990
  return function(input) {
5908
- var search_columns = input.search_columns, pageFilter = _object_without_properties(input, [
5991
+ var search_columns = input.search_columns, pageFilter = _object_without_properties$8(input, [
5909
5992
  "search_columns"
5910
5993
  ]);
5911
5994
  var data = {
5912
- page_context: _object_spread$2({}, pageFilter, search_columns ? {
5995
+ page_context: _object_spread$c({}, pageFilter, search_columns ? {
5913
5996
  search_columns: search_columns
5914
5997
  } : {})
5915
5998
  };
@@ -6017,7 +6100,7 @@ function _object_without_properties_loose(source, excluded) {
6017
6100
  * @see https://www.zoho.com/sign/api/document-managment/download-pdf.html
6018
6101
  */ function zohoSignDownloadPdf(context) {
6019
6102
  return function(_0) {
6020
- var requestId = _0.requestId, params = _object_without_properties(_0, [
6103
+ var requestId = _0.requestId, params = _object_without_properties$8(_0, [
6021
6104
  "requestId"
6022
6105
  ]);
6023
6106
  var searchParams = makeUrlSearchParams(params);
@@ -6241,7 +6324,7 @@ function _object_without_properties_loose(source, excluded) {
6241
6324
  }
6242
6325
  var form = makeUrlSearchParams(params);
6243
6326
  var hasForm = form.toString().length > 0;
6244
- return context.fetchJson("/requests/".concat(requestId, "/delete"), _object_spread$2({
6327
+ return context.fetchJson("/requests/".concat(requestId, "/delete"), _object_spread$c({
6245
6328
  method: 'PUT'
6246
6329
  }, hasForm ? {
6247
6330
  headers: {
@@ -6269,7 +6352,7 @@ var ZOHO_SIGN_SERVICE_NAME = 'sign';
6269
6352
  }
6270
6353
  }
6271
6354
 
6272
- function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
6355
+ function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
6273
6356
  try {
6274
6357
  var info = gen[key](arg);
6275
6358
  var value = info.value;
@@ -6283,22 +6366,22 @@ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
6283
6366
  Promise.resolve(value).then(_next, _throw);
6284
6367
  }
6285
6368
  }
6286
- function _async_to_generator$2(fn) {
6369
+ function _async_to_generator$4(fn) {
6287
6370
  return function() {
6288
6371
  var self = this, args = arguments;
6289
6372
  return new Promise(function(resolve, reject) {
6290
6373
  var gen = fn.apply(self, args);
6291
6374
  function _next(value) {
6292
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
6375
+ asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
6293
6376
  }
6294
6377
  function _throw(err) {
6295
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
6378
+ asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
6296
6379
  }
6297
6380
  _next(undefined);
6298
6381
  });
6299
6382
  };
6300
6383
  }
6301
- function _ts_generator$2(thisArg, body) {
6384
+ function _ts_generator$4(thisArg, body) {
6302
6385
  var f, y, t, _ = {
6303
6386
  label: 0,
6304
6387
  sent: function() {
@@ -6406,9 +6489,9 @@ var logZohoSignErrorToConsole = logZohoServerErrorFunction('ZohoSign', {
6406
6489
  * @param responseError - The fetch response error to parse
6407
6490
  * @returns Parsed Zoho server error, or undefined if parsing fails
6408
6491
  */ function parseZohoSignError(responseError) {
6409
- return _async_to_generator$2(function() {
6492
+ return _async_to_generator$4(function() {
6410
6493
  var data, result;
6411
- return _ts_generator$2(this, function(_state) {
6494
+ return _ts_generator$4(this, function(_state) {
6412
6495
  switch(_state.label){
6413
6496
  case 0:
6414
6497
  return [
@@ -6453,7 +6536,7 @@ var logZohoSignErrorToConsole = logZohoServerErrorFunction('ZohoSign', {
6453
6536
  var interceptZohoSign200StatusWithErrorResponse = interceptZohoErrorResponseFactory(parseZohoSignServerErrorResponseData);
6454
6537
  var handleZohoSignErrorFetch = handleZohoErrorFetchFactory(parseZohoSignError, logZohoSignErrorToConsole);
6455
6538
 
6456
- function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
6539
+ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
6457
6540
  try {
6458
6541
  var info = gen[key](arg);
6459
6542
  var value = info.value;
@@ -6467,22 +6550,22 @@ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
6467
6550
  Promise.resolve(value).then(_next, _throw);
6468
6551
  }
6469
6552
  }
6470
- function _async_to_generator$1(fn) {
6553
+ function _async_to_generator$3(fn) {
6471
6554
  return function() {
6472
6555
  var self = this, args = arguments;
6473
6556
  return new Promise(function(resolve, reject) {
6474
6557
  var gen = fn.apply(self, args);
6475
6558
  function _next(value) {
6476
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
6559
+ asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
6477
6560
  }
6478
6561
  function _throw(err) {
6479
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
6562
+ asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
6480
6563
  }
6481
6564
  _next(undefined);
6482
6565
  });
6483
6566
  };
6484
6567
  }
6485
- function _define_property$1(obj, key, value) {
6568
+ function _define_property$b(obj, key, value) {
6486
6569
  if (key in obj) {
6487
6570
  Object.defineProperty(obj, key, {
6488
6571
  value: value,
@@ -6495,14 +6578,14 @@ function _define_property$1(obj, key, value) {
6495
6578
  }
6496
6579
  return obj;
6497
6580
  }
6498
- function _instanceof(left, right) {
6581
+ function _instanceof$1(left, right) {
6499
6582
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
6500
6583
  return !!right[Symbol.hasInstance](left);
6501
6584
  } else {
6502
6585
  return left instanceof right;
6503
6586
  }
6504
6587
  }
6505
- function _object_spread$1(target) {
6588
+ function _object_spread$b(target) {
6506
6589
  for(var i = 1; i < arguments.length; i++){
6507
6590
  var source = arguments[i] != null ? arguments[i] : {};
6508
6591
  var ownKeys = Object.keys(source);
@@ -6512,12 +6595,12 @@ function _object_spread$1(target) {
6512
6595
  }));
6513
6596
  }
6514
6597
  ownKeys.forEach(function(key) {
6515
- _define_property$1(target, key, source[key]);
6598
+ _define_property$b(target, key, source[key]);
6516
6599
  });
6517
6600
  }
6518
6601
  return target;
6519
6602
  }
6520
- function ownKeys$1(object, enumerableOnly) {
6603
+ function ownKeys$b(object, enumerableOnly) {
6521
6604
  var keys = Object.keys(object);
6522
6605
  if (Object.getOwnPropertySymbols) {
6523
6606
  var symbols = Object.getOwnPropertySymbols(object);
@@ -6525,18 +6608,18 @@ function ownKeys$1(object, enumerableOnly) {
6525
6608
  }
6526
6609
  return keys;
6527
6610
  }
6528
- function _object_spread_props$1(target, source) {
6611
+ function _object_spread_props$b(target, source) {
6529
6612
  source = source != null ? source : {};
6530
6613
  if (Object.getOwnPropertyDescriptors) {
6531
6614
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6532
6615
  } else {
6533
- ownKeys$1(Object(source)).forEach(function(key) {
6616
+ ownKeys$b(Object(source)).forEach(function(key) {
6534
6617
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
6535
6618
  });
6536
6619
  }
6537
6620
  return target;
6538
6621
  }
6539
- function _ts_generator$1(thisArg, body) {
6622
+ function _ts_generator$3(thisArg, body) {
6540
6623
  var f, y, t, _ = {
6541
6624
  label: 0,
6542
6625
  sent: function() {
@@ -6667,9 +6750,9 @@ function _ts_generator$1(thisArg, body) {
6667
6750
  return fetchApiFetchService.makeFetch({
6668
6751
  baseUrl: input.apiUrl,
6669
6752
  baseRequest: function baseRequest() {
6670
- return _async_to_generator$1(function() {
6753
+ return _async_to_generator$3(function() {
6671
6754
  var _tmp, _tmp1, _, _1;
6672
- return _ts_generator$1(this, function(_state) {
6755
+ return _ts_generator$3(this, function(_state) {
6673
6756
  switch(_state.label){
6674
6757
  case 0:
6675
6758
  _tmp = {};
@@ -6707,7 +6790,7 @@ function _ts_generator$1(thisArg, body) {
6707
6790
  apiUrl: apiUrl
6708
6791
  });
6709
6792
  var fetch = handleZohoSignErrorFetch(baseFetch, logZohoServerErrorFunction, function(x) {
6710
- if (_instanceof(x, ZohoInvalidTokenError)) {
6793
+ if (_instanceof$1(x, ZohoInvalidTokenError)) {
6711
6794
  void accountsContext.loadAccessToken.resetAccessToken();
6712
6795
  }
6713
6796
  });
@@ -6719,7 +6802,7 @@ function _ts_generator$1(thisArg, body) {
6719
6802
  fetch: fetch,
6720
6803
  fetchJson: fetchJson,
6721
6804
  accessTokenStringFactory: accessTokenStringFactory,
6722
- config: _object_spread_props$1(_object_spread$1({}, config), {
6805
+ config: _object_spread_props$b(_object_spread$b({}, config), {
6723
6806
  apiUrl: apiUrl
6724
6807
  }),
6725
6808
  zohoRateLimiter: fetchHandler._rateLimiter
@@ -6731,6 +6814,2168 @@ function _ts_generator$1(thisArg, body) {
6731
6814
  };
6732
6815
  }
6733
6816
 
6817
+ /**
6818
+ * Service identifier used for Zoho Desk API access token resolution and service routing.
6819
+ */ var ZOHO_DESK_SERVICE_NAME = 'desk';
6820
+ /**
6821
+ * Resolves a Desk API URL input to its full base URL. The 'production' key maps to the
6822
+ * primary Zoho Desk endpoint; custom URLs pass through unchanged.
6823
+ *
6824
+ * @param input - A well-known environment key or a custom Desk API URL
6825
+ * @returns The resolved full Zoho Desk API base URL
6826
+ */ function zohoDeskConfigApiUrl(input) {
6827
+ var result;
6828
+ switch(input){
6829
+ case 'sandbox':
6830
+ case 'production':
6831
+ result = 'https://desk.zoho.com/api/v1';
6832
+ break;
6833
+ default:
6834
+ result = input;
6835
+ break;
6836
+ }
6837
+ return result;
6838
+ }
6839
+
6840
+ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
6841
+ try {
6842
+ var info = gen[key](arg);
6843
+ var value = info.value;
6844
+ } catch (error) {
6845
+ reject(error);
6846
+ return;
6847
+ }
6848
+ if (info.done) {
6849
+ resolve(value);
6850
+ } else {
6851
+ Promise.resolve(value).then(_next, _throw);
6852
+ }
6853
+ }
6854
+ function _async_to_generator$2(fn) {
6855
+ return function() {
6856
+ var self = this, args = arguments;
6857
+ return new Promise(function(resolve, reject) {
6858
+ var gen = fn.apply(self, args);
6859
+ function _next(value) {
6860
+ asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
6861
+ }
6862
+ function _throw(err) {
6863
+ asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
6864
+ }
6865
+ _next(undefined);
6866
+ });
6867
+ };
6868
+ }
6869
+ function _ts_generator$2(thisArg, body) {
6870
+ var f, y, t, _ = {
6871
+ label: 0,
6872
+ sent: function() {
6873
+ if (t[0] & 1) throw t[1];
6874
+ return t[1];
6875
+ },
6876
+ trys: [],
6877
+ ops: []
6878
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
6879
+ return d(g, "next", {
6880
+ value: verb(0)
6881
+ }), d(g, "throw", {
6882
+ value: verb(1)
6883
+ }), d(g, "return", {
6884
+ value: verb(2)
6885
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
6886
+ value: function() {
6887
+ return this;
6888
+ }
6889
+ }), g;
6890
+ function verb(n) {
6891
+ return function(v) {
6892
+ return step([
6893
+ n,
6894
+ v
6895
+ ]);
6896
+ };
6897
+ }
6898
+ function step(op) {
6899
+ if (f) throw new TypeError("Generator is already executing.");
6900
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
6901
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
6902
+ if (y = 0, t) op = [
6903
+ op[0] & 2,
6904
+ t.value
6905
+ ];
6906
+ switch(op[0]){
6907
+ case 0:
6908
+ case 1:
6909
+ t = op;
6910
+ break;
6911
+ case 4:
6912
+ _.label++;
6913
+ return {
6914
+ value: op[1],
6915
+ done: false
6916
+ };
6917
+ case 5:
6918
+ _.label++;
6919
+ y = op[1];
6920
+ op = [
6921
+ 0
6922
+ ];
6923
+ continue;
6924
+ case 7:
6925
+ op = _.ops.pop();
6926
+ _.trys.pop();
6927
+ continue;
6928
+ default:
6929
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
6930
+ _ = 0;
6931
+ continue;
6932
+ }
6933
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
6934
+ _.label = op[1];
6935
+ break;
6936
+ }
6937
+ if (op[0] === 6 && _.label < t[1]) {
6938
+ _.label = t[1];
6939
+ t = op;
6940
+ break;
6941
+ }
6942
+ if (t && _.label < t[2]) {
6943
+ _.label = t[2];
6944
+ _.ops.push(op);
6945
+ break;
6946
+ }
6947
+ if (t[2]) _.ops.pop();
6948
+ _.trys.pop();
6949
+ continue;
6950
+ }
6951
+ op = body.call(thisArg, _);
6952
+ } catch (e) {
6953
+ op = [
6954
+ 6,
6955
+ e
6956
+ ];
6957
+ y = 0;
6958
+ } finally{
6959
+ f = t = 0;
6960
+ }
6961
+ if (op[0] & 5) throw op[1];
6962
+ return {
6963
+ value: op[0] ? op[1] : void 0,
6964
+ done: true
6965
+ };
6966
+ }
6967
+ }
6968
+ /**
6969
+ * Pre-configured console logger for Zoho Desk server errors.
6970
+ * Data array errors are suppressed since they are handled separately.
6971
+ */ var logZohoDeskErrorToConsole = logZohoServerErrorFunction('ZohoDesk', {
6972
+ logDataArrayErrors: false
6973
+ });
6974
+ /**
6975
+ * Parses a fetch response error into a typed Zoho Desk server error by extracting and interpreting the JSON error body.
6976
+ *
6977
+ * @param responseError - The fetch response error to parse
6978
+ * @returns The parsed Zoho server error, or undefined if the response could not be parsed
6979
+ */ function parseZohoDeskError(responseError) {
6980
+ return _async_to_generator$2(function() {
6981
+ var data, result;
6982
+ return _ts_generator$2(this, function(_state) {
6983
+ switch(_state.label){
6984
+ case 0:
6985
+ return [
6986
+ 4,
6987
+ responseError.response.json().catch(function() {
6988
+ return undefined;
6989
+ })
6990
+ ];
6991
+ case 1:
6992
+ data = _state.sent();
6993
+ if (data) {
6994
+ result = parseZohoDeskServerErrorResponseData(data, responseError);
6995
+ }
6996
+ return [
6997
+ 2,
6998
+ result
6999
+ ];
7000
+ }
7001
+ });
7002
+ })();
7003
+ }
7004
+ /**
7005
+ * Parses a Zoho Desk error response body into a typed error. Delegates to Desk-specific
7006
+ * error code handling before falling back to the generic Zoho error parser.
7007
+ *
7008
+ * @param errorResponseData - The raw error response data from the Zoho Desk API
7009
+ * @param responseError - The original fetch response error for context
7010
+ * @returns The parsed Zoho server error, or undefined if the error could not be classified
7011
+ */ function parseZohoDeskServerErrorResponseData(errorResponseData, responseError) {
7012
+ var result;
7013
+ var error = tryFindZohoServerErrorData(errorResponseData, responseError);
7014
+ if (error) {
7015
+ var errorData = zohoServerErrorData(error);
7016
+ switch(errorData.code){
7017
+ // TODO: Add Desk-specific error codes here as we encounter them.
7018
+ default:
7019
+ result = parseZohoServerErrorResponseData(errorResponseData, responseError);
7020
+ break;
7021
+ }
7022
+ }
7023
+ return result;
7024
+ }
7025
+ /**
7026
+ * Fetch response interceptor that detects Zoho Desk error payloads hidden within HTTP 200 responses
7027
+ * and converts them into proper errors.
7028
+ */ var interceptZohoDesk200StatusWithErrorResponse = interceptZohoErrorResponseFactory(parseZohoDeskServerErrorResponseData);
7029
+ /**
7030
+ * Wraps a fetch function with Zoho Desk error parsing and console logging,
7031
+ * ensuring all Desk API errors are surfaced as typed exceptions.
7032
+ */ var handleZohoDeskErrorFetch = handleZohoErrorFetchFactory(parseZohoDeskError, logZohoDeskErrorToConsole);
7033
+
7034
+ function _define_property$a(obj, key, value) {
7035
+ if (key in obj) {
7036
+ Object.defineProperty(obj, key, {
7037
+ value: value,
7038
+ enumerable: true,
7039
+ configurable: true,
7040
+ writable: true
7041
+ });
7042
+ } else {
7043
+ obj[key] = value;
7044
+ }
7045
+ return obj;
7046
+ }
7047
+ function _object_spread$a(target) {
7048
+ for(var i = 1; i < arguments.length; i++){
7049
+ var source = arguments[i] != null ? arguments[i] : {};
7050
+ var ownKeys = Object.keys(source);
7051
+ if (typeof Object.getOwnPropertySymbols === "function") {
7052
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7053
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7054
+ }));
7055
+ }
7056
+ ownKeys.forEach(function(key) {
7057
+ _define_property$a(target, key, source[key]);
7058
+ });
7059
+ }
7060
+ return target;
7061
+ }
7062
+ function ownKeys$a(object, enumerableOnly) {
7063
+ var keys = Object.keys(object);
7064
+ if (Object.getOwnPropertySymbols) {
7065
+ var symbols = Object.getOwnPropertySymbols(object);
7066
+ keys.push.apply(keys, symbols);
7067
+ }
7068
+ return keys;
7069
+ }
7070
+ function _object_spread_props$a(target, source) {
7071
+ source = source != null ? source : {};
7072
+ if (Object.getOwnPropertyDescriptors) {
7073
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7074
+ } else {
7075
+ ownKeys$a(Object(source)).forEach(function(key) {
7076
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7077
+ });
7078
+ }
7079
+ return target;
7080
+ }
7081
+ // MARK: Desk Rate Limit Headers
7082
+ /**
7083
+ * Header name for the credit weight consumed by the last Zoho Desk API request.
7084
+ */ var ZOHO_DESK_RATE_LIMIT_WEIGHT_HEADER = 'X-Rate-Limit-Request-Weight-v3';
7085
+ /**
7086
+ * Header name for the remaining API credits in the current Zoho Desk rate limit window.
7087
+ */ var ZOHO_DESK_RATE_LIMIT_REMAINING_HEADER = 'X-Rate-Limit-Remaining-v3';
7088
+ /**
7089
+ * Header name indicating how many seconds to wait before retrying after a Zoho Desk 429 response.
7090
+ */ var ZOHO_DESK_RETRY_AFTER_HEADER = 'Retry-After';
7091
+ /**
7092
+ * Default rate limit for Zoho Desk API requests (credits per minute).
7093
+ */ var DEFAULT_ZOHO_DESK_API_RATE_LIMIT = 200;
7094
+ /**
7095
+ * Reads rate limit details from Zoho Desk v3 response headers.
7096
+ *
7097
+ * Desk uses a credit-based system with `X-Rate-Limit-Remaining-v3` and `Retry-After` (in seconds)
7098
+ * rather than the `X-RATELIMIT-*` headers used by CRM/Recruit/Sign.
7099
+ *
7100
+ * @param headers - HTTP response headers from a Zoho Desk API call
7101
+ * @returns Parsed rate limit details, or null if the Desk rate limit headers are absent
7102
+ */ function zohoDeskRateLimitDetailsReader(headers) {
7103
+ var remainingHeader = headers.get(ZOHO_DESK_RATE_LIMIT_REMAINING_HEADER);
7104
+ var result;
7105
+ if (remainingHeader != null) {
7106
+ var remaining = Number(remainingHeader);
7107
+ var resetAt;
7108
+ var retryAfterHeader = headers.get(ZOHO_DESK_RETRY_AFTER_HEADER);
7109
+ if (retryAfterHeader != null) {
7110
+ var retryAfterSeconds = Number(retryAfterHeader);
7111
+ if (!isNaN(retryAfterSeconds)) {
7112
+ resetAt = new Date(Date.now() + retryAfterSeconds * MS_IN_SECOND);
7113
+ }
7114
+ }
7115
+ if (!isNaN(remaining)) {
7116
+ result = {
7117
+ remaining: remaining,
7118
+ resetAt: resetAt
7119
+ };
7120
+ }
7121
+ }
7122
+ return result;
7123
+ }
7124
+ /**
7125
+ * Creates a {@link ZohoRateLimitedFetchHandler} configured for Zoho Desk's v3 rate limit headers.
7126
+ *
7127
+ * This is a convenience wrapper around {@link makeZohoRateLimitedFetchHandler} pre-configured
7128
+ * with the Desk-specific header reader. Unlike CRM, Desk does not provide a total limit header,
7129
+ * so the configured `maxRateLimit` (defaulting to {@link DEFAULT_ZOHO_DESK_API_RATE_LIMIT}) is used throughout.
7130
+ *
7131
+ * @param config - Optional configuration for rate limit, reset period, and 429 handling
7132
+ * @returns A rate-limited fetch handler with the underlying rate limiter accessible via `_rateLimiter`
7133
+ */ function zohoDeskRateLimitedFetchHandler(config) {
7134
+ return makeZohoRateLimitedFetchHandler(_object_spread_props$a(_object_spread$a({
7135
+ maxRateLimit: DEFAULT_ZOHO_DESK_API_RATE_LIMIT
7136
+ }, config), {
7137
+ readRateLimitDetails: zohoDeskRateLimitDetailsReader
7138
+ }));
7139
+ }
7140
+
7141
+ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
7142
+ try {
7143
+ var info = gen[key](arg);
7144
+ var value = info.value;
7145
+ } catch (error) {
7146
+ reject(error);
7147
+ return;
7148
+ }
7149
+ if (info.done) {
7150
+ resolve(value);
7151
+ } else {
7152
+ Promise.resolve(value).then(_next, _throw);
7153
+ }
7154
+ }
7155
+ function _async_to_generator$1(fn) {
7156
+ return function() {
7157
+ var self = this, args = arguments;
7158
+ return new Promise(function(resolve, reject) {
7159
+ var gen = fn.apply(self, args);
7160
+ function _next(value) {
7161
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
7162
+ }
7163
+ function _throw(err) {
7164
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
7165
+ }
7166
+ _next(undefined);
7167
+ });
7168
+ };
7169
+ }
7170
+ function _define_property$9(obj, key, value) {
7171
+ if (key in obj) {
7172
+ Object.defineProperty(obj, key, {
7173
+ value: value,
7174
+ enumerable: true,
7175
+ configurable: true,
7176
+ writable: true
7177
+ });
7178
+ } else {
7179
+ obj[key] = value;
7180
+ }
7181
+ return obj;
7182
+ }
7183
+ function _instanceof(left, right) {
7184
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
7185
+ return !!right[Symbol.hasInstance](left);
7186
+ } else {
7187
+ return left instanceof right;
7188
+ }
7189
+ }
7190
+ function _object_spread$9(target) {
7191
+ for(var i = 1; i < arguments.length; i++){
7192
+ var source = arguments[i] != null ? arguments[i] : {};
7193
+ var ownKeys = Object.keys(source);
7194
+ if (typeof Object.getOwnPropertySymbols === "function") {
7195
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7196
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7197
+ }));
7198
+ }
7199
+ ownKeys.forEach(function(key) {
7200
+ _define_property$9(target, key, source[key]);
7201
+ });
7202
+ }
7203
+ return target;
7204
+ }
7205
+ function ownKeys$9(object, enumerableOnly) {
7206
+ var keys = Object.keys(object);
7207
+ if (Object.getOwnPropertySymbols) {
7208
+ var symbols = Object.getOwnPropertySymbols(object);
7209
+ keys.push.apply(keys, symbols);
7210
+ }
7211
+ return keys;
7212
+ }
7213
+ function _object_spread_props$9(target, source) {
7214
+ source = source != null ? source : {};
7215
+ if (Object.getOwnPropertyDescriptors) {
7216
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7217
+ } else {
7218
+ ownKeys$9(Object(source)).forEach(function(key) {
7219
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7220
+ });
7221
+ }
7222
+ return target;
7223
+ }
7224
+ function _ts_generator$1(thisArg, body) {
7225
+ var f, y, t, _ = {
7226
+ label: 0,
7227
+ sent: function() {
7228
+ if (t[0] & 1) throw t[1];
7229
+ return t[1];
7230
+ },
7231
+ trys: [],
7232
+ ops: []
7233
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
7234
+ return d(g, "next", {
7235
+ value: verb(0)
7236
+ }), d(g, "throw", {
7237
+ value: verb(1)
7238
+ }), d(g, "return", {
7239
+ value: verb(2)
7240
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
7241
+ value: function() {
7242
+ return this;
7243
+ }
7244
+ }), g;
7245
+ function verb(n) {
7246
+ return function(v) {
7247
+ return step([
7248
+ n,
7249
+ v
7250
+ ]);
7251
+ };
7252
+ }
7253
+ function step(op) {
7254
+ if (f) throw new TypeError("Generator is already executing.");
7255
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
7256
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7257
+ if (y = 0, t) op = [
7258
+ op[0] & 2,
7259
+ t.value
7260
+ ];
7261
+ switch(op[0]){
7262
+ case 0:
7263
+ case 1:
7264
+ t = op;
7265
+ break;
7266
+ case 4:
7267
+ _.label++;
7268
+ return {
7269
+ value: op[1],
7270
+ done: false
7271
+ };
7272
+ case 5:
7273
+ _.label++;
7274
+ y = op[1];
7275
+ op = [
7276
+ 0
7277
+ ];
7278
+ continue;
7279
+ case 7:
7280
+ op = _.ops.pop();
7281
+ _.trys.pop();
7282
+ continue;
7283
+ default:
7284
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
7285
+ _ = 0;
7286
+ continue;
7287
+ }
7288
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
7289
+ _.label = op[1];
7290
+ break;
7291
+ }
7292
+ if (op[0] === 6 && _.label < t[1]) {
7293
+ _.label = t[1];
7294
+ t = op;
7295
+ break;
7296
+ }
7297
+ if (t && _.label < t[2]) {
7298
+ _.label = t[2];
7299
+ _.ops.push(op);
7300
+ break;
7301
+ }
7302
+ if (t[2]) _.ops.pop();
7303
+ _.trys.pop();
7304
+ continue;
7305
+ }
7306
+ op = body.call(thisArg, _);
7307
+ } catch (e) {
7308
+ op = [
7309
+ 6,
7310
+ e
7311
+ ];
7312
+ y = 0;
7313
+ } finally{
7314
+ f = t = 0;
7315
+ }
7316
+ if (op[0] & 5) throw op[1];
7317
+ return {
7318
+ value: op[0] ? op[1] : void 0,
7319
+ done: true
7320
+ };
7321
+ }
7322
+ }
7323
+ /**
7324
+ * Creates a {@link ZohoDeskFactory} from the given configuration.
7325
+ *
7326
+ * The factory pre-initializes shared resources (access token provider, rate limiter)
7327
+ * once, then produces {@link ZohoDesk} client instances for each {@link ZohoDeskConfig}.
7328
+ * Each client handles OAuth token refresh on {@link ZohoInvalidTokenError}, rate limiting,
7329
+ * and Zoho Desk's non-standard error responses (200 status with error body).
7330
+ *
7331
+ * Unlike CRM/Recruit/Sign, the Desk API requires an `orgId` header on every request.
7332
+ * This is injected automatically from the config.
7333
+ *
7334
+ * @param factoryConfig - Configuration providing account credentials and optional overrides
7335
+ * @returns A factory function that creates authenticated Zoho Desk clients
7336
+ */ function zohoDeskFactory(factoryConfig) {
7337
+ var accountsContext = factoryConfig.accountsContext;
7338
+ var accessTokenStringFactory = zohoAccessTokenStringFactory(accountsContext.loadAccessToken);
7339
+ var fetchHandler = zohoDeskRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
7340
+ var logZohoServerErrorFunction = factoryConfig.logZohoServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function(input) {
7341
+ return fetchApiFetchService.makeFetch({
7342
+ baseUrl: input.apiUrl,
7343
+ baseRequest: function baseRequest() {
7344
+ return _async_to_generator$1(function() {
7345
+ var _tmp, _tmp1, _, _1;
7346
+ return _ts_generator$1(this, function(_state) {
7347
+ switch(_state.label){
7348
+ case 0:
7349
+ _tmp = {};
7350
+ _tmp1 = {
7351
+ 'Content-Type': 'application/json'
7352
+ };
7353
+ _1 = (_ = "Bearer ").concat;
7354
+ return [
7355
+ 4,
7356
+ accessTokenStringFactory()
7357
+ ];
7358
+ case 1:
7359
+ return [
7360
+ 2,
7361
+ (_tmp.headers = (_tmp1.Authorization = _1.apply(_, [
7362
+ _state.sent()
7363
+ ]), _tmp1.orgId = input.orgId, _tmp1), _tmp)
7364
+ ];
7365
+ }
7366
+ });
7367
+ })();
7368
+ },
7369
+ fetchHandler: fetchHandler,
7370
+ timeout: 20 * 1000,
7371
+ requireOkResponse: true,
7372
+ useTimeout: true // use timeout
7373
+ });
7374
+ } : _factoryConfig_fetchFactory;
7375
+ return function(config) {
7376
+ if (!config.apiUrl) {
7377
+ throw new Error('ZohoDeskConfig missing api url.');
7378
+ }
7379
+ if (!config.orgId) {
7380
+ throw new Error('ZohoDeskConfig missing orgId.');
7381
+ }
7382
+ var apiUrl = zohoDeskConfigApiUrl(config.apiUrl);
7383
+ var baseFetch = fetchFactory({
7384
+ apiUrl: apiUrl,
7385
+ orgId: config.orgId
7386
+ });
7387
+ var fetch = handleZohoDeskErrorFetch(baseFetch, logZohoServerErrorFunction, function(x) {
7388
+ if (_instanceof(x, ZohoInvalidTokenError)) {
7389
+ void accountsContext.loadAccessToken.resetAccessToken();
7390
+ }
7391
+ });
7392
+ var fetchJson = fetchJsonFunction(fetch, {
7393
+ interceptJsonResponse: interceptZohoDesk200StatusWithErrorResponse,
7394
+ handleFetchJsonParseErrorFunction: returnNullHandleFetchJsonParseErrorFunction
7395
+ });
7396
+ var deskContext = {
7397
+ fetch: fetch,
7398
+ fetchJson: fetchJson,
7399
+ accessTokenStringFactory: accessTokenStringFactory,
7400
+ config: _object_spread_props$9(_object_spread$9({}, config), {
7401
+ apiUrl: apiUrl
7402
+ }),
7403
+ zohoRateLimiter: fetchHandler._rateLimiter
7404
+ };
7405
+ var zohoDesk = {
7406
+ deskContext: deskContext
7407
+ };
7408
+ return zohoDesk;
7409
+ };
7410
+ }
7411
+
7412
+ function _define_property$8(obj, key, value) {
7413
+ if (key in obj) {
7414
+ Object.defineProperty(obj, key, {
7415
+ value: value,
7416
+ enumerable: true,
7417
+ configurable: true,
7418
+ writable: true
7419
+ });
7420
+ } else {
7421
+ obj[key] = value;
7422
+ }
7423
+ return obj;
7424
+ }
7425
+ function _object_spread$8(target) {
7426
+ for(var i = 1; i < arguments.length; i++){
7427
+ var source = arguments[i] != null ? arguments[i] : {};
7428
+ var ownKeys = Object.keys(source);
7429
+ if (typeof Object.getOwnPropertySymbols === "function") {
7430
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7431
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7432
+ }));
7433
+ }
7434
+ ownKeys.forEach(function(key) {
7435
+ _define_property$8(target, key, source[key]);
7436
+ });
7437
+ }
7438
+ return target;
7439
+ }
7440
+ function ownKeys$8(object, enumerableOnly) {
7441
+ var keys = Object.keys(object);
7442
+ if (Object.getOwnPropertySymbols) {
7443
+ var symbols = Object.getOwnPropertySymbols(object);
7444
+ keys.push.apply(keys, symbols);
7445
+ }
7446
+ return keys;
7447
+ }
7448
+ function _object_spread_props$8(target, source) {
7449
+ source = source != null ? source : {};
7450
+ if (Object.getOwnPropertyDescriptors) {
7451
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7452
+ } else {
7453
+ ownKeys$8(Object(source)).forEach(function(key) {
7454
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7455
+ });
7456
+ }
7457
+ return target;
7458
+ }
7459
+ // MARK: Page Filter
7460
+ /**
7461
+ * Maximum number of records per page for Zoho Desk list endpoints.
7462
+ */ var ZOHO_DESK_MAX_PAGE_LIMIT = 50;
7463
+ /**
7464
+ * Default number of records per page for Zoho Desk list endpoints.
7465
+ */ var ZOHO_DESK_DEFAULT_PAGE_LIMIT = 25;
7466
+ /**
7467
+ * Creates a page factory that wraps a Zoho Desk fetch function with automatic offset-based pagination.
7468
+ *
7469
+ * The factory determines whether additional pages exist by comparing the number of returned records
7470
+ * against the requested `limit`. If `data.length >= limit`, more records are assumed to exist.
7471
+ * The `from` offset is automatically advanced by `limit` for subsequent requests.
7472
+ *
7473
+ * @param fetch - The Zoho Desk fetch function to paginate over
7474
+ * @param defaults - Optional default configuration for the page factory
7475
+ * @returns A page factory that produces iterable page fetchers
7476
+ *
7477
+ * @example
7478
+ * ```typescript
7479
+ * const pageFactory = zohoDeskFetchPageFactory(zohoDeskGetTickets(context));
7480
+ *
7481
+ * const fetchPage = pageFactory({ limit: 25 });
7482
+ * const firstPage = await fetchPage.fetchNext();
7483
+ *
7484
+ * if (firstPage.result.data.length >= 25) {
7485
+ * const secondPage = await firstPage.fetchNext();
7486
+ * }
7487
+ * ```
7488
+ */ function zohoDeskFetchPageFactory(fetch, defaults) {
7489
+ return fetchPageFactory(_object_spread_props$8(_object_spread$8({}, defaults), {
7490
+ fetch: fetch,
7491
+ readFetchPageResultInfo: function readFetchPageResultInfo(result) {
7492
+ var _ref;
7493
+ var _result_data;
7494
+ var dataLength = (_ref = (_result_data = result.data) === null || _result_data === void 0 ? void 0 : _result_data.length) !== null && _ref !== void 0 ? _ref : 0;
7495
+ return {
7496
+ hasNext: dataLength > 0 && dataLength >= ZOHO_DESK_DEFAULT_PAGE_LIMIT
7497
+ };
7498
+ },
7499
+ buildInputForNextPage: function buildInputForNextPage(pageResult, input, options) {
7500
+ var _ref, _options_maxItemsPerPage, _input_from;
7501
+ var limit = (_ref = (_options_maxItemsPerPage = options.maxItemsPerPage) !== null && _options_maxItemsPerPage !== void 0 ? _options_maxItemsPerPage : input.limit) !== null && _ref !== void 0 ? _ref : ZOHO_DESK_DEFAULT_PAGE_LIMIT;
7502
+ var previousFrom = (_input_from = input.from) !== null && _input_from !== void 0 ? _input_from : 1;
7503
+ var nextFrom = previousFrom + limit;
7504
+ return _object_spread_props$8(_object_spread$8({}, input), {
7505
+ from: nextFrom,
7506
+ limit: limit
7507
+ });
7508
+ }
7509
+ }));
7510
+ }
7511
+
7512
+ function _define_property$7(obj, key, value) {
7513
+ if (key in obj) {
7514
+ Object.defineProperty(obj, key, {
7515
+ value: value,
7516
+ enumerable: true,
7517
+ configurable: true,
7518
+ writable: true
7519
+ });
7520
+ } else {
7521
+ obj[key] = value;
7522
+ }
7523
+ return obj;
7524
+ }
7525
+ function _object_spread$7(target) {
7526
+ for(var i = 1; i < arguments.length; i++){
7527
+ var source = arguments[i] != null ? arguments[i] : {};
7528
+ var ownKeys = Object.keys(source);
7529
+ if (typeof Object.getOwnPropertySymbols === "function") {
7530
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7531
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7532
+ }));
7533
+ }
7534
+ ownKeys.forEach(function(key) {
7535
+ _define_property$7(target, key, source[key]);
7536
+ });
7537
+ }
7538
+ return target;
7539
+ }
7540
+ function ownKeys$7(object, enumerableOnly) {
7541
+ var keys = Object.keys(object);
7542
+ if (Object.getOwnPropertySymbols) {
7543
+ var symbols = Object.getOwnPropertySymbols(object);
7544
+ keys.push.apply(keys, symbols);
7545
+ }
7546
+ return keys;
7547
+ }
7548
+ function _object_spread_props$7(target, source) {
7549
+ source = source != null ? source : {};
7550
+ if (Object.getOwnPropertyDescriptors) {
7551
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7552
+ } else {
7553
+ ownKeys$7(Object(source)).forEach(function(key) {
7554
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7555
+ });
7556
+ }
7557
+ return target;
7558
+ }
7559
+ function _object_without_properties$7(source, excluded) {
7560
+ if (source == null) return {};
7561
+ var target = {}, sourceKeys, key, i;
7562
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
7563
+ sourceKeys = Reflect.ownKeys(Object(source));
7564
+ for(i = 0; i < sourceKeys.length; i++){
7565
+ key = sourceKeys[i];
7566
+ if (excluded.indexOf(key) >= 0) continue;
7567
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7568
+ target[key] = source[key];
7569
+ }
7570
+ return target;
7571
+ }
7572
+ target = _object_without_properties_loose$7(source, excluded);
7573
+ if (Object.getOwnPropertySymbols) {
7574
+ sourceKeys = Object.getOwnPropertySymbols(source);
7575
+ for(i = 0; i < sourceKeys.length; i++){
7576
+ key = sourceKeys[i];
7577
+ if (excluded.indexOf(key) >= 0) continue;
7578
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7579
+ target[key] = source[key];
7580
+ }
7581
+ }
7582
+ return target;
7583
+ }
7584
+ function _object_without_properties_loose$7(source, excluded) {
7585
+ if (source == null) return {};
7586
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
7587
+ for(i = 0; i < sourceKeys.length; i++){
7588
+ key = sourceKeys[i];
7589
+ if (excluded.indexOf(key) >= 0) continue;
7590
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7591
+ target[key] = source[key];
7592
+ }
7593
+ return target;
7594
+ }
7595
+ // MARK: Utility
7596
+ /**
7597
+ * Constructs the standard FetchJsonInput used by Desk API calls, pairing the HTTP method with an optional body.
7598
+ *
7599
+ * @param method - HTTP method to use for the request
7600
+ * @param body - Optional request body to include
7601
+ * @returns Configured fetch input for the Zoho Desk API call
7602
+ */ function zohoDeskApiFetchJsonInput(method, body) {
7603
+ return {
7604
+ method: method,
7605
+ body: body !== null && body !== void 0 ? body : undefined
7606
+ };
7607
+ }
7608
+ /**
7609
+ * Builds URL search params from the input objects, omitting keys that are used in the URL path.
7610
+ *
7611
+ * @param input - One or more objects to convert into URL search parameters
7612
+ * @param omitKeys - Keys to exclude from the search params
7613
+ * @returns URL search params string
7614
+ */ function zohoDeskUrlSearchParams(input, omitKeys) {
7615
+ return makeUrlSearchParams(input, {
7616
+ omitKeys: omitKeys
7617
+ });
7618
+ }
7619
+ /**
7620
+ * Joins include values into a comma-separated string.
7621
+ *
7622
+ * @param include - Single or array of include values
7623
+ * @returns Comma-separated string, or undefined if no values provided
7624
+ */ function joinInclude(include) {
7625
+ var result;
7626
+ if (include) {
7627
+ result = joinStringsWithCommas(asArray(include));
7628
+ }
7629
+ return result;
7630
+ }
7631
+ /**
7632
+ * Creates a {@link ZohoDeskGetTicketsFunction} bound to the given context.
7633
+ *
7634
+ * Retrieves a paginated list of tickets from Zoho Desk, with optional filtering by
7635
+ * department, status, priority, channel, assignee, and view.
7636
+ *
7637
+ * @param context - Authenticated Zoho Desk context
7638
+ * @returns Function that retrieves paginated tickets
7639
+ */ function zohoDeskGetTickets(context) {
7640
+ return function(input) {
7641
+ var include = input.include, rest = _object_without_properties$7(input, [
7642
+ "include"
7643
+ ]);
7644
+ var params = zohoDeskUrlSearchParams([
7645
+ _object_spread_props$7(_object_spread$7({}, rest), {
7646
+ include: joinInclude(include)
7647
+ })
7648
+ ]);
7649
+ return context.fetchJson("/tickets?".concat(params), zohoDeskApiFetchJsonInput('GET')).then(function(x) {
7650
+ return x !== null && x !== void 0 ? x : {
7651
+ data: []
7652
+ };
7653
+ });
7654
+ };
7655
+ }
7656
+ /**
7657
+ * Creates a {@link ZohoDeskGetTicketByIdFunction} bound to the given context.
7658
+ *
7659
+ * Retrieves a single ticket by its ID, with optional inline expansion of related entities.
7660
+ *
7661
+ * @param context - Authenticated Zoho Desk context
7662
+ * @returns Function that retrieves a single ticket
7663
+ */ function zohoDeskGetTicketById(context) {
7664
+ return function(input) {
7665
+ var ticketId = input.ticketId, include = input.include;
7666
+ var params = zohoDeskUrlSearchParams([
7667
+ {
7668
+ include: joinInclude(include)
7669
+ }
7670
+ ]);
7671
+ var queryString = params.toString();
7672
+ return context.fetchJson("/tickets/".concat(ticketId).concat(queryString ? "?".concat(queryString) : ''), zohoDeskApiFetchJsonInput('GET'));
7673
+ };
7674
+ }
7675
+ /**
7676
+ * Creates a {@link ZohoDeskSearchTicketsFunction} bound to the given context.
7677
+ *
7678
+ * Searches for tickets matching the given filter criteria. Supports filtering by
7679
+ * many fields including subject, email, status, priority, date ranges, and custom fields.
7680
+ *
7681
+ * @param context - Authenticated Zoho Desk context
7682
+ * @returns Function that searches for tickets
7683
+ */ function zohoDeskSearchTickets(context) {
7684
+ return function(input) {
7685
+ var params = zohoDeskUrlSearchParams([
7686
+ input
7687
+ ]);
7688
+ return context.fetchJson("/tickets/search?".concat(params), zohoDeskApiFetchJsonInput('GET')).then(function(x) {
7689
+ return x !== null && x !== void 0 ? x : {
7690
+ data: []
7691
+ };
7692
+ });
7693
+ };
7694
+ }
7695
+ /**
7696
+ * Creates a {@link ZohoDeskGetTicketsForContactFunction} bound to the given context.
7697
+ *
7698
+ * @param context - Authenticated Zoho Desk context
7699
+ * @returns Function that retrieves tickets for a contact
7700
+ */ function zohoDeskGetTicketsForContact(context) {
7701
+ return function(input) {
7702
+ var contactId = input.contactId, include = input.include, rest = _object_without_properties$7(input, [
7703
+ "contactId",
7704
+ "include"
7705
+ ]);
7706
+ var params = zohoDeskUrlSearchParams([
7707
+ _object_spread_props$7(_object_spread$7({}, rest), {
7708
+ include: joinInclude(include)
7709
+ })
7710
+ ]);
7711
+ return context.fetchJson("/contacts/".concat(contactId, "/tickets?").concat(params), zohoDeskApiFetchJsonInput('GET')).then(function(x) {
7712
+ return x !== null && x !== void 0 ? x : {
7713
+ data: []
7714
+ };
7715
+ });
7716
+ };
7717
+ }
7718
+ /**
7719
+ * Creates a {@link ZohoDeskGetTicketsForProductFunction} bound to the given context.
7720
+ *
7721
+ * @param context - Authenticated Zoho Desk context
7722
+ * @returns Function that retrieves tickets for a product
7723
+ */ function zohoDeskGetTicketsForProduct(context) {
7724
+ return function(input) {
7725
+ var productId = input.productId, include = input.include, rest = _object_without_properties$7(input, [
7726
+ "productId",
7727
+ "include"
7728
+ ]);
7729
+ var params = zohoDeskUrlSearchParams([
7730
+ _object_spread_props$7(_object_spread$7({}, rest), {
7731
+ include: joinInclude(include)
7732
+ })
7733
+ ]);
7734
+ return context.fetchJson("/products/".concat(productId, "/tickets?").concat(params), zohoDeskApiFetchJsonInput('GET')).then(function(x) {
7735
+ return x !== null && x !== void 0 ? x : {
7736
+ data: []
7737
+ };
7738
+ });
7739
+ };
7740
+ }
7741
+ /**
7742
+ * Creates a {@link ZohoDeskGetTicketMetricsFunction} bound to the given context.
7743
+ *
7744
+ * @param context - Authenticated Zoho Desk context
7745
+ * @returns Function that retrieves ticket metrics
7746
+ */ function zohoDeskGetTicketMetrics(context) {
7747
+ return function(input) {
7748
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/metrics"), zohoDeskApiFetchJsonInput('GET'));
7749
+ };
7750
+ }
7751
+ /**
7752
+ * Creates a {@link ZohoDeskGetAgentsTicketsCountFunction} bound to the given context.
7753
+ *
7754
+ * @param context - Authenticated Zoho Desk context
7755
+ * @returns Function that retrieves agent ticket counts
7756
+ */ function zohoDeskGetAgentsTicketsCount(context) {
7757
+ return function(input) {
7758
+ var params = zohoDeskUrlSearchParams([
7759
+ {
7760
+ agentIds: joinStringsWithCommas(asArray(input.agentIds)),
7761
+ departmentId: input.departmentId
7762
+ }
7763
+ ]);
7764
+ return context.fetchJson("/agentsTicketsCount?".concat(params), zohoDeskApiFetchJsonInput('GET'));
7765
+ };
7766
+ }
7767
+ /**
7768
+ * Creates a {@link ZohoDeskGetTicketsPageFactory} bound to the given context.
7769
+ *
7770
+ * Returns a page factory that automatically handles Zoho Desk's offset-based pagination,
7771
+ * making it easy to iterate through all tickets across multiple pages.
7772
+ *
7773
+ * @param context - Authenticated Zoho Desk context
7774
+ * @returns Page factory for iterating over ticket results
7775
+ */ function zohoDeskGetTicketsPageFactory(context) {
7776
+ return zohoDeskFetchPageFactory(zohoDeskGetTickets(context));
7777
+ }
7778
+ /**
7779
+ * Creates a {@link ZohoDeskSearchTicketsPageFactory} bound to the given context.
7780
+ *
7781
+ * @param context - Authenticated Zoho Desk context
7782
+ * @returns Page factory for iterating over search results
7783
+ */ function zohoDeskSearchTicketsPageFactory(context) {
7784
+ return zohoDeskFetchPageFactory(zohoDeskSearchTickets(context));
7785
+ }
7786
+
7787
+ // MARK: Utility
7788
+ function zohoDeskDepartmentApiFetchJsonInput(method) {
7789
+ return {
7790
+ method: method
7791
+ };
7792
+ }
7793
+ /**
7794
+ * Creates a {@link ZohoDeskGetDepartmentsFunction} bound to the given context.
7795
+ *
7796
+ * Retrieves a paginated list of departments from Zoho Desk, with optional filtering
7797
+ * by chat status, search string, and enabled state.
7798
+ *
7799
+ * @param context - Authenticated Zoho Desk context
7800
+ * @returns Function that retrieves paginated departments
7801
+ */ function zohoDeskGetDepartments(context) {
7802
+ return function(input) {
7803
+ var params = makeUrlSearchParams([
7804
+ input
7805
+ ]);
7806
+ return context.fetchJson("/departments?".concat(params), zohoDeskDepartmentApiFetchJsonInput('GET')).then(function(x) {
7807
+ return x !== null && x !== void 0 ? x : {
7808
+ data: []
7809
+ };
7810
+ });
7811
+ };
7812
+ }
7813
+ /**
7814
+ * Creates a {@link ZohoDeskGetDepartmentByIdFunction} bound to the given context.
7815
+ *
7816
+ * @param context - Authenticated Zoho Desk context
7817
+ * @returns Function that retrieves a single department
7818
+ */ function zohoDeskGetDepartmentById(context) {
7819
+ return function(input) {
7820
+ return context.fetchJson("/departments/".concat(input.departmentId), zohoDeskDepartmentApiFetchJsonInput('GET'));
7821
+ };
7822
+ }
7823
+
7824
+ function _define_property$6(obj, key, value) {
7825
+ if (key in obj) {
7826
+ Object.defineProperty(obj, key, {
7827
+ value: value,
7828
+ enumerable: true,
7829
+ configurable: true,
7830
+ writable: true
7831
+ });
7832
+ } else {
7833
+ obj[key] = value;
7834
+ }
7835
+ return obj;
7836
+ }
7837
+ function _object_spread$6(target) {
7838
+ for(var i = 1; i < arguments.length; i++){
7839
+ var source = arguments[i] != null ? arguments[i] : {};
7840
+ var ownKeys = Object.keys(source);
7841
+ if (typeof Object.getOwnPropertySymbols === "function") {
7842
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7843
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7844
+ }));
7845
+ }
7846
+ ownKeys.forEach(function(key) {
7847
+ _define_property$6(target, key, source[key]);
7848
+ });
7849
+ }
7850
+ return target;
7851
+ }
7852
+ function ownKeys$6(object, enumerableOnly) {
7853
+ var keys = Object.keys(object);
7854
+ if (Object.getOwnPropertySymbols) {
7855
+ var symbols = Object.getOwnPropertySymbols(object);
7856
+ keys.push.apply(keys, symbols);
7857
+ }
7858
+ return keys;
7859
+ }
7860
+ function _object_spread_props$6(target, source) {
7861
+ source = source != null ? source : {};
7862
+ if (Object.getOwnPropertyDescriptors) {
7863
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7864
+ } else {
7865
+ ownKeys$6(Object(source)).forEach(function(key) {
7866
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7867
+ });
7868
+ }
7869
+ return target;
7870
+ }
7871
+ function _object_without_properties$6(source, excluded) {
7872
+ if (source == null) return {};
7873
+ var target = {}, sourceKeys, key, i;
7874
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
7875
+ sourceKeys = Reflect.ownKeys(Object(source));
7876
+ for(i = 0; i < sourceKeys.length; i++){
7877
+ key = sourceKeys[i];
7878
+ if (excluded.indexOf(key) >= 0) continue;
7879
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7880
+ target[key] = source[key];
7881
+ }
7882
+ return target;
7883
+ }
7884
+ target = _object_without_properties_loose$6(source, excluded);
7885
+ if (Object.getOwnPropertySymbols) {
7886
+ sourceKeys = Object.getOwnPropertySymbols(source);
7887
+ for(i = 0; i < sourceKeys.length; i++){
7888
+ key = sourceKeys[i];
7889
+ if (excluded.indexOf(key) >= 0) continue;
7890
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7891
+ target[key] = source[key];
7892
+ }
7893
+ }
7894
+ return target;
7895
+ }
7896
+ function _object_without_properties_loose$6(source, excluded) {
7897
+ if (source == null) return {};
7898
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
7899
+ for(i = 0; i < sourceKeys.length; i++){
7900
+ key = sourceKeys[i];
7901
+ if (excluded.indexOf(key) >= 0) continue;
7902
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7903
+ target[key] = source[key];
7904
+ }
7905
+ return target;
7906
+ }
7907
+ // MARK: Utility
7908
+ function zohoDeskContactApiFetchJsonInput(method) {
7909
+ return {
7910
+ method: method
7911
+ };
7912
+ }
7913
+ /**
7914
+ * Joins include values into a comma-separated string.
7915
+ *
7916
+ * @param include - Single or array of include values
7917
+ * @returns Comma-separated string, or undefined if no values provided
7918
+ */ function joinContactInclude(include) {
7919
+ var result;
7920
+ if (include) {
7921
+ result = joinStringsWithCommas(asArray(include));
7922
+ }
7923
+ return result;
7924
+ }
7925
+ /**
7926
+ * Creates a {@link ZohoDeskGetContactsFunction} bound to the given context.
7927
+ *
7928
+ * Retrieves a paginated list of contacts from Zoho Desk, with optional sorting,
7929
+ * inline expansion of related entities, and custom view filtering.
7930
+ *
7931
+ * @param context - Authenticated Zoho Desk context
7932
+ * @returns Function that retrieves paginated contacts
7933
+ */ function zohoDeskGetContacts(context) {
7934
+ return function(input) {
7935
+ var include = input.include, rest = _object_without_properties$6(input, [
7936
+ "include"
7937
+ ]);
7938
+ var params = makeUrlSearchParams([
7939
+ _object_spread_props$6(_object_spread$6({}, rest), {
7940
+ include: joinContactInclude(include)
7941
+ })
7942
+ ]);
7943
+ return context.fetchJson("/contacts?".concat(params), zohoDeskContactApiFetchJsonInput('GET')).then(function(x) {
7944
+ return x !== null && x !== void 0 ? x : {
7945
+ data: []
7946
+ };
7947
+ });
7948
+ };
7949
+ }
7950
+ /**
7951
+ * Creates a {@link ZohoDeskGetContactByIdFunction} bound to the given context.
7952
+ *
7953
+ * @param context - Authenticated Zoho Desk context
7954
+ * @returns Function that retrieves a single contact
7955
+ */ function zohoDeskGetContactById(context) {
7956
+ return function(input) {
7957
+ var contactId = input.contactId, include = input.include;
7958
+ var params = makeUrlSearchParams([
7959
+ {
7960
+ include: joinContactInclude(include)
7961
+ }
7962
+ ]);
7963
+ var queryString = params.toString();
7964
+ return context.fetchJson("/contacts/".concat(contactId).concat(queryString ? "?".concat(queryString) : ''), zohoDeskContactApiFetchJsonInput('GET'));
7965
+ };
7966
+ }
7967
+ /**
7968
+ * Creates a {@link ZohoDeskGetContactsByIdsFunction} bound to the given context.
7969
+ *
7970
+ * Retrieves multiple contacts in a single request by providing their IDs.
7971
+ *
7972
+ * @param context - Authenticated Zoho Desk context
7973
+ * @returns Function that retrieves contacts by IDs
7974
+ */ function zohoDeskGetContactsByIds(context) {
7975
+ return function(input) {
7976
+ var params = makeUrlSearchParams([
7977
+ {
7978
+ contactIds: joinStringsWithCommas(asArray(input.contactIds))
7979
+ }
7980
+ ]);
7981
+ return context.fetchJson("/contacts/contactsByIds?".concat(params), zohoDeskContactApiFetchJsonInput('GET')).then(function(x) {
7982
+ return x !== null && x !== void 0 ? x : [];
7983
+ });
7984
+ };
7985
+ }
7986
+ /**
7987
+ * Creates a {@link ZohoDeskGetContactsPageFactory} bound to the given context.
7988
+ *
7989
+ * @param context - Authenticated Zoho Desk context
7990
+ * @returns Page factory for iterating over contact results
7991
+ */ function zohoDeskGetContactsPageFactory(context) {
7992
+ return zohoDeskFetchPageFactory(zohoDeskGetContacts(context));
7993
+ }
7994
+
7995
+ // MARK: Utility
7996
+ function zohoDeskTagApiFetchJsonInput(method, body) {
7997
+ return {
7998
+ method: method,
7999
+ body: body !== null && body !== void 0 ? body : undefined
8000
+ };
8001
+ }
8002
+ /**
8003
+ * Creates a {@link ZohoDeskGetTicketTagsFunction} bound to the given context.
8004
+ *
8005
+ * @param context - Authenticated Zoho Desk context
8006
+ * @returns Function that retrieves tags for a ticket
8007
+ */ function zohoDeskGetTicketTags(context) {
8008
+ return function(input) {
8009
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/tags"), zohoDeskTagApiFetchJsonInput('GET')).then(function(x) {
8010
+ return x !== null && x !== void 0 ? x : [];
8011
+ });
8012
+ };
8013
+ }
8014
+ /**
8015
+ * Creates a {@link ZohoDeskAssociateTicketTagsFunction} bound to the given context.
8016
+ *
8017
+ * Associates one or more tags with a ticket. If the tag does not exist, it will be created.
8018
+ *
8019
+ * @param context - Authenticated Zoho Desk context
8020
+ * @returns Function that associates tags with a ticket
8021
+ */ function zohoDeskAssociateTicketTags(context) {
8022
+ return function(input) {
8023
+ var body = {
8024
+ tags: asArray(input.tags).map(function(name) {
8025
+ return {
8026
+ name: name
8027
+ };
8028
+ })
8029
+ };
8030
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/tags"), zohoDeskTagApiFetchJsonInput('POST', body)).then(function(x) {
8031
+ return x !== null && x !== void 0 ? x : [];
8032
+ });
8033
+ };
8034
+ }
8035
+ /**
8036
+ * Creates a {@link ZohoDeskDissociateTicketTagFunction} bound to the given context.
8037
+ *
8038
+ * @param context - Authenticated Zoho Desk context
8039
+ * @returns Function that removes a tag from a ticket
8040
+ */ function zohoDeskDissociateTicketTag(context) {
8041
+ return function(input) {
8042
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/tags/").concat(input.tagId), zohoDeskTagApiFetchJsonInput('DELETE'));
8043
+ };
8044
+ }
8045
+ /**
8046
+ * Creates a {@link ZohoDeskSearchTagsFunction} bound to the given context.
8047
+ *
8048
+ * @param context - Authenticated Zoho Desk context
8049
+ * @returns Function that searches for tags
8050
+ */ function zohoDeskSearchTags(context) {
8051
+ return function(input) {
8052
+ var params = makeUrlSearchParams([
8053
+ input
8054
+ ]);
8055
+ return context.fetchJson("/tags/search?".concat(params), zohoDeskTagApiFetchJsonInput('GET')).then(function(x) {
8056
+ return x !== null && x !== void 0 ? x : {
8057
+ data: []
8058
+ };
8059
+ });
8060
+ };
8061
+ }
8062
+ /**
8063
+ * Creates a {@link ZohoDeskGetAllTagsFunction} bound to the given context.
8064
+ *
8065
+ * @param context - Authenticated Zoho Desk context
8066
+ * @returns Function that retrieves all tags
8067
+ */ function zohoDeskGetAllTags(context) {
8068
+ return function(input) {
8069
+ var params = makeUrlSearchParams([
8070
+ input
8071
+ ]);
8072
+ return context.fetchJson("/ticketTags?".concat(params), zohoDeskTagApiFetchJsonInput('GET')).then(function(x) {
8073
+ return x !== null && x !== void 0 ? x : {
8074
+ data: []
8075
+ };
8076
+ });
8077
+ };
8078
+ }
8079
+
8080
+ // MARK: Utility
8081
+ function zohoDeskFollowerApiFetchJsonInput(method, body) {
8082
+ return {
8083
+ method: method,
8084
+ body: body !== null && body !== void 0 ? body : undefined
8085
+ };
8086
+ }
8087
+ /**
8088
+ * Creates a {@link ZohoDeskGetTicketFollowersFunction} bound to the given context.
8089
+ *
8090
+ * @param context - Authenticated Zoho Desk context
8091
+ * @returns Function that retrieves followers for a ticket
8092
+ */ function zohoDeskGetTicketFollowers(context) {
8093
+ return function(input) {
8094
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/followers"), zohoDeskFollowerApiFetchJsonInput('GET')).then(function(x) {
8095
+ return x !== null && x !== void 0 ? x : [];
8096
+ });
8097
+ };
8098
+ }
8099
+ /**
8100
+ * Creates a {@link ZohoDeskAddTicketFollowersFunction} bound to the given context.
8101
+ *
8102
+ * @param context - Authenticated Zoho Desk context
8103
+ * @returns Function that adds followers to a ticket
8104
+ */ function zohoDeskAddTicketFollowers(context) {
8105
+ return function(input) {
8106
+ var body = {
8107
+ ids: asArray(input.agentIds)
8108
+ };
8109
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/followers"), zohoDeskFollowerApiFetchJsonInput('POST', body));
8110
+ };
8111
+ }
8112
+ /**
8113
+ * Creates a {@link ZohoDeskRemoveTicketFollowersFunction} bound to the given context.
8114
+ *
8115
+ * @param context - Authenticated Zoho Desk context
8116
+ * @returns Function that removes followers from a ticket
8117
+ */ function zohoDeskRemoveTicketFollowers(context) {
8118
+ return function(input) {
8119
+ var body = {
8120
+ ids: asArray(input.agentIds)
8121
+ };
8122
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/followers"), zohoDeskFollowerApiFetchJsonInput('DELETE', body));
8123
+ };
8124
+ }
8125
+
8126
+ function _define_property$5(obj, key, value) {
8127
+ if (key in obj) {
8128
+ Object.defineProperty(obj, key, {
8129
+ value: value,
8130
+ enumerable: true,
8131
+ configurable: true,
8132
+ writable: true
8133
+ });
8134
+ } else {
8135
+ obj[key] = value;
8136
+ }
8137
+ return obj;
8138
+ }
8139
+ function _object_spread$5(target) {
8140
+ for(var i = 1; i < arguments.length; i++){
8141
+ var source = arguments[i] != null ? arguments[i] : {};
8142
+ var ownKeys = Object.keys(source);
8143
+ if (typeof Object.getOwnPropertySymbols === "function") {
8144
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
8145
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
8146
+ }));
8147
+ }
8148
+ ownKeys.forEach(function(key) {
8149
+ _define_property$5(target, key, source[key]);
8150
+ });
8151
+ }
8152
+ return target;
8153
+ }
8154
+ function ownKeys$5(object, enumerableOnly) {
8155
+ var keys = Object.keys(object);
8156
+ if (Object.getOwnPropertySymbols) {
8157
+ var symbols = Object.getOwnPropertySymbols(object);
8158
+ keys.push.apply(keys, symbols);
8159
+ }
8160
+ return keys;
8161
+ }
8162
+ function _object_spread_props$5(target, source) {
8163
+ source = source != null ? source : {};
8164
+ if (Object.getOwnPropertyDescriptors) {
8165
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8166
+ } else {
8167
+ ownKeys$5(Object(source)).forEach(function(key) {
8168
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8169
+ });
8170
+ }
8171
+ return target;
8172
+ }
8173
+ function _object_without_properties$5(source, excluded) {
8174
+ if (source == null) return {};
8175
+ var target = {}, sourceKeys, key, i;
8176
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
8177
+ sourceKeys = Reflect.ownKeys(Object(source));
8178
+ for(i = 0; i < sourceKeys.length; i++){
8179
+ key = sourceKeys[i];
8180
+ if (excluded.indexOf(key) >= 0) continue;
8181
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8182
+ target[key] = source[key];
8183
+ }
8184
+ return target;
8185
+ }
8186
+ target = _object_without_properties_loose$5(source, excluded);
8187
+ if (Object.getOwnPropertySymbols) {
8188
+ sourceKeys = Object.getOwnPropertySymbols(source);
8189
+ for(i = 0; i < sourceKeys.length; i++){
8190
+ key = sourceKeys[i];
8191
+ if (excluded.indexOf(key) >= 0) continue;
8192
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8193
+ target[key] = source[key];
8194
+ }
8195
+ }
8196
+ return target;
8197
+ }
8198
+ function _object_without_properties_loose$5(source, excluded) {
8199
+ if (source == null) return {};
8200
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
8201
+ for(i = 0; i < sourceKeys.length; i++){
8202
+ key = sourceKeys[i];
8203
+ if (excluded.indexOf(key) >= 0) continue;
8204
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8205
+ target[key] = source[key];
8206
+ }
8207
+ return target;
8208
+ }
8209
+ // MARK: Utility
8210
+ function zohoDeskAttachmentApiFetchJsonInput(method, body) {
8211
+ return {
8212
+ method: method,
8213
+ body: body !== null && body !== void 0 ? body : undefined
8214
+ };
8215
+ }
8216
+ function joinAttachmentInclude(include) {
8217
+ var result;
8218
+ if (include) {
8219
+ result = joinStringsWithCommas(asArray(include));
8220
+ }
8221
+ return result;
8222
+ }
8223
+ /**
8224
+ * Creates a {@link ZohoDeskGetTicketAttachmentsFunction} bound to the given context.
8225
+ *
8226
+ * @param context - Authenticated Zoho Desk context
8227
+ * @returns Function that retrieves attachments for a ticket
8228
+ */ function zohoDeskGetTicketAttachments(context) {
8229
+ return function(input) {
8230
+ var ticketId = input.ticketId, include = input.include, rest = _object_without_properties$5(input, [
8231
+ "ticketId",
8232
+ "include"
8233
+ ]);
8234
+ var params = makeUrlSearchParams([
8235
+ _object_spread_props$5(_object_spread$5({}, rest), {
8236
+ include: joinAttachmentInclude(include)
8237
+ })
8238
+ ]);
8239
+ return context.fetchJson("/tickets/".concat(ticketId, "/attachments?").concat(params), zohoDeskAttachmentApiFetchJsonInput('GET')).then(function(x) {
8240
+ return x !== null && x !== void 0 ? x : {
8241
+ data: []
8242
+ };
8243
+ });
8244
+ };
8245
+ }
8246
+ /**
8247
+ * Creates a {@link ZohoDeskDeleteTicketAttachmentFunction} bound to the given context.
8248
+ *
8249
+ * @param context - Authenticated Zoho Desk context
8250
+ * @returns Function that deletes a ticket attachment
8251
+ */ function zohoDeskDeleteTicketAttachment(context) {
8252
+ return function(input) {
8253
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/attachments/").concat(input.attachmentId), zohoDeskAttachmentApiFetchJsonInput('DELETE'));
8254
+ };
8255
+ }
8256
+
8257
+ function _define_property$4(obj, key, value) {
8258
+ if (key in obj) {
8259
+ Object.defineProperty(obj, key, {
8260
+ value: value,
8261
+ enumerable: true,
8262
+ configurable: true,
8263
+ writable: true
8264
+ });
8265
+ } else {
8266
+ obj[key] = value;
8267
+ }
8268
+ return obj;
8269
+ }
8270
+ function _object_spread$4(target) {
8271
+ for(var i = 1; i < arguments.length; i++){
8272
+ var source = arguments[i] != null ? arguments[i] : {};
8273
+ var ownKeys = Object.keys(source);
8274
+ if (typeof Object.getOwnPropertySymbols === "function") {
8275
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
8276
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
8277
+ }));
8278
+ }
8279
+ ownKeys.forEach(function(key) {
8280
+ _define_property$4(target, key, source[key]);
8281
+ });
8282
+ }
8283
+ return target;
8284
+ }
8285
+ function ownKeys$4(object, enumerableOnly) {
8286
+ var keys = Object.keys(object);
8287
+ if (Object.getOwnPropertySymbols) {
8288
+ var symbols = Object.getOwnPropertySymbols(object);
8289
+ keys.push.apply(keys, symbols);
8290
+ }
8291
+ return keys;
8292
+ }
8293
+ function _object_spread_props$4(target, source) {
8294
+ source = source != null ? source : {};
8295
+ if (Object.getOwnPropertyDescriptors) {
8296
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8297
+ } else {
8298
+ ownKeys$4(Object(source)).forEach(function(key) {
8299
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8300
+ });
8301
+ }
8302
+ return target;
8303
+ }
8304
+ function _object_without_properties$4(source, excluded) {
8305
+ if (source == null) return {};
8306
+ var target = {}, sourceKeys, key, i;
8307
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
8308
+ sourceKeys = Reflect.ownKeys(Object(source));
8309
+ for(i = 0; i < sourceKeys.length; i++){
8310
+ key = sourceKeys[i];
8311
+ if (excluded.indexOf(key) >= 0) continue;
8312
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8313
+ target[key] = source[key];
8314
+ }
8315
+ return target;
8316
+ }
8317
+ target = _object_without_properties_loose$4(source, excluded);
8318
+ if (Object.getOwnPropertySymbols) {
8319
+ sourceKeys = Object.getOwnPropertySymbols(source);
8320
+ for(i = 0; i < sourceKeys.length; i++){
8321
+ key = sourceKeys[i];
8322
+ if (excluded.indexOf(key) >= 0) continue;
8323
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8324
+ target[key] = source[key];
8325
+ }
8326
+ }
8327
+ return target;
8328
+ }
8329
+ function _object_without_properties_loose$4(source, excluded) {
8330
+ if (source == null) return {};
8331
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
8332
+ for(i = 0; i < sourceKeys.length; i++){
8333
+ key = sourceKeys[i];
8334
+ if (excluded.indexOf(key) >= 0) continue;
8335
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8336
+ target[key] = source[key];
8337
+ }
8338
+ return target;
8339
+ }
8340
+ // MARK: Utility
8341
+ function zohoDeskCommentApiFetchJsonInput(method, body) {
8342
+ return {
8343
+ method: method,
8344
+ body: body !== null && body !== void 0 ? body : undefined
8345
+ };
8346
+ }
8347
+ function joinCommentInclude(include) {
8348
+ var result;
8349
+ if (include) {
8350
+ result = joinStringsWithCommas(asArray(include));
8351
+ }
8352
+ return result;
8353
+ }
8354
+ /**
8355
+ * Creates a {@link ZohoDeskGetTicketCommentsFunction} bound to the given context.
8356
+ *
8357
+ * @param context - Authenticated Zoho Desk context
8358
+ * @returns Function that retrieves comments for a ticket
8359
+ */ function zohoDeskGetTicketComments(context) {
8360
+ return function(input) {
8361
+ var ticketId = input.ticketId, include = input.include, rest = _object_without_properties$4(input, [
8362
+ "ticketId",
8363
+ "include"
8364
+ ]);
8365
+ var params = makeUrlSearchParams([
8366
+ _object_spread_props$4(_object_spread$4({}, rest), {
8367
+ include: joinCommentInclude(include)
8368
+ })
8369
+ ]);
8370
+ return context.fetchJson("/tickets/".concat(ticketId, "/comments?").concat(params), zohoDeskCommentApiFetchJsonInput('GET')).then(function(x) {
8371
+ return x !== null && x !== void 0 ? x : {
8372
+ data: []
8373
+ };
8374
+ });
8375
+ };
8376
+ }
8377
+ /**
8378
+ * Creates a {@link ZohoDeskGetTicketCommentByIdFunction} bound to the given context.
8379
+ *
8380
+ * @param context - Authenticated Zoho Desk context
8381
+ * @returns Function that retrieves a single comment
8382
+ */ function zohoDeskGetTicketCommentById(context) {
8383
+ return function(input) {
8384
+ var ticketId = input.ticketId, commentId = input.commentId, include = input.include;
8385
+ var params = makeUrlSearchParams([
8386
+ {
8387
+ include: joinCommentInclude(include)
8388
+ }
8389
+ ]);
8390
+ var queryString = params.toString();
8391
+ return context.fetchJson("/tickets/".concat(ticketId, "/comments/").concat(commentId).concat(queryString ? "?".concat(queryString) : ''), zohoDeskCommentApiFetchJsonInput('GET'));
8392
+ };
8393
+ }
8394
+ /**
8395
+ * Creates a {@link ZohoDeskCreateTicketCommentFunction} bound to the given context.
8396
+ *
8397
+ * @param context - Authenticated Zoho Desk context
8398
+ * @returns Function that creates a comment on a ticket
8399
+ */ function zohoDeskCreateTicketComment(context) {
8400
+ return function(input) {
8401
+ var ticketId = input.ticketId, body = _object_without_properties$4(input, [
8402
+ "ticketId"
8403
+ ]);
8404
+ return context.fetchJson("/tickets/".concat(ticketId, "/comments"), zohoDeskCommentApiFetchJsonInput('POST', body));
8405
+ };
8406
+ }
8407
+ /**
8408
+ * Creates a {@link ZohoDeskDeleteTicketCommentFunction} bound to the given context.
8409
+ *
8410
+ * @param context - Authenticated Zoho Desk context
8411
+ * @returns Function that deletes a comment from a ticket
8412
+ */ function zohoDeskDeleteTicketComment(context) {
8413
+ return function(input) {
8414
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/comments/").concat(input.commentId), zohoDeskCommentApiFetchJsonInput('DELETE'));
8415
+ };
8416
+ }
8417
+
8418
+ function _object_without_properties$3(source, excluded) {
8419
+ if (source == null) return {};
8420
+ var target = {}, sourceKeys, key, i;
8421
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
8422
+ sourceKeys = Reflect.ownKeys(Object(source));
8423
+ for(i = 0; i < sourceKeys.length; i++){
8424
+ key = sourceKeys[i];
8425
+ if (excluded.indexOf(key) >= 0) continue;
8426
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8427
+ target[key] = source[key];
8428
+ }
8429
+ return target;
8430
+ }
8431
+ target = _object_without_properties_loose$3(source, excluded);
8432
+ if (Object.getOwnPropertySymbols) {
8433
+ sourceKeys = Object.getOwnPropertySymbols(source);
8434
+ for(i = 0; i < sourceKeys.length; i++){
8435
+ key = sourceKeys[i];
8436
+ if (excluded.indexOf(key) >= 0) continue;
8437
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8438
+ target[key] = source[key];
8439
+ }
8440
+ }
8441
+ return target;
8442
+ }
8443
+ function _object_without_properties_loose$3(source, excluded) {
8444
+ if (source == null) return {};
8445
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
8446
+ for(i = 0; i < sourceKeys.length; i++){
8447
+ key = sourceKeys[i];
8448
+ if (excluded.indexOf(key) >= 0) continue;
8449
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8450
+ target[key] = source[key];
8451
+ }
8452
+ return target;
8453
+ }
8454
+ // MARK: Utility
8455
+ function zohoDeskTimeApiFetchJsonInput(method, body) {
8456
+ return {
8457
+ method: method,
8458
+ body: body !== null && body !== void 0 ? body : undefined
8459
+ };
8460
+ }
8461
+ /**
8462
+ * Creates a {@link ZohoDeskGetTicketTimerFunction} bound to the given context.
8463
+ *
8464
+ * @param context - Authenticated Zoho Desk context
8465
+ * @returns Function that retrieves the ticket timer
8466
+ */ function zohoDeskGetTicketTimer(context) {
8467
+ return function(input) {
8468
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/timer"), zohoDeskTimeApiFetchJsonInput('GET'));
8469
+ };
8470
+ }
8471
+ /**
8472
+ * Creates a {@link ZohoDeskPerformTicketTimerActionFunction} bound to the given context.
8473
+ *
8474
+ * @param context - Authenticated Zoho Desk context
8475
+ * @returns Function that performs a timer action on a ticket
8476
+ */ function zohoDeskPerformTicketTimerAction(context) {
8477
+ return function(input) {
8478
+ var ticketId = input.ticketId, body = _object_without_properties$3(input, [
8479
+ "ticketId"
8480
+ ]);
8481
+ return context.fetchJson("/tickets/".concat(ticketId, "/timer"), zohoDeskTimeApiFetchJsonInput('POST', body));
8482
+ };
8483
+ }
8484
+ /**
8485
+ * Creates a {@link ZohoDeskGetTicketTimeEntriesFunction} bound to the given context.
8486
+ *
8487
+ * @param context - Authenticated Zoho Desk context
8488
+ * @returns Function that retrieves time entries for a ticket
8489
+ */ function zohoDeskGetTicketTimeEntries(context) {
8490
+ return function(input) {
8491
+ var ticketId = input.ticketId, rest = _object_without_properties$3(input, [
8492
+ "ticketId"
8493
+ ]);
8494
+ var params = makeUrlSearchParams([
8495
+ rest
8496
+ ]);
8497
+ return context.fetchJson("/tickets/".concat(ticketId, "/timeEntries?").concat(params), zohoDeskTimeApiFetchJsonInput('GET')).then(function(x) {
8498
+ return x !== null && x !== void 0 ? x : {
8499
+ data: []
8500
+ };
8501
+ });
8502
+ };
8503
+ }
8504
+ /**
8505
+ * Creates a {@link ZohoDeskGetTicketTimeEntryByIdFunction} bound to the given context.
8506
+ *
8507
+ * @param context - Authenticated Zoho Desk context
8508
+ * @returns Function that retrieves a single time entry
8509
+ */ function zohoDeskGetTicketTimeEntryById(context) {
8510
+ return function(input) {
8511
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/timeEntries/").concat(input.timeEntryId), zohoDeskTimeApiFetchJsonInput('GET'));
8512
+ };
8513
+ }
8514
+ /**
8515
+ * Creates a {@link ZohoDeskGetTicketTimeEntrySummationFunction} bound to the given context.
8516
+ *
8517
+ * @param context - Authenticated Zoho Desk context
8518
+ * @returns Function that retrieves time entry summation
8519
+ */ function zohoDeskGetTicketTimeEntrySummation(context) {
8520
+ return function(input) {
8521
+ return context.fetchJson("/tickets/".concat(input.ticketId, "/timeEntries/summation"), zohoDeskTimeApiFetchJsonInput('GET'));
8522
+ };
8523
+ }
8524
+
8525
+ function _define_property$3(obj, key, value) {
8526
+ if (key in obj) {
8527
+ Object.defineProperty(obj, key, {
8528
+ value: value,
8529
+ enumerable: true,
8530
+ configurable: true,
8531
+ writable: true
8532
+ });
8533
+ } else {
8534
+ obj[key] = value;
8535
+ }
8536
+ return obj;
8537
+ }
8538
+ function _object_spread$3(target) {
8539
+ for(var i = 1; i < arguments.length; i++){
8540
+ var source = arguments[i] != null ? arguments[i] : {};
8541
+ var ownKeys = Object.keys(source);
8542
+ if (typeof Object.getOwnPropertySymbols === "function") {
8543
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
8544
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
8545
+ }));
8546
+ }
8547
+ ownKeys.forEach(function(key) {
8548
+ _define_property$3(target, key, source[key]);
8549
+ });
8550
+ }
8551
+ return target;
8552
+ }
8553
+ function ownKeys$3(object, enumerableOnly) {
8554
+ var keys = Object.keys(object);
8555
+ if (Object.getOwnPropertySymbols) {
8556
+ var symbols = Object.getOwnPropertySymbols(object);
8557
+ keys.push.apply(keys, symbols);
8558
+ }
8559
+ return keys;
8560
+ }
8561
+ function _object_spread_props$3(target, source) {
8562
+ source = source != null ? source : {};
8563
+ if (Object.getOwnPropertyDescriptors) {
8564
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8565
+ } else {
8566
+ ownKeys$3(Object(source)).forEach(function(key) {
8567
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8568
+ });
8569
+ }
8570
+ return target;
8571
+ }
8572
+ function _object_without_properties$2(source, excluded) {
8573
+ if (source == null) return {};
8574
+ var target = {}, sourceKeys, key, i;
8575
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
8576
+ sourceKeys = Reflect.ownKeys(Object(source));
8577
+ for(i = 0; i < sourceKeys.length; i++){
8578
+ key = sourceKeys[i];
8579
+ if (excluded.indexOf(key) >= 0) continue;
8580
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8581
+ target[key] = source[key];
8582
+ }
8583
+ return target;
8584
+ }
8585
+ target = _object_without_properties_loose$2(source, excluded);
8586
+ if (Object.getOwnPropertySymbols) {
8587
+ sourceKeys = Object.getOwnPropertySymbols(source);
8588
+ for(i = 0; i < sourceKeys.length; i++){
8589
+ key = sourceKeys[i];
8590
+ if (excluded.indexOf(key) >= 0) continue;
8591
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8592
+ target[key] = source[key];
8593
+ }
8594
+ }
8595
+ return target;
8596
+ }
8597
+ function _object_without_properties_loose$2(source, excluded) {
8598
+ if (source == null) return {};
8599
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
8600
+ for(i = 0; i < sourceKeys.length; i++){
8601
+ key = sourceKeys[i];
8602
+ if (excluded.indexOf(key) >= 0) continue;
8603
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8604
+ target[key] = source[key];
8605
+ }
8606
+ return target;
8607
+ }
8608
+ // MARK: Utility
8609
+ function zohoDeskThreadApiFetchJsonInput(method) {
8610
+ return {
8611
+ method: method
8612
+ };
8613
+ }
8614
+ function joinThreadInclude(include) {
8615
+ var result;
8616
+ if (include) {
8617
+ result = joinStringsWithCommas(asArray(include));
8618
+ }
8619
+ return result;
8620
+ }
8621
+ /**
8622
+ * Creates a {@link ZohoDeskGetTicketThreadsFunction} bound to the given context.
8623
+ *
8624
+ * Retrieves a paginated list of conversation threads (emails, replies, notes) for a ticket.
8625
+ *
8626
+ * @param context - Authenticated Zoho Desk context
8627
+ * @returns Function that retrieves threads for a ticket
8628
+ */ function zohoDeskGetTicketThreads(context) {
8629
+ return function(input) {
8630
+ var ticketId = input.ticketId, include = input.include, rest = _object_without_properties$2(input, [
8631
+ "ticketId",
8632
+ "include"
8633
+ ]);
8634
+ var params = makeUrlSearchParams([
8635
+ _object_spread_props$3(_object_spread$3({}, rest), {
8636
+ include: joinThreadInclude(include)
8637
+ })
8638
+ ]);
8639
+ return context.fetchJson("/tickets/".concat(ticketId, "/threads?").concat(params), zohoDeskThreadApiFetchJsonInput('GET')).then(function(x) {
8640
+ return x !== null && x !== void 0 ? x : {
8641
+ data: []
8642
+ };
8643
+ });
8644
+ };
8645
+ }
8646
+ /**
8647
+ * Creates a {@link ZohoDeskGetTicketThreadByIdFunction} bound to the given context.
8648
+ *
8649
+ * @param context - Authenticated Zoho Desk context
8650
+ * @returns Function that retrieves a single thread
8651
+ */ function zohoDeskGetTicketThreadById(context) {
8652
+ return function(input) {
8653
+ var ticketId = input.ticketId, threadId = input.threadId, include = input.include;
8654
+ var params = makeUrlSearchParams([
8655
+ {
8656
+ include: joinThreadInclude(include)
8657
+ }
8658
+ ]);
8659
+ var queryString = params.toString();
8660
+ return context.fetchJson("/tickets/".concat(ticketId, "/threads/").concat(threadId).concat(queryString ? "?".concat(queryString) : ''), zohoDeskThreadApiFetchJsonInput('GET'));
8661
+ };
8662
+ }
8663
+ /**
8664
+ * Creates a {@link ZohoDeskGetTicketThreadsPageFactory} bound to the given context.
8665
+ *
8666
+ * @param context - Authenticated Zoho Desk context
8667
+ * @returns Page factory for iterating over thread results
8668
+ */ function zohoDeskGetTicketThreadsPageFactory(context) {
8669
+ return zohoDeskFetchPageFactory(zohoDeskGetTicketThreads(context));
8670
+ }
8671
+
8672
+ function _define_property$2(obj, key, value) {
8673
+ if (key in obj) {
8674
+ Object.defineProperty(obj, key, {
8675
+ value: value,
8676
+ enumerable: true,
8677
+ configurable: true,
8678
+ writable: true
8679
+ });
8680
+ } else {
8681
+ obj[key] = value;
8682
+ }
8683
+ return obj;
8684
+ }
8685
+ function _object_spread$2(target) {
8686
+ for(var i = 1; i < arguments.length; i++){
8687
+ var source = arguments[i] != null ? arguments[i] : {};
8688
+ var ownKeys = Object.keys(source);
8689
+ if (typeof Object.getOwnPropertySymbols === "function") {
8690
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
8691
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
8692
+ }));
8693
+ }
8694
+ ownKeys.forEach(function(key) {
8695
+ _define_property$2(target, key, source[key]);
8696
+ });
8697
+ }
8698
+ return target;
8699
+ }
8700
+ function ownKeys$2(object, enumerableOnly) {
8701
+ var keys = Object.keys(object);
8702
+ if (Object.getOwnPropertySymbols) {
8703
+ var symbols = Object.getOwnPropertySymbols(object);
8704
+ keys.push.apply(keys, symbols);
8705
+ }
8706
+ return keys;
8707
+ }
8708
+ function _object_spread_props$2(target, source) {
8709
+ source = source != null ? source : {};
8710
+ if (Object.getOwnPropertyDescriptors) {
8711
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8712
+ } else {
8713
+ ownKeys$2(Object(source)).forEach(function(key) {
8714
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8715
+ });
8716
+ }
8717
+ return target;
8718
+ }
8719
+ function _object_without_properties$1(source, excluded) {
8720
+ if (source == null) return {};
8721
+ var target = {}, sourceKeys, key, i;
8722
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
8723
+ sourceKeys = Reflect.ownKeys(Object(source));
8724
+ for(i = 0; i < sourceKeys.length; i++){
8725
+ key = sourceKeys[i];
8726
+ if (excluded.indexOf(key) >= 0) continue;
8727
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8728
+ target[key] = source[key];
8729
+ }
8730
+ return target;
8731
+ }
8732
+ target = _object_without_properties_loose$1(source, excluded);
8733
+ if (Object.getOwnPropertySymbols) {
8734
+ sourceKeys = Object.getOwnPropertySymbols(source);
8735
+ for(i = 0; i < sourceKeys.length; i++){
8736
+ key = sourceKeys[i];
8737
+ if (excluded.indexOf(key) >= 0) continue;
8738
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8739
+ target[key] = source[key];
8740
+ }
8741
+ }
8742
+ return target;
8743
+ }
8744
+ function _object_without_properties_loose$1(source, excluded) {
8745
+ if (source == null) return {};
8746
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
8747
+ for(i = 0; i < sourceKeys.length; i++){
8748
+ key = sourceKeys[i];
8749
+ if (excluded.indexOf(key) >= 0) continue;
8750
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8751
+ target[key] = source[key];
8752
+ }
8753
+ return target;
8754
+ }
8755
+ // MARK: Utility
8756
+ function zohoDeskActivityApiFetchJsonInput(method) {
8757
+ return {
8758
+ method: method
8759
+ };
8760
+ }
8761
+ function joinActivityInclude(include) {
8762
+ var result;
8763
+ if (include) {
8764
+ result = joinStringsWithCommas(asArray(include));
8765
+ }
8766
+ return result;
8767
+ }
8768
+ /**
8769
+ * Creates a {@link ZohoDeskGetTicketActivitiesFunction} bound to the given context.
8770
+ *
8771
+ * Retrieves a paginated list of activities (tasks, events, calls) associated with a ticket.
8772
+ *
8773
+ * @param context - Authenticated Zoho Desk context
8774
+ * @returns Function that retrieves activities for a ticket
8775
+ */ function zohoDeskGetTicketActivities(context) {
8776
+ return function(input) {
8777
+ var ticketId = input.ticketId, include = input.include, rest = _object_without_properties$1(input, [
8778
+ "ticketId",
8779
+ "include"
8780
+ ]);
8781
+ var params = makeUrlSearchParams([
8782
+ _object_spread_props$2(_object_spread$2({}, rest), {
8783
+ include: joinActivityInclude(include)
8784
+ })
8785
+ ]);
8786
+ return context.fetchJson("/tickets/".concat(ticketId, "/activities?").concat(params), zohoDeskActivityApiFetchJsonInput('GET')).then(function(x) {
8787
+ return x !== null && x !== void 0 ? x : {
8788
+ data: []
8789
+ };
8790
+ });
8791
+ };
8792
+ }
8793
+ /**
8794
+ * Creates a {@link ZohoDeskGetTicketActivitiesPageFactory} bound to the given context.
8795
+ *
8796
+ * @param context - Authenticated Zoho Desk context
8797
+ * @returns Page factory for iterating over activity results
8798
+ */ function zohoDeskGetTicketActivitiesPageFactory(context) {
8799
+ return zohoDeskFetchPageFactory(zohoDeskGetTicketActivities(context));
8800
+ }
8801
+
8802
+ function _define_property$1(obj, key, value) {
8803
+ if (key in obj) {
8804
+ Object.defineProperty(obj, key, {
8805
+ value: value,
8806
+ enumerable: true,
8807
+ configurable: true,
8808
+ writable: true
8809
+ });
8810
+ } else {
8811
+ obj[key] = value;
8812
+ }
8813
+ return obj;
8814
+ }
8815
+ function _object_spread$1(target) {
8816
+ for(var i = 1; i < arguments.length; i++){
8817
+ var source = arguments[i] != null ? arguments[i] : {};
8818
+ var ownKeys = Object.keys(source);
8819
+ if (typeof Object.getOwnPropertySymbols === "function") {
8820
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
8821
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
8822
+ }));
8823
+ }
8824
+ ownKeys.forEach(function(key) {
8825
+ _define_property$1(target, key, source[key]);
8826
+ });
8827
+ }
8828
+ return target;
8829
+ }
8830
+ function ownKeys$1(object, enumerableOnly) {
8831
+ var keys = Object.keys(object);
8832
+ if (Object.getOwnPropertySymbols) {
8833
+ var symbols = Object.getOwnPropertySymbols(object);
8834
+ keys.push.apply(keys, symbols);
8835
+ }
8836
+ return keys;
8837
+ }
8838
+ function _object_spread_props$1(target, source) {
8839
+ source = source != null ? source : {};
8840
+ if (Object.getOwnPropertyDescriptors) {
8841
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8842
+ } else {
8843
+ ownKeys$1(Object(source)).forEach(function(key) {
8844
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8845
+ });
8846
+ }
8847
+ return target;
8848
+ }
8849
+ function _object_without_properties(source, excluded) {
8850
+ if (source == null) return {};
8851
+ var target = {}, sourceKeys, key, i;
8852
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
8853
+ sourceKeys = Reflect.ownKeys(Object(source));
8854
+ for(i = 0; i < sourceKeys.length; i++){
8855
+ key = sourceKeys[i];
8856
+ if (excluded.indexOf(key) >= 0) continue;
8857
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8858
+ target[key] = source[key];
8859
+ }
8860
+ return target;
8861
+ }
8862
+ target = _object_without_properties_loose(source, excluded);
8863
+ if (Object.getOwnPropertySymbols) {
8864
+ sourceKeys = Object.getOwnPropertySymbols(source);
8865
+ for(i = 0; i < sourceKeys.length; i++){
8866
+ key = sourceKeys[i];
8867
+ if (excluded.indexOf(key) >= 0) continue;
8868
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8869
+ target[key] = source[key];
8870
+ }
8871
+ }
8872
+ return target;
8873
+ }
8874
+ function _object_without_properties_loose(source, excluded) {
8875
+ if (source == null) return {};
8876
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
8877
+ for(i = 0; i < sourceKeys.length; i++){
8878
+ key = sourceKeys[i];
8879
+ if (excluded.indexOf(key) >= 0) continue;
8880
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
8881
+ target[key] = source[key];
8882
+ }
8883
+ return target;
8884
+ }
8885
+ // MARK: Utility
8886
+ function zohoDeskAgentApiFetchJsonInput(method) {
8887
+ return {
8888
+ method: method
8889
+ };
8890
+ }
8891
+ function joinAgentInclude(include) {
8892
+ var result;
8893
+ if (include) {
8894
+ result = joinStringsWithCommas(asArray(include));
8895
+ }
8896
+ return result;
8897
+ }
8898
+ /**
8899
+ * Creates a {@link ZohoDeskGetAgentsFunction} bound to the given context.
8900
+ *
8901
+ * Retrieves a paginated list of agents, with optional filtering by department and status,
8902
+ * and inline expansion of related entities (role, profile, departments).
8903
+ *
8904
+ * @param context - Authenticated Zoho Desk context
8905
+ * @returns Function that retrieves paginated agents
8906
+ */ function zohoDeskGetAgents(context) {
8907
+ return function(input) {
8908
+ var include = input.include, rest = _object_without_properties(input, [
8909
+ "include"
8910
+ ]);
8911
+ var params = makeUrlSearchParams([
8912
+ _object_spread_props$1(_object_spread$1({}, rest), {
8913
+ include: joinAgentInclude(include)
8914
+ })
8915
+ ]);
8916
+ return context.fetchJson("/agents?".concat(params), zohoDeskAgentApiFetchJsonInput('GET')).then(function(x) {
8917
+ return x !== null && x !== void 0 ? x : {
8918
+ data: []
8919
+ };
8920
+ });
8921
+ };
8922
+ }
8923
+ /**
8924
+ * Creates a {@link ZohoDeskGetAgentByIdFunction} bound to the given context.
8925
+ *
8926
+ * @param context - Authenticated Zoho Desk context
8927
+ * @returns Function that retrieves a single agent
8928
+ */ function zohoDeskGetAgentById(context) {
8929
+ return function(input) {
8930
+ var agentId = input.agentId, include = input.include;
8931
+ var params = makeUrlSearchParams([
8932
+ {
8933
+ include: joinAgentInclude(include)
8934
+ }
8935
+ ]);
8936
+ var queryString = params.toString();
8937
+ return context.fetchJson("/agents/".concat(agentId).concat(queryString ? "?".concat(queryString) : ''), zohoDeskAgentApiFetchJsonInput('GET'));
8938
+ };
8939
+ }
8940
+ /**
8941
+ * Creates a {@link ZohoDeskGetAgentsByIdsFunction} bound to the given context.
8942
+ *
8943
+ * @param context - Authenticated Zoho Desk context
8944
+ * @returns Function that retrieves agents by IDs
8945
+ */ function zohoDeskGetAgentsByIds(context) {
8946
+ return function(input) {
8947
+ var params = makeUrlSearchParams([
8948
+ {
8949
+ agentIds: joinStringsWithCommas(asArray(input.agentIds))
8950
+ }
8951
+ ]);
8952
+ return context.fetchJson("/agentsByIds?".concat(params), zohoDeskAgentApiFetchJsonInput('GET')).then(function(x) {
8953
+ var _ref;
8954
+ return (_ref = x === null || x === void 0 ? void 0 : x.data) !== null && _ref !== void 0 ? _ref : [];
8955
+ });
8956
+ };
8957
+ }
8958
+ /**
8959
+ * Creates a {@link ZohoDeskGetMyInfoFunction} bound to the given context.
8960
+ *
8961
+ * Retrieves the profile of the agent associated with the current OAuth token.
8962
+ *
8963
+ * @param context - Authenticated Zoho Desk context
8964
+ * @returns Function that retrieves the current agent's info
8965
+ */ function zohoDeskGetMyInfo(context) {
8966
+ return function() {
8967
+ return context.fetchJson('/myinfo', zohoDeskAgentApiFetchJsonInput('GET'));
8968
+ };
8969
+ }
8970
+ /**
8971
+ * Creates a {@link ZohoDeskGetAgentsPageFactory} bound to the given context.
8972
+ *
8973
+ * @param context - Authenticated Zoho Desk context
8974
+ * @returns Page factory for iterating over agent results
8975
+ */ function zohoDeskGetAgentsPageFactory(context) {
8976
+ return zohoDeskFetchPageFactory(zohoDeskGetAgents(context));
8977
+ }
8978
+
6734
8979
  /**
6735
8980
  * Creates a function that exchanges a refresh token for a new short-lived access token
6736
8981
  * via the Zoho OAuth `/oauth/v2/token` endpoint.
@@ -7285,4 +9530,4 @@ function safeZohoDateTimeString(date) {
7285
9530
  return isoDate.substring(0, isoDate.length - 5) + 'Z';
7286
9531
  }
7287
9532
 
7288
- export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION, 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_SIGN_SERVICE_NAME, 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, 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, handleZohoSignErrorFetch, insertRecord, interceptZohoAccounts200StatusWithErrorResponse, interceptZohoCrm200StatusWithErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruit200StatusWithErrorResponse, interceptZohoSign200StatusWithErrorResponse, isZohoCrmValidUrl, isZohoRecruitValidUrl, isZohoServerErrorResponseDataArrayRef, logZohoAccountsErrorToConsole, logZohoCrmErrorToConsole, logZohoRecruitErrorToConsole, logZohoServerErrorFunction, logZohoSignErrorToConsole, parseZohoAccountsError, parseZohoAccountsServerErrorResponseData, parseZohoCrmError, parseZohoCrmServerErrorResponseData, parseZohoRecruitError, parseZohoRecruitServerErrorResponseData, parseZohoServerErrorResponseData, parseZohoSignError, parseZohoSignServerErrorResponseData, removeTagsFromRecords, safeZohoDateTimeString, searchRecords, searchRecordsPageFactory, tryFindZohoServerErrorData, updateRecord, uploadAttachmentForRecord, upsertRecord, zohoAccessTokenStringFactory, zohoAccountsAccessToken, zohoAccountsApiFetchJsonInput, zohoAccountsConfigApiUrl, zohoAccountsFactory, zohoAccountsRefreshTokenFromAuthorizationCode, zohoAccountsZohoAccessTokenFactory, zohoCrmAddTagsToRecords, zohoCrmAddTagsToRecordsRequestBody, zohoCrmApiFetchJsonInput, zohoCrmCatchZohoCrmChangeObjectLikeResponseError, zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs, zohoCrmConfigApiUrl, zohoCrmCreateNotes, zohoCrmCreateNotesForRecord, zohoCrmCreateTagsForModule, zohoCrmDeleteAttachmentFromRecord, zohoCrmDeleteNotes, zohoCrmDeleteRecord, zohoCrmDeleteTag, 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, zohoSignConfigApiUrl, zohoSignCreateDocument, zohoSignDeleteDocument, zohoSignDownloadCompletionCertificate, zohoSignDownloadPdf, zohoSignExtendDocument, zohoSignFactory, zohoSignFetchPageFactory, zohoSignGetDocument, zohoSignGetDocumentFormData, zohoSignGetDocuments, zohoSignGetDocumentsPageFactory, zohoSignRetrieveFieldTypes, zohoSignSendDocumentForSignature, zohoSignUpdateDocument };
9533
+ export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_DESK_API_RATE_LIMIT, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION, 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_DESK_DEFAULT_PAGE_LIMIT, ZOHO_DESK_MAX_PAGE_LIMIT, ZOHO_DESK_RATE_LIMIT_REMAINING_HEADER, ZOHO_DESK_RATE_LIMIT_WEIGHT_HEADER, ZOHO_DESK_RETRY_AFTER_HEADER, ZOHO_DESK_SERVICE_NAME, 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_SIGN_SERVICE_NAME, 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, createNotes, createNotesForRecord, createTagsForModule, deleteAttachmentFromRecord, deleteNotes, deleteRecord, downloadAttachmentForRecord, emptyZohoPageResult, escapeZohoCrmFieldValueForCriteriaString, executeRestApiFunction, getAttachmentsForRecord, getAttachmentsForRecordPageFactory, getEmailsForRecord, getEmailsForRecordPageFactory, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, getRelatedRecordsFunctionFactory, getTagsForModule, getTagsForModulePageFactory, handleZohoAccountsErrorFetch, handleZohoCrmErrorFetch, handleZohoDeskErrorFetch, handleZohoErrorFetchFactory, handleZohoRecruitErrorFetch, handleZohoSignErrorFetch, insertRecord, interceptZohoAccounts200StatusWithErrorResponse, interceptZohoCrm200StatusWithErrorResponse, interceptZohoDesk200StatusWithErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruit200StatusWithErrorResponse, interceptZohoSign200StatusWithErrorResponse, isZohoCrmValidUrl, isZohoRecruitValidUrl, isZohoServerErrorResponseDataArrayRef, logZohoAccountsErrorToConsole, logZohoCrmErrorToConsole, logZohoDeskErrorToConsole, logZohoRecruitErrorToConsole, logZohoServerErrorFunction, logZohoSignErrorToConsole, makeZohoRateLimitedFetchHandler, parseZohoAccountsError, parseZohoAccountsServerErrorResponseData, parseZohoCrmError, parseZohoCrmServerErrorResponseData, parseZohoDeskError, parseZohoDeskServerErrorResponseData, parseZohoRecruitError, parseZohoRecruitServerErrorResponseData, parseZohoServerErrorResponseData, parseZohoSignError, parseZohoSignServerErrorResponseData, removeTagsFromRecords, safeZohoDateTimeString, searchRecords, searchRecordsPageFactory, tryFindZohoServerErrorData, updateRecord, uploadAttachmentForRecord, upsertRecord, zohoAccessTokenStringFactory, zohoAccountsAccessToken, zohoAccountsApiFetchJsonInput, zohoAccountsConfigApiUrl, zohoAccountsFactory, zohoAccountsRefreshTokenFromAuthorizationCode, zohoAccountsZohoAccessTokenFactory, zohoCrmAddTagsToRecords, zohoCrmAddTagsToRecordsRequestBody, zohoCrmApiFetchJsonInput, zohoCrmCatchZohoCrmChangeObjectLikeResponseError, zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs, zohoCrmConfigApiUrl, zohoCrmCreateNotes, zohoCrmCreateNotesForRecord, zohoCrmCreateTagsForModule, zohoCrmDeleteAttachmentFromRecord, zohoCrmDeleteNotes, zohoCrmDeleteRecord, zohoCrmDeleteTag, 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, zohoDeskAddTicketFollowers, zohoDeskApiFetchJsonInput, zohoDeskAssociateTicketTags, zohoDeskConfigApiUrl, zohoDeskCreateTicketComment, zohoDeskDeleteTicketAttachment, zohoDeskDeleteTicketComment, zohoDeskDissociateTicketTag, zohoDeskFactory, zohoDeskFetchPageFactory, zohoDeskGetAgentById, zohoDeskGetAgents, zohoDeskGetAgentsByIds, zohoDeskGetAgentsPageFactory, zohoDeskGetAgentsTicketsCount, zohoDeskGetAllTags, zohoDeskGetContactById, zohoDeskGetContacts, zohoDeskGetContactsByIds, zohoDeskGetContactsPageFactory, zohoDeskGetDepartmentById, zohoDeskGetDepartments, zohoDeskGetMyInfo, zohoDeskGetTicketActivities, zohoDeskGetTicketActivitiesPageFactory, zohoDeskGetTicketAttachments, zohoDeskGetTicketById, zohoDeskGetTicketCommentById, zohoDeskGetTicketComments, zohoDeskGetTicketFollowers, zohoDeskGetTicketMetrics, zohoDeskGetTicketTags, zohoDeskGetTicketThreadById, zohoDeskGetTicketThreads, zohoDeskGetTicketThreadsPageFactory, zohoDeskGetTicketTimeEntries, zohoDeskGetTicketTimeEntryById, zohoDeskGetTicketTimeEntrySummation, zohoDeskGetTicketTimer, zohoDeskGetTickets, zohoDeskGetTicketsForContact, zohoDeskGetTicketsForProduct, zohoDeskGetTicketsPageFactory, zohoDeskPerformTicketTimerAction, zohoDeskRateLimitDetailsReader, zohoDeskRateLimitedFetchHandler, zohoDeskRemoveTicketFollowers, zohoDeskSearchTags, zohoDeskSearchTickets, zohoDeskSearchTicketsPageFactory, 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, zohoSignConfigApiUrl, zohoSignCreateDocument, zohoSignDeleteDocument, zohoSignDownloadCompletionCertificate, zohoSignDownloadPdf, zohoSignExtendDocument, zohoSignFactory, zohoSignFetchPageFactory, zohoSignGetDocument, zohoSignGetDocumentFormData, zohoSignGetDocuments, zohoSignGetDocumentsPageFactory, zohoSignRetrieveFieldTypes, zohoSignSendDocumentForSignature, zohoSignUpdateDocument, zohoStandardRateLimitDetailsReader };