node-autotask 0.9.0 → 0.11.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 (77) hide show
  1. package/MCP_TOOL_CATALOG.json +3 -3
  2. package/MCP_TOOL_MANIFEST.md +5 -5
  3. package/N8N_MCP_MANIFEST.json +2 -2
  4. package/N8N_MCP_MANIFEST.md +3 -3
  5. package/capabilities.json +1354 -1263
  6. package/dist/capabilities.cjs +2 -3
  7. package/dist/capabilities.js +1 -2
  8. package/dist/{chunk-53MC2QRQ.cjs → chunk-25ZUKHS4.cjs} +135 -136
  9. package/dist/{chunk-BZPFDRAE.js → chunk-7L23FDQW.js} +1353 -1263
  10. package/dist/{chunk-UYJ5V262.js → chunk-CJONZQ7E.js} +32 -182
  11. package/dist/chunk-DMMMWO6A.js +0 -0
  12. package/dist/chunk-FLB2X6O5.cjs +1 -0
  13. package/dist/chunk-IDPB4N2Q.cjs +1 -0
  14. package/dist/{chunk-UDWV4VVD.js → chunk-LNRN45XS.js} +214 -20
  15. package/dist/{chunk-OYHKIYVR.cjs → chunk-QAX222R6.cjs} +422 -572
  16. package/dist/{chunk-QJU2N32V.js → chunk-SXHPUQMB.js} +2 -3
  17. package/dist/{chunk-LTKMTXUR.cjs → chunk-T5FLSJOD.cjs} +1353 -1263
  18. package/dist/chunk-UPQIUWOS.js +0 -0
  19. package/dist/{chunk-RWLPTU67.cjs → chunk-YKEX4SK7.cjs} +235 -41
  20. package/dist/{index-ZknpNhtc.d.ts → index-B_xToSpq.d.ts} +8 -8
  21. package/dist/{index-CfU1JDgS.d.cts → index-Dv_GSZaN.d.cts} +8 -8
  22. package/dist/{index-O2zzIMcQ.d.cts → index-cQ6CRexR.d.cts} +3 -1
  23. package/dist/{index-O2zzIMcQ.d.ts → index-cQ6CRexR.d.ts} +3 -1
  24. package/dist/index.cjs +21 -22
  25. package/dist/index.d.cts +4 -4
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +6 -7
  28. package/dist/operations/index.cjs +284 -131
  29. package/dist/operations/index.d.cts +28 -5
  30. package/dist/operations/index.d.ts +28 -5
  31. package/dist/operations/index.js +160 -7
  32. package/dist/pool.cjs +36 -12
  33. package/dist/pool.d.cts +2 -2
  34. package/dist/pool.d.ts +2 -2
  35. package/dist/pool.js +31 -7
  36. package/dist/resources/index.cjs +5 -6
  37. package/dist/resources/index.d.cts +2 -2
  38. package/dist/resources/index.d.ts +2 -2
  39. package/dist/resources/index.js +4 -5
  40. package/dist/types/index.cjs +1 -2
  41. package/dist/types/index.d.cts +1 -1
  42. package/dist/types/index.d.ts +1 -1
  43. package/dist/types/index.js +1 -2
  44. package/dist/untrusted.cjs +0 -1
  45. package/dist/untrusted.js +0 -1
  46. package/docs/API.md +12 -6
  47. package/package.json +1 -1
  48. package/dist/capabilities.cjs.map +0 -1
  49. package/dist/capabilities.js.map +0 -1
  50. package/dist/chunk-53MC2QRQ.cjs.map +0 -1
  51. package/dist/chunk-BZPFDRAE.js.map +0 -1
  52. package/dist/chunk-CXM35TEC.cjs +0 -1
  53. package/dist/chunk-CXM35TEC.cjs.map +0 -1
  54. package/dist/chunk-GIVD2CQ3.js +0 -1
  55. package/dist/chunk-GIVD2CQ3.js.map +0 -1
  56. package/dist/chunk-LTKMTXUR.cjs.map +0 -1
  57. package/dist/chunk-MHBMSBTA.js +0 -1
  58. package/dist/chunk-MHBMSBTA.js.map +0 -1
  59. package/dist/chunk-NZUFSSIZ.cjs +0 -1
  60. package/dist/chunk-NZUFSSIZ.cjs.map +0 -1
  61. package/dist/chunk-OYHKIYVR.cjs.map +0 -1
  62. package/dist/chunk-QJU2N32V.js.map +0 -1
  63. package/dist/chunk-RWLPTU67.cjs.map +0 -1
  64. package/dist/chunk-UDWV4VVD.js.map +0 -1
  65. package/dist/chunk-UYJ5V262.js.map +0 -1
  66. package/dist/index.cjs.map +0 -1
  67. package/dist/index.js.map +0 -1
  68. package/dist/operations/index.cjs.map +0 -1
  69. package/dist/operations/index.js.map +0 -1
  70. package/dist/pool.cjs.map +0 -1
  71. package/dist/pool.js.map +0 -1
  72. package/dist/resources/index.cjs.map +0 -1
  73. package/dist/resources/index.js.map +0 -1
  74. package/dist/types/index.cjs.map +0 -1
  75. package/dist/types/index.js.map +0 -1
  76. package/dist/untrusted.cjs.map +0 -1
  77. package/dist/untrusted.js.map +0 -1
@@ -28,13 +28,15 @@
28
28
 
29
29
 
30
30
 
31
- var _chunkRWLPTU67cjs = require('./chunk-RWLPTU67.cjs');
32
31
 
33
32
 
34
- var _chunkLTKMTXURcjs = require('./chunk-LTKMTXUR.cjs');
33
+ var _chunkYKEX4SK7cjs = require('./chunk-YKEX4SK7.cjs');
34
+
35
+
36
+ var _chunkT5FLSJODcjs = require('./chunk-T5FLSJOD.cjs');
35
37
 
36
38
  // src/resources/appointments.ts
37
- var AppointmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
39
+ var AppointmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
38
40
  constructor(http, pageSize) {
39
41
  super(http, {
40
42
  key: "appointments",
@@ -119,7 +121,7 @@ var AuthenticateResource = class {
119
121
  };
120
122
 
121
123
  // src/resources/billing_codes.ts
122
- var BillingCodesResource = class extends _chunkRWLPTU67cjs.BaseResource {
124
+ var BillingCodesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
123
125
  constructor(http, pageSize) {
124
126
  super(http, {
125
127
  key: "billing_codes",
@@ -169,7 +171,7 @@ var MAX_LIMIT = 500;
169
171
  function clampWindowLimit(limit) {
170
172
  const n = limit === void 0 ? DEFAULT_LIMIT : Math.trunc(limit);
171
173
  if (!Number.isInteger(n) || n < 1) {
172
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(limit)})`);
174
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(limit)})`);
173
175
  }
174
176
  return Math.min(n, MAX_LIMIT);
175
177
  }
@@ -215,7 +217,7 @@ function wallParts(tz, ms) {
215
217
  }
216
218
  }
217
219
  if (weekday < 0 || [w.y, w.m, w.d, w.h, w.mi, w.s].some((v) => v === void 0 || Number.isNaN(v))) {
218
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`dateWindow: could not read the wall-clock parts for timezone "${tz}" (the Intl format returned an incomplete or unmapped part)`);
220
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`dateWindow: could not read the wall-clock parts for timezone "${tz}" (the Intl format returned an incomplete or unmapped part)`);
219
221
  }
220
222
  return { y: w.y, m: w.m, d: w.d, h: w.h, mi: w.mi, s: w.s, weekday };
221
223
  }
@@ -242,7 +244,7 @@ function localDayEndMs(y, m, d, tz) {
242
244
  }
243
245
  function validateZone(tz, opName = "dateWindow") {
244
246
  if (typeof tz !== "string" || tz.length === 0) {
245
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
247
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
246
248
  `${opName}: tz must be a non-empty IANA timezone string (got ${JSON.stringify(tz)}; e.g. 'Australia/Sydney' \u2014 omitted tz = UTC)`,
247
249
  { operation: opName }
248
250
  );
@@ -250,7 +252,7 @@ function validateZone(tz, opName = "dateWindow") {
250
252
  try {
251
253
  new Intl.DateTimeFormat("en-US", { timeZone: tz });
252
254
  } catch (e2) {
253
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
255
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
254
256
  `${opName}: tz is not a valid IANA timezone (${JSON.stringify(tz)}; e.g. 'Australia/Sydney' \u2014 omitted tz = UTC)`,
255
257
  { operation: opName }
256
258
  );
@@ -402,13 +404,13 @@ async function dateWindowQuery(http, path, field, kind, limit, operation, now, t
402
404
  body: { MaxRecords: limit, filter },
403
405
  operation
404
406
  });
405
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
407
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
406
408
  }
407
409
  var isoUtc = (ms) => new Date(ms).toISOString().slice(0, 19) + "Z";
408
410
  function customRangeDay(value, label, zone, opName) {
409
411
  const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value.trim());
410
412
  if (!m) {
411
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
413
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
412
414
  zone === void 0 ? `${opName}: ${label} must be a UTC 'YYYY-MM-DD' date (got ${JSON.stringify(value)})` : `${opName}: ${label} must be a 'YYYY-MM-DD' local calendar day in ${zone} (got ${JSON.stringify(value)})`,
413
415
  { operation: opName }
414
416
  );
@@ -420,7 +422,7 @@ function customRangeDay(value, label, zone, opName) {
420
422
  const real = probe.getUTCFullYear() === y && probe.getUTCMonth() === mo - 1 && probe.getUTCDate() === d;
421
423
  const ms = !real ? NaN : zone === void 0 ? Date.UTC(y, mo - 1, d) : localDayStartMs(y, mo, d, zone);
422
424
  if (!Number.isFinite(ms)) {
423
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
425
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
424
426
  zone === void 0 ? `${opName}: ${label} is not a valid UTC date (${JSON.stringify(value)})` : `${opName}: ${label} is not a valid calendar day in ${zone} (${JSON.stringify(value)})`,
425
427
  { operation: opName }
426
428
  );
@@ -431,7 +433,7 @@ async function customRangeQuery(http, path, field, from, to, limit, operation, z
431
433
  const fromB = customRangeDay(from, "from", zone, operation);
432
434
  const toB = customRangeDay(to, "to", zone, operation);
433
435
  if (fromB.ms > toB.ms) {
434
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
436
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
435
437
  `${operation}: from (${isoUtc(fromB.ms)}) must not be after to (${isoUtc(toB.ms)})`,
436
438
  { operation }
437
439
  );
@@ -448,7 +450,7 @@ async function customRangeQuery(http, path, field, from, to, limit, operation, z
448
450
  body: { MaxRecords: limit, filter },
449
451
  operation
450
452
  });
451
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
453
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
452
454
  }
453
455
 
454
456
  // src/resources/special/billing_items.ts
@@ -481,7 +483,7 @@ async function customRange(_resource, from, to, http, opts) {
481
483
  }
482
484
 
483
485
  // src/resources/billing_items.ts
