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