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