484
- var BillingItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
486
+ var BillingItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
485
487
  constructor(http, pageSize) {
486
488
  super(http, {
487
489
  key: "billing_items",
@@ -583,7 +585,7 @@ var BillingItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
583
585
  };
584
586
 
585
587
  // src/resources/change_request_links.ts
586
- var ChangeRequestLinksResource = class extends _chunkRWLPTU67cjs.BaseResource {
588
+ var ChangeRequestLinksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
587
589
  constructor(http, pageSize) {
588
590
  super(http, {
589
591
  key: "change_request_links",
@@ -637,7 +639,7 @@ var ChangeRequestLinksResource = class extends _chunkRWLPTU67cjs.BaseResource {
637
639
  };
638
640
 
639
641
  // src/resources/checklist_libraries.ts
640
- var ChecklistLibrariesResource = class extends _chunkRWLPTU67cjs.BaseResource {
642
+ var ChecklistLibrariesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
641
643
  constructor(http, pageSize) {
642
644
  super(http, {
643
645
  key: "checklist_libraries",
@@ -711,7 +713,7 @@ var ChecklistLibrariesResource = class extends _chunkRWLPTU67cjs.BaseResource {
711
713
  };
712
714
 
713
715
  // src/resources/checklist_library_checklist_items.ts
714
- var ChecklistLibraryChecklistItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
716
+ var ChecklistLibraryChecklistItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
715
717
  constructor(http, pageSize) {
716
718
  super(http, {
717
719
  key: "checklist_library_checklist_items",
@@ -777,7 +779,7 @@ var ChecklistLibraryChecklistItemsResource = class extends _chunkRWLPTU67cjs.Bas
777
779
  };
778
780
 
779
781
  // src/resources/classification_icons.ts
780
- var ClassificationIconsResource = class extends _chunkRWLPTU67cjs.BaseResource {
782
+ var ClassificationIconsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
781
783
  constructor(http, pageSize) {
782
784
  super(http, {
783
785
  key: "classification_icons",
@@ -820,187 +822,12 @@ var ClassificationIconsResource = class extends _chunkRWLPTU67cjs.BaseResource {
820
822
  }
821
823
  };
822
824
 
823
- // src/operations/compositeNames.ts
824
- var DEFAULT_MAX_NAME_READS = 20;
825
- var TICKET_LABEL_FIELDS = ["status", "priority", "ticketType", "issueType", "subIssueType", "source", "queueID"];
826
- function isVendorId(value) {
827
- if (typeof value === "number") return Number.isSafeInteger(value) && value >= 0;
828
- if (typeof value === "string") return /^\d+$/.test(value);
829
- return false;
830
- }
831
- function createNamePlan(labelFields = []) {
832
- const resourceIds = [];
833
- const resSeen = /* @__PURE__ */ new Set();
834
- const recordFks = [];
835
- const fkSeen = /* @__PURE__ */ new Set();
836
- return {
837
- plan: () => ({ resourceIds, recordFks, labelFields }),
838
- addResource: (value) => {
839
- if (!isVendorId(value)) return;
840
- const k = String(value);
841
- if (!resSeen.has(k)) {
842
- resSeen.add(k);
843
- resourceIds.push(value);
844
- }
845
- },
846
- addFk: (table, value) => {
847
- if (!isVendorId(value)) return;
848
- const k = `${table}:${String(value)}`;
849
- if (!fkSeen.has(k)) {
850
- fkSeen.add(k);
851
- recordFks.push({ table, id: value });
852
- }
853
- }
854
- };
855
- }
856
- function addNameSibling(row, field, resolve) {
857
- const value = row[field];
858
- if (value === void 0) return;
859
- row[`${field}Name`] = isVendorId(value) ? resolve(value) : null;
860
- }
861
- function addLabelSibling(row, field, names) {
862
- const value = row[field];
863
- if (value === void 0) return;
864
- row[`${field}Label`] = names.labelFor(field, value);
865
- }
866
- var FK_TABLE_PATH = {
867
- role: "/V1.0/Roles",
868
- billingCode: "/V1.0/BillingCodes",
869
- contract: "/V1.0/Contracts"
870
- };
871
- var FK_NAME_FIELD = {
872
- role: "name",
873
- billingCode: "name",
874
- contract: "contractName"
875
- };
876
- function fkName(record, table) {
877
- const value = record[FK_NAME_FIELD[table]];
878
- return typeof value === "string" && value.trim() !== "" ? value : null;
879
- }
880
- function faultRow(err) {
881
- const e = err;
882
- return e.httpStatus !== void 0 ? { code: e.code, message: e.message, httpStatus: e.httpStatus } : { code: e.code, message: e.message };
883
- }
884
- async function resolveCompositeNames(http, plan, opts = {}) {
885
- if (opts.maxNameReads !== void 0 && (!Number.isInteger(opts.maxNameReads) || opts.maxNameReads < 1)) {
886
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`composite names: maxNameReads must be an integer >= 1 (got ${String(opts.maxNameReads)})`);
887
- }
888
- const budget = Math.min(DEFAULT_MAX_NAME_READS, _nullishCoalesce(opts.maxNameReads, () => ( DEFAULT_MAX_NAME_READS)));
889
- const client = http.client;
890
- if (client === void 0) {
891
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("composite names: the transport is not wired to an AutotaskClient (the composite must run through the client)");
892
- }
893
- const readCache = http.readCache;
894
- const nameCache = http.resourceNameCache;
895
- const section = { truncated: false, rows: {}, reasons: {} };
896
- let remaining = budget;
897
- const coldResource = [];
898
- for (const id of plan.resourceIds) {
899
- if (nameCache !== void 0 && nameCache.get(id) !== void 0) continue;
900
- if (readCache !== void 0 && readCache.get(`/V1.0/Resources/${id}`) !== void 0) continue;
901
- coldResource.push(id);
902
- }
903
- const withinBudget = coldResource.slice(0, remaining);
904
- const overBudgetResource = coldResource.slice(remaining);
905
- remaining -= withinBudget.length;
906
- for (const id of overBudgetResource) {
907
- section.rows[`resource:${id}`] = { name: null, blind: false, capped: true };
908
- section.truncated = true;
909
- }
910
- const overSet = new Set(overBudgetResource.map((id) => String(id)));
911
- const opIds = plan.resourceIds.filter((id) => !overSet.has(String(id)));
912
- if (opIds.length > 0) {
913
- let pass = opIds;
914
- if (pass.length > 500) {
915
- for (const id of pass.slice(500)) {
916
- section.rows[`resource:${id}`] = { name: null, blind: false, capped: true };
917
- section.truncated = true;
918
- }
919
- pass = pass.slice(0, 500);
920
- }
921
- const res = await _chunkRWLPTU67cjs.expandResourceNames.call(void 0, client, pass);
922
- for (const r of res.results) {
923
- const row = { name: r.name, blind: r.blind, capped: false };
924
- if (r.error !== void 0) row.error = faultRow(r.error);
925
- section.rows[`resource:${r.id}`] = row;
926
- }
927
- }
928
- const holders = {
929
- role: client.roles,
930
- billingCode: client.billingCodes,
931
- contract: client.contracts
932
- };
933
- for (const fk of plan.recordFks) {
934
- const key = `${fk.table}:${fk.id}`;
935
- const cold = readCache === void 0 || readCache.get(`${FK_TABLE_PATH[fk.table]}/${fk.id}`) === void 0;
936
- if (cold) {
937
- if (remaining < 1) {
938
- section.rows[key] = { name: null, blind: false, capped: true };
939
- section.truncated = true;
940
- continue;
941
- }
942
- remaining -= 1;
943
- }
944
- try {
945
- const record = await holders[fk.table].get(fk.id);
946
- section.rows[key] = { name: fkName(record, fk.table), blind: false, capped: false };
947
- } catch (err) {
948
- if (err instanceof _chunkRWLPTU67cjs.NotFoundError) {
949
- section.rows[key] = { name: null, blind: true, capped: false };
950
- } else if (_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) && err.code !== "ABORTED") {
951
- section.rows[key] = { name: null, blind: false, capped: false, error: faultRow(err) };
952
- } else {
953
- throw err;
954
- }
955
- }
956
- }
957
- const picklists = {};
958
- if (plan.labelFields.length > 0) {
959
- let usable = true;
960
- try {
961
- const catalog = await _chunkRWLPTU67cjs.fieldCatalog.call(void 0, client, { resources: ["tickets"], labels: true, fields: [...plan.labelFields] });
962
- const row = catalog.rows.find((r) => r.resource === "tickets");
963
- if (row === void 0 || row.error !== null || row.fields === void 0) {
964
- usable = false;
965
- } else {
966
- for (const f of plan.labelFields) {
967
- const frow = row.fields.find((x) => x.name === f);
968
- picklists[f] = _optionalChain([frow, 'optionalAccess', _6 => _6.picklistValues]);
969
- }
970
- }
971
- } catch (err) {
972
- if (_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) && err.code !== "ABORTED") usable = false;
973
- else throw err;
974
- }
975
- if (!usable) for (const f of plan.labelFields) section.reasons[f] = _chunkRWLPTU67cjs.FIELD_CATALOG_HONESTY_NOTE;
976
- }
977
- return {
978
- section,
979
- resourceName: (id) => _nullishCoalesce(_optionalChain([section, 'access', _7 => _7.rows, 'access', _8 => _8[`resource:${id}`], 'optionalAccess', _9 => _9.name]), () => ( null)),
980
- recordName: (table, id) => _nullishCoalesce(_optionalChain([section, 'access', _10 => _10.rows, 'access', _11 => _11[`${table}:${id}`], 'optionalAccess', _12 => _12.name]), () => ( null)),
981
- labelFor: (field, value) => {
982
- if (value === null || value === void 0) return null;
983
- const values = picklists[field];
984
- if (values === void 0) {
985
- section.reasons[field] = _chunkRWLPTU67cjs.FIELD_CATALOG_HONESTY_NOTE;
986
- return null;
987
- }
988
- const hit = values.find((v) => String(v.value) === String(value));
989
- if (hit === void 0) {
990
- section.reasons[field] = _chunkRWLPTU67cjs.FIELD_CATALOG_HONESTY_NOTE;
991
- return null;
992
- }
993
- return typeof hit.label === "string" ? hit.label : null;
994
- }
995
- };
996
- }
997
-
998
825
  // src/resources/special/companies.ts
999
826
  var DEFAULT_LIMIT2 = 25;
1000
827
  var MAX_LIMIT2 = 500;
1001
828
  function clampLimit(limit) {
1002
829
  const n = limit === void 0 ? DEFAULT_LIMIT2 : Math.trunc(limit);
1003
- if (!Number.isInteger(n) || n < 1) throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(limit)})`);
830
+ if (!Number.isInteger(n) || n < 1) throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(limit)})`);
1004
831
  return Math.min(n, MAX_LIMIT2);
1005
832
  }
1006
833
  async function queryCompanies(http, filter, limit) {
@@ -1011,7 +838,7 @@ async function queryCompanies(http, filter, limit) {
1011
838
  body: { MaxRecords: limit, filter },
1012
839
  operation: "companies.searchByDomain"
1013
840
  });
1014
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
841
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
1015
842
  }
1016
843
  async function queryContacts(http, filter, limit) {
1017
844
  const res = await http.request({
@@ -1021,7 +848,7 @@ async function queryContacts(http, filter, limit) {
1021
848
  body: { MaxRecords: limit, filter },
1022
849
  operation: "companies.searchByDomain"
1023
850
  });
1024
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
851
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
1025
852
  }
1026
853
  async function fetchCompanies(http, ids, limit) {
1027
854
  const out = [];
@@ -1036,7 +863,7 @@ async function fetchCompanies(http, ids, limit) {
1036
863
  const item = body && "item" in body ? body.item : null;
1037
864
  if (item) out.push(item);
1038
865
  } catch (err) {
1039
- if (err instanceof _chunkRWLPTU67cjs.NotFoundError) continue;
866
+ if (err instanceof _chunkYKEX4SK7cjs.NotFoundError) continue;
1040
867
  throw err;
1041
868
  }
1042
869
  }
@@ -1044,7 +871,7 @@ async function fetchCompanies(http, ids, limit) {
1044
871
  }
1045
872
  async function searchByDomain(_resource, domain, opts = {}, http) {
1046
873
  const text = domain.trim();
1047
- if (text === "") throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("searchByDomain: empty domain");
874
+ if (text === "") throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("searchByDomain: empty domain");
1048
875
  const limit = clampLimit(opts.limit);
1049
876
  const filter = [{ field: "webAddress", op: "contains", value: text }];
1050
877
  const direct = await queryCompanies(http, filter, limit);
@@ -1054,11 +881,11 @@ async function searchByDomain(_resource, domain, opts = {}, http) {
1054
881
  return fetchCompanies(http, ids, limit);
1055
882
  }
1056
883
  async function searchByIdentity(_resource, identity, opts = {}, http) {
1057
- const name = _nullishCoalesce(_optionalChain([identity, 'access', _13 => _13.companyName, 'optionalAccess', _14 => _14.trim, 'call', _15 => _15()]), () => ( ""));
1058
- const email = _nullishCoalesce(_optionalChain([identity, 'access', _16 => _16.email, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]), () => ( ""));
1059
- const website = _nullishCoalesce(_optionalChain([identity, 'access', _19 => _19.website, 'optionalAccess', _20 => _20.trim, 'call', _21 => _21()]), () => ( ""));
884
+ const name = _nullishCoalesce(_optionalChain([identity, 'access', _6 => _6.companyName, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]), () => ( ""));
885
+ const email = _nullishCoalesce(_optionalChain([identity, 'access', _9 => _9.email, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]), () => ( ""));
886
+ const website = _nullishCoalesce(_optionalChain([identity, 'access', _12 => _12.website, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]), () => ( ""));
1060
887
  if (name === "" && email === "" && website === "") {
1061
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("searchByIdentity: at least one of companyName / email / website is required");
888
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("searchByIdentity: at least one of companyName / email / website is required");
1062
889
  }
1063
890
  const limit = clampLimit(opts.limit);
1064
891
  const found = /* @__PURE__ */ new Map();
@@ -1085,41 +912,57 @@ async function familyChildPage(http, parentID) {
1085
912
  path: "/V1.0/Companies/query",
1086
913
  body: {
1087
914
  MaxRecords: COMPANIES_FAMILY_CHILD_CAP,
1088
- filter: _chunkRWLPTU67cjs.buildFilter.call(void 0, [{ field: "parentCompanyID", op: "eq", value: parentID }]).filter
915
+ filter: _chunkYKEX4SK7cjs.buildFilter.call(void 0, [{ field: "parentCompanyID", op: "eq", value: parentID }]).filter
1089
916
  },
1090
917
  operation: "companies.search"
1091
918
  });
1092
- const { items, pageDetails } = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res, "companies.search");
919
+ const { items, pageDetails } = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res, "companies.search");
1093
920
  return { rows: items, hasNext: pageDetails.nextPageUrl !== null };
1094
921
  }
922
+ function assertSearchWithDetailOpts(opts) {
923
+ if (opts === void 0) return;
924
+ if (typeof opts !== "object" || opts === null || Array.isArray(opts)) {
925
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("companies.searchWithDetail: opts must be an object { limit?: number }", {
926
+ operation: "companies.searchWithDetail"
927
+ });
928
+ }
929
+ for (const key of Object.keys(opts)) {
930
+ if (key !== "limit") {
931
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
932
+ `companies.searchWithDetail: unknown opts key "${key}" \u2014 the bag is closed: limit (includeFamily is a companies.search option)`,
933
+ { operation: "companies.searchWithDetail" }
934
+ );
935
+ }
936
+ }
937
+ }
1095
938
  async function searchWithFamily(_resource, query, opts = {}, http) {
1096
939
  if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
1097
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("companies.search: opts must be an object { limit?: number, includeFamily?: boolean }");
940
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("companies.search: opts must be an object { limit?: number, includeFamily?: boolean }");
1098
941
  }
1099
942
  for (const key of Object.keys(_nullishCoalesce(opts, () => ( {})))) {
1100
943
  if (!COMPANY_SEARCH_OPT_KEYS.includes(key)) {
1101
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
944
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
1102
945
  `companies.search: unknown opts key "${key}" \u2014 the bag is closed: ${COMPANY_SEARCH_OPT_KEYS.join(", ")}`,
1103
946
  { operation: "companies.search" }
1104
947
  );
1105
948
  }
1106
949
  }
1107
950
  if (opts.includeFamily !== void 0 && typeof opts.includeFamily !== "boolean") {
1108
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`companies.search: opts.includeFamily must be a boolean (got ${String(opts.includeFamily)})`, {
951
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`companies.search: opts.includeFamily must be a boolean (got ${String(opts.includeFamily)})`, {
1109
952
  operation: "companies.search"
1110
953
  });
1111
954
  }
1112
955
  const text = query.trim();
1113
- if (text === "") throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("search: empty query", { operation: "companies.search" });
1114
- const limit = opts.limit === void 0 ? 25 : _chunkRWLPTU67cjs.clampPageSize.call(void 0, opts.limit);
956
+ if (text === "") throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("search: empty query", { operation: "companies.search" });
957
+ const limit = opts.limit === void 0 ? 25 : _chunkYKEX4SK7cjs.clampPageSize.call(void 0, opts.limit);
1115
958
  const res = await http.request({
1116
959
  method: "POST",
1117
960
  idempotent: true,
1118
961
  path: "/V1.0/Companies/query",
1119
- body: { MaxRecords: limit, filter: _chunkRWLPTU67cjs.buildFilter.call(void 0, [{ field: "companyName", op: "contains", value: text }]).filter },
962
+ body: { MaxRecords: limit, filter: _chunkYKEX4SK7cjs.buildFilter.call(void 0, [{ field: "companyName", op: "contains", value: text }]).filter },
1120
963
  operation: "companies.search"
1121
964
  });
1122
- const hits = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res, "companies.search").items;
965
+ const hits = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res, "companies.search").items;
1123
966
  if (opts.includeFamily !== true) return hits;
1124
967
  const rows = [];
1125
968
  for (const hit of hits) {
@@ -1143,7 +986,7 @@ var DEFAULT_COMPANY_TYPE = 1;
1143
986
  var DEDUP_NAME_LIMIT = 10;
1144
987
  var BLIND_SURFACE_CAVEAT = "dedup only covers companies this API user can enumerate (the unowned surface is blind); a same-name company outside that scope is not detected";
1145
988
  var SAFE_COMPANY_CREATE_DEFAULTS = {};
1146
- var OwnerResourceRequiredError = class extends _chunkRWLPTU67cjs.AutotaskError {
989
+ var OwnerResourceRequiredError = class extends _chunkYKEX4SK7cjs.AutotaskError {
1147
990
  constructor(message, options = {}) {
1148
991
  super(message, {
1149
992
  code: "OWNER_RESOURCE_REQUIRED",
@@ -1154,13 +997,13 @@ var OwnerResourceRequiredError = class extends _chunkRWLPTU67cjs.AutotaskError {
1154
997
  this.name = "OwnerResourceRequiredError";
1155
998
  }
1156
999
  };
1157
- var CompanyResourceInvalidError = class extends _chunkRWLPTU67cjs.AutotaskError {
1000
+ var CompanyResourceInvalidError = class extends _chunkYKEX4SK7cjs.AutotaskError {
1158
1001
  constructor(message, options = {}) {
1159
1002
  super(message, { code: "RESOURCE_INVALID", category: "validation", ...options });
1160
1003
  this.name = "CompanyResourceInvalidError";
1161
1004
  }
1162
1005
  };
1163
- var CompanyCreateFailedError = class extends _chunkRWLPTU67cjs.AutotaskError {
1006
+ var CompanyCreateFailedError = class extends _chunkYKEX4SK7cjs.AutotaskError {
1164
1007
  /** The vendor-named fields (empty when the 500 body named nothing parseable). */
1165
1008
 
1166
1009
  constructor(message, vendorFields, options = {}) {
@@ -1171,18 +1014,18 @@ var CompanyCreateFailedError = class extends _chunkRWLPTU67cjs.AutotaskError {
1171
1014
  };
1172
1015
  async function upsertByName(resource, companyName, params, opts, http) {
1173
1016
  if (typeof companyName !== "string" || companyName.trim() === "") {
1174
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("upsertByName: companyName is required (a non-empty string)", { operation: OP_UPSERT_NAME });
1017
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("upsertByName: companyName is required (a non-empty string)", { operation: OP_UPSERT_NAME });
1175
1018
  }
1176
- if (typeof _optionalChain([params, 'optionalAccess', _22 => _22.phone]) !== "string" || params.phone.trim() === "") {
1177
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("upsertByName: params.phone is required (a non-empty string \u2014 the ww29 live-required set is { companyName, companyType, phone, ownerResourceID })", { operation: OP_UPSERT_NAME });
1019
+ if (typeof _optionalChain([params, 'optionalAccess', _15 => _15.phone]) !== "string" || params.phone.trim() === "") {
1020
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("upsertByName: params.phone is required (a non-empty string \u2014 the ww29 live-required set is { companyName, companyType, phone, ownerResourceID })", { operation: OP_UPSERT_NAME });
1178
1021
  }
1179
1022
  const companyType = _nullishCoalesce(params.companyType, () => ( DEFAULT_COMPANY_TYPE));
1180
1023
  if (typeof companyType !== "number" || !Number.isSafeInteger(companyType) || companyType < 1) {
1181
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`upsertByName: params.companyType must be a positive integer picklist value (got ${String(params.companyType)}; default 1 \u2014 the ww29-proven value)`, { operation: OP_UPSERT_NAME });
1024
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`upsertByName: params.companyType must be a positive integer picklist value (got ${String(params.companyType)}; default 1 \u2014 the ww29-proven value)`, { operation: OP_UPSERT_NAME });
1182
1025
  }
1183
1026
  const owner = params.ownerResourceID;
1184
1027
  if (owner !== void 0 && (typeof owner !== "number" || !Number.isSafeInteger(owner) || owner < 1)) {
1185
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`upsertByName: params.ownerResourceID must be a positive integer (got ${String(owner)})`, { operation: OP_UPSERT_NAME });
1028
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`upsertByName: params.ownerResourceID must be a positive integer (got ${String(owner)})`, { operation: OP_UPSERT_NAME });
1186
1029
  }
1187
1030
  const q = await resource.queryBounded({ filter: [{ field: "companyName", op: "eq", value: companyName }], limit: DEDUP_NAME_LIMIT });
1188
1031
  const caveat = {
@@ -1193,7 +1036,7 @@ async function upsertByName(resource, companyName, params, opts, http) {
1193
1036
  const match = q.items[0];
1194
1037
  if (match !== void 0) {
1195
1038
  if (opts.dryRun === true) {
1196
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
1039
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
1197
1040
  {
1198
1041
  operation: OP_UPSERT_NAME,
1199
1042
  method: "POST",
@@ -1228,7 +1071,7 @@ async function upsertByName(resource, companyName, params, opts, http) {
1228
1071
  "ownerResourceID is REQUIRED on the apply path (the vendor requires it; the node cannot enumerate candidates \u2014 the resources table is blind to this API user (count/query return 0)): the apply throws the typed OWNER_RESOURCE_REQUIRED if it is still absent"
1229
1072
  );
1230
1073
  }
1231
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
1074
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
1232
1075
  {
1233
1076
  operation: OP_UPSERT_NAME,
1234
1077
  method: "POST",
@@ -1276,8 +1119,8 @@ async function upsertByName(resource, companyName, params, opts, http) {
1276
1119
  sideEffects: ['vendor auto-creates a "Primary Address" location under the new company (UI-only cleanup \u2014 the delete 405 gap, \xA711.5)']
1277
1120
  };
1278
1121
  } catch (err) {
1279
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) throw err;
1280
- const named = (_nullishCoalesce(_chunkRWLPTU67cjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []))).map((e) => e.field).filter((f) => f !== void 0);
1122
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) throw err;
1123
+ const named = (_nullishCoalesce(_chunkYKEX4SK7cjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []))).map((e) => e.field).filter((f) => f !== void 0);
1281
1124
  const seen = /* @__PURE__ */ new Set();
1282
1125
  const unique = [...named].filter((f) => seen.has(f) ? false : (seen.add(f), true));
1283
1126
  const hasDefault = unique.some((f) => SAFE_COMPANY_CREATE_DEFAULTS[f] !== void 0);
@@ -1291,7 +1134,7 @@ async function upsertByName(resource, companyName, params, opts, http) {
1291
1134
  }
1292
1135
  continue;
1293
1136
  }
1294
- const detail = _chunkRWLPTU67cjs.formatVendorDetail.call(void 0, err.vendorError);
1137
+ const detail = _chunkYKEX4SK7cjs.formatVendorDetail.call(void 0, err.vendorError);
1295
1138
  throw new CompanyCreateFailedError(
1296
1139
  `upsertByName: the vendor rejected the company create${unique.length > 0 ? ` naming field(s) ${unique.join(", ")}` : ""} (no proven-safe default \u2014 the ww29 required set is fully filled by the node)${detail ? ` \u2014 ${detail}` : ""}`,
1297
1140
  unique,
@@ -1310,7 +1153,7 @@ var PROFILE_PART_LIMIT = 50;
1310
1153
  function profilePartLimit(value, name) {
1311
1154
  const n = value === void 0 ? PROFILE_PART_LIMIT : Math.trunc(value);
1312
1155
  if (!Number.isInteger(n) || n < 1) {
1313
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`fullProfile: ${name} must be an integer >= 1 (got ${String(value)})`);
1156
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`fullProfile: ${name} must be an integer >= 1 (got ${String(value)})`);
1314
1157
  }
1315
1158
  return n;
1316
1159
  }
@@ -1322,14 +1165,14 @@ async function scopedCompanyQuery(http, path, companyID, limit) {
1322
1165
  body: { MaxRecords: limit, filter: [{ field: "companyID", op: "eq", value: companyID }] },
1323
1166
  operation: "companies.fullProfile"
1324
1167
  });
1325
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
1168
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
1326
1169
  }
1327
1170
  async function fullProfile(resource, id, opts = {}, http) {
1328
1171
  const contactLimit = profilePartLimit(opts.contactLimit, "contactLimit");
1329
1172
  const noteLimit = profilePartLimit(opts.noteLimit, "noteLimit");
1330
1173
  const ticketLimit = profilePartLimit(opts.ticketLimit, "ticketLimit");
1331
1174
  const projectLimit = profilePartLimit(opts.projectLimit, "projectLimit");
1332
- const companyID = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
1175
+ const companyID = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
1333
1176
  const company = await resource.get(companyID);
1334
1177
  const locations = await scopedCompanyQuery(http, "/V1.0/CompanyLocations/query", companyID, PROFILE_PART_LIMIT);
1335
1178
  const contacts = await scopedCompanyQuery(http, "/V1.0/Contacts/query", companyID, contactLimit);
@@ -1346,7 +1189,7 @@ async function fullProfile(resource, id, opts = {}, http) {
1346
1189
  },
1347
1190
  operation: "companies.fullProfile"
1348
1191
  });
1349
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
1192
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
1350
1193
  })();
1351
1194
  let openTickets = {
1352
1195
  items: openRows,
@@ -1355,7 +1198,7 @@ async function fullProfile(resource, id, opts = {}, http) {
1355
1198
  note: OPEN_TICKETS_NOTE
1356
1199
  };
1357
1200
  if (openRows.length === 0) {
1358
- const stamp = _chunkRWLPTU67cjs.blindStampFor.call(void 0, _optionalChain([_chunkRWLPTU67cjs.BLIND_SURFACE_STAMPS, 'access', _23 => _23["tickets"], 'optionalAccess', _24 => _24.query]), [
1201
+ const stamp = _chunkYKEX4SK7cjs.blindStampFor.call(void 0, _optionalChain([_chunkYKEX4SK7cjs.BLIND_SURFACE_STAMPS, 'access', _16 => _16["tickets"], 'optionalAccess', _17 => _17.query]), [
1359
1202
  { field: "companyID", op: "eq", value: companyID },
1360
1203
  { field: "status", op: "noteq", value: 5 }
1361
1204
  ]);
@@ -1386,7 +1229,7 @@ async function fullProfile(resource, id, opts = {}, http) {
1386
1229
  }
1387
1230
  };
1388
1231
  if (opts.names === true) {
1389
- const builder = createNamePlan(TICKET_LABEL_FIELDS);
1232
+ const builder = _chunkYKEX4SK7cjs.createNamePlan.call(void 0, _chunkYKEX4SK7cjs.TICKET_LABEL_FIELDS);
1390
1233
  const c = company;
1391
1234
  builder.addResource(c["ownerResourceID"]);
1392
1235
  builder.addResource(c["createdByResourceID"]);
@@ -1403,20 +1246,20 @@ async function fullProfile(resource, id, opts = {}, http) {
1403
1246
  builder.addResource(r["creatorResourceID"]);
1404
1247
  builder.addFk("contract", r["contractID"]);
1405
1248
  }
1406
- const names = await resolveCompositeNames(http, builder.plan(), { maxNameReads: opts.maxNameReads });
1249
+ const names = await _chunkYKEX4SK7cjs.resolveCompositeNames.call(void 0, http, builder.plan(), { maxNameReads: opts.maxNameReads });
1407
1250
  const companyRow = { ...company };
1408
- addNameSibling(companyRow, "ownerResourceID", (v) => names.resourceName(v));
1409
- addNameSibling(companyRow, "createdByResourceID", (v) => names.resourceName(v));
1251
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, companyRow, "ownerResourceID", (v) => names.resourceName(v));
1252
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, companyRow, "createdByResourceID", (v) => names.resourceName(v));
1410
1253
  result.company = companyRow;
1411
1254
  result.openTickets = {
1412
1255
  ...openTickets,
1413
1256
  items: openTickets.items.map((row) => {
1414
1257
  const r = { ...row };
1415
- addNameSibling(r, "creatorResourceID", (v) => names.resourceName(v));
1416
- addNameSibling(r, "contractID", (v) => names.recordName("contract", v));
1417
- addNameSibling(r, "billingCodeID", (v) => names.recordName("billingCode", v));
1418
- addNameSibling(r, "assignedResourceRoleID", (v) => names.recordName("role", v));
1419
- for (const f of TICKET_LABEL_FIELDS) addLabelSibling(r, f, names);
1258
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "creatorResourceID", (v) => names.resourceName(v));
1259
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "contractID", (v) => names.recordName("contract", v));
1260
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "billingCodeID", (v) => names.recordName("billingCode", v));
1261
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "assignedResourceRoleID", (v) => names.recordName("role", v));
1262
+ for (const f of _chunkYKEX4SK7cjs.TICKET_LABEL_FIELDS) _chunkYKEX4SK7cjs.addLabelSibling.call(void 0, r, f, names);
1420
1263
  return r;
1421
1264
  })
1422
1265
  };
@@ -1424,9 +1267,9 @@ async function fullProfile(resource, id, opts = {}, http) {
1424
1267
  ...result.projects,
1425
1268
  items: result.projects.items.map((row) => {
1426
1269
  const r = { ...row };
1427
- addNameSibling(r, "projectLeadResourceID", (v) => names.resourceName(v));
1428
- addNameSibling(r, "creatorResourceID", (v) => names.resourceName(v));
1429
- addNameSibling(r, "contractID", (v) => names.recordName("contract", v));
1270
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "projectLeadResourceID", (v) => names.resourceName(v));
1271
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "creatorResourceID", (v) => names.resourceName(v));
1272
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, r, "contractID", (v) => names.recordName("contract", v));
1430
1273
  return r;
1431
1274
  })
1432
1275
  };
@@ -1458,7 +1301,7 @@ function isDateYMD(v) {
1458
1301
  }
1459
1302
  function validateUnbilledWorkOptions(companyId, opts) {
1460
1303
  if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
1461
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
1304
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
1462
1305
  `unbilledWork: opts must be the options object (got ${Array.isArray(opts) ? "an array" : typeof opts})`,
1463
1306
  { operation: "companies.unbilledWork" }
1464
1307
  );
@@ -1487,7 +1330,7 @@ function validateUnbilledWorkOptions(companyId, opts) {
1487
1330
  try {
1488
1331
  limit = clampLimit(opts.limit);
1489
1332
  } catch (err) {
1490
- problems.push(err instanceof _chunkRWLPTU67cjs.AutotaskError ? err.message : `limit must be an integer >= 1 (got ${String(opts.limit)})`);
1333
+ problems.push(err instanceof _chunkYKEX4SK7cjs.AutotaskError ? err.message : `limit must be an integer >= 1 (got ${String(opts.limit)})`);
1491
1334
  limit = 50;
1492
1335
  }
1493
1336
  if (source === "date_range") {
@@ -1502,9 +1345,9 @@ function validateUnbilledWorkOptions(companyId, opts) {
1502
1345
  problems.push('invoiceId is required (the vendor invoice id) when source is "invoice"');
1503
1346
  } else {
1504
1347
  try {
1505
- _chunkRWLPTU67cjs.parseIdentifier.call(void 0, opts.invoiceId, "opts.invoiceId");
1348
+ _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, opts.invoiceId, "opts.invoiceId");
1506
1349
  } catch (err) {
1507
- problems.push(err instanceof _chunkRWLPTU67cjs.AutotaskError ? err.message : "invoiceId must be a vendor numeric id");
1350
+ problems.push(err instanceof _chunkYKEX4SK7cjs.AutotaskError ? err.message : "invoiceId must be a vendor numeric id");
1508
1351
  }
1509
1352
  }
1510
1353
  }
@@ -1514,20 +1357,20 @@ function validateUnbilledWorkOptions(companyId, opts) {
1514
1357
  } else {
1515
1358
  opts.ticketIds.forEach((tid, i) => {
1516
1359
  try {
1517
- _chunkRWLPTU67cjs.parseIdentifier.call(void 0, tid, `opts.ticketIds[${i}]`);
1360
+ _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, tid, `opts.ticketIds[${i}]`);
1518
1361
  } catch (err) {
1519
- problems.push(err instanceof _chunkRWLPTU67cjs.AutotaskError ? err.message : `ticketIds[${i}] must be a vendor numeric id`);
1362
+ problems.push(err instanceof _chunkYKEX4SK7cjs.AutotaskError ? err.message : `ticketIds[${i}] must be a vendor numeric id`);
1520
1363
  }
1521
1364
  });
1522
1365
  }
1523
1366
  }
1524
1367
  try {
1525
- _chunkRWLPTU67cjs.parseIdentifier.call(void 0, companyId, "companyId");
1368
+ _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, companyId, "companyId");
1526
1369
  } catch (err) {
1527
- problems.push(err instanceof _chunkRWLPTU67cjs.AutotaskError ? err.message : "companyId must be a vendor numeric id");
1370
+ problems.push(err instanceof _chunkYKEX4SK7cjs.AutotaskError ? err.message : "companyId must be a vendor numeric id");
1528
1371
  }
1529
1372
  if (problems.length > 0) {
1530
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
1373
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
1531
1374
  `unbilledWork: ${problems.length} problem(s) found pre-request (zero wire was issued)
1532
1375
  - ` + problems.join("\n- "),
1533
1376
  { operation: "companies.unbilledWork" }
@@ -1556,7 +1399,7 @@ async function boundedPart(http, path, conditions, limit, includeFields) {
1556
1399
  body,
1557
1400
  operation: "companies.unbilledWork"
1558
1401
  });
1559
- const { items, pageDetails } = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res, "companies.unbilledWork");
1402
+ const { items, pageDetails } = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res, "companies.unbilledWork");
1560
1403
  const capped = items.length >= limit;
1561
1404
  return { items, capped, hasMore: capped && pageDetails.nextPageUrl != null };
1562
1405
  }
@@ -1567,7 +1410,7 @@ function capJoinSet(ids, cap) {
1567
1410
  }
1568
1411
  function unbilledWorkPartStatus(key, conditions, items) {
1569
1412
  if (items.length !== 0) return { status: "ok" };
1570
- const stamp = _chunkRWLPTU67cjs.blindStampFor.call(void 0, _optionalChain([_chunkRWLPTU67cjs.BLIND_SURFACE_STAMPS, 'access', _25 => _25[key], 'optionalAccess', _26 => _26.query]), conditions);
1413
+ const stamp = _chunkYKEX4SK7cjs.blindStampFor.call(void 0, _optionalChain([_chunkYKEX4SK7cjs.BLIND_SURFACE_STAMPS, 'access', _18 => _18[key], 'optionalAccess', _19 => _19.query]), conditions);
1571
1414
  if (stamp !== void 0) return { status: "blind", blindSurface: stamp, note: stamp.note };
1572
1415
  return {
1573
1416
  status: "ok",
@@ -1576,7 +1419,7 @@ function unbilledWorkPartStatus(key, conditions, items) {
1576
1419
  }
1577
1420
  async function unbilledWork(resource, companyId, opts = {}, http) {
1578
1421
  const v = validateUnbilledWorkOptions(companyId, opts);
1579
- const id = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, companyId, "companyId");
1422
+ const id = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, companyId, "companyId");
1580
1423
  const company = await resource.get(id);
1581
1424
  const companyIds = [num(company.id)];
1582
1425
  let parent = null;
@@ -1589,7 +1432,7 @@ async function unbilledWork(resource, companyId, opts = {}, http) {
1589
1432
  parentStatus = "ok";
1590
1433
  companyIds.push(num(parent.id));
1591
1434
  } catch (err) {
1592
- if (err instanceof _chunkRWLPTU67cjs.NotFoundError) parent = null;
1435
+ if (err instanceof _chunkYKEX4SK7cjs.NotFoundError) parent = null;
1593
1436
  else throw err;
1594
1437
  }
1595
1438
  }
@@ -1621,7 +1464,7 @@ async function unbilledWork(resource, companyId, opts = {}, http) {
1621
1464
  if (v.dateFrom !== void 0) billingConditions.push({ field: "itemDate", op: "gte", value: v.dateFrom });
1622
1465
  if (v.dateTo !== void 0) billingConditions.push({ field: "itemDate", op: "lte", value: v.dateTo });
1623
1466
  }
1624
- const billingFields = _chunkRWLPTU67cjs.resolveFieldsPreset.call(void 0, "billing_join", "billing_items");
1467
+ const billingFields = _chunkYKEX4SK7cjs.resolveFieldsPreset.call(void 0, "billing_join", "billing_items");
1625
1468
  const billingIncludeFields = [...billingFields, "id", ...v.includeNotes ? ["description"] : []];
1626
1469
  const billingRaw = await boundedPart(http, "/V1.0/BillingItems/query", billingConditions, v.limit, billingIncludeFields);
1627
1470
  const taskCap = capJoinSet(taskIds, UNBILLED_WORK_JOIN_SET_CAP);
@@ -1640,7 +1483,8 @@ async function unbilledWork(resource, companyId, opts = {}, http) {
1640
1483
  capped: false,
1641
1484
  hasMore: false,
1642
1485
  status: "skipped",
1643
- note: "skipped: the company (set) has no tickets or tasks in the returned join set \u2014 no tasks/tickets to join against is NOT evidence of no time entries (zero wire)"
1486
+ // joinNotes ride the skipped part too: an empty join set from a PARTIAL read (e.g. a full projects page) is not a true zero
1487
+ note: ["skipped: the company (set) has no tickets or tasks in the returned join set \u2014 no tasks/tickets to join against is NOT evidence of no time entries (zero wire)", ...joinNotes].join(" | ")
1644
1488
  };
1645
1489
  } else {
1646
1490
  const timeConditions = taskCap.ids.length > 0 && ticketCap.ids.length > 0 ? [{ op: "or", items: [{ field: "taskID", op: "in", value: taskCap.ids }, { field: "ticketID", op: "in", value: ticketCap.ids }] }] : taskCap.ids.length > 0 ? [{ field: "taskID", op: "in", value: taskCap.ids }] : [{ field: "ticketID", op: "in", value: ticketCap.ids }];
@@ -1652,7 +1496,7 @@ async function unbilledWork(resource, companyId, opts = {}, http) {
1652
1496
  let cappedItems = entries;
1653
1497
  let noteCharsTruncated = 0;
1654
1498
  if (v.includeNotes) {
1655
- [cappedItems, noteCharsTruncated] = _chunkRWLPTU67cjs.truncateNoteChars.call(void 0, entries, v.noteChars, ["summaryNotes"]);
1499
+ [cappedItems, noteCharsTruncated] = _chunkYKEX4SK7cjs.truncateNoteChars.call(void 0, entries, v.noteChars, ["summaryNotes"]);
1656
1500
  }
1657
1501
  const st = unbilledWorkPartStatus("time_entries", timeConditions, entries);
1658
1502
  timePart = {
@@ -1667,8 +1511,8 @@ async function unbilledWork(resource, companyId, opts = {}, http) {
1667
1511
  let billingItems = billingRaw.items;
1668
1512
  let billingNoteCharsTruncated = 0;
1669
1513
  if (v.includeNotes) {
1670
- const noteFields = (_nullishCoalesce(_chunkRWLPTU67cjs.UNTRUSTED_FIELDS_BY_RESOURCE["billing_items"], () => ( []))).filter((f) => billingIncludeFields.includes(f));
1671
- [billingItems, billingNoteCharsTruncated] = _chunkRWLPTU67cjs.truncateNoteChars.call(void 0, billingRaw.items, v.noteChars, noteFields);
1514
+ const noteFields = (_nullishCoalesce(_chunkYKEX4SK7cjs.UNTRUSTED_FIELDS_BY_RESOURCE["billing_items"], () => ( []))).filter((f) => billingIncludeFields.includes(f));
1515
+ [billingItems, billingNoteCharsTruncated] = _chunkYKEX4SK7cjs.truncateNoteChars.call(void 0, billingRaw.items, v.noteChars, noteFields);
1672
1516
  }
1673
1517
  const billingSt = unbilledWorkPartStatus("billing_items", billingConditions, billingRaw.items);
1674
1518
  const billingItemsPart = {
@@ -1765,7 +1609,7 @@ async function unbilledWork(resource, companyId, opts = {}, http) {
1765
1609
  }
1766
1610
 
1767
1611
  // src/resources/companies.ts
1768
- var CompaniesResource = class extends _chunkRWLPTU67cjs.BaseResource {
1612
+ var CompaniesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
1769
1613
  constructor(http, pageSize) {
1770
1614
  super(http, {
1771
1615
  key: "companies",
@@ -1833,6 +1677,13 @@ var CompaniesResource = class extends _chunkRWLPTU67cjs.BaseResource {
1833
1677
  async search(query, opts) {
1834
1678
  return searchWithFamily(this, query, opts, this.http);
1835
1679
  }
1680
+ /** `search` with an empty result explained. Same closed opts discipline as `search`: only `limit` is
1681
+ * accepted here (an unknown key is refused pre-request, zero wire — never silently dropped); the
1682
+ * family block is a `search`-only option. */
1683
+ async searchWithDetail(query, opts = {}) {
1684
+ assertSearchWithDetailOpts(opts);
1685
+ return super.searchWithDetail(query, opts);
1686
+ }
1836
1687
  /** Get the Company with its primary context records in one call (each part a single-record
1837
1688
  * fetch; no sub-lists; absent/dangling references come back null). */
1838
1689
  async getContext(id) {
@@ -1865,7 +1716,7 @@ var CompaniesResource = class extends _chunkRWLPTU67cjs.BaseResource {
1865
1716
  };
1866
1717
 
1867
1718
  // src/resources/company_alerts.ts
1868
- var CompanyAlertsResource = class extends _chunkRWLPTU67cjs.BaseResource {
1719
+ var CompanyAlertsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
1869
1720
  constructor(http, pageSize) {
1870
1721
  super(http, {
1871
1722
  key: "company_alerts",
@@ -1931,7 +1782,7 @@ var CompanyAlertsResource = class extends _chunkRWLPTU67cjs.BaseResource {
1931
1782
  };
1932
1783
 
1933
1784
  // src/resources/company_locations.ts
1934
- var CompanyLocationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
1785
+ var CompanyLocationsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
1935
1786
  constructor(http, pageSize) {
1936
1787
  super(http, {
1937
1788
  key: "company_locations",
@@ -2002,7 +1853,7 @@ var CompanyLocationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2002
1853
  };
2003
1854
 
2004
1855
  // src/resources/company_notes.ts
2005
- var CompanyNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
1856
+ var CompanyNotesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2006
1857
  constructor(http, pageSize) {
2007
1858
  super(http, {
2008
1859
  key: "company_notes",
@@ -2067,7 +1918,7 @@ var CompanyNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
2067
1918
  };
2068
1919
 
2069
1920
  // src/resources/company_site_configurations.ts
2070
- var CompanySiteConfigurationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
1921
+ var CompanySiteConfigurationsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2071
1922
  constructor(http, pageSize) {
2072
1923
  super(http, {
2073
1924
  key: "company_site_configurations",
@@ -2118,7 +1969,7 @@ var CompanySiteConfigurationsResource = class extends _chunkRWLPTU67cjs.BaseReso
2118
1969
  };
2119
1970
 
2120
1971
  // src/resources/company_webhooks.ts
2121
- var CompanyWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
1972
+ var CompanyWebhooksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2122
1973
  constructor(http, pageSize) {
2123
1974
  super(http, {
2124
1975
  key: "company_webhooks",
@@ -2194,7 +2045,7 @@ var CompanyWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
2194
2045
  };
2195
2046
 
2196
2047
  // src/resources/configuration_item_billing_product_associations.ts
2197
- var ConfigurationItemBillingProductAssociationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2048
+ var ConfigurationItemBillingProductAssociationsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2198
2049
  constructor(http, pageSize) {
2199
2050
  super(http, {
2200
2051
  key: "configuration_item_billing_product_associations",
@@ -2260,7 +2111,7 @@ var ConfigurationItemBillingProductAssociationsResource = class extends _chunkRW
2260
2111
  };
2261
2112
 
2262
2113
  // src/resources/configuration_item_categories.ts
2263
- var ConfigurationItemCategoriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
2114
+ var ConfigurationItemCategoriesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2264
2115
  constructor(http, pageSize) {
2265
2116
  super(http, {
2266
2117
  key: "configuration_item_categories",
@@ -2327,7 +2178,7 @@ var ConfigurationItemCategoriesResource = class extends _chunkRWLPTU67cjs.BaseRe
2327
2178
  };
2328
2179
 
2329
2180
  // src/resources/configuration_item_category_udf_associations.ts
2330
- var ConfigurationItemCategoryUdfAssociationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2181
+ var ConfigurationItemCategoryUdfAssociationsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2331
2182
  constructor(http, pageSize) {
2332
2183
  super(http, {
2333
2184
  key: "configuration_item_category_udf_associations",
@@ -2393,7 +2244,7 @@ var ConfigurationItemCategoryUdfAssociationsResource = class extends _chunkRWLPT
2393
2244
  };
2394
2245
 
2395
2246
  // src/resources/configuration_item_dns_records.ts
2396
- var ConfigurationItemDnsRecordsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2247
+ var ConfigurationItemDnsRecordsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2397
2248
  constructor(http, pageSize) {
2398
2249
  super(http, {
2399
2250
  key: "configuration_item_dns_records",
@@ -2442,7 +2293,7 @@ var ConfigurationItemDnsRecordsResource = class extends _chunkRWLPTU67cjs.BaseRe
2442
2293
  };
2443
2294
 
2444
2295
  // src/resources/configuration_item_notes.ts
2445
- var ConfigurationItemNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
2296
+ var ConfigurationItemNotesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2446
2297
  constructor(http, pageSize) {
2447
2298
  super(http, {
2448
2299
  key: "configuration_item_notes",
@@ -2501,7 +2352,7 @@ var ConfigurationItemNotesResource = class extends _chunkRWLPTU67cjs.BaseResourc
2501
2352
  };
2502
2353
 
2503
2354
  // src/resources/configuration_item_related_items.ts
2504
- var ConfigurationItemRelatedItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2355
+ var ConfigurationItemRelatedItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2505
2356
  constructor(http, pageSize) {
2506
2357
  super(http, {
2507
2358
  key: "configuration_item_related_items",
@@ -2562,16 +2413,16 @@ async function fetchRecord(http, path, label) {
2562
2413
  const res = await http.request({ method: "GET", path, operation: "configuration_items.moveConfigurationItem" });
2563
2414
  const body = res;
2564
2415
  if (body === null || !("item" in body) || body.item === null || body.item === void 0) {
2565
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
2416
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
2566
2417
  }
2567
2418
  return body.item;
2568
2419
  }
2569
2420
  async function moveConfigurationItem(_resource, sourceId, opts, http) {
2570
- const numericSource = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, sourceId, "sourceId");
2571
- if (_optionalChain([opts, 'optionalAccess', _27 => _27.destinationCompanyId]) === void 0) {
2572
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("moveConfigurationItem: destinationCompanyId is required");
2421
+ const numericSource = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, sourceId, "sourceId");
2422
+ if (_optionalChain([opts, 'optionalAccess', _20 => _20.destinationCompanyId]) === void 0) {
2423
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("moveConfigurationItem: destinationCompanyId is required");
2573
2424
  }
2574
- const destId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, opts.destinationCompanyId, "destinationCompanyId");
2425
+ const destId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, opts.destinationCompanyId, "destinationCompanyId");
2575
2426
  const source = await fetchRecord(http, `/V1.0/ConfigurationItems/${numericSource}`, `Configuration item ${numericSource}`);
2576
2427
  await fetchRecord(http, `/V1.0/Companies/${destId}`, `Company ${destId}`);
2577
2428
  const body = { ...source };
@@ -2581,20 +2432,20 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
2581
2432
  body.companyID = destId;
2582
2433
  body.isActive = true;
2583
2434
  if (opts.newReferenceTitle !== void 0) {
2584
- if (opts.newReferenceTitle.trim() === "") throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("moveConfigurationItem: newReferenceTitle must be non-empty");
2435
+ if (opts.newReferenceTitle.trim() === "") throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("moveConfigurationItem: newReferenceTitle must be non-empty");
2585
2436
  body.referenceTitle = opts.newReferenceTitle.trim();
2586
2437
  }
2587
2438
  if (opts.lastModifiedDate !== void 0) {
2588
2439
  const current = source.lastModifiedDate;
2589
2440
  if (current !== opts.lastModifiedDate) {
2590
- throw new (0, _chunkRWLPTU67cjs.StaleObjectError)(
2441
+ throw new (0, _chunkYKEX4SK7cjs.StaleObjectError)(
2591
2442
  `moveConfigurationItem: source item ${numericSource} was modified since the snapshot (expected lastModifiedDate ${opts.lastModifiedDate}, current ${_nullishCoalesce(current, () => ( "unknown"))})`,
2592
2443
  { operation: "configuration_items.moveConfigurationItem", resourceIds: [numericSource] }
2593
2444
  );
2594
2445
  }
2595
2446
  }
2596
2447
  if (opts.dryRun === true) {
2597
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
2448
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
2598
2449
  operation: "configuration_items.moveConfigurationItem",
2599
2450
  method: "POST",
2600
2451
  path: "/V1.0/ConfigurationItems",
@@ -2618,7 +2469,7 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
2618
2469
  const createdBody = created;
2619
2470
  const newId = createdBody !== null ? _nullishCoalesce(createdBody.itemId, () => ( createdBody.id)) : void 0;
2620
2471
  if (typeof newId !== "number") {
2621
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("moveConfigurationItem: vendor create response has no itemId");
2472
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("moveConfigurationItem: vendor create response has no itemId");
2622
2473
  }
2623
2474
  let sourceDeactivated = false;
2624
2475
  if (opts.deactivateSource !== false) {
@@ -2636,7 +2487,7 @@ var PROFILE_PART_LIMIT2 = 50;
2636
2487
  function profilePartLimit2(value, name) {
2637
2488
  const n = value === void 0 ? PROFILE_PART_LIMIT2 : Math.trunc(value);
2638
2489
  if (!Number.isInteger(n) || n < 1) {
2639
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`profile: ${name} must be an integer >= 1 (got ${String(value)})`);
2490
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`profile: ${name} must be an integer >= 1 (got ${String(value)})`);
2640
2491
  }
2641
2492
  return n;
2642
2493
  }
@@ -2652,14 +2503,14 @@ async function contextFetchPart(http, entityPath, referenceId) {
2652
2503
  });
2653
2504
  const body = res;
2654
2505
  if (body === null || !("item" in body)) {
2655
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`context part not found (unexpected envelope shape)`, { resourceIds: [referenceId] });
2506
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`context part not found (unexpected envelope shape)`, { resourceIds: [referenceId] });
2656
2507
  }
2657
2508
  if (body.item === null || body.item === void 0) {
2658
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)("context part not found", { resourceIds: [referenceId] });
2509
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)("context part not found", { resourceIds: [referenceId] });
2659
2510
  }
2660
2511
  return body.item;
2661
2512
  } catch (err) {
2662
- if (err instanceof _chunkRWLPTU67cjs.NotFoundError) return null;
2513
+ if (err instanceof _chunkYKEX4SK7cjs.NotFoundError) return null;
2663
2514
  throw err;
2664
2515
  }
2665
2516
  }
@@ -2671,7 +2522,7 @@ async function ciScopedQuery(http, path, itemID, limit) {
2671
2522
  body: { MaxRecords: limit, filter: [{ field: "configurationItemID", op: "eq", value: itemID }] },
2672
2523
  operation: "configuration_items.profile"
2673
2524
  });
2674
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
2525
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
2675
2526
  }
2676
2527
  async function profile(resource, id, opts = {}, http) {
2677
2528
  const noteLimit = profilePartLimit2(opts.noteLimit, "noteLimit");
@@ -2683,7 +2534,7 @@ async function profile(resource, id, opts = {}, http) {
2683
2534
  const notes = await ciScopedQuery(http, "/V1.0/ConfigurationItemNotes/query", id, noteLimit);
2684
2535
  const relatedItems = await ciScopedQuery(http, "/V1.0/ConfigurationItemRelatedItems/query", id, relatedLimit);
2685
2536
  const associations = await ciScopedQuery(http, "/V1.0/ConfigurationItemBillingProductAssociations/query", id, PROFILE_PART_LIMIT2);
2686
- const wallQuirk = _optionalChain([_chunkRWLPTU67cjs.RELATIONSHIP_MAP, 'access', _28 => _28["configuration_items"], 'optionalAccess', _29 => _29.zoneFacts, 'optionalAccess', _30 => _30.quirks, 'optionalAccess', _31 => _31.find, 'call', _32 => _32((q) => q.startsWith("product wall"))]);
2537
+ const wallQuirk = _optionalChain([_chunkYKEX4SK7cjs.RELATIONSHIP_MAP, 'access', _21 => _21["configuration_items"], 'optionalAccess', _22 => _22.zoneFacts, 'optionalAccess', _23 => _23.quirks, 'optionalAccess', _24 => _24.find, 'call', _25 => _25((q) => q.startsWith("product wall"))]);
2687
2538
  const productAssociations = {
2688
2539
  items: associations,
2689
2540
  capped: associations.length >= PROFILE_PART_LIMIT2,
@@ -2707,11 +2558,11 @@ async function profile(resource, id, opts = {}, http) {
2707
2558
  }
2708
2559
  };
2709
2560
  if (opts.names === true) {
2710
- const builder = createNamePlan();
2561
+ const builder = _chunkYKEX4SK7cjs.createNamePlan.call(void 0, );
2711
2562
  builder.addFk("contract", root["contractID"]);
2712
- const names = await resolveCompositeNames(http, builder.plan(), { maxNameReads: opts.maxNameReads });
2563
+ const names = await _chunkYKEX4SK7cjs.resolveCompositeNames.call(void 0, http, builder.plan(), { maxNameReads: opts.maxNameReads });
2713
2564
  const ciRow = { ...ci };
2714
- addNameSibling(ciRow, "contractID", (v) => names.recordName("contract", v));
2565
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, ciRow, "contractID", (v) => names.recordName("contract", v));
2715
2566
  result.ci = ciRow;
2716
2567
  result.names = names.section;
2717
2568
  }
@@ -2719,7 +2570,7 @@ async function profile(resource, id, opts = {}, http) {
2719
2570
  }
2720
2571
 
2721
2572
  // src/resources/configuration_items.ts
2722
- var ConfigurationItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2573
+ var ConfigurationItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2723
2574
  constructor(http, pageSize) {
2724
2575
  super(http, {
2725
2576
  key: "configuration_items",
@@ -2808,7 +2659,7 @@ var ConfigurationItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2808
2659
  };
2809
2660
 
2810
2661
  // src/resources/configuration_item_ssl_subject_alternative_names.ts
2811
- var ConfigurationItemSslSubjectAlternativeNamesResource = class extends _chunkRWLPTU67cjs.BaseResource {
2662
+ var ConfigurationItemSslSubjectAlternativeNamesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2812
2663
  constructor(http, pageSize) {
2813
2664
  super(http, {
2814
2665
  key: "configuration_item_ssl_subject_alternative_names",
@@ -2871,7 +2722,7 @@ var ConfigurationItemSslSubjectAlternativeNamesResource = class extends _chunkRW
2871
2722
  };
2872
2723
 
2873
2724
  // src/resources/configuration_item_types.ts
2874
- var ConfigurationItemTypesResource = class extends _chunkRWLPTU67cjs.BaseResource {
2725
+ var ConfigurationItemTypesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2875
2726
  constructor(http, pageSize) {
2876
2727
  super(http, {
2877
2728
  key: "configuration_item_types",
@@ -2945,7 +2796,7 @@ var ConfigurationItemTypesResource = class extends _chunkRWLPTU67cjs.BaseResourc
2945
2796
  };
2946
2797
 
2947
2798
  // src/resources/configuration_item_webhooks.ts
2948
- var ConfigurationItemWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
2799
+ var ConfigurationItemWebhooksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
2949
2800
  constructor(http, pageSize) {
2950
2801
  super(http, {
2951
2802
  key: "configuration_item_webhooks",
@@ -3021,7 +2872,7 @@ var ConfigurationItemWebhooksResource = class extends _chunkRWLPTU67cjs.BaseReso
3021
2872
  };
3022
2873
 
3023
2874
  // src/resources/contact_group_contacts.ts
3024
- var ContactGroupContactsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2875
+ var ContactGroupContactsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3025
2876
  constructor(http, pageSize) {
3026
2877
  super(http, {
3027
2878
  key: "contact_group_contacts",
@@ -3075,7 +2926,7 @@ var ContactGroupContactsResource = class extends _chunkRWLPTU67cjs.BaseResource
3075
2926
  };
3076
2927
 
3077
2928
  // src/resources/contact_groups.ts
3078
- var ContactGroupsResource = class extends _chunkRWLPTU67cjs.BaseResource {
2929
+ var ContactGroupsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3079
2930
  constructor(http, pageSize) {
3080
2931
  super(http, {
3081
2932
  key: "contact_groups",
@@ -3153,22 +3004,22 @@ async function fetchRecord2(http, path, label) {
3153
3004
  const res = await http.request({ method: "GET", path, operation: "contacts.moveToCompany" });
3154
3005
  const body = res;
3155
3006
  if (body === null || !("item" in body) || body.item === null || body.item === void 0) {
3156
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
3007
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
3157
3008
  }
3158
3009
  return body.item;
3159
3010
  }
3160
3011
  async function moveToCompany(_resource, sourceContactId, destinationCompanyId, opts = {}, http) {
3161
- const sourceId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, sourceContactId, "sourceContactId");
3162
- const destId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, destinationCompanyId, "destinationCompanyId");
3012
+ const sourceId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, sourceContactId, "sourceContactId");
3013
+ const destId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, destinationCompanyId, "destinationCompanyId");
3163
3014
  const source = await fetchRecord2(http, `/V1.0/Contacts/${sourceId}`, `Contact ${sourceId}`);
3164
3015
  const companyID = source.companyID;
3165
3016
  if (typeof companyID !== "number" || companyID < 0) {
3166
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`Contact ${sourceId} has no companyID (cannot scope the source delete)`);
3017
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`Contact ${sourceId} has no companyID (cannot scope the source delete)`);
3167
3018
  }
3168
3019
  if (opts.lastModifiedDate !== void 0) {
3169
3020
  const current = source.lastModifiedDate;
3170
3021
  if (current !== opts.lastModifiedDate) {
3171
- throw new (0, _chunkRWLPTU67cjs.StaleObjectError)(
3022
+ throw new (0, _chunkYKEX4SK7cjs.StaleObjectError)(
3172
3023
  `moveToCompany: source contact ${sourceId} was modified since the snapshot (expected lastModifiedDate ${opts.lastModifiedDate}, current ${typeof current === "string" ? current : "unknown"})`,
3173
3024
  { operation: "contacts.moveToCompany", resourceIds: [sourceId, destId] }
3174
3025
  );
@@ -3190,10 +3041,10 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
3190
3041
  },
3191
3042
  operation: "contacts.moveToCompany"
3192
3043
  });
3193
- const items = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
3044
+ const items = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
3194
3045
  const clash = items.find((c) => String(c.id) !== String(sourceId));
3195
3046
  if (clash !== void 0) {
3196
- throw new (0, _chunkRWLPTU67cjs.ConflictError)(
3047
+ throw new (0, _chunkYKEX4SK7cjs.ConflictError)(
3197
3048
  `Contact email "${email}" already exists under company ${destId} (contact ${String(clash.id)}); aborting the move`,
3198
3049
  { resourceIds: [sourceId, destId] }
3199
3050
  );
@@ -3207,7 +3058,7 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
3207
3058
  if (opts.dryRun === true) {
3208
3059
  const warnings = [];
3209
3060
  if (opts.deleteSource === true) warnings.push("the source contact will be deleted after the move");
3210
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
3061
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
3211
3062
  operation: "contacts.moveToCompany",
3212
3063
  method: "POST",
3213
3064
  path: `/V1.0/Companies/${destId}/Contacts`,
@@ -3232,7 +3083,7 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
3232
3083
  const createdBody = created;
3233
3084
  const newId = createdBody !== null ? _nullishCoalesce(createdBody.itemId, () => ( createdBody.id)) : void 0;
3234
3085
  if (typeof newId !== "number") {
3235
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("contacts.moveToCompany: vendor create response has no itemId");
3086
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("contacts.moveToCompany: vendor create response has no itemId");
3236
3087
  }
3237
3088
  let sourceDeleted = false;
3238
3089
  if (opts.deleteSource === true) {
@@ -3250,7 +3101,7 @@ var UPSERT_MAX_DISCOVERY_MERGES = 3;
3250
3101
  var EMAIL_SHAPE = /^.+@.+/;
3251
3102
  var SAFE_CONTACT_CREATE_DEFAULTS = {};
3252
3103
  var DEDUP_LIMIT = 10;
3253
- var CompanyNotFoundError = class extends _chunkRWLPTU67cjs.AutotaskError {
3104
+ var CompanyNotFoundError = class extends _chunkYKEX4SK7cjs.AutotaskError {
3254
3105
  constructor(message, options = {}) {
3255
3106
  super(message, {
3256
3107
  code: "COMPANY_NOT_FOUND",
@@ -3261,7 +3112,7 @@ var CompanyNotFoundError = class extends _chunkRWLPTU67cjs.AutotaskError {
3261
3112
  this.name = "CompanyNotFoundError";
3262
3113
  }
3263
3114
  };
3264
- var ContactCreateFailedError = class extends _chunkRWLPTU67cjs.AutotaskError {
3115
+ var ContactCreateFailedError = class extends _chunkYKEX4SK7cjs.AutotaskError {
3265
3116
  /** The vendor-named fields (empty when the 500 body named nothing parseable). */
3266
3117
 
3267
3118
  constructor(message, vendorFields, options = {}) {
@@ -3271,25 +3122,25 @@ var ContactCreateFailedError = class extends _chunkRWLPTU67cjs.AutotaskError {
3271
3122
  }
3272
3123
  };
3273
3124
  async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3274
- const cid = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, companyID, "companyID");
3125
+ const cid = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, companyID, "companyID");
3275
3126
  if (typeof email !== "string" || !EMAIL_SHAPE.test(email)) {
3276
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
3127
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
3277
3128
  `upsertByEmail: email must be a non-empty string with the @ shape (a non-empty local part + a non-empty domain; got ${JSON.stringify(email)})`,
3278
3129
  { operation: OP_UPSERT_EMAIL }
3279
3130
  );
3280
3131
  }
3281
3132
  if (extra !== void 0) {
3282
3133
  if (extra.isActive !== void 0 && typeof extra.isActive !== "boolean" && extra.isActive !== 0 && extra.isActive !== 1) {
3283
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
3134
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
3284
3135
  `upsertByEmail: extra.isActive must be a boolean (mapped to the zone-correct number 1/0) or a raw 0/1 number (got ${String(extra.isActive)})`,
3285
3136
  { operation: OP_UPSERT_EMAIL }
3286
3137
  );
3287
3138
  }
3288
3139
  if (extra.firstName !== void 0 && (typeof extra.firstName !== "string" || extra.firstName === "")) {
3289
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("upsertByEmail: extra.firstName must be a non-empty string (or omitted \u2014 the node defaults it to the email local-part)", { operation: OP_UPSERT_EMAIL });
3140
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("upsertByEmail: extra.firstName must be a non-empty string (or omitted \u2014 the node defaults it to the email local-part)", { operation: OP_UPSERT_EMAIL });
3290
3141
  }
3291
3142
  if (extra.lastName !== void 0 && typeof extra.lastName !== "string") {
3292
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("upsertByEmail: extra.lastName must be a string (or omitted \u2014 the node defaults it to the non-empty neutral value Unknown)", { operation: OP_UPSERT_EMAIL });
3143
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("upsertByEmail: extra.lastName must be a string (or omitted \u2014 the node defaults it to the non-empty neutral value Unknown)", { operation: OP_UPSERT_EMAIL });
3293
3144
  }
3294
3145
  }
3295
3146
  const parentRes = await http.request({ method: "GET", path: `/V1.0/Companies/${cid}`, operation: OP_UPSERT_EMAIL });
@@ -3310,7 +3161,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3310
3161
  const match = q.items[0];
3311
3162
  if (match !== void 0) {
3312
3163
  if (opts.dryRun === true) {
3313
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
3164
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
3314
3165
  {
3315
3166
  operation: OP_UPSERT_EMAIL,
3316
3167
  method: "POST",
@@ -3331,16 +3182,16 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3331
3182
  return { id: Number(match.id), created: false, existing: match };
3332
3183
  }
3333
3184
  const localPart = email.split("@")[0];
3334
- const isActive = _optionalChain([extra, 'optionalAccess', _33 => _33.isActive]) === void 0 ? true : extra.isActive;
3185
+ const isActive = _optionalChain([extra, 'optionalAccess', _26 => _26.isActive]) === void 0 ? true : extra.isActive;
3335
3186
  const body = {
3336
3187
  emailAddress: email,
3337
3188
  companyID: cid,
3338
- firstName: _nullishCoalesce(_optionalChain([extra, 'optionalAccess', _34 => _34.firstName]), () => ( localPart)),
3339
- lastName: _nullishCoalesce(_optionalChain([extra, 'optionalAccess', _35 => _35.lastName]), () => ( "Unknown")),
3189
+ firstName: _nullishCoalesce(_optionalChain([extra, 'optionalAccess', _27 => _27.firstName]), () => ( localPart)),
3190
+ lastName: _nullishCoalesce(_optionalChain([extra, 'optionalAccess', _28 => _28.lastName]), () => ( "Unknown")),
3340
3191
  isActive: typeof isActive === "boolean" ? isActive ? 1 : 0 : isActive
3341
3192
  };
3342
3193
  if (opts.dryRun === true) {
3343
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
3194
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
3344
3195
  {
3345
3196
  operation: OP_UPSERT_EMAIL,
3346
3197
  method: "POST",
@@ -3363,8 +3214,8 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3363
3214
  const created = await resource.create(cid, body, {});
3364
3215
  return { id: created.id, created: true };
3365
3216
  } catch (err) {
3366
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) throw err;
3367
- const named = (_nullishCoalesce(_chunkRWLPTU67cjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []))).map((e) => e.field).filter((f) => f !== void 0);
3217
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) throw err;
3218
+ const named = (_nullishCoalesce(_chunkYKEX4SK7cjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []))).map((e) => e.field).filter((f) => f !== void 0);
3368
3219
  const seen = /* @__PURE__ */ new Set();
3369
3220
  const unique = [...named].filter((f) => seen.has(f) ? false : (seen.add(f), true));
3370
3221
  const hasDefault = unique.some((f) => SAFE_CONTACT_CREATE_DEFAULTS[f] !== void 0);
@@ -3378,7 +3229,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3378
3229
  }
3379
3230
  continue;
3380
3231
  }
3381
- const detail = _chunkRWLPTU67cjs.formatVendorDetail.call(void 0, err.vendorError);
3232
+ const detail = _chunkYKEX4SK7cjs.formatVendorDetail.call(void 0, err.vendorError);
3382
3233
  throw new ContactCreateFailedError(
3383
3234
  `upsertByEmail: the vendor rejected the contact create${unique.length > 0 ? ` naming field(s) ${unique.join(", ")}` : ""} (no proven-safe default \u2014 the required set is fully filled by the node)${detail ? ` \u2014 ${detail}` : ""}`,
3384
3235
  unique,
@@ -3394,7 +3245,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3394
3245
  }
3395
3246
 
3396
3247
  // src/resources/contacts.ts
3397
- var ContactsResource = class extends _chunkRWLPTU67cjs.BaseResource {
3248
+ var ContactsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3398
3249
  constructor(http, pageSize) {
3399
3250
  super(http, {
3400
3251
  key: "contacts",
@@ -3486,7 +3337,7 @@ var ContactsResource = class extends _chunkRWLPTU67cjs.BaseResource {
3486
3337
  };
3487
3338
 
3488
3339
  // src/resources/contact_webhooks.ts
3489
- var ContactWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
3340
+ var ContactWebhooksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3490
3341
  constructor(http, pageSize) {
3491
3342
  super(http, {
3492
3343
  key: "contact_webhooks",
@@ -3562,7 +3413,7 @@ var ContactWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
3562
3413
  };
3563
3414
 
3564
3415
  // src/resources/contract_billing_rules.ts
3565
- var ContractBillingRulesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3416
+ var ContractBillingRulesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3566
3417
  constructor(http, pageSize) {
3567
3418
  super(http, {
3568
3419
  key: "contract_billing_rules",
@@ -3628,7 +3479,7 @@ var ContractBillingRulesResource = class extends _chunkRWLPTU67cjs.BaseResource
3628
3479
  };
3629
3480
 
3630
3481
  // src/resources/contract_block_hour_factors.ts
3631
- var ContractBlockHourFactorsResource = class extends _chunkRWLPTU67cjs.BaseResource {
3482
+ var ContractBlockHourFactorsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3632
3483
  constructor(http, pageSize) {
3633
3484
  super(http, {
3634
3485
  key: "contract_block_hour_factors",
@@ -3687,7 +3538,7 @@ var ContractBlockHourFactorsResource = class extends _chunkRWLPTU67cjs.BaseResou
3687
3538
  };
3688
3539
 
3689
3540
  // src/resources/contract_blocks.ts
3690
- var ContractBlocksResource = class extends _chunkRWLPTU67cjs.BaseResource {
3541
+ var ContractBlocksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3691
3542
  constructor(http, pageSize) {
3692
3543
  super(http, {
3693
3544
  key: "contract_blocks",
@@ -3746,7 +3597,7 @@ var ContractBlocksResource = class extends _chunkRWLPTU67cjs.BaseResource {
3746
3597
  };
3747
3598
 
3748
3599
  // src/resources/contract_charges.ts
3749
- var ContractChargesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3600
+ var ContractChargesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3750
3601
  constructor(http, pageSize) {
3751
3602
  super(http, {
3752
3603
  key: "contract_charges",
@@ -3817,7 +3668,7 @@ var ContractChargesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3817
3668
  };
3818
3669
 
3819
3670
  // src/resources/contract_exclusion_billing_codes.ts
3820
- var ContractExclusionBillingCodesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3671
+ var ContractExclusionBillingCodesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3821
3672
  constructor(http, pageSize) {
3822
3673
  super(http, {
3823
3674
  key: "contract_exclusion_billing_codes",
@@ -3874,7 +3725,7 @@ var ContractExclusionBillingCodesResource = class extends _chunkRWLPTU67cjs.Base
3874
3725
  };
3875
3726
 
3876
3727
  // src/resources/contract_exclusion_roles.ts
3877
- var ContractExclusionRolesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3728
+ var ContractExclusionRolesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3878
3729
  constructor(http, pageSize) {
3879
3730
  super(http, {
3880
3731
  key: "contract_exclusion_roles",
@@ -3931,7 +3782,7 @@ var ContractExclusionRolesResource = class extends _chunkRWLPTU67cjs.BaseResourc
3931
3782
  };
3932
3783
 
3933
3784
  // src/resources/contract_exclusion_set_excluded_roles.ts
3934
- var ContractExclusionSetExcludedRolesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3785
+ var ContractExclusionSetExcludedRolesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3935
3786
  constructor(http, pageSize) {
3936
3787
  super(http, {
3937
3788
  key: "contract_exclusion_set_excluded_roles",
@@ -3988,7 +3839,7 @@ var ContractExclusionSetExcludedRolesResource = class extends _chunkRWLPTU67cjs.
3988
3839
  };
3989
3840
 
3990
3841
  // src/resources/contract_exclusion_set_excluded_work_types.ts
3991
- var ContractExclusionSetExcludedWorkTypesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3842
+ var ContractExclusionSetExcludedWorkTypesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
3992
3843
  constructor(http, pageSize) {
3993
3844
  super(http, {
3994
3845
  key: "contract_exclusion_set_excluded_work_types",
@@ -4045,7 +3896,7 @@ var ContractExclusionSetExcludedWorkTypesResource = class extends _chunkRWLPTU67
4045
3896
  };
4046
3897
 
4047
3898
  // src/resources/contract_exclusion_sets.ts
4048
- var ContractExclusionSetsResource = class extends _chunkRWLPTU67cjs.BaseResource {
3899
+ var ContractExclusionSetsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4049
3900
  constructor(http, pageSize) {
4050
3901
  super(http, {
4051
3902
  key: "contract_exclusion_sets",
@@ -4119,7 +3970,7 @@ var ContractExclusionSetsResource = class extends _chunkRWLPTU67cjs.BaseResource
4119
3970
  };
4120
3971
 
4121
3972
  // src/resources/contract_milestones.ts
4122
- var ContractMilestonesResource = class extends _chunkRWLPTU67cjs.BaseResource {
3973
+ var ContractMilestonesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4123
3974
  constructor(http, pageSize) {
4124
3975
  super(http, {
4125
3976
  key: "contract_milestones",
@@ -4178,7 +4029,7 @@ var ContractMilestonesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4178
4029
  };
4179
4030
 
4180
4031
  // src/resources/contract_notes.ts
4181
- var ContractNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4032
+ var ContractNotesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4182
4033
  constructor(http, pageSize) {
4183
4034
  super(http, {
4184
4035
  key: "contract_notes",
@@ -4237,7 +4088,7 @@ var ContractNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4237
4088
  };
4238
4089
 
4239
4090
  // src/resources/contract_rates.ts
4240
- var ContractRatesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4091
+ var ContractRatesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4241
4092
  constructor(http, pageSize) {
4242
4093
  super(http, {
4243
4094
  key: "contract_rates",
@@ -4296,7 +4147,7 @@ var ContractRatesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4296
4147
  };
4297
4148
 
4298
4149
  // src/resources/contract_retainers.ts
4299
- var ContractRetainersResource = class extends _chunkRWLPTU67cjs.BaseResource {
4150
+ var ContractRetainersResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4300
4151
  constructor(http, pageSize) {
4301
4152
  super(http, {
4302
4153
  key: "contract_retainers",
@@ -4355,7 +4206,7 @@ var ContractRetainersResource = class extends _chunkRWLPTU67cjs.BaseResource {
4355
4206
  };
4356
4207
 
4357
4208
  // src/resources/contract_role_costs.ts
4358
- var ContractRoleCostsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4209
+ var ContractRoleCostsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4359
4210
  constructor(http, pageSize) {
4360
4211
  super(http, {
4361
4212
  key: "contract_role_costs",
@@ -4414,7 +4265,7 @@ var ContractRoleCostsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4414
4265
  };
4415
4266
 
4416
4267
  // src/resources/contract_service_adjustments.ts
4417
- var ContractServiceAdjustmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4268
+ var ContractServiceAdjustmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4418
4269
  constructor(http, pageSize) {
4419
4270
  super(http, {
4420
4271
  key: "contract_service_adjustments",
@@ -4448,7 +4299,7 @@ var ContractServiceAdjustmentsResource = class extends _chunkRWLPTU67cjs.BaseRes
4448
4299
  };
4449
4300
 
4450
4301
  // src/resources/contract_service_bundle_adjustments.ts
4451
- var ContractServiceBundleAdjustmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4302
+ var ContractServiceBundleAdjustmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4452
4303
  constructor(http, pageSize) {
4453
4304
  super(http, {
4454
4305
  key: "contract_service_bundle_adjustments",
@@ -4482,7 +4333,7 @@ var ContractServiceBundleAdjustmentsResource = class extends _chunkRWLPTU67cjs.B
4482
4333
  };
4483
4334
 
4484
4335
  // src/resources/contract_service_bundles.ts
4485
- var ContractServiceBundlesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4336
+ var ContractServiceBundlesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4486
4337
  constructor(http, pageSize) {
4487
4338
  super(http, {
4488
4339
  key: "contract_service_bundles",
@@ -4541,7 +4392,7 @@ var ContractServiceBundlesResource = class extends _chunkRWLPTU67cjs.BaseResourc
4541
4392
  };
4542
4393
 
4543
4394
  // src/resources/contract_service_bundle_units.ts
4544
- var ContractServiceBundleUnitsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4395
+ var ContractServiceBundleUnitsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4545
4396
  constructor(http, pageSize) {
4546
4397
  super(http, {
4547
4398
  key: "contract_service_bundle_units",
@@ -4583,7 +4434,7 @@ var ContractServiceBundleUnitsResource = class extends _chunkRWLPTU67cjs.BaseRes
4583
4434
  };
4584
4435
 
4585
4436
  // src/resources/contract_services.ts
4586
- var ContractServicesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4437
+ var ContractServicesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4587
4438
  constructor(http, pageSize) {
4588
4439
  super(http, {
4589
4440
  key: "contract_services",
@@ -4642,7 +4493,7 @@ var ContractServicesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4642
4493
  };
4643
4494
 
4644
4495
  // src/resources/contract_service_units.ts
4645
- var ContractServiceUnitsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4496
+ var ContractServiceUnitsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4646
4497
  constructor(http, pageSize) {
4647
4498
  super(http, {
4648
4499
  key: "contract_service_units",
@@ -4684,7 +4535,7 @@ var ContractServiceUnitsResource = class extends _chunkRWLPTU67cjs.BaseResource
4684
4535
  };
4685
4536
 
4686
4537
  // src/resources/contracts.ts
4687
- var ContractsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4538
+ var ContractsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4688
4539
  constructor(http, pageSize) {
4689
4540
  super(http, {
4690
4541
  key: "contracts",
@@ -4751,7 +4602,7 @@ var ContractsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4751
4602
  };
4752
4603
 
4753
4604
  // src/resources/contract_ticket_purchases.ts
4754
- var ContractTicketPurchasesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4605
+ var ContractTicketPurchasesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4755
4606
  constructor(http, pageSize) {
4756
4607
  super(http, {
4757
4608
  key: "contract_ticket_purchases",
@@ -4810,7 +4661,7 @@ var ContractTicketPurchasesResource = class extends _chunkRWLPTU67cjs.BaseResour
4810
4661
  };
4811
4662
 
4812
4663
  // src/resources/countries.ts
4813
- var CountriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4664
+ var CountriesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4814
4665
  constructor(http, pageSize) {
4815
4666
  super(http, {
4816
4667
  key: "countries",
@@ -4869,7 +4720,7 @@ var CountriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
4869
4720
  };
4870
4721
 
4871
4722
  // src/resources/departments.ts
4872
- var DepartmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4723
+ var DepartmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4873
4724
  constructor(http, pageSize) {
4874
4725
  super(http, {
4875
4726
  key: "departments",
@@ -4936,7 +4787,7 @@ var DepartmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4936
4787
  };
4937
4788
 
4938
4789
  // src/resources/domain_registrars.ts
4939
- var DomainRegistrarsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4790
+ var DomainRegistrarsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
4940
4791
  constructor(http, pageSize) {
4941
4792
  super(http, {
4942
4793
  key: "domain_registrars",
@@ -5019,7 +4870,7 @@ var EntityInformationResource = class {
5019
4870
  };
5020
4871
 
5021
4872
  // src/resources/expense_item_attachments.ts
5022
- var ExpenseItemAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4873
+ var ExpenseItemAttachmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5023
4874
  constructor(http, pageSize) {
5024
4875
  super(http, {
5025
4876
  key: "expense_item_attachments",
@@ -5081,7 +4932,7 @@ var ExpenseItemAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResourc
5081
4932
  };
5082
4933
 
5083
4934
  // src/resources/expense_items.ts
5084
- var ExpenseItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4935
+ var ExpenseItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5085
4936
  constructor(http, pageSize) {
5086
4937
  super(http, {
5087
4938
  key: "expense_items",
@@ -5140,7 +4991,7 @@ var ExpenseItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5140
4991
  };
5141
4992
 
5142
4993
  // src/resources/expense_reports.ts
5143
- var ExpenseReportsResource = class extends _chunkRWLPTU67cjs.BaseResource {
4994
+ var ExpenseReportsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5144
4995
  constructor(http, pageSize) {
5145
4996
  super(http, {
5146
4997
  key: "expense_reports",
@@ -5207,7 +5058,7 @@ var ExpenseReportsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5207
5058
  };
5208
5059
 
5209
5060
  // src/resources/holiday_sets.ts
5210
- var HolidaySetsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5061
+ var HolidaySetsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5211
5062
  constructor(http, pageSize) {
5212
5063
  super(http, {
5213
5064
  key: "holiday_sets",
@@ -5276,7 +5127,7 @@ var HolidaySetsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5276
5127
  };
5277
5128
 
5278
5129
  // src/resources/holidays.ts
5279
- var HolidaysResource = class extends _chunkRWLPTU67cjs.BaseResource {
5130
+ var HolidaysResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5280
5131
  constructor(http, pageSize) {
5281
5132
  super(http, {
5282
5133
  key: "holidays",
@@ -5348,10 +5199,10 @@ var PATH_SUFFIX = {
5348
5199
  transfer: "StockedItemsTransfer"
5349
5200
  };
5350
5201
  async function stockedItems(_resource, kind, parentId, data, opts = {}, http) {
5351
- const numericParent = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, parentId, "parentId");
5202
+ const numericParent = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, parentId, "parentId");
5352
5203
  const suffix = PATH_SUFFIX[kind];
5353
5204
  if (opts.dryRun === true) {
5354
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
5205
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
5355
5206
  operation: `inventory_products.stockedItems${suffix.slice("StockedItems".length)}`,
5356
5207
  method: "POST",
5357
5208
  path: `/V1.0/InventoryProducts/${numericParent}/${suffix}`,
@@ -5367,11 +5218,11 @@ async function stockedItems(_resource, kind, parentId, data, opts = {}, http) {
5367
5218
  body: data,
5368
5219
  operation: `inventory_products.stockedItems${suffix.slice("StockedItems".length)}`
5369
5220
  });
5370
- return _chunkRWLPTU67cjs.unwrapOperation.call(void 0, res);
5221
+ return _chunkYKEX4SK7cjs.unwrapOperation.call(void 0, res);
5371
5222
  }
5372
5223
 
5373
5224
  // src/resources/inventory_products.ts
5374
- var InventoryProductsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5225
+ var InventoryProductsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5375
5226
  constructor(http, pageSize) {
5376
5227
  super(http, {
5377
5228
  key: "inventory_products",
@@ -5453,7 +5304,7 @@ var InventoryProductsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5453
5304
 
5454
5305
  // src/resources/special/invoices.ts
5455
5306
  async function markup(_resource, id, format, http) {
5456
- const numericId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
5307
+ const numericId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
5457
5308
  const suffix = format === "html" ? "InvoiceMarkupHtml" : "InvoiceMarkupXml";
5458
5309
  const res = await http.request({
5459
5310
  method: "GET",
@@ -5462,7 +5313,7 @@ async function markup(_resource, id, format, http) {
5462
5313
  });
5463
5314
  const body = res;
5464
5315
  if (body === null || typeof body !== "object" || typeof body.invoiceMarkup !== "string") {
5465
- throw new (0, _chunkRWLPTU67cjs.AutotaskError)(
5316
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskError)(
5466
5317
  `Expected the InvoiceMarkupResultModel envelope { invoiceMarkup: string } for invoice ${numericId}; got a different shape`,
5467
5318
  { code: "INVALID_RESPONSE", category: "server", resourceIds: [numericId] }
5468
5319
  );
@@ -5470,44 +5321,44 @@ async function markup(_resource, id, format, http) {
5470
5321
  return body.invoiceMarkup;
5471
5322
  }
5472
5323
  async function pdf(_resource, id, http) {
5473
- const numericId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
5324
+ const numericId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
5474
5325
  const res = await http.request({
5475
5326
  method: "GET",
5476
5327
  path: `/V1.0/Invoices/${numericId}/InvoicePdf`,
5477
5328
  operation: "invoices.pdf"
5478
5329
  });
5479
- return _chunkRWLPTU67cjs.decodeFileData.call(void 0, res);
5330
+ return _chunkYKEX4SK7cjs.decodeFileData.call(void 0, res);
5480
5331
  }
5481
5332
  async function windowQuery2(_resource, kind, http, opts) {
5482
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _36 => _36.now]), () => ( /* @__PURE__ */ new Date()));
5483
- const tz = _optionalChain([opts, 'optionalAccess', _37 => _37.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
5333
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _29 => _29.now]), () => ( /* @__PURE__ */ new Date()));
5334
+ const tz = _optionalChain([opts, 'optionalAccess', _30 => _30.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
5484
5335
  return dateWindowQuery(
5485
5336
  http,
5486
5337
  "/V1.0/Invoices/query",
5487
5338
  "invoiceDateTime",
5488
5339
  kind,
5489
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _38 => _38.limit])),
5340
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _31 => _31.limit])),
5490
5341
  `invoices.${kind}`,
5491
5342
  now,
5492
5343
  tz
5493
5344
  );
5494
5345
  }
5495
5346
  async function customRange2(_resource, from, to, http, opts) {
5496
- const zone = _optionalChain([opts, 'optionalAccess', _39 => _39.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
5347
+ const zone = _optionalChain([opts, 'optionalAccess', _32 => _32.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
5497
5348
  return customRangeQuery(
5498
5349
  http,
5499
5350
  "/V1.0/Invoices/query",
5500
5351
  "invoiceDateTime",
5501
5352
  from,
5502
5353
  to,
5503
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _40 => _40.limit])),
5354
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _33 => _33.limit])),
5504
5355
  "invoices.customRange",
5505
5356
  zone
5506
5357
  );
5507
5358
  }
5508
5359
 
5509
5360
  // src/resources/invoices.ts
5510
- var InvoicesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5361
+ var InvoicesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5511
5362
  constructor(http, pageSize) {
5512
5363
  super(http, {
5513
5364
  key: "invoices",
@@ -5637,7 +5488,7 @@ var ModulesResource = class {
5637
5488
  };
5638
5489
 
5639
5490
  // src/resources/notification_history.ts
5640
- var NotificationHistoryResource = class extends _chunkRWLPTU67cjs.BaseResource {
5491
+ var NotificationHistoryResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5641
5492
  constructor(http, pageSize) {
5642
5493
  super(http, {
5643
5494
  key: "notification_history",
@@ -5676,7 +5527,7 @@ var NotificationHistoryResource = class extends _chunkRWLPTU67cjs.BaseResource {
5676
5527
  };
5677
5528
 
5678
5529
  // src/resources/opportunities.ts
5679
- var OpportunitiesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5530
+ var OpportunitiesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5680
5531
  constructor(http, pageSize) {
5681
5532
  super(http, {
5682
5533
  key: "opportunities",
@@ -5738,7 +5589,7 @@ var OpportunitiesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5738
5589
  };
5739
5590
 
5740
5591
  // src/resources/opportunity_attachments.ts
5741
- var OpportunityAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5592
+ var OpportunityAttachmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5742
5593
  constructor(http, pageSize) {
5743
5594
  super(http, {
5744
5595
  key: "opportunity_attachments",
@@ -5800,7 +5651,7 @@ var OpportunityAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResourc
5800
5651
  };
5801
5652
 
5802
5653
  // src/resources/opportunity_categories.ts
5803
- var OpportunityCategoriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5654
+ var OpportunityCategoriesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5804
5655
  constructor(http, pageSize) {
5805
5656
  super(http, {
5806
5657
  key: "opportunity_categories",
@@ -5859,7 +5710,7 @@ var OpportunityCategoriesResource = class extends _chunkRWLPTU67cjs.BaseResource
5859
5710
  };
5860
5711
 
5861
5712
  // src/resources/phases.ts
5862
- var PhasesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5713
+ var PhasesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5863
5714
  constructor(http, pageSize) {
5864
5715
  super(http, {
5865
5716
  key: "phases",
@@ -5918,7 +5769,7 @@ var PhasesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5918
5769
  };
5919
5770
 
5920
5771
  // src/resources/products.ts
5921
- var ProductsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5772
+ var ProductsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5922
5773
  constructor(http, pageSize) {
5923
5774
  super(http, {
5924
5775
  key: "products",
@@ -5985,7 +5836,7 @@ var ProductsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5985
5836
  };
5986
5837
 
5987
5838
  // src/resources/product_vendors.ts
5988
- var ProductVendorsResource = class extends _chunkRWLPTU67cjs.BaseResource {
5839
+ var ProductVendorsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
5989
5840
  constructor(http, pageSize) {
5990
5841
  super(http, {
5991
5842
  key: "product_vendors",
@@ -6044,7 +5895,7 @@ var ProductVendorsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6044
5895
  };
6045
5896
 
6046
5897
  // src/resources/project_charges.ts
6047
- var ProjectChargesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5898
+ var ProjectChargesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6048
5899
  constructor(http, pageSize) {
6049
5900
  super(http, {
6050
5901
  key: "project_charges",
@@ -6115,7 +5966,7 @@ var ProjectChargesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6115
5966
  };
6116
5967
 
6117
5968
  // src/resources/project_notes.ts
6118
- var ProjectNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
5969
+ var ProjectNotesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6119
5970
  constructor(http, pageSize) {
6120
5971
  super(http, {
6121
5972
  key: "project_notes",
@@ -6174,7 +6025,7 @@ var ProjectNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6174
6025
  };
6175
6026
 
6176
6027
  // src/resources/projects.ts
6177
- var ProjectsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6028
+ var ProjectsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6178
6029
  constructor(http, pageSize) {
6179
6030
  super(http, {
6180
6031
  key: "projects",
@@ -6251,13 +6102,13 @@ var ProjectsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6251
6102
  const leadResource = await this.contextFetch("/V1.0/Resources", root["projectLeadResourceID"]);
6252
6103
  const result = { project, company, opportunity, leadResource };
6253
6104
  if (opts.names === true) {
6254
- const builder = createNamePlan();
6105
+ const builder = _chunkYKEX4SK7cjs.createNamePlan.call(void 0, );
6255
6106
  builder.addResource(root["creatorResourceID"]);
6256
6107
  builder.addFk("contract", root["contractID"]);
6257
- const names = await resolveCompositeNames(this.http, builder.plan(), { maxNameReads: opts.maxNameReads });
6108
+ const names = await _chunkYKEX4SK7cjs.resolveCompositeNames.call(void 0, this.http, builder.plan(), { maxNameReads: opts.maxNameReads });
6258
6109
  const row = { ...project };
6259
- addNameSibling(row, "creatorResourceID", (v) => names.resourceName(v));
6260
- addNameSibling(row, "contractID", (v) => names.recordName("contract", v));
6110
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, row, "creatorResourceID", (v) => names.resourceName(v));
6111
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, row, "contractID", (v) => names.recordName("contract", v));
6261
6112
  result.project = row;
6262
6113
  result.names = names.section;
6263
6114
  }
@@ -6266,7 +6117,7 @@ var ProjectsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6266
6117
  };
6267
6118
 
6268
6119
  // src/resources/purchase_approvals.ts
6269
- var PurchaseApprovalsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6120
+ var PurchaseApprovalsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6270
6121
  constructor(http, pageSize) {
6271
6122
  super(http, {
6272
6123
  key: "purchase_approvals",
@@ -6320,7 +6171,7 @@ var PurchaseApprovalsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6320
6171
  };
6321
6172
 
6322
6173
  // src/resources/purchase_order_item_receiving.ts
6323
- var PurchaseOrderItemReceivingResource = class extends _chunkRWLPTU67cjs.BaseResource {
6174
+ var PurchaseOrderItemReceivingResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6324
6175
  constructor(http, pageSize) {
6325
6176
  super(http, {
6326
6177
  key: "purchase_order_item_receiving",
@@ -6370,7 +6221,7 @@ var PurchaseOrderItemReceivingResource = class extends _chunkRWLPTU67cjs.BaseRes
6370
6221
  };
6371
6222
 
6372
6223
  // src/resources/purchase_order_items.ts
6373
- var PurchaseOrderItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6224
+ var PurchaseOrderItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6374
6225
  constructor(http, pageSize) {
6375
6226
  super(http, {
6376
6227
  key: "purchase_order_items",
@@ -6429,7 +6280,7 @@ var PurchaseOrderItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6429
6280
  };
6430
6281
 
6431
6282
  // src/resources/purchase_orders.ts
6432
- var PurchaseOrdersResource = class extends _chunkRWLPTU67cjs.BaseResource {
6283
+ var PurchaseOrdersResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6433
6284
  constructor(http, pageSize) {
6434
6285
  super(http, {
6435
6286
  key: "purchase_orders",
@@ -6491,7 +6342,7 @@ var PurchaseOrdersResource = class extends _chunkRWLPTU67cjs.BaseResource {
6491
6342
  };
6492
6343
 
6493
6344
  // src/resources/quote_items.ts
6494
- var QuoteItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6345
+ var QuoteItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6495
6346
  constructor(http, pageSize) {
6496
6347
  super(http, {
6497
6348
  key: "quote_items",
@@ -6562,7 +6413,7 @@ var QuoteItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6562
6413
  };
6563
6414
 
6564
6415
  // src/resources/quote_locations.ts
6565
- var QuoteLocationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6416
+ var QuoteLocationsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6566
6417
  constructor(http, pageSize) {
6567
6418
  super(http, {
6568
6419
  key: "quote_locations",
@@ -6627,7 +6478,7 @@ var QuoteLocationsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6627
6478
  };
6628
6479
 
6629
6480
  // src/resources/quotes.ts
6630
- var QuotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6481
+ var QuotesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6631
6482
  constructor(http, pageSize) {
6632
6483
  super(http, {
6633
6484
  key: "quotes",
@@ -6694,7 +6545,7 @@ var QuotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6694
6545
  };
6695
6546
 
6696
6547
  // src/resources/quote_templates.ts
6697
- var QuoteTemplatesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6548
+ var QuoteTemplatesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6698
6549
  constructor(http, pageSize) {
6699
6550
  super(http, {
6700
6551
  key: "quote_templates",
@@ -6738,7 +6589,7 @@ var QuoteTemplatesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6738
6589
  };
6739
6590
 
6740
6591
  // src/resources/resource_role_queues.ts
6741
- var ResourceRoleQueuesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6592
+ var ResourceRoleQueuesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6742
6593
  constructor(http, pageSize) {
6743
6594
  super(http, {
6744
6595
  key: "resource_role_queues",
@@ -6797,7 +6648,7 @@ var ResourceRoleQueuesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6797
6648
  };
6798
6649
 
6799
6650
  // src/resources/resource_roles.ts
6800
- var ResourceRolesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6651
+ var ResourceRolesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6801
6652
  constructor(http, pageSize) {
6802
6653
  super(http, {
6803
6654
  key: "resource_roles",
@@ -6839,7 +6690,7 @@ var ResourceRolesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6839
6690
  };
6840
6691
 
6841
6692
  // src/resources/resource_skills.ts
6842
- var ResourceSkillsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6693
+ var ResourceSkillsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6843
6694
  constructor(http, pageSize) {
6844
6695
  super(http, {
6845
6696
  key: "resource_skills",
@@ -6893,16 +6744,16 @@ var ResourceSkillsResource = class extends _chunkRWLPTU67cjs.BaseResource {
6893
6744
  var MAX_TRANSFER_IDS = 500;
6894
6745
  function requirePositiveIds(ids, label) {
6895
6746
  if (!Array.isArray(ids) || ids.length === 0) {
6896
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`${label}: at least one positive integer id is required`);
6747
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`${label}: at least one positive integer id is required`);
6897
6748
  }
6898
6749
  if (ids.length > MAX_TRANSFER_IDS) {
6899
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`${label}: at most ${MAX_TRANSFER_IDS} ids are accepted (bounded fan-out)`);
6750
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`${label}: at most ${MAX_TRANSFER_IDS} ids are accepted (bounded fan-out)`);
6900
6751
  }
6901
6752
  const out = [];
6902
6753
  for (const raw of ids) {
6903
- const id = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, raw, `${label} id`);
6754
+ const id = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, raw, `${label} id`);
6904
6755
  if (typeof id === "number" && id < 1) {
6905
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`${label}: every id must be a positive integer (got ${String(raw)})`);
6756
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`${label}: every id must be a positive integer (got ${String(raw)})`);
6906
6757
  }
6907
6758
  out.push(id);
6908
6759
  }
@@ -6910,7 +6761,7 @@ function requirePositiveIds(ids, label) {
6910
6761
  }
6911
6762
  async function whoAmI(_resource, userName, http) {
6912
6763
  const user = userName.trim();
6913
- if (user === "") throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("whoAmI: the configured UserName is empty");
6764
+ if (user === "") throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("whoAmI: the configured UserName is empty");
6914
6765
  const value = user.includes("@") ? _nullishCoalesce(user.split("@")[0], () => ( "")) : user;
6915
6766
  const res = await http.request({
6916
6767
  method: "POST",
@@ -6919,11 +6770,11 @@ async function whoAmI(_resource, userName, http) {
6919
6770
  body: { MaxRecords: 2, filter: [{ field: "userName", op: "eq", value }] },
6920
6771
  operation: "resources.whoAmI"
6921
6772
  });
6922
- const matches = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
6773
+ const matches = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
6923
6774
  if (matches.length === 0) return null;
6924
6775
  if (matches.length > 1) {
6925
6776
  const ids = matches.map((m) => m.id).filter((id) => typeof id === "number");
6926
- throw new (0, _chunkRWLPTU67cjs.ResolutionError)(
6777
+ throw new (0, _chunkYKEX4SK7cjs.ResolutionError)(
6927
6778
  `whoAmI: "${value}" is ambiguous (matched ${matches.length} resources)`,
6928
6779
  { code: "RESOLUTION_AMBIGUOUS", resourceIds: ids }
6929
6780
  );
@@ -6932,11 +6783,11 @@ async function whoAmI(_resource, userName, http) {
6932
6783
  }
6933
6784
  async function transferOwnership(_resource, companyIds, destinationResourceId, http, opts) {
6934
6785
  const ids = requirePositiveIds(companyIds, "transferOwnership");
6935
- const destination = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, destinationResourceId, "destinationResourceId");
6786
+ const destination = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, destinationResourceId, "destinationResourceId");
6936
6787
  if (typeof destination === "number" && destination < 1) {
6937
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("transferOwnership: destinationResourceId must be a positive integer");
6788
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("transferOwnership: destinationResourceId must be a positive integer");
6938
6789
  }
6939
- const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _41 => _41.dryRun]), () => ( true));
6790
+ const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _34 => _34.dryRun]), () => ( true));
6940
6791
  const changes = [];
6941
6792
  const applied = [];
6942
6793
  for (const id of ids) {
@@ -6946,7 +6797,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
6946
6797
  path: `/V1.0/Companies/${id}`,
6947
6798
  operation: "resources.transferOwnership"
6948
6799
  });
6949
- const company = _chunkRWLPTU67cjs.unwrapItem.call(void 0, res, id);
6800
+ const company = _chunkYKEX4SK7cjs.unwrapItem.call(void 0, res, id);
6950
6801
  const current = typeof company.ownerResourceID === "number" ? company.ownerResourceID : null;
6951
6802
  changes.push({ id, fromOwnerResourceID: current, toOwnerResourceID: destination });
6952
6803
  if (!dryRun) {
@@ -6956,11 +6807,11 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
6956
6807
  body: { id, ownerResourceID: destination },
6957
6808
  operation: "resources.transferOwnership"
6958
6809
  });
6959
- _chunkRWLPTU67cjs.unwrapOperation.call(void 0, update);
6810
+ _chunkYKEX4SK7cjs.unwrapOperation.call(void 0, update);
6960
6811
  applied.push(id);
6961
6812
  }
6962
6813
  } catch (err) {
6963
- if (!dryRun && err instanceof _chunkRWLPTU67cjs.AutotaskError) {
6814
+ if (!dryRun && err instanceof _chunkYKEX4SK7cjs.AutotaskError) {
6964
6815
  err.resourceIds = [id];
6965
6816
  err.suggestedAction = `Partial transfer: ${applied.length} of ${ids.length} companies were re-owned (ids: ${applied.join(", ") || "none"}); id ${id} failed. Re-run transferOwnership for the remaining ids (from ${id} on).`;
6966
6817
  }
@@ -6970,7 +6821,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
6970
6821
  if (dryRun) {
6971
6822
  const anyChange = changes.some((c) => c.fromOwnerResourceID !== c.toOwnerResourceID);
6972
6823
  return {
6973
- ..._chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
6824
+ ..._chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
6974
6825
  operation: "resources.transferOwnership",
6975
6826
  method: "PUT",
6976
6827
  path: "/V1.0/Companies",
@@ -6994,7 +6845,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
6994
6845
  }
6995
6846
 
6996
6847
  // src/resources/resources.ts
6997
- var ResourcesResource = class extends _chunkRWLPTU67cjs.BaseResource {
6848
+ var ResourcesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
6998
6849
 
6999
6850
  constructor(http, clientConfig, pageSize) {
7000
6851
  super(http, {
@@ -7067,7 +6918,7 @@ var ResourcesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7067
6918
 
7068
6919
  // src/resources/special/resource_time_off_additional.ts
7069
6920
  async function getByResource(_resource, resourceId, http) {
7070
- const numericResource = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, resourceId, "resourceId");
6921
+ const numericResource = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, resourceId, "resourceId");
7071
6922
  const res = await http.request({
7072
6923
  method: "GET",
7073
6924
  path: `/V1.0/Resources/${numericResource}/TimeOffAdditional`,
@@ -7081,11 +6932,11 @@ async function getByResource(_resource, resourceId, http) {
7081
6932
  if (typeof item === "object" && !Array.isArray(item)) return [item];
7082
6933
  }
7083
6934
  }
7084
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res, "resource_time_off_additional.getByResource").items;
6935
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res, "resource_time_off_additional.getByResource").items;
7085
6936
  }
7086
6937
 
7087
6938
  // src/resources/resource_time_off_additional.ts
7088
- var ResourceTimeOffAdditionalResource = class extends _chunkRWLPTU67cjs.BaseResource {
6939
+ var ResourceTimeOffAdditionalResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7089
6940
  constructor(http, pageSize) {
7090
6941
  super(http, {
7091
6942
  key: "resource_time_off_additional",
@@ -7124,7 +6975,7 @@ var ResourceTimeOffAdditionalResource = class extends _chunkRWLPTU67cjs.BaseReso
7124
6975
  };
7125
6976
 
7126
6977
  // src/resources/resource_time_off_approvers.ts
7127
- var ResourceTimeOffApproversResource = class extends _chunkRWLPTU67cjs.BaseResource {
6978
+ var ResourceTimeOffApproversResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7128
6979
  constructor(http, pageSize) {
7129
6980
  super(http, {
7130
6981
  key: "resource_time_off_approvers",
@@ -7167,29 +7018,29 @@ var ResourceTimeOffApproversResource = class extends _chunkRWLPTU67cjs.BaseResou
7167
7018
 
7168
7019
  // src/resources/special/resource_time_off_balances.ts
7169
7020
  async function getByResource2(_resource, resourceId, http) {
7170
- const numericResource = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, resourceId, "resourceId");
7021
+ const numericResource = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, resourceId, "resourceId");
7171
7022
  const res = await http.request({
7172
7023
  method: "GET",
7173
7024
  path: `/V1.0/Resources/${numericResource}/TimeOffBalances`,
7174
7025
  operation: "resource_time_off_balances.getByResource"
7175
7026
  });
7176
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res, "resource_time_off_balances.getByResource").items;
7027
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res, "resource_time_off_balances.getByResource").items;
7177
7028
  }
7178
7029
  async function getByYear(_resource, resourceId, year, http) {
7179
- const numericResource = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, resourceId, "resourceId");
7030
+ const numericResource = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, resourceId, "resourceId");
7180
7031
  if (!Number.isSafeInteger(year) || year < 1) {
7181
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("getByYear: year must be a positive integer");
7032
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("getByYear: year must be a positive integer");
7182
7033
  }
7183
7034
  const res = await http.request({
7184
7035
  method: "GET",
7185
7036
  path: `/V1.0/Resources/${numericResource}/TimeOffBalances/${year}`,
7186
7037
  operation: "resource_time_off_balances.getByYear"
7187
7038
  });
7188
- return _chunkRWLPTU67cjs.unwrapItem.call(void 0, res, year, "resource_time_off_balances.getByYear");
7039
+ return _chunkYKEX4SK7cjs.unwrapItem.call(void 0, res, year, "resource_time_off_balances.getByYear");
7189
7040
  }
7190
7041
 
7191
7042
  // src/resources/resource_time_off_balances.ts
7192
- var ResourceTimeOffBalancesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7043
+ var ResourceTimeOffBalancesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7193
7044
  constructor(http, pageSize) {
7194
7045
  super(http, {
7195
7046
  key: "resource_time_off_balances",
@@ -7227,7 +7078,7 @@ var ResourceTimeOffBalancesResource = class extends _chunkRWLPTU67cjs.BaseResour
7227
7078
  };
7228
7079
 
7229
7080
  // src/resources/roles.ts
7230
- var RolesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7081
+ var RolesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7231
7082
  constructor(http, pageSize) {
7232
7083
  super(http, {
7233
7084
  key: "roles",
@@ -7294,7 +7145,7 @@ var RolesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7294
7145
  };
7295
7146
 
7296
7147
  // src/resources/service_calls.ts
7297
- var ServiceCallsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7148
+ var ServiceCallsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7298
7149
  constructor(http, pageSize) {
7299
7150
  super(http, {
7300
7151
  key: "service_calls",
@@ -7363,7 +7214,7 @@ var ServiceCallsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7363
7214
  };
7364
7215
 
7365
7216
  // src/resources/service_call_task_resources.ts
7366
- var ServiceCallTaskResourcesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7217
+ var ServiceCallTaskResourcesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7367
7218
  constructor(http, pageSize) {
7368
7219
  super(http, {
7369
7220
  key: "service_call_task_resources",
@@ -7420,7 +7271,7 @@ var ServiceCallTaskResourcesResource = class extends _chunkRWLPTU67cjs.BaseResou
7420
7271
  };
7421
7272
 
7422
7273
  // src/resources/service_call_tasks.ts
7423
- var ServiceCallTasksResource = class extends _chunkRWLPTU67cjs.BaseResource {
7274
+ var ServiceCallTasksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7424
7275
  constructor(http, pageSize) {
7425
7276
  super(http, {
7426
7277
  key: "service_call_tasks",
@@ -7477,7 +7328,7 @@ var ServiceCallTasksResource = class extends _chunkRWLPTU67cjs.BaseResource {
7477
7328
  };
7478
7329
 
7479
7330
  // src/resources/service_call_ticket_resources.ts
7480
- var ServiceCallTicketResourcesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7331
+ var ServiceCallTicketResourcesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7481
7332
  constructor(http, pageSize) {
7482
7333
  super(http, {
7483
7334
  key: "service_call_ticket_resources",
@@ -7534,7 +7385,7 @@ var ServiceCallTicketResourcesResource = class extends _chunkRWLPTU67cjs.BaseRes
7534
7385
  };
7535
7386
 
7536
7387
  // src/resources/service_call_tickets.ts
7537
- var ServiceCallTicketsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7388
+ var ServiceCallTicketsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7538
7389
  constructor(http, pageSize) {
7539
7390
  super(http, {
7540
7391
  key: "service_call_tickets",
@@ -7591,7 +7442,7 @@ var ServiceCallTicketsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7591
7442
  };
7592
7443
 
7593
7444
  // src/resources/service_level_agreement_results.ts
7594
- var ServiceLevelAgreementResultsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7445
+ var ServiceLevelAgreementResultsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7595
7446
  constructor(http, pageSize) {
7596
7447
  super(http, {
7597
7448
  key: "service_level_agreement_results",
@@ -7630,7 +7481,7 @@ var ServiceLevelAgreementResultsResource = class extends _chunkRWLPTU67cjs.BaseR
7630
7481
  };
7631
7482
 
7632
7483
  // src/resources/services.ts
7633
- var ServicesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7484
+ var ServicesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7634
7485
  constructor(http, pageSize) {
7635
7486
  super(http, {
7636
7487
  key: "services",
@@ -7698,7 +7549,7 @@ var ServicesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7698
7549
  };
7699
7550
 
7700
7551
  // src/resources/skills.ts
7701
- var SkillsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7552
+ var SkillsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7702
7553
  constructor(http, pageSize) {
7703
7554
  super(http, {
7704
7555
  key: "skills",
@@ -7742,7 +7593,7 @@ var SkillsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7742
7593
  };
7743
7594
 
7744
7595
  // src/resources/subscription_periods.ts
7745
- var SubscriptionPeriodsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7596
+ var SubscriptionPeriodsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7746
7597
  constructor(http, pageSize) {
7747
7598
  super(http, {
7748
7599
  key: "subscription_periods",
@@ -7781,7 +7632,7 @@ var SubscriptionPeriodsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7781
7632
  };
7782
7633
 
7783
7634
  // src/resources/subscriptions.ts
7784
- var SubscriptionsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7635
+ var SubscriptionsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7785
7636
  constructor(http, pageSize) {
7786
7637
  super(http, {
7787
7638
  key: "subscriptions",
@@ -7850,7 +7701,7 @@ var SubscriptionsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7850
7701
  };
7851
7702
 
7852
7703
  // src/resources/survey_results.ts
7853
- var SurveyResultsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7704
+ var SurveyResultsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7854
7705
  constructor(http, pageSize) {
7855
7706
  super(http, {
7856
7707
  key: "survey_results",
@@ -7889,7 +7740,7 @@ var SurveyResultsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7889
7740
  };
7890
7741
 
7891
7742
  // src/resources/surveys.ts
7892
- var SurveysResource = class extends _chunkRWLPTU67cjs.BaseResource {
7743
+ var SurveysResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7893
7744
  constructor(http, pageSize) {
7894
7745
  super(http, {
7895
7746
  key: "surveys",
@@ -7933,7 +7784,7 @@ var SurveysResource = class extends _chunkRWLPTU67cjs.BaseResource {
7933
7784
  };
7934
7785
 
7935
7786
  // src/resources/tag_aliases.ts
7936
- var TagAliasesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7787
+ var TagAliasesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7937
7788
  constructor(http, pageSize) {
7938
7789
  super(http, {
7939
7790
  key: "tag_aliases",
@@ -7990,7 +7841,7 @@ var TagAliasesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7990
7841
  };
7991
7842
 
7992
7843
  // src/resources/tag_groups.ts
7993
- var TagGroupsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7844
+ var TagGroupsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
7994
7845
  constructor(http, pageSize) {
7995
7846
  super(http, {
7996
7847
  key: "tag_groups",
@@ -8059,7 +7910,7 @@ var TagGroupsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8059
7910
  };
8060
7911
 
8061
7912
  // src/resources/tags.ts
8062
- var TagsResource = class extends _chunkRWLPTU67cjs.BaseResource {
7913
+ var TagsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8063
7914
  constructor(http, pageSize) {
8064
7915
  super(http, {
8065
7916
  key: "tags",
@@ -8128,7 +7979,7 @@ var TagsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8128
7979
  };
8129
7980
 
8130
7981
  // src/resources/task_secondary_resources.ts
8131
- var TaskSecondaryResourcesResource = class extends _chunkRWLPTU67cjs.BaseResource {
7982
+ var TaskSecondaryResourcesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8132
7983
  constructor(http, pageSize) {
8133
7984
  super(http, {
8134
7985
  key: "task_secondary_resources",
@@ -8185,7 +8036,7 @@ var TaskSecondaryResourcesResource = class extends _chunkRWLPTU67cjs.BaseResourc
8185
8036
  };
8186
8037
 
8187
8038
  // src/resources/tasks.ts
8188
- var TasksResource = class extends _chunkRWLPTU67cjs.BaseResource {
8039
+ var TasksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8189
8040
  constructor(http, pageSize) {
8190
8041
  super(http, {
8191
8042
  key: "tasks",
@@ -8273,7 +8124,7 @@ var ThresholdInformationResource = class {
8273
8124
  };
8274
8125
 
8275
8126
  // src/resources/ticket_additional_configuration_items.ts
8276
- var TicketAdditionalConfigurationItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8127
+ var TicketAdditionalConfigurationItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8277
8128
  constructor(http, pageSize) {
8278
8129
  super(http, {
8279
8130
  key: "ticket_additional_configuration_items",
@@ -8330,7 +8181,7 @@ var TicketAdditionalConfigurationItemsResource = class extends _chunkRWLPTU67cjs
8330
8181
  };
8331
8182
 
8332
8183
  // src/resources/ticket_additional_contacts.ts
8333
- var TicketAdditionalContactsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8184
+ var TicketAdditionalContactsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8334
8185
  constructor(http, pageSize) {
8335
8186
  super(http, {
8336
8187
  key: "ticket_additional_contacts",
@@ -8387,7 +8238,7 @@ var TicketAdditionalContactsResource = class extends _chunkRWLPTU67cjs.BaseResou
8387
8238
  };
8388
8239
 
8389
8240
  // src/resources/ticket_attachments.ts
8390
- var TicketAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8241
+ var TicketAttachmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8391
8242
  constructor(http, pageSize) {
8392
8243
  super(http, {
8393
8244
  key: "ticket_attachments",
@@ -8449,7 +8300,7 @@ var TicketAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8449
8300
  };
8450
8301
 
8451
8302
  // src/resources/ticket_categories.ts
8452
- var TicketCategoriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8303
+ var TicketCategoriesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8453
8304
  constructor(http, pageSize) {
8454
8305
  super(http, {
8455
8306
  key: "ticket_categories",
@@ -8508,7 +8359,7 @@ var TicketCategoriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8508
8359
  };
8509
8360
 
8510
8361
  // src/resources/ticket_category_field_defaults.ts
8511
- var TicketCategoryFieldDefaultsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8362
+ var TicketCategoryFieldDefaultsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8512
8363
  constructor(http, pageSize) {
8513
8364
  super(http, {
8514
8365
  key: "ticket_category_field_defaults",
@@ -8550,7 +8401,7 @@ var TicketCategoryFieldDefaultsResource = class extends _chunkRWLPTU67cjs.BaseRe
8550
8401
  };
8551
8402
 
8552
8403
  // src/resources/ticket_change_request_approvals.ts
8553
- var TicketChangeRequestApprovalsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8404
+ var TicketChangeRequestApprovalsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8554
8405
  constructor(http, pageSize) {
8555
8406
  super(http, {
8556
8407
  key: "ticket_change_request_approvals",
@@ -8607,7 +8458,7 @@ var TicketChangeRequestApprovalsResource = class extends _chunkRWLPTU67cjs.BaseR
8607
8458
  };
8608
8459
 
8609
8460
  // src/resources/ticket_charges.ts
8610
- var TicketChargesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8461
+ var TicketChargesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8611
8462
  constructor(http, pageSize) {
8612
8463
  super(http, {
8613
8464
  key: "ticket_charges",
@@ -8678,7 +8529,7 @@ var TicketChargesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8678
8529
  };
8679
8530
 
8680
8531
  // src/resources/ticket_checklist_items.ts
8681
- var TicketChecklistItemsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8532
+ var TicketChecklistItemsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8682
8533
  constructor(http, pageSize) {
8683
8534
  super(http, {
8684
8535
  key: "ticket_checklist_items",
@@ -8744,7 +8595,7 @@ var TicketChecklistItemsResource = class extends _chunkRWLPTU67cjs.BaseResource
8744
8595
  };
8745
8596
 
8746
8597
  // src/resources/ticket_checklist_libraries.ts
8747
- var TicketChecklistLibrariesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8598
+ var TicketChecklistLibrariesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8748
8599
  constructor(http, pageSize) {
8749
8600
  super(http, {
8750
8601
  key: "ticket_checklist_libraries",
@@ -8768,9 +8619,9 @@ var TicketChecklistLibrariesResource = class extends _chunkRWLPTU67cjs.BaseResou
8768
8619
  * `dryRun: true` returns the pinned envelope (document existence is unverifiable in the MVP
8769
8620
  * surface — no documents read op — and never issues the POST). */
8770
8621
  async attachToDocument(documentID, data, opts = {}) {
8771
- const n = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, documentID, "documentID");
8622
+ const n = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, documentID, "documentID");
8772
8623
  if (opts.dryRun === true) {
8773
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
8624
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
8774
8625
  operation: "ticket_checklist_libraries.attachToDocument",
8775
8626
  method: "POST",
8776
8627
  path: `/V1.0/Documents/${n}/ChecklistLibraries`,
@@ -8787,7 +8638,7 @@ var TicketChecklistLibrariesResource = class extends _chunkRWLPTU67cjs.BaseResou
8787
8638
  body: { ...data },
8788
8639
  operation: "ticket_checklist_libraries.attachToDocument"
8789
8640
  });
8790
- return _chunkRWLPTU67cjs.unwrapOperation.call(void 0, res);
8641
+ return _chunkYKEX4SK7cjs.unwrapOperation.call(void 0, res);
8791
8642
  }
8792
8643
  /** Resolve a TicketChecklistLibrary from a numeric id (or, where the vendor indexes a primary text field,
8793
8644
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8803,7 +8654,7 @@ var TicketChecklistLibrariesResource = class extends _chunkRWLPTU67cjs.BaseResou
8803
8654
  };
8804
8655
 
8805
8656
  // src/resources/ticket_history.ts
8806
- var TicketHistoryResource = class extends _chunkRWLPTU67cjs.BaseResource {
8657
+ var TicketHistoryResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8807
8658
  constructor(http, pageSize) {
8808
8659
  super(http, {
8809
8660
  key: "ticket_history",
@@ -8842,7 +8693,7 @@ var TicketHistoryResource = class extends _chunkRWLPTU67cjs.BaseResource {
8842
8693
  };
8843
8694
 
8844
8695
  // src/resources/ticket_note_attachments.ts
8845
- var TicketNoteAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
8696
+ var TicketNoteAttachmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8846
8697
  constructor(http, pageSize) {
8847
8698
  super(http, {
8848
8699
  key: "ticket_note_attachments",
@@ -8904,7 +8755,7 @@ var TicketNoteAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource
8904
8755
  };
8905
8756
 
8906
8757
  // src/resources/ticket_notes.ts
8907
- var TicketNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8758
+ var TicketNotesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8908
8759
  constructor(http, pageSize) {
8909
8760
  super(http, {
8910
8761
  key: "ticket_notes",
@@ -8963,7 +8814,7 @@ var TicketNotesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8963
8814
  };
8964
8815
 
8965
8816
  // src/resources/ticket_note_webhooks.ts
8966
- var TicketNoteWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
8817
+ var TicketNoteWebhooksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
8967
8818
  constructor(http, pageSize) {
8968
8819
  super(http, {
8969
8820
  key: "ticket_note_webhooks",
@@ -9039,7 +8890,7 @@ var TicketNoteWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
9039
8890
  };
9040
8891
 
9041
8892
  // src/resources/ticket_secondary_resources.ts
9042
- var TicketSecondaryResourcesResource = class extends _chunkRWLPTU67cjs.BaseResource {
8893
+ var TicketSecondaryResourcesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
9043
8894
  constructor(http, pageSize) {
9044
8895
  super(http, {
9045
8896
  key: "ticket_secondary_resources",
@@ -9106,9 +8957,9 @@ async function fetchTicket(http, id, operation) {
9106
8957
  });
9107
8958
  const body = res;
9108
8959
  if (body === null || !("item" in body)) {
9109
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`Ticket ${id} not found (unexpected envelope shape)`, { resourceIds: [id] });
8960
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`Ticket ${id} not found (unexpected envelope shape)`, { resourceIds: [id] });
9110
8961
  }
9111
- if (body.item === null || body.item === void 0) throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`Ticket ${id} not found`, { resourceIds: [id] });
8962
+ if (body.item === null || body.item === void 0) throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`Ticket ${id} not found`, { resourceIds: [id] });
9112
8963
  return body.item;
9113
8964
  }
9114
8965
  async function ticketQueryItems(http, path, filter, maxRecords, operation) {
@@ -9119,29 +8970,29 @@ async function ticketQueryItems(http, path, filter, maxRecords, operation) {
9119
8970
  body: { MaxRecords: maxRecords, filter },
9120
8971
  operation
9121
8972
  });
9122
- return _chunkRWLPTU67cjs.unwrapItems.call(void 0, res).items;
8973
+ return _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res).items;
9123
8974
  }
9124
8975
  function isRouteUnavailable(err) {
9125
- return _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) && (err.httpStatus === 404 || err.httpStatus === 500);
8976
+ return _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) && (err.httpStatus === 404 || err.httpStatus === 500);
9126
8977
  }
9127
8978
  function routeFact(route, path, err) {
9128
8979
  return {
9129
8980
  route,
9130
8981
  path,
9131
- httpStatus: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) && typeof err.httpStatus === "number" ? err.httpStatus : null
8982
+ httpStatus: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) && typeof err.httpStatus === "number" ? err.httpStatus : null
9132
8983
  };
9133
8984
  }
9134
8985
  function childDeclaresQuery(resourceKey) {
9135
- return _chunkLTKMTXURcjs.CAPABILITIES.some(
8986
+ return _chunkT5FLSJODcjs.CAPABILITIES.some(
9136
8987
  (c) => c.id === `${resourceKey}.query` && (c.status === "implemented" || c.status === "tested")
9137
8988
  );
9138
8989
  }
9139
8990
  function planScopedPath(resourceKey, ticketId) {
9140
8991
  if (!childDeclaresQuery(resourceKey)) return null;
9141
- const entry = _chunkRWLPTU67cjs.RELATIONSHIP_MAP[resourceKey];
8992
+ const entry = _chunkYKEX4SK7cjs.RELATIONSHIP_MAP[resourceKey];
9142
8993
  const parent = entry === void 0 ? null : entry.parent;
9143
8994
  if (parent === null || parent.resource !== "tickets" || parent.segment === null || parent.field === null) return null;
9144
- const parentPath = _optionalChain([_chunkRWLPTU67cjs.RELATIONSHIP_MAP, 'access', _42 => _42[parent.resource], 'optionalAccess', _43 => _43.path]);
8995
+ const parentPath = _optionalChain([_chunkYKEX4SK7cjs.RELATIONSHIP_MAP, 'access', _35 => _35[parent.resource], 'optionalAccess', _36 => _36.path]);
9145
8996
  if (parentPath === null || parentPath === void 0) return null;
9146
8997
  return `/V1.0/${parentPath}/${ticketId}/${parent.segment}`;
9147
8998
  }
@@ -9180,14 +9031,14 @@ async function scopedCollectionRead(http, startPath, limit, operation, accept) {
9180
9031
  break;
9181
9032
  }
9182
9033
  const body = await http.request({ method: "GET", path: target, operation });
9183
- const { items: pageItems, pageDetails } = _chunkRWLPTU67cjs.unwrapItems.call(void 0, body, operation);
9034
+ const { items: pageItems, pageDetails } = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, body, operation);
9184
9035
  nextCursor = pageDetails.nextPageUrl;
9185
9036
  pages += 1;
9186
9037
  const window = pageItems.slice(0, Math.max(0, limit - items.length));
9187
9038
  for (const row of window) if (accept(row)) items.push(row);
9188
9039
  if (items.length >= limit) break;
9189
9040
  if (nextCursor === null || pageItems.length === 0) break;
9190
- target = _chunkRWLPTU67cjs.cursorToPath.call(void 0, http.baseUrl, nextCursor);
9041
+ target = _chunkYKEX4SK7cjs.cursorToPath.call(void 0, http.baseUrl, nextCursor);
9191
9042
  }
9192
9043
  const capped = items.length >= limit || guard && nextCursor !== null;
9193
9044
  return { items, capped };
@@ -9221,7 +9072,7 @@ function truncate(text, limit) {
9221
9072
  }
9222
9073
  async function slaHealthCheck(_resource, id, opts = {}, http) {
9223
9074
  void opts;
9224
- const ticketId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
9075
+ const ticketId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
9225
9076
  await fetchTicket(http, ticketId, "tickets.slaHealthCheck");
9226
9077
  const rows = await ticketQueryItems(
9227
9078
  http,
@@ -9246,9 +9097,9 @@ async function slaHealthCheck(_resource, id, opts = {}, http) {
9246
9097
  async function summary(_resource, id, opts = {}, http) {
9247
9098
  const limit = opts.summaryTextLimit === void 0 ? 500 : Math.trunc(opts.summaryTextLimit);
9248
9099
  if (!Number.isInteger(limit) || limit < 1) {
9249
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`summaryTextLimit must be an integer >= 1 (got ${String(opts.summaryTextLimit)})`);
9100
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`summaryTextLimit must be an integer >= 1 (got ${String(opts.summaryTextLimit)})`);
9250
9101
  }
9251
- const ticketId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
9102
+ const ticketId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
9252
9103
  const ticket = await fetchTicket(http, ticketId, "tickets.summary");
9253
9104
  const desc = truncate(ticket.description, limit);
9254
9105
  const now = _nullishCoalesce(opts.now, () => ( /* @__PURE__ */ new Date()));
@@ -9275,13 +9126,13 @@ async function summary(_resource, id, opts = {}, http) {
9275
9126
  }
9276
9127
  async function timeline(_resource, id, opts = {}, http) {
9277
9128
  const limit = opts.limit === void 0 ? 100 : Math.trunc(opts.limit);
9278
- if (!Number.isInteger(limit) || limit < 1) throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(opts.limit)})`);
9129
+ if (!Number.isInteger(limit) || limit < 1) throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(opts.limit)})`);
9279
9130
  const bounded = Math.min(limit, 500);
9280
9131
  const textLimit = opts.textLimit === void 0 ? 500 : Math.trunc(opts.textLimit);
9281
9132
  if (!Number.isInteger(textLimit) || textLimit < 1) {
9282
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`textLimit must be an integer >= 1 (got ${String(opts.textLimit)})`);
9133
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`textLimit must be an integer >= 1 (got ${String(opts.textLimit)})`);
9283
9134
  }
9284
- const ticketId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
9135
+ const ticketId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
9285
9136
  await fetchTicket(http, ticketId, "tickets.timeline");
9286
9137
  const dateFilters = (field) => {
9287
9138
  const f = [{ field: "ticketID", op: "eq", value: ticketId }];
@@ -9368,14 +9219,14 @@ function isPositiveInt(v) {
9368
9219
  return typeof v === "number" && Number.isInteger(v) && v > 0;
9369
9220
  }
9370
9221
  function namedVendorFields(err) {
9371
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return [];
9372
- const entries = _nullishCoalesce(_chunkRWLPTU67cjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []));
9222
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return [];
9223
+ const entries = _nullishCoalesce(_chunkYKEX4SK7cjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []));
9373
9224
  const out = /* @__PURE__ */ new Set();
9374
9225
  for (const e of entries) if (e.field !== void 0) out.add(e.field);
9375
9226
  return [...out];
9376
9227
  }
9377
9228
  function vendorDetailOf(err) {
9378
- return _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? _chunkRWLPTU67cjs.formatVendorDetail.call(void 0, err.vendorError) : void 0;
9229
+ return _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? _chunkYKEX4SK7cjs.formatVendorDetail.call(void 0, err.vendorError) : void 0;
9379
9230
  }
9380
9231
  async function fetchItem(http, path, operation) {
9381
9232
  const res = await http.request({ method: "GET", path, operation });
@@ -9396,8 +9247,8 @@ function operationId(res) {
9396
9247
  return typeof body.itemId === "number" ? body.itemId : typeof body.id === "number" ? body.id : void 0;
9397
9248
  }
9398
9249
  function discoveryMerge(err, body, defaults) {
9399
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return null;
9400
- const entries = _chunkRWLPTU67cjs.parseVendorErrors.call(void 0, err.vendorError);
9250
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return null;
9251
+ const entries = _chunkYKEX4SK7cjs.parseVendorErrors.call(void 0, err.vendorError);
9401
9252
  if (entries === void 0) return null;
9402
9253
  for (const entry of entries) {
9403
9254
  const field = entry.field;
@@ -9409,7 +9260,7 @@ function discoveryMerge(err, body, defaults) {
9409
9260
  }
9410
9261
  function stepErrorText(code, err) {
9411
9262
  const detail = vendorDetailOf(err);
9412
- const base = _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.message : String(err);
9263
+ const base = _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.message : String(err);
9413
9264
  return detail ? `${code}: ${detail}` : `${code}: ${base}`;
9414
9265
  }
9415
9266
  var DEFAULT_TICKET_PRIORITY = 3;
@@ -9418,7 +9269,7 @@ var DEFAULT_NOTE_TYPE = 1;
9418
9269
  var DEFAULT_PUBLISH = 1;
9419
9270
  var PUBLISH_VALUES = /* @__PURE__ */ new Set([1, 2, 4]);
9420
9271
  var SAFE_TICKET_CREATE_DEFAULTS = {};
9421
- var QueueRequiredError = class extends _chunkRWLPTU67cjs.AutotaskError {
9272
+ var QueueRequiredError = class extends _chunkYKEX4SK7cjs.AutotaskError {
9422
9273
  constructor(message, options = {}) {
9423
9274
  super(message, {
9424
9275
  code: "QUEUE_REQUIRED",
@@ -9429,13 +9280,13 @@ var QueueRequiredError = class extends _chunkRWLPTU67cjs.AutotaskError {
9429
9280
  this.name = "QueueRequiredError";
9430
9281
  }
9431
9282
  };
9432
- var TicketResourceInvalidError = class extends _chunkRWLPTU67cjs.AutotaskError {
9283
+ var TicketResourceInvalidError = class extends _chunkYKEX4SK7cjs.AutotaskError {
9433
9284
  constructor(message, options = {}) {
9434
9285
  super(message, { code: "RESOURCE_INVALID", category: "validation", ...options });
9435
9286
  this.name = "TicketResourceInvalidError";
9436
9287
  }
9437
9288
  };
9438
- var TicketCreateValidationFailedError = class extends _chunkRWLPTU67cjs.AutotaskError {
9289
+ var TicketCreateValidationFailedError = class extends _chunkYKEX4SK7cjs.AutotaskError {
9439
9290
  /** The vendor-named fields (empty when the 500 body named nothing parseable). */
9440
9291
 
9441
9292
  constructor(message, vendorFields, options = {}) {
@@ -9445,43 +9296,43 @@ var TicketCreateValidationFailedError = class extends _chunkRWLPTU67cjs.Autotask
9445
9296
  }
9446
9297
  };
9447
9298
  async function openWithNoteAndAssign(resource, params, note, assign, opts, http) {
9448
- const companyID = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, _optionalChain([params, 'optionalAccess', _44 => _44.companyID]), "params.companyID");
9449
- const title = _optionalChain([params, 'optionalAccess', _45 => _45.title]);
9299
+ const companyID = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, _optionalChain([params, 'optionalAccess', _37 => _37.companyID]), "params.companyID");
9300
+ const title = _optionalChain([params, 'optionalAccess', _38 => _38.title]);
9450
9301
  if (typeof title !== "string" || title.trim() === "") {
9451
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("openWithNoteAndAssign: params.title is required (a non-empty string)", { operation: OP_OPEN });
9302
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("openWithNoteAndAssign: params.title is required (a non-empty string)", { operation: OP_OPEN });
9452
9303
  }
9453
9304
  const priority = _nullishCoalesce(params.priority, () => ( DEFAULT_TICKET_PRIORITY));
9454
9305
  const status = _nullishCoalesce(params.status, () => ( DEFAULT_TICKET_STATUS));
9455
9306
  if (!isPositiveInt(priority)) {
9456
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`openWithNoteAndAssign: params.priority must be a positive integer (got ${String(params.priority)})`, { operation: OP_OPEN });
9307
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`openWithNoteAndAssign: params.priority must be a positive integer (got ${String(params.priority)})`, { operation: OP_OPEN });
9457
9308
  }
9458
9309
  if (!isPositiveInt(status)) {
9459
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`openWithNoteAndAssign: params.status must be a positive integer (got ${String(params.status)})`, { operation: OP_OPEN });
9310
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`openWithNoteAndAssign: params.status must be a positive integer (got ${String(params.status)})`, { operation: OP_OPEN });
9460
9311
  }
9461
9312
  if (params.queueID !== void 0 && !isPositiveInt(params.queueID)) {
9462
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`openWithNoteAndAssign: params.queueID must be a positive integer (got ${String(params.queueID)})`, { operation: OP_OPEN });
9313
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`openWithNoteAndAssign: params.queueID must be a positive integer (got ${String(params.queueID)})`, { operation: OP_OPEN });
9463
9314
  }
9464
9315
  if (note !== void 0) {
9465
9316
  if (typeof note.description !== "string" || note.description.trim() === "") {
9466
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("openWithNoteAndAssign: note.description is required (a non-empty string)", { operation: OP_OPEN });
9317
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("openWithNoteAndAssign: note.description is required (a non-empty string)", { operation: OP_OPEN });
9467
9318
  }
9468
9319
  if (typeof note.title !== "string" || note.title.trim() === "") {
9469
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("openWithNoteAndAssign: note.title is required (a non-empty string) \u2014 the ww29 scoped note create 500s without it (S12-A live-verified: Missing Required Field: title; the S11-B proven note body is { title, description, noteType: 1, publish: 1 })", { operation: OP_OPEN });
9320
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("openWithNoteAndAssign: note.title is required (a non-empty string) \u2014 the ww29 scoped note create 500s without it (S12-A live-verified: Missing Required Field: title; the S11-B proven note body is { title, description, noteType: 1, publish: 1 })", { operation: OP_OPEN });
9470
9321
  }
9471
9322
  if (note.noteType !== void 0 && !isPositiveInt(note.noteType)) {
9472
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`openWithNoteAndAssign: note.noteType must be a positive integer (got ${String(note.noteType)})`, { operation: OP_OPEN });
9323
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`openWithNoteAndAssign: note.noteType must be a positive integer (got ${String(note.noteType)})`, { operation: OP_OPEN });
9473
9324
  }
9474
9325
  if (note.publish !== void 0 && !PUBLISH_VALUES.has(note.publish)) {
9475
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`openWithNoteAndAssign: note.publish must be an integer picklist value 1/2/4 (got ${String(note.publish)} \u2014 NOT a boolean)`, { operation: OP_OPEN });
9326
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`openWithNoteAndAssign: note.publish must be an integer picklist value 1/2/4 (got ${String(note.publish)} \u2014 NOT a boolean)`, { operation: OP_OPEN });
9476
9327
  }
9477
9328
  }
9478
- const assignee = assign === void 0 ? void 0 : _chunkRWLPTU67cjs.parseIdentifier.call(void 0, assign.resourceID, "assign.resourceID");
9329
+ const assignee = assign === void 0 ? void 0 : _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, assign.resourceID, "assign.resourceID");
9479
9330
  if (assign !== void 0 && assignee !== void 0 && (typeof assignee === "number" ? assignee < 1 : false)) {
9480
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`openWithNoteAndAssign: assign.resourceID must be a positive integer (got ${String(assignee)})`, { operation: OP_OPEN });
9331
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`openWithNoteAndAssign: assign.resourceID must be a positive integer (got ${String(assignee)})`, { operation: OP_OPEN });
9481
9332
  }
9482
- const roleID = _optionalChain([assign, 'optionalAccess', _46 => _46.roleID]);
9333
+ const roleID = _optionalChain([assign, 'optionalAccess', _39 => _39.roleID]);
9483
9334
  if (assign !== void 0 && !isPositiveInt(roleID)) {
9484
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("openWithNoteAndAssign: assign.roleID is required (a positive integer) \u2014 the ww29 vendor requires BOTH assignedResourceID and assignedResourceRoleID when assigning a resource (S12-A live-verified: Data violation: When assigning a Resource, you must assign both a assignedResourceID and assignedResourceRoleID)", { operation: OP_OPEN });
9335
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("openWithNoteAndAssign: assign.roleID is required (a positive integer) \u2014 the ww29 vendor requires BOTH assignedResourceID and assignedResourceRoleID when assigning a resource (S12-A live-verified: Data violation: When assigning a Resource, you must assign both a assignedResourceID and assignedResourceRoleID)", { operation: OP_OPEN });
9485
9336
  }
9486
9337
  if (assign !== void 0 && assignee !== void 0) {
9487
9338
  const rid = assignee;
@@ -9516,7 +9367,7 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
9516
9367
  if (assign !== void 0) {
9517
9368
  warnings.push(`the assignment is the v0.6.0 MERGE update (unredacted GET + collection PUT, 2 wire) setting assignedResourceID ${String(assignee)} + assignedResourceRoleID ${String(roleID)} (the vendor requires both \u2014 S12-A live-verified); a failure lands in steps[] as ASSIGN_FAILED (the applied ticketId is still returned).`);
9518
9369
  }
9519
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
9370
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
9520
9371
  {
9521
9372
  operation: OP_OPEN,
9522
9373
  method: "POST",
@@ -9558,8 +9409,8 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
9558
9409
  `openWithNoteAndAssign: the vendor rejected the ticket create naming 'queueID' (the ww29 live-required set is { title, status, priority, companyID, queueID }) and the node never guesses a queue${detail ? ` \u2014 ${detail}` : ""}`,
9559
9410
  {
9560
9411
  operation: OP_OPEN,
9561
- httpStatus: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
9562
- vendorError: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0
9412
+ httpStatus: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
9413
+ vendorError: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0
9563
9414
  }
9564
9415
  );
9565
9416
  }
@@ -9574,8 +9425,8 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
9574
9425
  named,
9575
9426
  {
9576
9427
  operation: OP_OPEN,
9577
- httpStatus: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
9578
- vendorError: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0,
9428
+ httpStatus: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
9429
+ vendorError: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0,
9579
9430
  resourceIds: [companyID]
9580
9431
  }
9581
9432
  );
@@ -9597,10 +9448,10 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
9597
9448
  try {
9598
9449
  const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_OPEN);
9599
9450
  if (current === null) {
9600
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`openWithNoteAndAssign: ticket ${ticketId} vanished between the create and the assign merge read`, { operation: OP_OPEN, resourceIds: [ticketId] });
9451
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`openWithNoteAndAssign: ticket ${ticketId} vanished between the create and the assign merge read`, { operation: OP_OPEN, resourceIds: [ticketId] });
9601
9452
  }
9602
9453
  ticketNumber = typeof current.ticketNumber === "string" ? current.ticketNumber : null;
9603
- const merged = _chunkRWLPTU67cjs.mergePartialBody.call(void 0, current, { id: ticketId, assignedResourceID: assignee, assignedResourceRoleID: roleID });
9454
+ const merged = _chunkYKEX4SK7cjs.mergePartialBody.call(void 0, current, { id: ticketId, assignedResourceID: assignee, assignedResourceRoleID: roleID });
9604
9455
  merged.id = ticketId;
9605
9456
  await http.request({ method: "PUT", path: "/V1.0/Tickets", body: merged, operation: OP_OPEN });
9606
9457
  assigned = true;
@@ -9621,7 +9472,7 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
9621
9472
  var STATUS_REQUIRED_FIELDS = {
9622
9473
  // <discovery output lands here — e.g. 8: { requiredFields: ['dueDateTime'], safeDefaults: { dueDateTime: '<now>' } }>
9623
9474
  };
9624
- var StatusUnknownError = class extends _chunkRWLPTU67cjs.AutotaskError {
9475
+ var StatusUnknownError = class extends _chunkYKEX4SK7cjs.AutotaskError {
9625
9476
  /** The live picklist size (the message names it; the values + labels are via operations.fieldCatalog with labels: true). */
9626
9477
 
9627
9478
  constructor(message, options = {}) {
@@ -9635,7 +9486,7 @@ var StatusUnknownError = class extends _chunkRWLPTU67cjs.AutotaskError {
9635
9486
  this.picklistCount = _nullishCoalesce(options.picklistCount, () => ( 0));
9636
9487
  }
9637
9488
  };
9638
- var StatusFieldsRequiredError = class extends _chunkRWLPTU67cjs.AutotaskError {
9489
+ var StatusFieldsRequiredError = class extends _chunkYKEX4SK7cjs.AutotaskError {
9639
9490
 
9640
9491
 
9641
9492
 
@@ -9664,26 +9515,26 @@ async function readLiveStatusSet(resource) {
9664
9515
  }
9665
9516
  var GUARD_DEGRADED_WARNING = "the tenant's live status picklist metadata was unavailable (the local guard is degraded for this call \u2014 the W-A4 wall or a metadata failure); the vendor's own validation is the final authority on the status value";
9666
9517
  async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9667
- const ticketId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
9518
+ const ticketId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
9668
9519
  if (!isPositiveInt(targetStatus)) {
9669
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`changeStatus: targetStatus must be a positive integer (got ${String(targetStatus)})`, { operation: OP_STATUS });
9520
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`changeStatus: targetStatus must be a positive integer (got ${String(targetStatus)})`, { operation: OP_STATUS });
9670
9521
  }
9671
9522
  let liveStatus = null;
9672
9523
  try {
9673
9524
  const ids = await readLiveStatusSet(resource);
9674
9525
  if (ids.size > 0) liveStatus = ids;
9675
9526
  } catch (err) {
9676
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.code === "ABORTED") throw err;
9527
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.code === "ABORTED") throw err;
9677
9528
  }
9678
9529
  if (liveStatus !== null && !liveStatus.has(targetStatus)) {
9679
- _optionalChain([http, 'access', _47 => _47.fieldCache, 'optionalAccess', _48 => _48.invalidate, 'call', _49 => _49("tickets")]);
9530
+ _optionalChain([http, 'access', _40 => _40.fieldCache, 'optionalAccess', _41 => _41.invalidate, 'call', _42 => _42("tickets")]);
9680
9531
  let freshStatus = null;
9681
9532
  let reReadFailed = false;
9682
9533
  try {
9683
9534
  const freshIds = await readLiveStatusSet(resource);
9684
9535
  if (freshIds.size > 0) freshStatus = freshIds;
9685
9536
  } catch (err) {
9686
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.code === "ABORTED") throw err;
9537
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.code === "ABORTED") throw err;
9687
9538
  freshStatus = null;
9688
9539
  reReadFailed = true;
9689
9540
  }
@@ -9700,16 +9551,16 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9700
9551
  }
9701
9552
  const guardDegraded = liveStatus === null;
9702
9553
  if (fields !== void 0 && (typeof fields !== "object" || fields === null || Array.isArray(fields))) {
9703
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("changeStatus: fields must be a plain object of ticket fields (or omitted)", { operation: OP_STATUS });
9554
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("changeStatus: fields must be a plain object of ticket fields (or omitted)", { operation: OP_STATUS });
9704
9555
  }
9705
9556
  const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS);
9706
9557
  if (current === null) {
9707
- throw new (0, _chunkRWLPTU67cjs.NotFoundError)(`changeStatus: ticket ${ticketId} was not found (tickets.get returned item: null)`, { operation: OP_STATUS, resourceIds: [ticketId] });
9558
+ throw new (0, _chunkYKEX4SK7cjs.NotFoundError)(`changeStatus: ticket ${ticketId} was not found (tickets.get returned item: null)`, { operation: OP_STATUS, resourceIds: [ticketId] });
9708
9559
  }
9709
9560
  const previousStatus = typeof current.status === "number" ? current.status : null;
9710
9561
  if (previousStatus === targetStatus) {
9711
9562
  if (opts.dryRun === true) {
9712
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
9563
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
9713
9564
  {
9714
9565
  operation: OP_STATUS,
9715
9566
  method: "PUT",
@@ -9742,7 +9593,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9742
9593
  for (const field of mapEntry.requiredFields) {
9743
9594
  if (mergeData[field] !== void 0) continue;
9744
9595
  if (current[field] !== null && current[field] !== void 0) continue;
9745
- const safe = _optionalChain([mapEntry, 'access', _50 => _50.safeDefaults, 'optionalAccess', _51 => _51[field]]);
9596
+ const safe = _optionalChain([mapEntry, 'access', _43 => _43.safeDefaults, 'optionalAccess', _44 => _44[field]]);
9746
9597
  if (safe === void 0) {
9747
9598
  throw new StatusFieldsRequiredError(
9748
9599
  `changeStatus: status ${targetStatus} requires the field '${field}' and the live-discovered map has no proven-safe default for it \u2014 the op is safe-without-the-map (never a blind full update): supply the value in fields and retry`,
@@ -9763,7 +9614,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9763
9614
  if (mapEntry === void 0) {
9764
9615
  warnings.push(`status ${targetStatus} has no entry in the live-discovered required-field map yet \u2014 if the vendor 500 names a required field without a safe default, the apply throws the typed STATUS_FIELDS_REQUIRED (the caller supplies the value; never a blind retry).`);
9765
9616
  }
9766
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
9617
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
9767
9618
  {
9768
9619
  operation: OP_STATUS,
9769
9620
  method: "PUT",
@@ -9781,8 +9632,8 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9781
9632
  { redactPersonalData: http.redactPersonalData }
9782
9633
  );
9783
9634
  }
9784
- const safeDefaults = _nullishCoalesce(_optionalChain([mapEntry, 'optionalAccess', _52 => _52.safeDefaults]), () => ( {}));
9785
- const body = _chunkRWLPTU67cjs.mergePartialBody.call(void 0, current, mergeData);
9635
+ const safeDefaults = _nullishCoalesce(_optionalChain([mapEntry, 'optionalAccess', _45 => _45.safeDefaults]), () => ( {}));
9636
+ const body = _chunkYKEX4SK7cjs.mergePartialBody.call(void 0, current, mergeData);
9786
9637
  body.id = ticketId;
9787
9638
  let merges = 0;
9788
9639
  for (; ; ) {
@@ -9806,8 +9657,8 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9806
9657
  { vendorFields: named, currentStatus: previousStatus, targetStatus, currentValues },
9807
9658
  {
9808
9659
  operation: OP_STATUS,
9809
- httpStatus: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
9810
- vendorError: _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0,
9660
+ httpStatus: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
9661
+ vendorError: _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0,
9811
9662
  resourceIds: [ticketId]
9812
9663
  }
9813
9664
  );
@@ -9817,7 +9668,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9817
9668
  }
9818
9669
  const verify = await fetchItem(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS);
9819
9670
  if (verify === null) {
9820
- throw new (0, _chunkRWLPTU67cjs.AutotaskError)(`changeStatus: the post-PUT read-back found no ticket ${ticketId} (the PUT 200ed but the record is gone)`, {
9671
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskError)(`changeStatus: the post-PUT read-back found no ticket ${ticketId} (the PUT 200ed but the record is gone)`, {
9821
9672
  code: "INVALID_RESPONSE",
9822
9673
  category: "server",
9823
9674
  operation: OP_STATUS,
@@ -9826,7 +9677,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
9826
9677
  }
9827
9678
  const finalStatus = typeof verify.status === "number" ? verify.status : null;
9828
9679
  if (finalStatus !== targetStatus) {
9829
- throw new (0, _chunkRWLPTU67cjs.AutotaskError)(
9680
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskError)(
9830
9681
  `changeStatus: the post-PUT read-back shows status ${_nullishCoalesce(finalStatus, () => ( "unknown"))} (the vendor 200ed the PUT but did not apply ${targetStatus} \u2014 the F-A1 lesson: the 200 proves nothing)`,
9831
9682
  {
9832
9683
  code: "INVALID_RESPONSE",
@@ -9844,7 +9695,7 @@ var DEFAULT_PART_LIMIT = 50;
9844
9695
  function partLimit(value, name) {
9845
9696
  const n = value === void 0 ? DEFAULT_PART_LIMIT : Math.trunc(value);
9846
9697
  if (!Number.isInteger(n) || n < 1) {
9847
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`fullContext: ${name} must be an integer >= 1 (got ${String(value)})`);
9698
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`fullContext: ${name} must be an integer >= 1 (got ${String(value)})`);
9848
9699
  }
9849
9700
  return n;
9850
9701
  }
@@ -9860,7 +9711,7 @@ async function fullContext(resource, id, opts = {}, http) {
9860
9711
  const noteLimit = partLimit(opts.noteLimit, "noteLimit");
9861
9712
  const timeEntryLimit = partLimit(opts.timeEntryLimit, "timeEntryLimit");
9862
9713
  const textLimit = partLimit(opts.textLimit, "textLimit");
9863
- const ticketId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
9714
+ const ticketId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
9864
9715
  const ctx = await resource.getContext(ticketId);
9865
9716
  const op = "tickets.fullContext";
9866
9717
  const ticketFilter = [{ field: "ticketID", op: "eq", value: ticketId }];
@@ -9914,7 +9765,7 @@ async function fullContext(resource, id, opts = {}, http) {
9914
9765
  result.truncated = result.truncated || part.capped || historyRows.some((h) => h.detailTruncated === true);
9915
9766
  }
9916
9767
  if (opts.names === true) {
9917
- const builder = createNamePlan(TICKET_LABEL_FIELDS);
9768
+ const builder = _chunkYKEX4SK7cjs.createNamePlan.call(void 0, _chunkYKEX4SK7cjs.TICKET_LABEL_FIELDS);
9918
9769
  const t = ctx.ticket;
9919
9770
  builder.addResource(t["creatorResourceID"]);
9920
9771
  builder.addFk("contract", t["contractID"]);
@@ -9926,20 +9777,20 @@ async function fullContext(resource, id, opts = {}, http) {
9926
9777
  builder.addFk("billingCode", e["billingCodeID"]);
9927
9778
  builder.addFk("contract", e["contractID"]);
9928
9779
  }
9929
- const names = await resolveCompositeNames(http, builder.plan(), { maxNameReads: opts.maxNameReads });
9780
+ const names = await _chunkYKEX4SK7cjs.resolveCompositeNames.call(void 0, http, builder.plan(), { maxNameReads: opts.maxNameReads });
9930
9781
  const ticketRow = { ...ctx.ticket };
9931
- addNameSibling(ticketRow, "creatorResourceID", (v) => names.resourceName(v));
9932
- addNameSibling(ticketRow, "contractID", (v) => names.recordName("contract", v));
9933
- addNameSibling(ticketRow, "billingCodeID", (v) => names.recordName("billingCode", v));
9934
- addNameSibling(ticketRow, "assignedResourceRoleID", (v) => names.recordName("role", v));
9935
- for (const f of TICKET_LABEL_FIELDS) addLabelSibling(ticketRow, f, names);
9782
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, ticketRow, "creatorResourceID", (v) => names.resourceName(v));
9783
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, ticketRow, "contractID", (v) => names.recordName("contract", v));
9784
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, ticketRow, "billingCodeID", (v) => names.recordName("billingCode", v));
9785
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, ticketRow, "assignedResourceRoleID", (v) => names.recordName("role", v));
9786
+ for (const f of _chunkYKEX4SK7cjs.TICKET_LABEL_FIELDS) _chunkYKEX4SK7cjs.addLabelSibling.call(void 0, ticketRow, f, names);
9936
9787
  result.ticket = ticketRow;
9937
9788
  result.timeEntries.items = entriesPart.items.map((e) => {
9938
9789
  const row = { ...e };
9939
- addNameSibling(row, "resourceID", (v) => names.resourceName(v));
9940
- addNameSibling(row, "roleID", (v) => names.recordName("role", v));
9941
- addNameSibling(row, "billingCodeID", (v) => names.recordName("billingCode", v));
9942
- addNameSibling(row, "contractID", (v) => names.recordName("contract", v));
9790
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, row, "resourceID", (v) => names.resourceName(v));
9791
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, row, "roleID", (v) => names.recordName("role", v));
9792
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, row, "billingCodeID", (v) => names.recordName("billingCode", v));
9793
+ _chunkYKEX4SK7cjs.addNameSibling.call(void 0, row, "contractID", (v) => names.recordName("contract", v));
9943
9794
  return row;
9944
9795
  });
9945
9796
  result.names = names.section;
@@ -9949,7 +9800,7 @@ async function fullContext(resource, id, opts = {}, http) {
9949
9800
  }
9950
9801
 
9951
9802
  // src/resources/tickets.ts
9952
- var TicketsResource = class extends _chunkRWLPTU67cjs.BaseResource {
9803
+ var TicketsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
9953
9804
  constructor(http, pageSize) {
9954
9805
  super(http, {
9955
9806
  key: "tickets",
@@ -10055,7 +9906,7 @@ var TicketsResource = class extends _chunkRWLPTU67cjs.BaseResource {
10055
9906
  };
10056
9907
 
10057
9908
  // src/resources/ticket_webhooks.ts
10058
- var TicketWebhooksResource = class extends _chunkRWLPTU67cjs.BaseResource {
9909
+ var TicketWebhooksResource = class extends _chunkYKEX4SK7cjs.BaseResource {
10059
9910
  constructor(http, pageSize) {
10060
9911
  super(http, {
10061
9912
  key: "ticket_webhooks",
@@ -10141,62 +9992,62 @@ async function queryTimeEntries(_resource, filter, limit, operation, http) {
10141
9992
  body: { MaxRecords: limit, filter },
10142
9993
  operation
10143
9994
  });
10144
- const { items, pageDetails } = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res);
9995
+ const { items, pageDetails } = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res);
10145
9996
  return { items, hasMore: pageDetails.nextPageUrl != null };
10146
9997
  }
10147
9998
  async function windowQuery3(_resource, kind, http, opts) {
10148
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _53 => _53.now]), () => ( /* @__PURE__ */ new Date()));
10149
- const tz = _optionalChain([opts, 'optionalAccess', _54 => _54.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
9999
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _46 => _46.now]), () => ( /* @__PURE__ */ new Date()));
10000
+ const tz = _optionalChain([opts, 'optionalAccess', _47 => _47.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
10150
10001
  const { from, to } = dateWindowBounds(kind, now, tz);
10151
10002
  const filter = [
10152
10003
  { field: "dateWorked", op: "gte", value: from },
10153
10004
  { field: "dateWorked", op: "lte", value: to }
10154
10005
  ];
10155
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _55 => _55.limit])), `time_entries.${kind}`, http);
10006
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _48 => _48.limit])), `time_entries.${kind}`, http);
10156
10007
  return items;
10157
10008
  }
10158
10009
  async function customRange3(_resource, from, to, http, opts) {
10159
- const zone = _optionalChain([opts, 'optionalAccess', _56 => _56.tz]) === void 0 ? void 0 : validateZone(opts.tz, "time_entries.customRange");
10010
+ const zone = _optionalChain([opts, 'optionalAccess', _49 => _49.tz]) === void 0 ? void 0 : validateZone(opts.tz, "time_entries.customRange");
10160
10011
  const fromB = customRangeDay(from, "from", zone, "customRange");
10161
10012
  const toB = customRangeDay(to, "to", zone, "customRange");
10162
10013
  if (fromB.ms > toB.ms) {
10163
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("customRange: from must not be after to");
10014
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("customRange: from must not be after to");
10164
10015
  }
10165
10016
  const toEndMs = zone === void 0 ? toB.ms + DAY_MS2 - 1 : localDayEndMs(toB.y, toB.mo, toB.d, zone);
10166
10017
  const filter = [
10167
10018
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
10168
10019
  { field: "dateWorked", op: "lte", value: iso2(toEndMs) }
10169
10020
  ];
10170
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _57 => _57.limit])), "time_entries.customRange", http);
10021
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _50 => _50.limit])), "time_entries.customRange", http);
10171
10022
  return items;
10172
10023
  }
10173
10024
  async function postedDateStatusQuery(_resource, mode, http, opts) {
10174
10025
  const filter = [
10175
10026
  { field: "postedDate", op: mode === "posted" ? "exist" : "notExist" }
10176
10027
  ];
10177
- if (_optionalChain([opts, 'optionalAccess', _58 => _58.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
10028
+ if (_optionalChain([opts, 'optionalAccess', _51 => _51.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
10178
10029
  const operation = mode === "posted" ? "time_entries.getPosted" : "time_entries.getUnposted";
10179
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _59 => _59.limit])), operation, http);
10030
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _52 => _52.limit])), operation, http);
10180
10031
  return items;
10181
10032
  }
10182
10033
  async function postedWithin(_resource, from, to, http, opts, opLabel = "time_entries.postedWithin") {
10183
10034
  const OP2 = opLabel;
10184
- const zone = _optionalChain([opts, 'optionalAccess', _60 => _60.tz]) === void 0 ? void 0 : validateZone(opts.tz, OP2);
10035
+ const zone = _optionalChain([opts, 'optionalAccess', _53 => _53.tz]) === void 0 ? void 0 : validateZone(opts.tz, OP2);
10185
10036
  const fromB = customRangeDay(from, "from", zone, OP2);
10186
10037
  const toB = customRangeDay(to, "to", zone, OP2);
10187
10038
  if (fromB.ms > toB.ms) {
10188
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(`${OP2}: from (${iso2(fromB.ms)}) must not be after to (${iso2(toB.ms)})`, { operation: OP2 });
10039
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(`${OP2}: from (${iso2(fromB.ms)}) must not be after to (${iso2(toB.ms)})`, { operation: OP2 });
10189
10040
  }
10190
10041
  const windowToMs = zone === void 0 ? toB.ms + DAY_MS2 - 1 : localDayEndMs(toB.y, toB.mo, toB.d, zone);
10191
10042
  const filter = [
10192
10043
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
10193
10044
  { field: "dateWorked", op: "lte", value: iso2(windowToMs) }
10194
10045
  ];
10195
- if (_optionalChain([opts, 'optionalAccess', _61 => _61.posted]) === true) filter.push({ field: "postedDate", op: "exist" });
10196
- else if (_optionalChain([opts, 'optionalAccess', _62 => _62.posted]) === false) filter.push({ field: "postedDate", op: "notExist" });
10197
- if (_optionalChain([opts, 'optionalAccess', _63 => _63.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
10198
- if (_optionalChain([opts, 'optionalAccess', _64 => _64.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
10199
- const { items, hasMore } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _65 => _65.limit])), OP2, http);
10046
+ if (_optionalChain([opts, 'optionalAccess', _54 => _54.posted]) === true) filter.push({ field: "postedDate", op: "exist" });
10047
+ else if (_optionalChain([opts, 'optionalAccess', _55 => _55.posted]) === false) filter.push({ field: "postedDate", op: "notExist" });
10048
+ if (_optionalChain([opts, 'optionalAccess', _56 => _56.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
10049
+ if (_optionalChain([opts, 'optionalAccess', _57 => _57.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
10050
+ const { items, hasMore } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _58 => _58.limit])), OP2, http);
10200
10051
  let postedCount = 0;
10201
10052
  for (const item of items) {
10202
10053
  const postedDate = item.postedDate;
@@ -10252,13 +10103,13 @@ var LINKAGE_OWNED_FIELDS = /* @__PURE__ */ new Set([
10252
10103
  "roleID"
10253
10104
  ]);
10254
10105
  var TIME_WINDOW_FIELDS = /* @__PURE__ */ new Set(["dateWorked", "startDateTime", "endDateTime", "hoursWorked"]);
10255
- var ResourceInvalidError = class extends _chunkRWLPTU67cjs.AutotaskError {
10106
+ var ResourceInvalidError = class extends _chunkYKEX4SK7cjs.AutotaskError {
10256
10107
  constructor(message, options = {}) {
10257
10108
  super(message, { code: "RESOURCE_INVALID", category: "validation", ...options });
10258
10109
  this.name = "ResourceInvalidError";
10259
10110
  }
10260
10111
  };
10261
- var AllocationCodeError = class extends _chunkRWLPTU67cjs.AutotaskError {
10112
+ var AllocationCodeError = class extends _chunkYKEX4SK7cjs.AutotaskError {
10262
10113
  /** The failure kind (the machine code is `ALLOCATION_CODE_<KIND>`). */
10263
10114
 
10264
10115
  constructor(kind, message, options = {}) {
@@ -10267,7 +10118,7 @@ var AllocationCodeError = class extends _chunkRWLPTU67cjs.AutotaskError {
10267
10118
  this.kind = kind;
10268
10119
  }
10269
10120
  };
10270
- var NoApplicableAllocationCodeError = class extends _chunkRWLPTU67cjs.AutotaskError {
10121
+ var NoApplicableAllocationCodeError = class extends _chunkYKEX4SK7cjs.AutotaskError {
10271
10122
  /** The structured blocker details (filters tried + department sets). */
10272
10123
 
10273
10124
  constructor(details, options = {}) {
@@ -10293,7 +10144,7 @@ async function boundedQuery(http, path, filter, totalCap, operation) {
10293
10144
  let pages = 0;
10294
10145
  for (; ; ) {
10295
10146
  if (pages >= PAGE_GUARD) {
10296
- throw new (0, _chunkRWLPTU67cjs.AutotaskError)(`createForResource: the ${path} walk hit the ${PAGE_GUARD}-page guard`, {
10147
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskError)(`createForResource: the ${path} walk hit the ${PAGE_GUARD}-page guard`, {
10297
10148
  code: "RESOLUTION_TRUNCATED",
10298
10149
  category: "resolution",
10299
10150
  operation,
@@ -10304,11 +10155,11 @@ async function boundedQuery(http, path, filter, totalCap, operation) {
10304
10155
  const res = await http.request({
10305
10156
  method: "POST",
10306
10157
  idempotent: true,
10307
- path: isFirst ? path : _chunkRWLPTU67cjs.cursorToPath.call(void 0, http.baseUrl, cursor),
10158
+ path: isFirst ? path : _chunkYKEX4SK7cjs.cursorToPath.call(void 0, http.baseUrl, cursor),
10308
10159
  body: { MaxRecords: pageSize, filter },
10309
10160
  operation
10310
10161
  });
10311
- const { items: pageItems, pageDetails } = _chunkRWLPTU67cjs.unwrapItems.call(void 0, res, operation);
10162
+ const { items: pageItems, pageDetails } = _chunkYKEX4SK7cjs.unwrapItems.call(void 0, res, operation);
10312
10163
  items.push(...pageItems);
10313
10164
  pages += 1;
10314
10165
  if (items.length >= totalCap) break;
@@ -10421,8 +10272,8 @@ function windowDefaults(params) {
10421
10272
  };
10422
10273
  }
10423
10274
  async function createForResource(resource, resourceID, params, opts = {}, http) {
10424
- const rid = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, resourceID, "resourceID");
10425
- const pin = (value, label) => typeof value === "number" ? _chunkRWLPTU67cjs.parseIdentifier.call(void 0, value, label) : void 0;
10275
+ const rid = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, resourceID, "resourceID");
10276
+ const pin = (value, label) => typeof value === "number" ? _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, value, label) : void 0;
10426
10277
  const pins = {
10427
10278
  code: pin(params.internallAllocationCodeID, "internallAllocationCodeID"),
10428
10279
  ticket: pin(params.ticketID, "ticketID"),
@@ -10431,19 +10282,19 @@ async function createForResource(resource, resourceID, params, opts = {}, http)
10431
10282
  };
10432
10283
  const pinCount = [pins.code, pins.ticket, pins.task].filter((v) => v !== void 0).length;
10433
10284
  if (pinCount > 1) {
10434
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
10285
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
10435
10286
  "createForResource: exactly one linkage pin is honoured (internallAllocationCodeID | ticketID | taskID) \u2014 the vendor gate requires exactly one; pass one pin (or none for the default internal linkage)",
10436
10287
  { operation: OP }
10437
10288
  );
10438
10289
  }
10439
10290
  if (pins.role !== void 0 && pins.code !== void 0) {
10440
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
10291
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
10441
10292
  "createForResource: a pinned roleID is only meaningful with the task/ticket linkage (internallAllocationCodeID pins the internal linkage and owns the code) \u2014 drop one",
10442
10293
  { operation: OP }
10443
10294
  );
10444
10295
  }
10445
10296
  if (params.hoursWorked !== void 0 && (typeof params.hoursWorked !== "number" || !Number.isFinite(params.hoursWorked) || params.hoursWorked <= 0)) {
10446
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)(
10297
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)(
10447
10298
  `createForResource: hoursWorked must be a positive finite number (got ${String(params.hoursWorked)})`,
10448
10299
  { operation: OP }
10449
10300
  );
@@ -10520,7 +10371,7 @@ async function createForResource(resource, resourceID, params, opts = {}, http)
10520
10371
  if (usedLinkage === "internal" && linkage === "task") {
10521
10372
  warnings.push("the task had zero applicable general allocation codes \u2014 the linkage fell back to internal (the sanctioned fallback; no taskID/roleID in the body).");
10522
10373
  }
10523
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0,
10374
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0,
10524
10375
  {
10525
10376
  operation: OP,
10526
10377
  method: "POST",
@@ -10559,7 +10410,7 @@ async function createForResource(resource, resourceID, params, opts = {}, http)
10559
10410
  };
10560
10411
  } catch (err) {
10561
10412
  lastError = err;
10562
- const text = _chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) ? `${_nullishCoalesce(_chunkRWLPTU67cjs.formatVendorDetail.call(void 0, err.vendorError), () => ( ""))} ${err.message}` : "";
10413
+ const text = _chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) ? `${_nullishCoalesce(_chunkYKEX4SK7cjs.formatVendorDetail.call(void 0, err.vendorError), () => ( ""))} ${err.message}` : "";
10563
10414
  const gate3 = ROLE_REJECTION_PATTERN.test(text);
10564
10415
  if (usedLinkage !== "internal" && gate3) {
10565
10416
  if (!taskRoleFetched && usedLinkage === "task" && pins.task !== void 0) {
@@ -10579,14 +10430,14 @@ async function createForResource(resource, resourceID, params, opts = {}, http)
10579
10430
  throw err;
10580
10431
  }
10581
10432
  }
10582
- if (_chunkRWLPTU67cjs.isAutotaskError.call(void 0, lastError)) {
10433
+ if (_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, lastError)) {
10583
10434
  lastError.suggestedAction = (lastError.suggestedAction ? `${lastError.suggestedAction} ` : "") + `The createForResource attempt budget (${MAX_CREATE_ATTEMPTS} attempts: the role ladder + ${MAX_DISCOVERY_MERGES2} discovery merges) was exhausted \u2014 the vendor oracle rejected every candidate. Re-read the record/fields (operations.fieldCatalog, billing_codes.query with a filter) and retry with an explicit pin.`;
10584
10435
  }
10585
10436
  throw lastError;
10586
10437
  }
10587
10438
  function discoveryField(err, body, defaults) {
10588
- if (!_chunkRWLPTU67cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return null;
10589
- const entries = _chunkRWLPTU67cjs.parseVendorErrors.call(void 0, err.vendorError);
10439
+ if (!_chunkYKEX4SK7cjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return null;
10440
+ const entries = _chunkYKEX4SK7cjs.parseVendorErrors.call(void 0, err.vendorError);
10590
10441
  if (entries === void 0) return null;
10591
10442
  for (const entry of entries) {
10592
10443
  const field = entry.field;
@@ -10599,7 +10450,7 @@ function discoveryField(err, body, defaults) {
10599
10450
  }
10600
10451
 
10601
10452
  // src/resources/time_entries.ts
10602
- var TimeEntriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
10453
+ var TimeEntriesResource = class extends _chunkYKEX4SK7cjs.BaseResource {
10603
10454
  constructor(http, pageSize) {
10604
10455
  super(http, {
10605
10456
  key: "time_entries",
@@ -10736,7 +10587,7 @@ var TimeEntriesResource = class extends _chunkRWLPTU67cjs.BaseResource {
10736
10587
  };
10737
10588
 
10738
10589
  // src/resources/time_entry_attachments.ts
10739
- var TimeEntryAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource {
10590
+ var TimeEntryAttachmentsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
10740
10591
  constructor(http, pageSize) {
10741
10592
  super(http, {
10742
10593
  key: "time_entry_attachments",
@@ -10799,9 +10650,9 @@ var TimeEntryAttachmentsResource = class extends _chunkRWLPTU67cjs.BaseResource
10799
10650
 
10800
10651
  // src/resources/special/time_off_requests.ts
10801
10652
  async function approve(_resource, id, opts = {}, http) {
10802
- const numericId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
10653
+ const numericId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
10803
10654
  if (opts.dryRun === true) {
10804
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
10655
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
10805
10656
  operation: "time_off_requests.approve",
10806
10657
  method: "GET",
10807
10658
  path: `/V1.0/TimeOffRequests/${numericId}/Approve`,
@@ -10816,16 +10667,16 @@ async function approve(_resource, id, opts = {}, http) {
10816
10667
  path: `/V1.0/TimeOffRequests/${numericId}/Approve`,
10817
10668
  operation: "time_off_requests.approve"
10818
10669
  });
10819
- return _chunkRWLPTU67cjs.unwrapOperation.call(void 0, res);
10670
+ return _chunkYKEX4SK7cjs.unwrapOperation.call(void 0, res);
10820
10671
  }
10821
10672
  async function reject(_resource, id, reason, opts = {}, http) {
10822
- const numericId = _chunkRWLPTU67cjs.parseIdentifier.call(void 0, id, "id");
10673
+ const numericId = _chunkYKEX4SK7cjs.parseIdentifier.call(void 0, id, "id");
10823
10674
  const text = reason.trim();
10824
10675
  if (text === "") {
10825
- throw new (0, _chunkRWLPTU67cjs.AutotaskConfigError)("reject: a non-empty reason is required (vendor TimeOffRequestRejectModel)");
10676
+ throw new (0, _chunkYKEX4SK7cjs.AutotaskConfigError)("reject: a non-empty reason is required (vendor TimeOffRequestRejectModel)");
10826
10677
  }
10827
10678
  if (opts.dryRun === true) {
10828
- return _chunkRWLPTU67cjs.buildDryRunResult.call(void 0, {
10679
+ return _chunkYKEX4SK7cjs.buildDryRunResult.call(void 0, {
10829
10680
  operation: "time_off_requests.reject",
10830
10681
  method: "POST",
10831
10682
  path: `/V1.0/TimeOffRequests/${numericId}/Reject`,
@@ -10842,11 +10693,11 @@ async function reject(_resource, id, reason, opts = {}, http) {
10842
10693
  body: { timeOffRequestID: numericId, reason: text },
10843
10694
  operation: "time_off_requests.reject"
10844
10695
  });
10845
- return _chunkRWLPTU67cjs.unwrapOperation.call(void 0, res);
10696
+ return _chunkYKEX4SK7cjs.unwrapOperation.call(void 0, res);
10846
10697
  }
10847
10698
 
10848
10699
  // src/resources/time_off_requests.ts
10849
- var TimeOffRequestsResource = class extends _chunkRWLPTU67cjs.BaseResource {
10700
+ var TimeOffRequestsResource = class extends _chunkYKEX4SK7cjs.BaseResource {
10850
10701
  constructor(http, pageSize) {
10851
10702
  super(http, {
10852
10703
  key: "time_off_requests",
@@ -11082,4 +10933,3 @@ var ZoneInformationResource = class {
11082
10933
 
11083
10934
 
11084
10935
  exports.AppointmentsResource = AppointmentsResource; exports.AuthenticateResource = AuthenticateResource; exports.BillingCodesResource = BillingCodesResource; exports.BillingItemsResource = BillingItemsResource; exports.ChangeRequestLinksResource = ChangeRequestLinksResource; exports.ChecklistLibrariesResource = ChecklistLibrariesResource; exports.ChecklistLibraryChecklistItemsResource = ChecklistLibraryChecklistItemsResource; exports.ClassificationIconsResource = ClassificationIconsResource; exports.CompaniesResource = CompaniesResource; exports.CompanyAlertsResource = CompanyAlertsResource; exports.CompanyLocationsResource = CompanyLocationsResource; exports.CompanyNotesResource = CompanyNotesResource; exports.CompanySiteConfigurationsResource = CompanySiteConfigurationsResource; exports.CompanyWebhooksResource = CompanyWebhooksResource; exports.ConfigurationItemBillingProductAssociationsResource = ConfigurationItemBillingProductAssociationsResource; exports.ConfigurationItemCategoriesResource = ConfigurationItemCategoriesResource; exports.ConfigurationItemCategoryUdfAssociationsResource = ConfigurationItemCategoryUdfAssociationsResource; exports.ConfigurationItemDnsRecordsResource = ConfigurationItemDnsRecordsResource; exports.ConfigurationItemNotesResource = ConfigurationItemNotesResource; exports.ConfigurationItemRelatedItemsResource = ConfigurationItemRelatedItemsResource; exports.ConfigurationItemsResource = ConfigurationItemsResource; exports.ConfigurationItemSslSubjectAlternativeNamesResource = ConfigurationItemSslSubjectAlternativeNamesResource; exports.ConfigurationItemTypesResource = ConfigurationItemTypesResource; exports.ConfigurationItemWebhooksResource = ConfigurationItemWebhooksResource; exports.ContactGroupContactsResource = ContactGroupContactsResource; exports.ContactGroupsResource = ContactGroupsResource; exports.ContactsResource = ContactsResource; exports.ContactWebhooksResource = ContactWebhooksResource; exports.ContractBillingRulesResource = ContractBillingRulesResource; exports.ContractBlockHourFactorsResource = ContractBlockHourFactorsResource; exports.ContractBlocksResource = ContractBlocksResource; exports.ContractChargesResource = ContractChargesResource; exports.ContractExclusionBillingCodesResource = ContractExclusionBillingCodesResource; exports.ContractExclusionRolesResource = ContractExclusionRolesResource; exports.ContractExclusionSetExcludedRolesResource = ContractExclusionSetExcludedRolesResource; exports.ContractExclusionSetExcludedWorkTypesResource = ContractExclusionSetExcludedWorkTypesResource; exports.ContractExclusionSetsResource = ContractExclusionSetsResource; exports.ContractMilestonesResource = ContractMilestonesResource; exports.ContractNotesResource = ContractNotesResource; exports.ContractRatesResource = ContractRatesResource; exports.ContractRetainersResource = ContractRetainersResource; exports.ContractRoleCostsResource = ContractRoleCostsResource; exports.ContractServiceAdjustmentsResource = ContractServiceAdjustmentsResource; exports.ContractServiceBundleAdjustmentsResource = ContractServiceBundleAdjustmentsResource; exports.ContractServiceBundlesResource = ContractServiceBundlesResource; exports.ContractServiceBundleUnitsResource = ContractServiceBundleUnitsResource; exports.ContractServicesResource = ContractServicesResource; exports.ContractServiceUnitsResource = ContractServiceUnitsResource; exports.ContractsResource = ContractsResource; exports.ContractTicketPurchasesResource = ContractTicketPurchasesResource; exports.CountriesResource = CountriesResource; exports.DepartmentsResource = DepartmentsResource; exports.DomainRegistrarsResource = DomainRegistrarsResource; exports.EntityInformationResource = EntityInformationResource; exports.ExpenseItemAttachmentsResource = ExpenseItemAttachmentsResource; exports.ExpenseItemsResource = ExpenseItemsResource; exports.ExpenseReportsResource = ExpenseReportsResource; exports.HolidaySetsResource = HolidaySetsResource; exports.HolidaysResource = HolidaysResource; exports.InventoryProductsResource = InventoryProductsResource; exports.InvoicesResource = InvoicesResource; exports.ModulesResource = ModulesResource; exports.NotificationHistoryResource = NotificationHistoryResource; exports.OpportunitiesResource = OpportunitiesResource; exports.OpportunityAttachmentsResource = OpportunityAttachmentsResource; exports.OpportunityCategoriesResource = OpportunityCategoriesResource; exports.PhasesResource = PhasesResource; exports.ProductsResource = ProductsResource; exports.ProductVendorsResource = ProductVendorsResource; exports.ProjectChargesResource = ProjectChargesResource; exports.ProjectNotesResource = ProjectNotesResource; exports.ProjectsResource = ProjectsResource; exports.PurchaseApprovalsResource = PurchaseApprovalsResource; exports.PurchaseOrderItemReceivingResource = PurchaseOrderItemReceivingResource; exports.PurchaseOrderItemsResource = PurchaseOrderItemsResource; exports.PurchaseOrdersResource = PurchaseOrdersResource; exports.QuoteItemsResource = QuoteItemsResource; exports.QuoteLocationsResource = QuoteLocationsResource; exports.QuotesResource = QuotesResource; exports.QuoteTemplatesResource = QuoteTemplatesResource; exports.ResourceRoleQueuesResource = ResourceRoleQueuesResource; exports.ResourceRolesResource = ResourceRolesResource; exports.ResourceSkillsResource = ResourceSkillsResource; exports.ResourcesResource = ResourcesResource; exports.ResourceTimeOffAdditionalResource = ResourceTimeOffAdditionalResource; exports.ResourceTimeOffApproversResource = ResourceTimeOffApproversResource; exports.ResourceTimeOffBalancesResource = ResourceTimeOffBalancesResource; exports.RolesResource = RolesResource; exports.ServiceCallsResource = ServiceCallsResource; exports.ServiceCallTaskResourcesResource = ServiceCallTaskResourcesResource; exports.ServiceCallTasksResource = ServiceCallTasksResource; exports.ServiceCallTicketResourcesResource = ServiceCallTicketResourcesResource; exports.ServiceCallTicketsResource = ServiceCallTicketsResource; exports.ServiceLevelAgreementResultsResource = ServiceLevelAgreementResultsResource; exports.ServicesResource = ServicesResource; exports.SkillsResource = SkillsResource; exports.SubscriptionPeriodsResource = SubscriptionPeriodsResource; exports.SubscriptionsResource = SubscriptionsResource; exports.SurveyResultsResource = SurveyResultsResource; exports.SurveysResource = SurveysResource; exports.TagAliasesResource = TagAliasesResource; exports.TagGroupsResource = TagGroupsResource; exports.TagsResource = TagsResource; exports.TaskSecondaryResourcesResource = TaskSecondaryResourcesResource; exports.TasksResource = TasksResource; exports.ThresholdInformationResource = ThresholdInformationResource; exports.TicketAdditionalConfigurationItemsResource = TicketAdditionalConfigurationItemsResource; exports.TicketAdditionalContactsResource = TicketAdditionalContactsResource; exports.TicketAttachmentsResource = TicketAttachmentsResource; exports.TicketCategoriesResource = TicketCategoriesResource; exports.TicketCategoryFieldDefaultsResource = TicketCategoryFieldDefaultsResource; exports.TicketChangeRequestApprovalsResource = TicketChangeRequestApprovalsResource; exports.TicketChargesResource = TicketChargesResource; exports.TicketChecklistItemsResource = TicketChecklistItemsResource; exports.TicketChecklistLibrariesResource = TicketChecklistLibrariesResource; exports.TicketHistoryResource = TicketHistoryResource; exports.TicketNoteAttachmentsResource = TicketNoteAttachmentsResource; exports.TicketNotesResource = TicketNotesResource; exports.TicketNoteWebhooksResource = TicketNoteWebhooksResource; exports.TicketSecondaryResourcesResource = TicketSecondaryResourcesResource; exports.TicketsResource = TicketsResource; exports.TicketWebhooksResource = TicketWebhooksResource; exports.TimeEntriesResource = TimeEntriesResource; exports.TimeEntryAttachmentsResource = TimeEntryAttachmentsResource; exports.TimeOffRequestsResource = TimeOffRequestsResource; exports.VersionInformationResource = VersionInformationResource; exports.VersionResource = VersionResource; exports.ZoneInformationResource = ZoneInformationResource;
11085
- //# sourceMappingURL=chunk-OYHKIYVR.cjs.map