node-autotask 0.38.0 → 0.39.1

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 (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/MCP_TOOL_CATALOG.json +2 -2
  3. package/MCP_TOOL_MANIFEST.md +7 -7
  4. package/N8N_MCP_MANIFEST.json +2 -2
  5. package/N8N_MCP_MANIFEST.md +3 -3
  6. package/capabilities.json +1460 -1429
  7. package/capabilities.schema.json +2 -1
  8. package/dist/capabilities.cjs +2 -2
  9. package/dist/capabilities.d.cts +4 -4
  10. package/dist/capabilities.d.ts +4 -4
  11. package/dist/capabilities.js +1 -1
  12. package/dist/{chunk-DCTUBUIZ.cjs → chunk-73QNAEAF.cjs} +143 -143
  13. package/dist/{chunk-IY3WCPCK.js → chunk-CQXB7KAO.js} +2 -2
  14. package/dist/{chunk-U3K6IDKB.js → chunk-GDSCYY2G.js} +1459 -1428
  15. package/dist/{chunk-7FNKFNIJ.cjs → chunk-GIVYTQ6R.cjs} +285 -285
  16. package/dist/{chunk-IY5QZZVF.cjs → chunk-LB34VFQY.cjs} +254 -143
  17. package/dist/{chunk-KPYXO7F5.js → chunk-LDTJNLX7.js} +2 -2
  18. package/dist/{chunk-4QHGCYEI.js → chunk-LN3HQQBR.js} +136 -25
  19. package/dist/{chunk-73JMTV4O.cjs → chunk-VR6RYXTD.cjs} +1459 -1428
  20. package/dist/{index-Q-4HQEEb.d.ts → index-C-Oqef4y.d.cts} +7170 -52
  21. package/dist/{index-BFbUB5YD.d.cts → index-C-Oqef4y.d.ts} +7170 -52
  22. package/dist/index.cjs +22 -22
  23. package/dist/index.d.cts +2 -4
  24. package/dist/index.d.ts +2 -4
  25. package/dist/index.js +4 -4
  26. package/dist/operations/index.cjs +181 -177
  27. package/dist/operations/index.d.cts +3 -172
  28. package/dist/operations/index.d.ts +3 -172
  29. package/dist/operations/index.js +6 -2
  30. package/dist/pool.cjs +9 -9
  31. package/dist/pool.d.cts +1 -2
  32. package/dist/pool.d.ts +1 -2
  33. package/dist/pool.js +4 -4
  34. package/dist/resources/index.cjs +4 -4
  35. package/dist/resources/index.d.cts +1 -2
  36. package/dist/resources/index.d.ts +1 -2
  37. package/dist/resources/index.js +3 -3
  38. package/dist/types/index.d.cts +1 -1
  39. package/dist/types/index.d.ts +1 -1
  40. package/docs/API.md +63 -8
  41. package/package.json +1 -1
  42. package/dist/index-BQVStxwi.d.cts +0 -6893
  43. package/dist/index-BQVStxwi.d.ts +0 -6893
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;
2
2
 
3
- var _chunk73JMTV4Ocjs = require('./chunk-73JMTV4O.cjs');
3
+ var _chunkVR6RYXTDcjs = require('./chunk-VR6RYXTD.cjs');
4
4
 
5
5
 
6
6
  var _chunkMJTKK3QGcjs = require('./chunk-MJTKK3QG.cjs');
@@ -17853,7 +17853,7 @@ function buildEntityTypeMap() {
17853
17853
  }
17854
17854
  var ENTITY_TYPE_TO_RESOURCE = buildEntityTypeMap();
17855
17855
  var ENUMERABLE_RESOURCES = new Set(
17856
- _chunk73JMTV4Ocjs.CAPABILITIES.filter((rec) => rec.resource !== "operations" && (rec.operation === "query" || rec.operation === "get")).map(
17856
+ _chunkVR6RYXTDcjs.CAPABILITIES.filter((rec) => rec.resource !== "operations" && (rec.operation === "query" || rec.operation === "get")).map(
17857
17857
  (rec) => rec.resource
17858
17858
  )
17859
17859
  );
@@ -17878,7 +17878,8 @@ var WORKFLOW_RESOURCES = [
17878
17878
  // src/operations/fieldCatalog.ts
17879
17879
  var MAX_FIELD_CATALOG_WIRE = 60;
17880
17880
  var FIELD_CATALOG_HONESTY_NOTE = "Live field metadata reports the SHAPE of a field (existence, requiredness, type, maxLength, read-only, queryable, picklist-ness) as FLAGS and NAMES: picklist-ness as a flag (isPickList) and picklist field names (picklistFields). With the opt-in `labels: true`, picklist rows carry the vendor's exposed picklist VALUES (labels next to each value); without it the op serves no VALUES. It cannot resolve a picklist VALUE the vendor does not expose to this API user (the W-A4 wall \u2014 e.g. the attachments Type picklist): retrying the catalog will not surface a withheld value; that gap is vendor-side, not a client defect.";
17881
- var FIELD_CATALOG_OPT_KEYS = ["resources", "include", "fresh", "fields", "labels"];
17881
+ var MIN_FIELD_CATALOG_MAX_BYTES = 4096;
17882
+ var FIELD_CATALOG_OPT_KEYS = ["resources", "include", "fresh", "fields", "labels", "compact", "maxBytes"];
17882
17883
  function projectFieldRow(raw, labels = false, udf = false) {
17883
17884
  const r = typeof raw === "object" && raw !== null ? raw : {};
17884
17885
  const name = typeof r.name === "string" ? r.name : "";
@@ -17905,6 +17906,16 @@ function projectFieldRow(raw, labels = false, udf = false) {
17905
17906
  ...values !== void 0 ? { picklistValues: values } : {}
17906
17907
  };
17907
17908
  }
17909
+ function compactFieldRow(f, udf, keepValues) {
17910
+ return {
17911
+ name: f.name,
17912
+ type: f.type,
17913
+ isPickList: f.isPickList,
17914
+ isReference: f.referenceEntityType !== "",
17915
+ udf,
17916
+ ...keepValues && f.picklistValues !== void 0 ? { picklistValues: f.picklistValues } : {}
17917
+ };
17918
+ }
17908
17919
  function isObjectOrArrayType(type) {
17909
17920
  const t = type.trim().toLowerCase();
17910
17921
  return t === "object" || t === "array" || t === "collection" || t.endsWith("[]");
@@ -17930,7 +17941,7 @@ function capabilitySets() {
17930
17941
  const fieldOps = /* @__PURE__ */ new Map();
17931
17942
  const udfCapable = /* @__PURE__ */ new Set();
17932
17943
  const resources = /* @__PURE__ */ new Set();
17933
- for (const rec of _chunk73JMTV4Ocjs.CAPABILITIES) {
17944
+ for (const rec of _chunkVR6RYXTDcjs.CAPABILITIES) {
17934
17945
  if (rec.resource === "operations") continue;
17935
17946
  resources.add(rec.resource);
17936
17947
  if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
@@ -17942,7 +17953,7 @@ var derivedIndex = null;
17942
17953
  function derivedFieldsFor(resource) {
17943
17954
  if (derivedIndex === null) {
17944
17955
  derivedIndex = /* @__PURE__ */ new Map();
17945
- for (const rec of _chunk73JMTV4Ocjs.CAPABILITIES) {
17956
+ for (const rec of _chunkVR6RYXTDcjs.CAPABILITIES) {
17946
17957
  const declared = _optionalChain([rec, 'access', _136 => _136.metadata, 'optionalAccess', _137 => _137.derivedFields]);
17947
17958
  if (!Array.isArray(declared) || derivedIndex.has(rec.resource)) continue;
17948
17959
  const rows = [];
@@ -17972,7 +17983,7 @@ function apiEntityFor(rec) {
17972
17983
  function validateCatalogOptsShape(opts) {
17973
17984
  if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
17974
17985
  throw new AutotaskConfigError(
17975
- "fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean, fields?: string[], labels?: boolean }"
17986
+ "fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean, fields?: string[], labels?: boolean, compact?: boolean, maxBytes?: number }"
17976
17987
  );
17977
17988
  }
17978
17989
  for (const key of Object.keys(_nullishCoalesce(opts, () => ( {})))) {
@@ -18061,6 +18072,61 @@ function resolveLabels(opts) {
18061
18072
  }
18062
18073
  return _optionalChain([opts, 'optionalAccess', _142 => _142.labels]) === true;
18063
18074
  }
18075
+ function resolveSizeOpts(opts) {
18076
+ if (_optionalChain([opts, 'optionalAccess', _143 => _143.compact]) !== void 0 && typeof opts.compact !== "boolean") {
18077
+ throw new AutotaskConfigError(`fieldCatalog: opts.compact must be a boolean (got ${typeof opts.compact})`);
18078
+ }
18079
+ const maxBytes = _optionalChain([opts, 'optionalAccess', _144 => _144.maxBytes]);
18080
+ if (maxBytes !== void 0 && (typeof maxBytes !== "number" || !Number.isInteger(maxBytes) || maxBytes < MIN_FIELD_CATALOG_MAX_BYTES)) {
18081
+ throw new AutotaskConfigError(
18082
+ `fieldCatalog: opts.maxBytes must be an integer >= ${MIN_FIELD_CATALOG_MAX_BYTES} (got ${String(maxBytes)})`
18083
+ );
18084
+ }
18085
+ return { compact: _optionalChain([opts, 'optionalAccess', _145 => _145.compact]) === true, maxBytes };
18086
+ }
18087
+ var jsonBytes = (v) => Buffer.byteLength(JSON.stringify(v), "utf8");
18088
+ var TRIM_KINDS = ["udf", "fields", "picklistFields", "queryable", "readOnly", "required"];
18089
+ function applyMaxBytes(result, maxBytes) {
18090
+ const fullBytes = jsonBytes(result);
18091
+ if (fullBytes <= maxBytes) return;
18092
+ result.truncated = true;
18093
+ const omitted = /* @__PURE__ */ new Map();
18094
+ const truncation = { reason: "maxBytes", maxBytes, fullBytes, omitted: [], note: "" };
18095
+ result.truncation = truncation;
18096
+ const lists = [];
18097
+ for (const kind of TRIM_KINDS.slice(0, 2)) {
18098
+ for (let i = result.rows.length - 1; i >= 0; i--) {
18099
+ const row = result.rows[i];
18100
+ if (Array.isArray(row[kind])) lists.push({ resource: row.resource, kind, list: row[kind] });
18101
+ }
18102
+ }
18103
+ for (const kind of TRIM_KINDS.slice(2)) {
18104
+ for (let i = result.rows.length - 1; i >= 0; i--) lists.push({ resource: result.rows[i].resource, kind, list: result.rows[i][kind] });
18105
+ }
18106
+ for (; ; ) {
18107
+ truncation.omitted = [...omitted.values()];
18108
+ const rowsDropped = truncation.omitted.filter((o) => o.kind === "fields" || o.kind === "udf").reduce((a, o) => a + o.count, 0);
18109
+ const namesDropped = truncation.omitted.length > 0 && truncation.omitted.some((o) => o.kind !== "fields" && o.kind !== "udf");
18110
+ truncation.note = `${rowsDropped} field row(s) omitted to fit maxBytes ${maxBytes} (the full result is ${fullBytes} bytes); ` + (namesDropped ? "the row name lists were trimmed as well (see omitted). " : "the row name lists (required, readOnly, queryable, picklistFields) still name every field. ") + `Narrow with fields: [...], ${result.compact ? "" : "use compact: true, "}or raise maxBytes.`;
18111
+ let bytes = jsonBytes(result);
18112
+ if (bytes <= maxBytes) return;
18113
+ if (lists.every((l) => l.list.length === 0)) {
18114
+ throw new AutotaskConfigError(
18115
+ `fieldCatalog: maxBytes ${maxBytes} cannot hold this result: with every field row and name list dropped it is still ${bytes} bytes for ${result.rows.length} resource row(s); request fewer resources or raise maxBytes`
18116
+ );
18117
+ }
18118
+ for (const { resource, kind, list } of lists) {
18119
+ while (list.length > 0 && bytes > maxBytes) {
18120
+ bytes -= jsonBytes(list.pop()) + 1;
18121
+ const key = `${resource}:${kind}`;
18122
+ const entry = _nullishCoalesce(omitted.get(key), () => ( { resource, kind, count: 0 }));
18123
+ entry.count += 1;
18124
+ omitted.set(key, entry);
18125
+ }
18126
+ if (bytes <= maxBytes) break;
18127
+ }
18128
+ }
18129
+ }
18064
18130
  function assertWithinWireCap(targetCount, kindCount) {
18065
18131
  const cost = targetCount * kindCount;
18066
18132
  if (cost > MAX_FIELD_CATALOG_WIRE) {
@@ -18072,9 +18138,9 @@ function assertWithinWireCap(targetCount, kindCount) {
18072
18138
  }
18073
18139
  function kindFetches(holder, resource) {
18074
18140
  return {
18075
- info: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _143 => _143.getEntityInfo, 'optionalCall', _144 => _144()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getEntityInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18076
- fields: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _145 => _145.getFieldInfo, 'optionalCall', _146 => _146()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getFieldInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18077
- udf: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _147 => _147.getUdfInfo, 'optionalCall', _148 => _148()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getUdfInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" }))))
18141
+ info: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _146 => _146.getEntityInfo, 'optionalCall', _147 => _147()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getEntityInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18142
+ fields: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _148 => _148.getFieldInfo, 'optionalCall', _149 => _149()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getFieldInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18143
+ udf: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _150 => _150.getUdfInfo, 'optionalCall', _151 => _151()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getUdfInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" }))))
18078
18144
  };
18079
18145
  }
18080
18146
  async function sweepResource(ctx, resource, tally) {
@@ -18100,7 +18166,7 @@ async function sweepResource(ctx, resource, tally) {
18100
18166
  error: null
18101
18167
  };
18102
18168
  const fetches = kindFetches(holder, resource);
18103
- if (fresh) _optionalChain([cache, 'optionalAccess', _149 => _149.invalidate, 'call', _150 => _150(resource)]);
18169
+ if (fresh) _optionalChain([cache, 'optionalAccess', _152 => _152.invalidate, 'call', _153 => _153(resource)]);
18104
18170
  const projectList = (kind, list) => {
18105
18171
  const projected = list.map((f) => projectFieldRow(f, labels, kind === "udf"));
18106
18172
  if (kind === "fields") applyFieldsFilter(projected, fieldsFilter, row);
@@ -18142,11 +18208,16 @@ async function sweepResource(ctx, resource, tally) {
18142
18208
  }
18143
18209
  }
18144
18210
  row.cache = allCached ? { hit: true, age: ages.length > 0 ? Math.max(...ages) : 0 } : { hit: false, age: null };
18211
+ if (ctx.compact) {
18212
+ const keepValues = labels && fieldsFilter !== void 0;
18213
+ if (row.fields !== void 0) row.fields = row.fields.map((f) => compactFieldRow(f, false, keepValues));
18214
+ if (Array.isArray(row.udf)) row.udf = row.udf.map((f) => compactFieldRow(f, true, keepValues));
18215
+ }
18145
18216
  const declared = derivedFieldsFor(resource);
18146
18217
  if (declared.length > 0) {
18147
18218
  const byField = new Map(declared.map((d) => [d.field, d]));
18148
18219
  row.derivedFields = declared;
18149
- for (const field of _nullishCoalesce(row.fields, () => ( []))) {
18220
+ for (const field of ctx.compact ? [] : _nullishCoalesce(row.fields, () => ( []))) {
18150
18221
  const derivation = byField.get(field.name);
18151
18222
  if (derivation === void 0) continue;
18152
18223
  field.derived = {
@@ -18164,22 +18235,24 @@ async function fieldCatalog(client, opts) {
18164
18235
  const targets = resolveTargets(opts, fieldOps, allResources);
18165
18236
  const fieldsFilter = resolveFieldsFilter(opts);
18166
18237
  const labels = resolveLabels(opts);
18238
+ const { compact, maxBytes } = resolveSizeOpts(opts);
18167
18239
  assertWithinWireCap(targets.length, include.length);
18168
18240
  const cache = client.http.fieldCache;
18169
18241
  const zone = _nullishCoalesce(client.config.zone, () => ( "unknown"));
18170
18242
  const rows = [];
18171
18243
  const tally = { wireUsed: 0, anyPicklistValues: false };
18172
- const ctx = { client, include, fieldsFilter, labels, fresh: _optionalChain([opts, 'optionalAccess', _151 => _151.fresh]) === true, fieldOps, udfCapable };
18244
+ const ctx = { client, include, fieldsFilter, labels, compact, fresh: _optionalChain([opts, 'optionalAccess', _154 => _154.fresh]) === true, fieldOps, udfCapable };
18173
18245
  for (const resource of targets) {
18174
18246
  const row = await sweepResource(ctx, resource, tally);
18175
18247
  if (row !== void 0) rows.push(row);
18176
18248
  }
18177
- return {
18249
+ const result = {
18178
18250
  zone,
18179
18251
  label: zone,
18180
18252
  cached: cache !== void 0,
18181
18253
  labels,
18182
- ttlMs: _nullishCoalesce(_optionalChain([cache, 'optionalAccess', _152 => _152.ttlMs]), () => ( null)),
18254
+ compact,
18255
+ ttlMs: _nullishCoalesce(_optionalChain([cache, 'optionalAccess', _155 => _155.ttlMs]), () => ( null)),
18183
18256
  fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
18184
18257
  rows,
18185
18258
  wireUsed: tally.wireUsed,
@@ -18196,6 +18269,8 @@ async function fieldCatalog(client, opts) {
18196
18269
  note: FIELD_CATALOG_HONESTY_NOTE
18197
18270
  }
18198
18271
  };
18272
+ if (maxBytes !== void 0) applyMaxBytes(result, maxBytes);
18273
+ return result;
18199
18274
  }
18200
18275
 
18201
18276
  // src/field-sets.ts
@@ -18450,7 +18525,7 @@ function blindEmptyReason(stamp) {
18450
18525
  };
18451
18526
  }
18452
18527
  function attachUpdateTargetMissReason(err, key) {
18453
- const pinned = _optionalChain([EMPTY_REASON_STAMPS, 'access', _153 => _153[key], 'optionalAccess', _154 => _154.update]);
18528
+ const pinned = _optionalChain([EMPTY_REASON_STAMPS, 'access', _156 => _156[key], 'optionalAccess', _157 => _157.update]);
18454
18529
  if (pinned === void 0) return;
18455
18530
  err.details = { ..._nullishCoalesce(err.details, () => ( {})), emptyReason: pinned };
18456
18531
  }
@@ -18753,7 +18828,7 @@ var QueryBase = class {
18753
18828
  }
18754
18829
  /** @internal */
18755
18830
  walkPageSize(params) {
18756
- return clampPageSize(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _155 => _155.maxRecords]), () => ( this.defaultPageSize)));
18831
+ return clampPageSize(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _158 => _158.maxRecords]), () => ( this.defaultPageSize)));
18757
18832
  }
18758
18833
  /** Issue #281: relation filters (`ticket.<field>` …) resolve before a walk,
18759
18834
  * through the same rewrite as queryBounded / count. `undefined` = no parent
@@ -18761,7 +18836,7 @@ var QueryBase = class {
18761
18836
  async relationWalkParams(params, op) {
18762
18837
  const p = _nullishCoalesce(params, () => ( {}));
18763
18838
  const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(p.filter), op);
18764
- if (_optionalChain([relation, 'optionalAccess', _156 => _156.never]) === true) return void 0;
18839
+ if (_optionalChain([relation, 'optionalAccess', _159 => _159.never]) === true) return void 0;
18765
18840
  return relation === void 0 ? p : { ...p, filter: relation.conditions };
18766
18841
  }
18767
18842
  /**
@@ -18836,19 +18911,19 @@ var QueryBase = class {
18836
18911
  "queryBounded: params must be an object { filter?, limit?, latest?, includeFields? } \u2014 a bare conditions array is not accepted (wrap it: { filter: [...] })"
18837
18912
  );
18838
18913
  }
18839
- const limit = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _157 => _157.limit]), () => ( BOUNDED_QUERY_DEFAULT_LIMIT));
18914
+ const limit = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _160 => _160.limit]), () => ( BOUNDED_QUERY_DEFAULT_LIMIT));
18840
18915
  if (!Number.isInteger(limit) || limit < 1 || limit > BOUNDED_QUERY_MAX_LIMIT) {
18841
18916
  throw new AutotaskConfigError(
18842
18917
  `queryBounded: limit must be an integer 1..${BOUNDED_QUERY_MAX_LIMIT} (got ${String(limit)}) \u2014 it is the TOTAL record cap, not a page size`
18843
18918
  );
18844
18919
  }
18845
- const noteChars = _optionalChain([params, 'optionalAccess', _158 => _158.noteChars]);
18920
+ const noteChars = _optionalChain([params, 'optionalAccess', _161 => _161.noteChars]);
18846
18921
  if (noteChars !== void 0 && (!Number.isInteger(noteChars) || noteChars < 1)) {
18847
18922
  throw new AutotaskConfigError(
18848
18923
  `queryBounded: noteChars must be an integer >= 1 (got ${String(noteChars)}) \u2014 it is the per-field char cap on the untrusted-class free-text fields (absent = the raw, untruncated result)`
18849
18924
  );
18850
18925
  }
18851
- let walkParams = _optionalChain([params, 'optionalAccess', _159 => _159.fieldsPreset]) !== void 0 ? { ...params, includeFields: resolveFieldsPreset(params.fieldsPreset, this.config.key, params.includeFields) } : _nullishCoalesce(params, () => ( {}));
18926
+ let walkParams = _optionalChain([params, 'optionalAccess', _162 => _162.fieldsPreset]) !== void 0 ? { ...params, includeFields: resolveFieldsPreset(params.fieldsPreset, this.config.key, params.includeFields) } : _nullishCoalesce(params, () => ( {}));
18852
18927
  const latest = walkParams.latest;
18853
18928
  if (latest !== void 0) {
18854
18929
  if (!Number.isInteger(latest) || latest < 1 || latest > BOUNDED_QUERY_MAX_LIMIT) {
@@ -18856,14 +18931,14 @@ var QueryBase = class {
18856
18931
  `queryBounded: latest must be an integer 1..${BOUNDED_QUERY_MAX_LIMIT} (got ${String(latest)}) \u2014 it is the count of the highest-id rows to return`
18857
18932
  );
18858
18933
  }
18859
- if (_optionalChain([params, 'optionalAccess', _160 => _160.limit]) !== void 0 && limit < latest) {
18934
+ if (_optionalChain([params, 'optionalAccess', _163 => _163.limit]) !== void 0 && limit < latest) {
18860
18935
  throw new AutotaskConfigError(
18861
18936
  `queryBounded: limit (${String(limit)}) must be >= latest (${String(latest)}) \u2014 latest governs the returned count and limit is the walk window`
18862
18937
  );
18863
18938
  }
18864
18939
  }
18865
18940
  const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(walkParams.filter), `${this.config.key}.query`);
18866
- if (_optionalChain([relation, 'optionalAccess', _161 => _161.never]) === true) return { items: [], fetched: 0, hasMore: false, pagesWalked: 0, relationNote: relation.note };
18941
+ if (_optionalChain([relation, 'optionalAccess', _164 => _164.never]) === true) return { items: [], fetched: 0, hasMore: false, pagesWalked: 0, relationNote: relation.note };
18867
18942
  if (relation !== void 0) walkParams = { ...walkParams, filter: relation.conditions };
18868
18943
  if (latest !== void 0) {
18869
18944
  return this.applyNoteChars(await this.latestWalk(walkParams, Math.max(limit, latest), latest), noteChars);
@@ -18947,8 +19022,8 @@ var QueryBase = class {
18947
19022
  * @internal */
18948
19023
  stampEmptyQueryResult(result, params) {
18949
19024
  if (result.items.length !== 0) return;
18950
- result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _162 => _162[this.config.key], 'optionalAccess', _163 => _163.query]), _optionalChain([params, 'optionalAccess', _164 => _164.filter]));
18951
- const pinnedReason = normalizedConditions(_optionalChain([params, 'optionalAccess', _165 => _165.filter])) === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _166 => _166[this.config.key], 'optionalAccess', _167 => _167.query]) : void 0;
19025
+ result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _165 => _165[this.config.key], 'optionalAccess', _166 => _166.query]), _optionalChain([params, 'optionalAccess', _167 => _167.filter]));
19026
+ const pinnedReason = normalizedConditions(_optionalChain([params, 'optionalAccess', _168 => _168.filter])) === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _169 => _169[this.config.key], 'optionalAccess', _170 => _170.query]) : void 0;
18952
19027
  if (result.blindSurface !== void 0 || pinnedReason !== void 0) {
18953
19028
  result.emptyReason = result.blindSurface !== void 0 ? blindEmptyReason(result.blindSurface) : pinnedReason;
18954
19029
  }
@@ -19177,7 +19252,7 @@ var QueryBase = class {
19177
19252
  if (result.items.length === 0) {
19178
19253
  this.stampEmptyQueryResult(result, params);
19179
19254
  } else {
19180
- result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _168 => _168[this.config.key], 'optionalAccess', _169 => _169.query]), params.filter);
19255
+ result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _171 => _171[this.config.key], 'optionalAccess', _172 => _172.query]), params.filter);
19181
19256
  }
19182
19257
  return result;
19183
19258
  }
@@ -19218,9 +19293,9 @@ var QueryBase = class {
19218
19293
  * or, on a plan-pinned blind surface, the `{ count: 0, blindSurface }`
19219
19294
  * typed sentinel (S12-C T10; see `BlindCountResult`). */
19220
19295
  async countGlobal(params) {
19221
- const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(_optionalChain([params, 'optionalAccess', _170 => _170.filter])), `${this.config.key}.count`);
19222
- if (_optionalChain([relation, 'optionalAccess', _171 => _171.never]) === true) return 0;
19223
- const conditions = relation !== void 0 ? relation.conditions : normalizedConditions(_optionalChain([params, 'optionalAccess', _172 => _172.filter]));
19296
+ const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(_optionalChain([params, 'optionalAccess', _173 => _173.filter])), `${this.config.key}.count`);
19297
+ if (_optionalChain([relation, 'optionalAccess', _174 => _174.never]) === true) return 0;
19298
+ const conditions = relation !== void 0 ? relation.conditions : normalizedConditions(_optionalChain([params, 'optionalAccess', _175 => _175.filter]));
19224
19299
  const body = {};
19225
19300
  body.filter = conditions === void 0 ? [] : buildFilter(conditions).filter;
19226
19301
  const res = await this.http.request({
@@ -19231,9 +19306,9 @@ var QueryBase = class {
19231
19306
  idempotent: true
19232
19307
  });
19233
19308
  const count = unwrapQueryCount(res, `${this.config.key}.count`);
19234
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _173 => _173[this.config.key], 'optionalAccess', _174 => _174.count]), _optionalChain([params, 'optionalAccess', _175 => _175.filter]));
19309
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _176 => _176[this.config.key], 'optionalAccess', _177 => _177.count]), _optionalChain([params, 'optionalAccess', _178 => _178.filter]));
19235
19310
  if (count === 0) {
19236
- const pinnedReason = conditions === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _176 => _176[this.config.key], 'optionalAccess', _177 => _177.count]) : void 0;
19311
+ const pinnedReason = conditions === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _179 => _179[this.config.key], 'optionalAccess', _180 => _180.count]) : void 0;
19237
19312
  if (stamp !== void 0 || pinnedReason !== void 0) {
19238
19313
  return {
19239
19314
  count,
@@ -19269,9 +19344,9 @@ var MetaBase = class extends QueryBase {
19269
19344
  const hit = cache.get(path);
19270
19345
  if (hit !== void 0) return hit;
19271
19346
  }
19272
- const epoch = _optionalChain([cache, 'optionalAccess', _178 => _178.epoch]);
19347
+ const epoch = _optionalChain([cache, 'optionalAccess', _181 => _181.epoch]);
19273
19348
  const res = await this.http.request({ method: "GET", path, operation });
19274
- _optionalChain([cache, 'optionalAccess', _179 => _179.set, 'call', _180 => _180(path, res, resource, epoch)]);
19349
+ _optionalChain([cache, 'optionalAccess', _182 => _182.set, 'call', _183 => _183(path, res, resource, epoch)]);
19275
19350
  return res;
19276
19351
  }
19277
19352
  /**
@@ -19311,7 +19386,7 @@ var MetaBase = class extends QueryBase {
19311
19386
  return value;
19312
19387
  });
19313
19388
  work.catch((err) => {
19314
- if (err instanceof AutotaskError && (err.code === "INVALID_RESPONSE" || _optionalChain([err, 'access', _181 => _181.details, 'optionalAccess', _182 => _182.deterministic]) === true)) {
19389
+ if (err instanceof AutotaskError && (err.code === "INVALID_RESPONSE" || _optionalChain([err, 'access', _184 => _184.details, 'optionalAccess', _185 => _185.deterministic]) === true)) {
19315
19390
  cache.invalidate(key);
19316
19391
  }
19317
19392
  });
@@ -19341,7 +19416,7 @@ var MetaBase = class extends QueryBase {
19341
19416
  path: `${this.resourcePath}/${numeric}`,
19342
19417
  operation: `${this.config.key}.get`,
19343
19418
  skipResponseRedaction: true,
19344
- maxRetries: _optionalChain([readOpts, 'optionalAccess', _183 => _183.maxRetries])
19419
+ maxRetries: _optionalChain([readOpts, 'optionalAccess', _186 => _186.maxRetries])
19345
19420
  });
19346
19421
  return unwrapItem(res, numeric, `${this.config.key}.get`, this.entityName);
19347
19422
  }
@@ -19360,7 +19435,7 @@ var MetaBase = class extends QueryBase {
19360
19435
  path: this.scopedItemPath(parentId, numeric),
19361
19436
  operation: `${this.config.key}.get`,
19362
19437
  skipResponseRedaction: true,
19363
- maxRetries: _optionalChain([readOpts, 'optionalAccess', _184 => _184.maxRetries])
19438
+ maxRetries: _optionalChain([readOpts, 'optionalAccess', _187 => _187.maxRetries])
19364
19439
  });
19365
19440
  return unwrapItem(res, numeric, `${this.config.key}.get`, this.entityName);
19366
19441
  }
@@ -19569,12 +19644,12 @@ var MetaBase = class extends QueryBase {
19569
19644
  return null;
19570
19645
  }
19571
19646
  }
19572
- const epoch = _optionalChain([cache, 'optionalAccess', _185 => _185.epoch]);
19647
+ const epoch = _optionalChain([cache, 'optionalAccess', _188 => _188.epoch]);
19573
19648
  try {
19574
19649
  return await this.fetchRecordRaw(entityPath, referenceId);
19575
19650
  } catch (err) {
19576
19651
  if (err instanceof NotFoundError) {
19577
- _optionalChain([cache, 'optionalAccess', _186 => _186.set, 'call', _187 => _187(absentKey, CONTEXT_ABSENT_MARKER, RESOURCE_KEY_BY_PATH[entityPath], epoch)]);
19652
+ _optionalChain([cache, 'optionalAccess', _189 => _189.set, 'call', _190 => _190(absentKey, CONTEXT_ABSENT_MARKER, RESOURCE_KEY_BY_PATH[entityPath], epoch)]);
19578
19653
  return null;
19579
19654
  }
19580
19655
  throw err;
@@ -19691,7 +19766,7 @@ var MetaBase = class extends QueryBase {
19691
19766
  missDetail(operator, fields) {
19692
19767
  const key = this.config.key;
19693
19768
  const probe = fields.map((field) => ({ field, op: operator, value: "" }));
19694
- const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _188 => _188[key], 'optionalAccess', _189 => _189.query]), probe);
19769
+ const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _191 => _191[key], 'optionalAccess', _192 => _192.query]), probe);
19695
19770
  const next = [];
19696
19771
  if (blind !== void 0) {
19697
19772
  next.push(`This surface is blind to records the API user does not own, so a miss is not proof of absence: ${blind.authority} returns the record when the id is known.`);
@@ -20320,7 +20395,7 @@ var MutationBase = class extends MetaBase {
20320
20395
  }
20321
20396
  }
20322
20397
  if (isRecord2(data)) {
20323
- const eff = effectiveRequiredFields(void 0, _nullishCoalesce(_optionalChain([RELATIONSHIP_MAP, 'access', _190 => _190[this.config.key], 'optionalAccess', _191 => _191.zoneFacts]), () => ( null)));
20398
+ const eff = effectiveRequiredFields(void 0, _nullishCoalesce(_optionalChain([RELATIONSHIP_MAP, 'access', _193 => _193[this.config.key], 'optionalAccess', _194 => _194.zoneFacts]), () => ( null)));
20324
20399
  const missing = eff.fields.filter((f) => f !== this.config.parentField && data[f] === void 0);
20325
20400
  if (missing.length > 0) {
20326
20401
  warnings.push(`required field(s) not in the data: ${missing.join(", ")} (${eff.from}); the vendor would likely reject the create`);
@@ -20360,7 +20435,7 @@ var MutationBase = class extends MetaBase {
20360
20435
  current = parentId === void 0 ? await this.getGlobal(id, true) : this.config.attachmentGet ? await this.getScopedModel(parentId, id, true) : await this.getScopedRaw(parentId, id, true);
20361
20436
  } catch (err) {
20362
20437
  if (err instanceof NotFoundError) {
20363
- const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _192 => _192[this.config.key], 'optionalAccess', _193 => _193.update]);
20438
+ const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _195 => _195[this.config.key], 'optionalAccess', _196 => _196.update]);
20364
20439
  checks.push({
20365
20440
  name: "current-record-exists",
20366
20441
  ok: false,
@@ -20455,6 +20530,7 @@ var BaseResource = class extends MutationBase {
20455
20530
 
20456
20531
  // src/operations/compositeNames.ts
20457
20532
  var PICKLIST_VALUE_NOT_SERVED_NOTE = "The picklist is served to this API user, but this record's value is not in it (an inactive or unexposed value) \u2014 the label cannot be resolved and is null; refreshing the field catalog will not surface it. (A picklist the vendor does not expose at all is reported with the field-catalog honesty note instead.)";
20533
+ var PICKLIST_CATALOG_UNAVAILABLE_NOTE = "The field-catalog read that serves picklist labels failed for this call, so this label is unavailable (null), not absent: the value may well have one. Retry the call once the catalog read succeeds (see names.catalogError).";
20458
20534
  var DEFAULT_MAX_NAME_READS = 20;
20459
20535
  var TICKET_LABEL_FIELDS = ["status", "priority", "ticketType", "issueType", "subIssueType", "source", "queueID"];
20460
20536
  function isVendorId(value) {
@@ -20720,7 +20796,7 @@ async function resolveCompositeNames(http, plan, opts = {}) {
20720
20796
  } else {
20721
20797
  for (const f of plan.labelFields) {
20722
20798
  const frow = row.fields.find((x) => x.name === f);
20723
- picklists[f] = _optionalChain([frow, 'optionalAccess', _194 => _194.picklistValues]);
20799
+ picklists[f] = _optionalChain([frow, 'optionalAccess', _197 => _197.picklistValues]);
20724
20800
  }
20725
20801
  }
20726
20802
  } catch (err) {
@@ -20754,8 +20830,8 @@ async function resolveCompositeNames(http, plan, opts = {}) {
20754
20830
  return {
20755
20831
  section,
20756
20832
  lineOfBusiness: lineOfBusiness2,
20757
- resourceName: (id) => _nullishCoalesce(_optionalChain([section, 'access', _195 => _195.rows, 'access', _196 => _196[`resource:${id}`], 'optionalAccess', _197 => _197.name]), () => ( null)),
20758
- recordName: (table, id) => _nullishCoalesce(_optionalChain([section, 'access', _198 => _198.rows, 'access', _199 => _199[`${table}:${id}`], 'optionalAccess', _200 => _200.name]), () => ( null)),
20833
+ resourceName: (id) => _nullishCoalesce(_optionalChain([section, 'access', _198 => _198.rows, 'access', _199 => _199[`resource:${id}`], 'optionalAccess', _200 => _200.name]), () => ( null)),
20834
+ recordName: (table, id) => _nullishCoalesce(_optionalChain([section, 'access', _201 => _201.rows, 'access', _202 => _202[`${table}:${id}`], 'optionalAccess', _203 => _203.name]), () => ( null)),
20759
20835
  labelFor: (field, value) => {
20760
20836
  if (value === null || value === void 0) return null;
20761
20837
  const values = picklists[field];
@@ -20765,7 +20841,7 @@ async function resolveCompositeNames(http, plan, opts = {}) {
20765
20841
  }
20766
20842
  const hit = values.find((v) => String(v.value) === String(value));
20767
20843
  if (hit === void 0) {
20768
- section.reasons[field] = PICKLIST_VALUE_NOT_SERVED_NOTE;
20844
+ if (String(value) !== "0") section.reasons[field] = PICKLIST_VALUE_NOT_SERVED_NOTE;
20769
20845
  return null;
20770
20846
  }
20771
20847
  return typeof hit.label === "string" ? hit.label : null;
@@ -20786,6 +20862,7 @@ function untrustedName(name) {
20786
20862
  const [[capped]] = truncateNoteChars([{ v: name }], LABEL_NAME_MAX_CHARS, ["v"]);
20787
20863
  return _nullishCoalesce(_chunkMJTKK3QGcjs.wrapUntrusted.call(void 0, capped.v), () => ( capped.v));
20788
20864
  }
20865
+ var lastPicklists = /* @__PURE__ */ new WeakMap();
20789
20866
  function readNamesOpt(value, where) {
20790
20867
  if (value === void 0) return true;
20791
20868
  if (typeof value !== "boolean") {
@@ -20794,19 +20871,35 @@ function readNamesOpt(value, where) {
20794
20871
  return value;
20795
20872
  }
20796
20873
  async function labelRows(client, resourceKey, rows) {
20797
- const present = /* @__PURE__ */ new Set();
20798
- for (const row of rows) for (const [k, v] of Object.entries(row)) if (v !== null && v !== void 0) present.add(k);
20799
- if (present.size === 0) return { rows: [...rows] };
20874
+ const keys = /* @__PURE__ */ new Set();
20875
+ for (const row of rows) for (const k of Object.keys(row)) keys.add(k);
20876
+ if (keys.size === 0) return { rows: [...rows] };
20800
20877
  let picklistFields = [];
20878
+ let unavailable = [];
20879
+ let catalogError;
20801
20880
  const modelFields = _nullishCoalesce(MODEL_FIELD_SETS[resourceKey], () => ( []));
20802
- const candidates = [...present].filter((f) => f !== "id" && modelFields.includes(f) && ROW_FK_TABLES[f] === void 0 && !isResourceFkField(f));
20881
+ const candidates = [...keys].filter((f) => f !== "id" && modelFields.includes(f) && ROW_FK_TABLES[f] === void 0 && !isResourceFkField(f));
20803
20882
  if (candidates.length > 0) try {
20804
20883
  const catalog = await fieldCatalog(client, { resources: [resourceKey], labels: true });
20805
- const fields = _nullishCoalesce(_optionalChain([catalog, 'access', _201 => _201.rows, 'access', _202 => _202.find, 'call', _203 => _203((r) => r.resource === resourceKey), 'optionalAccess', _204 => _204.fields]), () => ( []));
20806
- picklistFields = fields.filter((f) => f.isPickList && candidates.includes(f.name)).map((f) => f.name);
20884
+ const row = catalog.rows.find((r) => r.resource === resourceKey);
20885
+ const known = _nullishCoalesce(lastPicklists.get(client), () => ( /* @__PURE__ */ new Map()));
20886
+ lastPicklists.set(client, known);
20887
+ if (_optionalChain([row, 'optionalAccess', _204 => _204.fields]) === void 0) {
20888
+ const last = known.get(resourceKey);
20889
+ unavailable = (_nullishCoalesce(last, () => ( []))).filter((f) => candidates.includes(f));
20890
+ if (last === void 0 || unavailable.length > 0) {
20891
+ catalogError = _nullishCoalesce(_optionalChain([row, 'optionalAccess', _205 => _205.error]), () => ( { code: "INVALID_RESPONSE", message: `fieldCatalog: no ${resourceKey} row` }));
20892
+ }
20893
+ } else {
20894
+ const all = row.fields.filter((f) => f.isPickList).map((f) => f.name);
20895
+ known.set(resourceKey, all);
20896
+ picklistFields = all.filter((f) => candidates.includes(f));
20897
+ }
20807
20898
  } catch (err) {
20808
20899
  if (!isAutotaskError(err) || err.code === "ABORTED") throw err;
20809
20900
  }
20901
+ const labelled = (field) => picklistFields.includes(field) || unavailable.includes(field) || ROW_FK_TABLES[field] !== void 0 || isResourceFkField(field);
20902
+ if (catalogError === void 0 && ![...keys].some(labelled)) return { rows: [...rows] };
20810
20903
  const builder = createNamePlan(picklistFields, resourceKey);
20811
20904
  for (const row of rows) {
20812
20905
  for (const [field, value] of Object.entries(row)) {
@@ -20817,29 +20910,43 @@ async function labelRows(client, resourceKey, rows) {
20817
20910
  }
20818
20911
  }
20819
20912
  const plan = builder.plan();
20820
- if (plan.resourceIds.length === 0 && plan.recordFks.length === 0 && picklistFields.length === 0) return { rows: [...rows] };
20821
- const names = await resolveCompositeNames(client.http, plan);
20913
+ const names = plan.resourceIds.length === 0 && plan.recordFks.length === 0 && picklistFields.length === 0 ? void 0 : await resolveCompositeNames(client.http, plan);
20822
20914
  const out = rows.map((row) => {
20823
20915
  const r = { ...row };
20824
20916
  for (const [field, value] of Object.entries(row)) {
20825
- if (value === null || value === void 0 || value === 0 || value === "0") continue;
20826
- if (picklistFields.includes(field)) r[`${field}Label`] = names.labelFor(field, value);
20917
+ const has2 = value !== null && value !== void 0 && names !== void 0;
20918
+ if (picklistFields.includes(field)) r[`${field}Label`] = has2 ? names.labelFor(field, value) : null;
20919
+ else if (unavailable.includes(field)) r[`${field}Label`] = null;
20920
+ const set = has2 && value !== 0 && value !== "0";
20827
20921
  const table = ROW_FK_TABLES[field];
20828
- if (table !== void 0 && isVendorId(value)) r[`${field}Name`] = untrustedName(names.recordName(table, value));
20829
- else if (isResourceFkField(field) && isVendorId(value)) r[`${field}Name`] = untrustedName(names.resourceName(value));
20922
+ if (table !== void 0) r[`${field}Name`] = set && isVendorId(value) ? untrustedName(names.recordName(table, value)) : null;
20923
+ else if (isResourceFkField(field)) r[`${field}Name`] = set && isVendorId(value) ? untrustedName(names.resourceName(value)) : null;
20830
20924
  }
20831
20925
  if (r["assignedResourceIDName"] !== void 0) r["assignedResourceName"] = r["assignedResourceIDName"];
20832
20926
  return r;
20833
20927
  });
20834
- const capped = Object.values(names.section.rows).filter((row) => row.capped).length;
20835
- const reasons = names.section.reasons;
20836
- if (capped === 0 && Object.keys(reasons).length === 0) return { rows: out };
20928
+ const capped = names === void 0 ? 0 : Object.values(names.section.rows).filter((row) => row.capped).length;
20929
+ const unresolved = Object.keys(_nullishCoalesce(_optionalChain([names, 'optionalAccess', _206 => _206.section, 'access', _207 => _207.reasons]), () => ( {})));
20930
+ const reasons = { ..._optionalChain([names, 'optionalAccess', _208 => _208.section, 'access', _209 => _209.reasons]) };
20931
+ for (const f of unavailable) reasons[f] = PICKLIST_CATALOG_UNAVAILABLE_NOTE;
20932
+ if (capped === 0 && unresolved.length === 0 && catalogError === void 0) return { rows: out };
20837
20933
  const parts = [];
20838
20934
  if (capped > 0) parts.push(`${capped} id(s) left unlabelled (their *Name is null): the per-call cap of ${DEFAULT_MAX_NAME_READS} uncached name reads was hit \u2014 names already read are cached, so repeating or narrowing the call labels more`);
20839
- if (Object.keys(reasons).length > 0) parts.push(`picklist label(s) unavailable for ${Object.keys(reasons).join(", ")} (see reasons)`);
20935
+ if (unresolved.length > 0) parts.push(`picklist label(s) unavailable for ${unresolved.join(", ")} (see reasons)`);
20936
+ if (catalogError !== void 0) {
20937
+ parts.push(
20938
+ `the ${resourceKey} field catalog read failed (${catalogError.code}), so picklist labels are unavailable for this call, not absent: ` + (unavailable.length > 0 ? `the *Label is null for ${unavailable.join(", ")}` : "no *Label sibling was added (the picklist fields are unknown until a catalog read succeeds)") + " \u2014 retry the call to label them"
20939
+ );
20940
+ }
20840
20941
  return {
20841
20942
  rows: out,
20842
- names: { truncated: capped > 0, capped, note: parts.join("; "), ...Object.keys(reasons).length > 0 ? { reasons } : {} }
20943
+ names: {
20944
+ truncated: capped > 0,
20945
+ capped,
20946
+ note: parts.join("; "),
20947
+ ...Object.keys(reasons).length > 0 ? { reasons } : {},
20948
+ ...catalogError !== void 0 ? { catalogError } : {}
20949
+ }
20843
20950
  };
20844
20951
  }
20845
20952
  async function labelFetchResults(client, result) {
@@ -20858,11 +20965,13 @@ async function labelFetchResults(client, result) {
20858
20965
  }
20859
20966
  if (summaries.length === 0) return { ...result, results };
20860
20967
  const reasons = Object.assign({}, ...summaries.map((s) => _nullishCoalesce(s.reasons, () => ( {}))));
20968
+ const catalogError = _optionalChain([summaries, 'access', _210 => _210.find, 'call', _211 => _211((s) => s.catalogError !== void 0), 'optionalAccess', _212 => _212.catalogError]);
20861
20969
  const names = {
20862
20970
  truncated: summaries.some((s) => s.truncated),
20863
20971
  capped: summaries.reduce((n, s) => n + s.capped, 0),
20864
20972
  note: summaries.map((s) => s.note).join("; "),
20865
- ...Object.keys(reasons).length > 0 ? { reasons } : {}
20973
+ ...Object.keys(reasons).length > 0 ? { reasons } : {},
20974
+ ...catalogError !== void 0 ? { catalogError } : {}
20866
20975
  };
20867
20976
  return { ...result, results, names };
20868
20977
  }
@@ -20892,7 +21001,7 @@ var BillingCodesResource = class extends BaseResource {
20892
21001
  }
20893
21002
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
20894
21003
  async get(id, opts = {}) {
20895
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _205 => _205.fresh]) === true);
21004
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _213 => _213.fresh]) === true);
20896
21005
  }
20897
21006
  /** Resolve a BillingCode from a numeric id (or, where the vendor indexes a primary text field,
20898
21007
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -20907,7 +21016,7 @@ var BillingCodesResource = class extends BaseResource {
20907
21016
  /** Search BillingCode records: bounded contains on name (no vendor free-text search exists);
20908
21017
  * limit defaults to 25, max 500. */
20909
21018
  async search(query, opts) {
20910
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _206 => _206.limit]) });
21019
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _214 => _214.limit]) });
20911
21020
  }
20912
21021
  };
20913
21022
 
@@ -21211,28 +21320,28 @@ async function customRangeQuery(http, path, field, from, to, limit, operation, z
21211
21320
 
21212
21321
  // src/resources/special/billing_items.ts
21213
21322
  async function windowQuery(_resource, kind, http, opts) {
21214
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _207 => _207.now]), () => ( /* @__PURE__ */ new Date()));
21215
- const tz = _optionalChain([opts, 'optionalAccess', _208 => _208.tz]) === void 0 ? void 0 : validateZone(opts.tz, `billing_items.${kind}`);
21323
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _215 => _215.now]), () => ( /* @__PURE__ */ new Date()));
21324
+ const tz = _optionalChain([opts, 'optionalAccess', _216 => _216.tz]) === void 0 ? void 0 : validateZone(opts.tz, `billing_items.${kind}`);
21216
21325
  return dateWindowQuery(
21217
21326
  http,
21218
21327
  "/V1.0/BillingItems/query",
21219
21328
  "itemDate",
21220
21329
  kind,
21221
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _209 => _209.limit])),
21330
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _217 => _217.limit])),
21222
21331
  `billing_items.${kind}`,
21223
21332
  now,
21224
21333
  tz
21225
21334
  );
21226
21335
  }
21227
21336
  async function customRange(_resource, from, to, http, opts) {
21228
- const zone = _optionalChain([opts, 'optionalAccess', _210 => _210.tz]) === void 0 ? void 0 : validateZone(opts.tz, "billing_items.customRange");
21337
+ const zone = _optionalChain([opts, 'optionalAccess', _218 => _218.tz]) === void 0 ? void 0 : validateZone(opts.tz, "billing_items.customRange");
21229
21338
  return customRangeQuery(
21230
21339
  http,
21231
21340
  "/V1.0/BillingItems/query",
21232
21341
  "itemDate",
21233
21342
  from,
21234
21343
  to,
21235
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _211 => _211.limit])),
21344
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _219 => _219.limit])),
21236
21345
  "billing_items.customRange",
21237
21346
  zone
21238
21347
  );
@@ -21264,7 +21373,7 @@ var BillingItemsResource = class extends BaseResource {
21264
21373
  }
21265
21374
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
21266
21375
  async get(id, opts = {}) {
21267
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _212 => _212.fresh]) === true);
21376
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _220 => _220.fresh]) === true);
21268
21377
  }
21269
21378
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
21270
21379
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -21456,9 +21565,9 @@ async function searchByDomain(_resource, domain, opts = {}, http) {
21456
21565
  return fetchCompanies(http, ids2, limit);
21457
21566
  }
21458
21567
  async function searchByIdentity(_resource, identity, opts = {}, http) {
21459
- const name = _nullishCoalesce(_optionalChain([identity, 'access', _213 => _213.companyName, 'optionalAccess', _214 => _214.trim, 'call', _215 => _215()]), () => ( ""));
21460
- const email = _nullishCoalesce(_optionalChain([identity, 'access', _216 => _216.email, 'optionalAccess', _217 => _217.trim, 'call', _218 => _218()]), () => ( ""));
21461
- const website = _nullishCoalesce(_optionalChain([identity, 'access', _219 => _219.website, 'optionalAccess', _220 => _220.trim, 'call', _221 => _221()]), () => ( ""));
21568
+ const name = _nullishCoalesce(_optionalChain([identity, 'access', _221 => _221.companyName, 'optionalAccess', _222 => _222.trim, 'call', _223 => _223()]), () => ( ""));
21569
+ const email = _nullishCoalesce(_optionalChain([identity, 'access', _224 => _224.email, 'optionalAccess', _225 => _225.trim, 'call', _226 => _226()]), () => ( ""));
21570
+ const website = _nullishCoalesce(_optionalChain([identity, 'access', _227 => _227.website, 'optionalAccess', _228 => _228.trim, 'call', _229 => _229()]), () => ( ""));
21462
21571
  if (name === "" && email === "" && website === "") {
21463
21572
  throw new AutotaskConfigError("searchByIdentity: at least one of companyName / email / website is required");
21464
21573
  }
@@ -21597,7 +21706,7 @@ function validateUpsertInput(companyName, params) {
21597
21706
  if (typeof companyName !== "string" || companyName.trim() === "") {
21598
21707
  throw new AutotaskConfigError("upsertByName: companyName is required (a non-empty string)", { operation: OP_UPSERT_NAME });
21599
21708
  }
21600
- if (typeof _optionalChain([params, 'optionalAccess', _222 => _222.phone]) !== "string" || params.phone.trim() === "") {
21709
+ if (typeof _optionalChain([params, 'optionalAccess', _230 => _230.phone]) !== "string" || params.phone.trim() === "") {
21601
21710
  throw new 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 });
21602
21711
  }
21603
21712
  const companyType = _nullishCoalesce(params.companyType, () => ( DEFAULT_COMPANY_TYPE));
@@ -21822,7 +21931,7 @@ function readIncludeNames(record, includeFields) {
21822
21931
  function resolveAuthority(record, live) {
21823
21932
  if (live !== null) return { known: live, authority: "the tenant's live entity field metadata" };
21824
21933
  const vendored = MODEL_FIELD_SETS[record.resource];
21825
- const liveOnlyExempt = Array.isArray(_optionalChain([record, 'access', _223 => _223.metadata, 'optionalAccess', _224 => _224.liveOnlyFields])) ? record.metadata.liveOnlyFields : [];
21934
+ const liveOnlyExempt = Array.isArray(_optionalChain([record, 'access', _231 => _231.metadata, 'optionalAccess', _232 => _232.liveOnlyFields])) ? record.metadata.liveOnlyFields : [];
21826
21935
  if (vendored === void 0) return void 0;
21827
21936
  return {
21828
21937
  known: [...vendored, ...liveOnlyExempt],
@@ -21878,11 +21987,11 @@ var CLOSED_STATUS_LABELS = ["complete", "completed", "closed", "cancelled", "can
21878
21987
  var OP = "tickets.statusSemantics";
21879
21988
  function picklistOf(fields) {
21880
21989
  if (!Array.isArray(fields)) return [];
21881
- const status = fields.find((f) => typeof _optionalChain([f, 'optionalAccess', _225 => _225.name]) === "string" && f.name.toLowerCase() === "status");
21990
+ const status = fields.find((f) => typeof _optionalChain([f, 'optionalAccess', _233 => _233.name]) === "string" && f.name.toLowerCase() === "status");
21882
21991
  if (status === void 0 || status.isPickList !== true || !Array.isArray(status.picklistValues)) return [];
21883
21992
  const out = [];
21884
21993
  for (const v of status.picklistValues) {
21885
- const id = Number(_optionalChain([v, 'optionalAccess', _226 => _226.value]));
21994
+ const id = Number(_optionalChain([v, 'optionalAccess', _234 => _234.value]));
21886
21995
  if (!Number.isSafeInteger(id)) continue;
21887
21996
  out.push({ id, label: typeof v.label === "string" ? v.label : "" });
21888
21997
  }
@@ -21898,11 +22007,11 @@ async function readFields(http, fresh) {
21898
22007
  if (hit !== void 0) return hit;
21899
22008
  }
21900
22009
  const res = await http.request({ method: "GET", path: "/V1.0/Tickets/entityInformation/fields", operation: OP, maxRetries: 0 });
21901
- const fields = _optionalChain([res, 'optionalAccess', _227 => _227.fields]);
22010
+ const fields = _optionalChain([res, 'optionalAccess', _235 => _235.fields]);
21902
22011
  if (!Array.isArray(fields)) {
21903
22012
  throw new AutotaskError("Expected the FieldInformationResultModel envelope { fields: [] }; got a different shape", { code: "INVALID_RESPONSE", category: "server" });
21904
22013
  }
21905
- _optionalChain([cache, 'optionalAccess', _228 => _228.set, 'call', _229 => _229(key, "fields", fields)]);
22014
+ _optionalChain([cache, 'optionalAccess', _236 => _236.set, 'call', _237 => _237(key, "fields", fields)]);
21906
22015
  return fields;
21907
22016
  }
21908
22017
  function assumed(allowAssumed, operation) {
@@ -22054,7 +22163,7 @@ async function readOpenTickets(http, companyID, ticketLimit, includeFields, stat
22054
22163
  closedStatus
22055
22164
  };
22056
22165
  if (openRows.length === 0) {
22057
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _230 => _230["tickets"], 'optionalAccess', _231 => _231.query]), [{ field: "companyID", op: "eq", value: companyID }, openLeaf]);
22166
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _238 => _238["tickets"], 'optionalAccess', _239 => _239.query]), [{ field: "companyID", op: "eq", value: companyID }, openLeaf]);
22058
22167
  if (stamp !== void 0) {
22059
22168
  openTickets = {
22060
22169
  items: openRows,
@@ -22224,7 +22333,7 @@ async function prepareCrmWrite(resource, input, http) {
22224
22333
  const rows = await readRows(http, "/V1.0/CompanyLocations/query", [{ field: "companyID", op: "eq", value: companyID }]);
22225
22334
  const items = rows.map((r) => ({ id: r.id, name: str(r.name), isPrimary: bool(r.isPrimary), isActive: bool(r.isActive), city: str(r.city), state: str(r.state), postalCode: str(r.postalCode) }));
22226
22335
  const active = items.filter((l) => l.isActive !== false);
22227
- const m = active.filter((l) => has(ct.city) && _optionalChain([l, 'access', _232 => _232.city, 'optionalAccess', _233 => _233.toLowerCase, 'call', _234 => _234()]) === String(ct.city).toLowerCase() || has(ct.postalCode) && l.postalCode === String(ct.postalCode));
22336
+ const m = active.filter((l) => has(ct.city) && _optionalChain([l, 'access', _240 => _240.city, 'optionalAccess', _241 => _241.toLowerCase, 'call', _242 => _242()]) === String(ct.city).toLowerCase() || has(ct.postalCode) && l.postalCode === String(ct.postalCode));
22228
22337
  const pick = has(ct.companyLocationID) ? { rule: "matched", locationID: ct.companyLocationID } : active.length === 1 ? { rule: "single", locationID: active[0].id } : active.length > 1 && m.length === 1 ? { rule: "matched", locationID: m[0].id } : active.length > 1 ? { rule: "ask", locationID: null } : { rule: "none", locationID: null };
22229
22338
  locations = { items, pick };
22230
22339
  if (input.intent === "add_contact" && pick.locationID === null) {
@@ -22259,7 +22368,7 @@ async function prepareCrmWrite(resource, input, http) {
22259
22368
  }
22260
22369
  }
22261
22370
  if (input.intent === "create_company" && status !== "matched") {
22262
- const eff = effectiveRequiredFields(null, _optionalChain([RELATIONSHIP_MAP, 'access', _235 => _235.companies, 'optionalAccess', _236 => _236.zoneFacts]));
22371
+ const eff = effectiveRequiredFields(null, _optionalChain([RELATIONSHIP_MAP, 'access', _243 => _243.companies, 'optionalAccess', _244 => _244.zoneFacts]));
22263
22372
  const research = (f) => ["companyType", "ownerResourceID", "countryID"].includes(f) ? "lookup" : "web_if_available_else_ask";
22264
22373
  const lookups = {
22265
22374
  companyType: { via: "operations.fieldCatalog", resource: "companies", field: "companyType", labels: true, note: "map the user wording to one returned label; never hardcode ids" },
@@ -22281,16 +22390,16 @@ async function prepareCrmWrite(resource, input, http) {
22281
22390
  }
22282
22391
  let next = null;
22283
22392
  const isInactive = (d) => d.isActive === false || d.isActive === 0;
22284
- const dups = _nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _237 => _237.duplicates]), () => ( []));
22393
+ const dups = _nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _245 => _245.duplicates]), () => ( []));
22285
22394
  const sameCompany = companyID === null ? dups : dups.filter((d) => d.companyID === companyID);
22286
22395
  const elsewhere = companyID === null ? [] : dups.filter((d) => d.companyID !== companyID && !isInactive(d));
22287
22396
  if (input.intent === "add_contact" && sameCompany.length === 0 && elsewhere.length > 0) {
22288
- needsInput.push({ field: "contact", why: `a contact with this ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _238 => _238.matchedBy]), () => ( "identity"))} is active at another company: update it, move it with contacts.moveToCompany, or confirm a second record`, source: "policy", lookup: { duplicates: elsewhere }, research: "ask" });
22397
+ needsInput.push({ field: "contact", why: `a contact with this ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _246 => _246.matchedBy]), () => ( "identity"))} is active at another company: update it, move it with contacts.moveToCompany, or confirm a second record`, source: "policy", lookup: { duplicates: elsewhere }, research: "ask" });
22289
22398
  }
22290
22399
  if (needsInput.length === 0) {
22291
22400
  const dup = sameCompany[0];
22292
22401
  if (input.intent === "create_company") next = status === "matched" ? { operation: "companies.update", note: "the company already exists: update it instead of creating" } : { operation: "companies.create", note: 'then re-run with intent add_contact: the vendor auto-creates a "Primary Address" location (rename it with company_locations.update; locations cannot be deleted via the API)' };
22293
- else if (input.intent === "add_contact") next = dup ? { operation: "contacts.update", note: `a contact already matches by ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _239 => _239.matchedBy]), () => ( "id"))} (id ${String(dup.id)}): update it, or move it with contacts.moveToCompany if it belongs to another company` } : { operation: "contacts.create", note: `set companyID ${String(companyID)} and companyLocationID ${String(_optionalChain([locations, 'optionalAccess', _240 => _240.pick, 'access', _241 => _241.locationID]))}` };
22402
+ else if (input.intent === "add_contact") next = dup ? { operation: "contacts.update", note: `a contact already matches by ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _247 => _247.matchedBy]), () => ( "id"))} (id ${String(dup.id)}): update it, or move it with contacts.moveToCompany if it belongs to another company` } : { operation: "contacts.create", note: `set companyID ${String(companyID)} and companyLocationID ${String(_optionalChain([locations, 'optionalAccess', _248 => _248.pick, 'access', _249 => _249.locationID]))}` };
22294
22403
  else if (input.intent === "update_contact") next = { operation: "contacts.update", note: "send only the changed fields" };
22295
22404
  else next = { operation: "companies.update", note: "send only the changed fields" };
22296
22405
  }
@@ -22410,7 +22519,7 @@ function validateUnbilledWorkOptions(companyId, opts) {
22410
22519
  var OP3 = "companies.unbilledWork";
22411
22520
  function unbilledWorkPartStatus(key, conditions, items) {
22412
22521
  if (items.length !== 0) return { status: "ok" };
22413
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _242 => _242[key], 'optionalAccess', _243 => _243.query]), conditions);
22522
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _250 => _250[key], 'optionalAccess', _251 => _251.query]), conditions);
22414
22523
  if (stamp !== void 0) return { status: "blind", blindSurface: stamp, note: stamp.note };
22415
22524
  return {
22416
22525
  status: "ok",
@@ -22660,7 +22769,7 @@ var CompaniesResource = class extends BaseResource {
22660
22769
  }
22661
22770
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
22662
22771
  async get(id, opts = {}) {
22663
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _244 => _244.fresh]) === true);
22772
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _252 => _252.fresh]) === true);
22664
22773
  }
22665
22774
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
22666
22775
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -22817,8 +22926,8 @@ function validateFetchManyItems(items, cap, opName = "fetchMany", capRef = `FETC
22817
22926
  problems.push(`${at}.fields: must be an array of exact vendor field names (discover them via operations.fieldCatalog)`);
22818
22927
  continue;
22819
22928
  }
22820
- if (_optionalChain([validation, 'optionalAccess', _245 => _245.fieldCheck]) !== false) {
22821
- const authoritative = _nullishCoalesce(_optionalChain([validation, 'optionalAccess', _246 => _246.fieldSetsByResource, 'optionalAccess', _247 => _247.get, 'call', _248 => _248(resourceKey)]), () => ( fields));
22929
+ if (_optionalChain([validation, 'optionalAccess', _253 => _253.fieldCheck]) !== false) {
22930
+ const authoritative = _nullishCoalesce(_optionalChain([validation, 'optionalAccess', _254 => _254.fieldSetsByResource, 'optionalAccess', _255 => _255.get, 'call', _256 => _256(resourceKey)]), () => ( fields));
22822
22931
  for (const f of item.fields) {
22823
22932
  if (!authoritative.includes(f)) {
22824
22933
  problems.push(
@@ -22924,7 +23033,7 @@ function project3(value, fields) {
22924
23033
  return out;
22925
23034
  }
22926
23035
  function resourcePathOf(key, holder) {
22927
- const path = _optionalChain([holder, 'optionalAccess', _249 => _249.resourcePath]);
23036
+ const path = _optionalChain([holder, 'optionalAccess', _257 => _257.resourcePath]);
22928
23037
  if (typeof path !== "string" || path === "") {
22929
23038
  throw new AutotaskConfigError(`fetchByIds: the client exposes no ${key} resource path (registry drift)`, {
22930
23039
  suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
@@ -23537,7 +23646,7 @@ var stampPart = (key, raw, conditions, extraNotes) => {
23537
23646
  status: st.status,
23538
23647
  blindSurface: st.blindSurface,
23539
23648
  note: [st.note, ..._nullishCoalesce(extraNotes, () => ( []))].filter(Boolean).join(" | ") || void 0,
23540
- emptyReason: raw.items.length === 0 && st.status === "ok" ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _250 => _250[key], 'optionalAccess', _251 => _251.query]) : void 0
23649
+ emptyReason: raw.items.length === 0 && st.status === "ok" ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _258 => _258[key], 'optionalAccess', _259 => _259.query]) : void 0
23541
23650
  };
23542
23651
  };
23543
23652
  function appendWiresNote(wires, note) {
@@ -23602,7 +23711,7 @@ async function resolveContractType(ctx, contractType) {
23602
23711
  if (contractType > 0) {
23603
23712
  ctx.wires.issued += 1;
23604
23713
  try {
23605
- contractTypeLabel = await _asyncNullishCoalesce(await _asyncOptionalChain([(await readPicklists(ctx.http, "/V1.0/Contracts", ctx.OP)), 'access', async _252 => _252.get, 'call', async _253 => _253("contractType"), 'optionalAccess', async _254 => _254.get, 'call', async _255 => _255(contractType)]), async () => ( null));
23714
+ contractTypeLabel = await _asyncNullishCoalesce(await _asyncOptionalChain([(await readPicklists(ctx.http, "/V1.0/Contracts", ctx.OP)), 'access', async _260 => _260.get, 'call', async _261 => _261("contractType"), 'optionalAccess', async _262 => _262.get, 'call', async _263 => _263(contractType)]), async () => ( null));
23606
23715
  } catch (err) {
23607
23716
  if (!(err instanceof AutotaskError)) throw err;
23608
23717
  }
@@ -23613,7 +23722,7 @@ async function resolveContractType(ctx, contractType) {
23613
23722
  return { contractTypeLabel, contractTypeKnown, isBlockHours, isTimeAndMaterials };
23614
23723
  }
23615
23724
  async function fetchRoot(ctx, resource) {
23616
- const contractCached = _optionalChain([ctx, 'access', _256 => _256.rawHttp, 'access', _257 => _257.readCache, 'optionalAccess', _258 => _258.get, 'call', _259 => _259(`/V1.0/Contracts/${ctx.id}`)]) !== void 0;
23725
+ const contractCached = _optionalChain([ctx, 'access', _264 => _264.rawHttp, 'access', _265 => _265.readCache, 'optionalAccess', _266 => _266.get, 'call', _267 => _267(`/V1.0/Contracts/${ctx.id}`)]) !== void 0;
23617
23726
  const contract = await resource.get(ctx.id);
23618
23727
  ctx.wires.issued += 1;
23619
23728
  if (!contractCached) ctx.wires.requests += 1;
@@ -23828,10 +23937,10 @@ async function fetchSubscriptions(ctx, cis) {
23828
23937
  const labels = await readSubscriptionLabels(ctx, subscriptions);
23829
23938
  for (const x of subscriptions) {
23830
23939
  const sid = num(x["id"]);
23831
- const periodLabel = _optionalChain([labels, 'optionalAccess', _260 => _260.get, 'call', _261 => _261("periodType"), 'optionalAccess', _262 => _262.get, 'call', _263 => _263(num(x["periodType"]))]);
23940
+ const periodLabel = _optionalChain([labels, 'optionalAccess', _268 => _268.get, 'call', _269 => _269("periodType"), 'optionalAccess', _270 => _270.get, 'call', _271 => _271(num(x["periodType"]))]);
23832
23941
  subFactor.set(sid, periodMonthlyFactor(x["periodType"], periodLabel));
23833
23942
  if (isOneTimePeriod(x["periodType"], periodLabel)) oneTimeSubs.add(sid);
23834
- const statusLabel = _optionalChain([labels, 'optionalAccess', _264 => _264.get, 'call', _265 => _265("status"), 'optionalAccess', _266 => _266.get, 'call', _267 => _267(num(x["status"]))]);
23943
+ const statusLabel = _optionalChain([labels, 'optionalAccess', _272 => _272.get, 'call', _273 => _273("status"), 'optionalAccess', _274 => _274.get, 'call', _275 => _275(num(x["status"]))]);
23835
23944
  const notActive = statusLabel !== void 0 ? NOT_ACTIVE_LABEL_RE.test(statusLabel) : labels === null && SUBSCRIPTION_NOT_ACTIVE_STATUS_IDS.has(num(x["status"]));
23836
23945
  if (notActive) cancelledSubs.add(sid);
23837
23946
  }
@@ -24532,7 +24641,7 @@ var ContractsResource = class extends BaseResource {
24532
24641
  }
24533
24642
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24534
24643
  async get(id, opts = {}) {
24535
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _268 => _268.fresh]) === true);
24644
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _276 => _276.fresh]) === true);
24536
24645
  }
24537
24646
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24538
24647
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24568,7 +24677,7 @@ var ContractsResource = class extends BaseResource {
24568
24677
  /** Search Contract records: bounded contains on contractName (no vendor free-text search exists);
24569
24678
  * limit defaults to 25, max 500. */
24570
24679
  async search(query, opts) {
24571
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _269 => _269.limit]) });
24680
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _277 => _277.limit]) });
24572
24681
  }
24573
24682
  /** Node-parity special op (hand-written in src/resources/special/contracts.ts). */
24574
24683
  profitability(id, opts) {
@@ -24608,28 +24717,28 @@ async function pdf(_resource, id, http) {
24608
24717
  return decodeFileData(res);
24609
24718
  }
24610
24719
  async function windowQuery2(_resource, kind, http, opts) {
24611
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _270 => _270.now]), () => ( /* @__PURE__ */ new Date()));
24612
- const tz = _optionalChain([opts, 'optionalAccess', _271 => _271.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
24720
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _278 => _278.now]), () => ( /* @__PURE__ */ new Date()));
24721
+ const tz = _optionalChain([opts, 'optionalAccess', _279 => _279.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
24613
24722
  return dateWindowQuery(
24614
24723
  http,
24615
24724
  "/V1.0/Invoices/query",
24616
24725
  "invoiceDateTime",
24617
24726
  kind,
24618
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _272 => _272.limit])),
24727
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _280 => _280.limit])),
24619
24728
  `invoices.${kind}`,
24620
24729
  now,
24621
24730
  tz
24622
24731
  );
24623
24732
  }
24624
24733
  async function customRange2(_resource, from, to, http, opts) {
24625
- const zone = _optionalChain([opts, 'optionalAccess', _273 => _273.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
24734
+ const zone = _optionalChain([opts, 'optionalAccess', _281 => _281.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
24626
24735
  return customRangeQuery(
24627
24736
  http,
24628
24737
  "/V1.0/Invoices/query",
24629
24738
  "invoiceDateTime",
24630
24739
  from,
24631
24740
  to,
24632
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _274 => _274.limit])),
24741
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _282 => _282.limit])),
24633
24742
  "invoices.customRange",
24634
24743
  zone
24635
24744
  );
@@ -24661,7 +24770,7 @@ var InvoicesResource = class extends BaseResource {
24661
24770
  }
24662
24771
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24663
24772
  async get(id, opts = {}) {
24664
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _275 => _275.fresh]) === true);
24773
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _283 => _283.fresh]) === true);
24665
24774
  }
24666
24775
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
24667
24776
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -24775,7 +24884,7 @@ var OrganizationalLevel1sResource = class extends BaseResource {
24775
24884
  }
24776
24885
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24777
24886
  async get(id, opts = {}) {
24778
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _276 => _276.fresh]) === true);
24887
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _284 => _284.fresh]) === true);
24779
24888
  }
24780
24889
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24781
24890
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24826,7 +24935,7 @@ var OrganizationalLevel2sResource = class extends BaseResource {
24826
24935
  }
24827
24936
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24828
24937
  async get(id, opts = {}) {
24829
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _277 => _277.fresh]) === true);
24938
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _285 => _285.fresh]) === true);
24830
24939
  }
24831
24940
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24832
24941
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24877,7 +24986,7 @@ var OrganizationalLevelAssociationsResource = class extends BaseResource {
24877
24986
  }
24878
24987
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24879
24988
  async get(id, opts = {}) {
24880
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _278 => _278.fresh]) === true);
24989
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _286 => _286.fresh]) === true);
24881
24990
  }
24882
24991
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24883
24992
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24949,7 +25058,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24949
25058
  if (typeof destination === "number" && destination < 1) {
24950
25059
  throw new AutotaskConfigError("transferOwnership: destinationResourceId must be a positive integer");
24951
25060
  }
24952
- const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _279 => _279.dryRun]), () => ( true));
25061
+ const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _287 => _287.dryRun]), () => ( true));
24953
25062
  const changes = [];
24954
25063
  const applied = [];
24955
25064
  for (const id of ids2) {
@@ -24958,7 +25067,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24958
25067
  method: "GET",
24959
25068
  path: `/V1.0/Companies/${id}`,
24960
25069
  operation: "resources.transferOwnership",
24961
- maxRetries: _optionalChain([opts, 'optionalAccess', _280 => _280.maxRetries])
25070
+ maxRetries: _optionalChain([opts, 'optionalAccess', _288 => _288.maxRetries])
24962
25071
  });
24963
25072
  const company = unwrapItem(res, id, void 0, "company");
24964
25073
  const current = typeof company.ownerResourceID === "number" ? company.ownerResourceID : null;
@@ -24969,7 +25078,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24969
25078
  path: "/V1.0/Companies",
24970
25079
  body: { id, ownerResourceID: destination },
24971
25080
  operation: "resources.transferOwnership",
24972
- maxRetries: _optionalChain([opts, 'optionalAccess', _281 => _281.maxRetries])
25081
+ maxRetries: _optionalChain([opts, 'optionalAccess', _289 => _289.maxRetries])
24973
25082
  });
24974
25083
  unwrapOperation(update);
24975
25084
  applied.push(id);
@@ -25038,7 +25147,7 @@ var ResourcesResource = class extends BaseResource {
25038
25147
  }
25039
25148
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
25040
25149
  async get(id, opts = {}) {
25041
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _282 => _282.fresh]) === true);
25150
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _290 => _290.fresh]) === true);
25042
25151
  }
25043
25152
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
25044
25153
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -25066,7 +25175,7 @@ var ResourcesResource = class extends BaseResource {
25066
25175
  /** Search Resource records: bounded contains on firstName + lastName (no vendor free-text search exists);
25067
25176
  * limit defaults to 25, max 500. */
25068
25177
  async search(query, opts) {
25069
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _283 => _283.limit]) });
25178
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _291 => _291.limit]) });
25070
25179
  }
25071
25180
  /** Node-parity special op (hand-written in src/resources/special/resources.ts). */
25072
25181
  transferOwnership(sourceResourceIds, destinationResourceId, opts = {}) {
@@ -25101,7 +25210,7 @@ function uiHostFromBase(baseUrl) {
25101
25210
  } catch (e20) {
25102
25211
  return void 0;
25103
25212
  }
25104
- const n = _optionalChain([REST_HOST, 'access', _284 => _284.exec, 'call', _285 => _285(hostname), 'optionalAccess', _286 => _286[1]]);
25213
+ const n = _optionalChain([REST_HOST, 'access', _292 => _292.exec, 'call', _293 => _293(hostname), 'optionalAccess', _294 => _294[1]]);
25105
25214
  return n === void 0 ? void 0 : `ww${n}.autotask.net`;
25106
25215
  }
25107
25216
  function buildUiLink(input) {
@@ -25154,7 +25263,7 @@ async function postedStateOf(http, entries, op, beforeRequest) {
25154
25263
  let incomplete = false;
25155
25264
  for (let c = 0; c < ids2.length; c += FETCH_BY_IDS_CHUNK_SIZE) {
25156
25265
  const chunk = ids2.slice(c, c + FETCH_BY_IDS_CHUNK_SIZE);
25157
- _optionalChain([beforeRequest, 'optionalCall', _287 => _287()]);
25266
+ _optionalChain([beforeRequest, 'optionalCall', _295 => _295()]);
25158
25267
  const res = await http.request({
25159
25268
  method: "POST",
25160
25269
  idempotent: true,
@@ -25201,11 +25310,11 @@ async function queryTimeEntries(_resource, filter, limit, operation, http, curso
25201
25310
  return { items, hasMore: pageDetails.nextPageUrl != null, nextCursor: _nullishCoalesce(pageDetails.nextPageUrl, () => ( null)) };
25202
25311
  }
25203
25312
  function pagingOpts(opts, OP9) {
25204
- if (_optionalChain([opts, 'optionalAccess', _288 => _288.countOnly]) !== void 0 && typeof opts.countOnly !== "boolean") {
25313
+ if (_optionalChain([opts, 'optionalAccess', _296 => _296.countOnly]) !== void 0 && typeof opts.countOnly !== "boolean") {
25205
25314
  throw new AutotaskConfigError(`${OP9}: countOnly must be a boolean`, { operation: OP9 });
25206
25315
  }
25207
- const countOnly = _optionalChain([opts, 'optionalAccess', _289 => _289.countOnly]) === true;
25208
- const cursor = _optionalChain([opts, 'optionalAccess', _290 => _290.cursor]);
25316
+ const countOnly = _optionalChain([opts, 'optionalAccess', _297 => _297.countOnly]) === true;
25317
+ const cursor = _optionalChain([opts, 'optionalAccess', _298 => _298.cursor]);
25209
25318
  if (cursor !== void 0 && (typeof cursor !== "string" || cursor.trim() === "")) {
25210
25319
  throw new AutotaskConfigError(`${OP9}: cursor must be the non-empty nextCursor of a previous call`, { operation: OP9 });
25211
25320
  }
@@ -25215,9 +25324,9 @@ function pagingOpts(opts, OP9) {
25215
25324
  if (cursor !== void 0 && countOnly) {
25216
25325
  throw new AutotaskConfigError(`${OP9}: cursor does not apply with countOnly (countOnly reads every page itself)`, { operation: OP9 });
25217
25326
  }
25218
- const budget = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _291 => _291.maxVendorCalls]), () => ( COUNT_BUDGET_DEFAULT));
25327
+ const budget = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _299 => _299.maxVendorCalls]), () => ( COUNT_BUDGET_DEFAULT));
25219
25328
  if (!Number.isInteger(budget) || budget < 1 || budget > COUNT_BUDGET_MAX) {
25220
- throw new AutotaskConfigError(`${OP9}: maxVendorCalls must be an integer 1-${COUNT_BUDGET_MAX} (got ${String(_optionalChain([opts, 'optionalAccess', _292 => _292.maxVendorCalls]))})`, { operation: OP9 });
25329
+ throw new AutotaskConfigError(`${OP9}: maxVendorCalls must be an integer 1-${COUNT_BUDGET_MAX} (got ${String(_optionalChain([opts, 'optionalAccess', _300 => _300.maxVendorCalls]))})`, { operation: OP9 });
25221
25330
  }
25222
25331
  return { ...cursor === void 0 ? {} : { cursor }, countOnly, budget };
25223
25332
  }
@@ -25288,18 +25397,18 @@ async function countPostedState(http, filter, OP9, budget, window) {
25288
25397
  return { window, total: states.size, postedCount, unpostedCount: states.size - postedCount, vendorCalls: issued, estimate, budget };
25289
25398
  }
25290
25399
  async function windowQuery3(_resource, kind, http, opts) {
25291
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _293 => _293.now]), () => ( /* @__PURE__ */ new Date()));
25292
- const tz = _optionalChain([opts, 'optionalAccess', _294 => _294.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
25400
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _301 => _301.now]), () => ( /* @__PURE__ */ new Date()));
25401
+ const tz = _optionalChain([opts, 'optionalAccess', _302 => _302.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
25293
25402
  const { from, to } = dateOnlyWindowBounds(kind, now, tz);
25294
25403
  const filter = [
25295
25404
  { field: "dateWorked", op: "gte", value: from },
25296
25405
  { field: "dateWorked", op: "lte", value: to }
25297
25406
  ];
25298
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _295 => _295.limit])), `time_entries.${kind}`, http);
25407
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _303 => _303.limit])), `time_entries.${kind}`, http);
25299
25408
  return items;
25300
25409
  }
25301
25410
  async function customRange3(_resource, from, to, http, opts) {
25302
- if (_optionalChain([opts, 'optionalAccess', _296 => _296.tz]) !== void 0) validateZone(opts.tz, "time_entries.customRange");
25411
+ if (_optionalChain([opts, 'optionalAccess', _304 => _304.tz]) !== void 0) validateZone(opts.tz, "time_entries.customRange");
25303
25412
  const fromB = customRangeDay(from, "from", void 0, "customRange");
25304
25413
  const toB = customRangeDay(to, "to", void 0, "customRange");
25305
25414
  if (fromB.ms > toB.ms) {
@@ -25310,7 +25419,7 @@ async function customRange3(_resource, from, to, http, opts) {
25310
25419
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
25311
25420
  { field: "dateWorked", op: "lte", value: iso2(toEndMs) }
25312
25421
  ];
25313
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _297 => _297.limit])), "time_entries.customRange", http);
25422
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _305 => _305.limit])), "time_entries.customRange", http);
25314
25423
  return items;
25315
25424
  }
25316
25425
  async function postedStateQuery(_resource, mode, http, opts) {
@@ -25318,16 +25427,16 @@ async function postedStateQuery(_resource, mode, http, opts) {
25318
25427
  const paging = pagingOpts(opts, operation);
25319
25428
  const window = { from: null, to: null };
25320
25429
  const filter = [];
25321
- const fromB = _optionalChain([opts, 'optionalAccess', _298 => _298.dateFrom]) === void 0 ? void 0 : customRangeDay(opts.dateFrom, "from", void 0, operation);
25322
- const toB = _optionalChain([opts, 'optionalAccess', _299 => _299.dateTo]) === void 0 ? void 0 : customRangeDay(opts.dateTo, "to", void 0, operation);
25430
+ const fromB = _optionalChain([opts, 'optionalAccess', _306 => _306.dateFrom]) === void 0 ? void 0 : customRangeDay(opts.dateFrom, "from", void 0, operation);
25431
+ const toB = _optionalChain([opts, 'optionalAccess', _307 => _307.dateTo]) === void 0 ? void 0 : customRangeDay(opts.dateTo, "to", void 0, operation);
25323
25432
  if (fromB && toB && fromB.ms > toB.ms) {
25324
25433
  throw new AutotaskConfigError(`${operation}: dateFrom (${iso2(fromB.ms)}) must not be after dateTo (${iso2(toB.ms)})`, { operation });
25325
25434
  }
25326
25435
  if (fromB) filter.push({ field: "dateWorked", op: "gte", value: window.from = iso2(fromB.ms) });
25327
25436
  if (toB) filter.push({ field: "dateWorked", op: "lte", value: window.to = iso2(toB.ms + DAY_MS2 - 1) });
25328
- if (_optionalChain([opts, 'optionalAccess', _300 => _300.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25437
+ if (_optionalChain([opts, 'optionalAccess', _308 => _308.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25329
25438
  if (paging.countOnly) return countPostedState(http, filter, operation, paging.budget, window);
25330
- const read = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _301 => _301.limit])), operation, http, paging.cursor);
25439
+ const read = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _309 => _309.limit])), operation, http, paging.cursor);
25331
25440
  const { states, incomplete } = await postedStateOf(http, read.items, operation);
25332
25441
  const items = read.items.filter((e) => states.get(e.id) === mode);
25333
25442
  const approvedCount = items.filter(isApproved).length;
@@ -25337,7 +25446,7 @@ async function postedStateQuery(_resource, mode, http, opts) {
25337
25446
  async function postedWithin(_resource, from, to, http, opts, opLabel = "time_entries.postedWithin") {
25338
25447
  const OP9 = opLabel;
25339
25448
  const paging = pagingOpts(opts, OP9);
25340
- if (_optionalChain([opts, 'optionalAccess', _302 => _302.tz]) !== void 0) validateZone(opts.tz, OP9);
25449
+ if (_optionalChain([opts, 'optionalAccess', _310 => _310.tz]) !== void 0) validateZone(opts.tz, OP9);
25341
25450
  const fromB = customRangeDay(from, "from", void 0, OP9);
25342
25451
  const toB = customRangeDay(to, "to", void 0, OP9);
25343
25452
  if (fromB.ms > toB.ms) {
@@ -25348,11 +25457,11 @@ async function postedWithin(_resource, from, to, http, opts, opLabel = "time_ent
25348
25457
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
25349
25458
  { field: "dateWorked", op: "lte", value: iso2(windowToMs) }
25350
25459
  ];
25351
- if (_optionalChain([opts, 'optionalAccess', _303 => _303.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25352
- if (_optionalChain([opts, 'optionalAccess', _304 => _304.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
25460
+ if (_optionalChain([opts, 'optionalAccess', _311 => _311.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25461
+ if (_optionalChain([opts, 'optionalAccess', _312 => _312.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
25353
25462
  const window = { from: iso2(fromB.ms), to: iso2(windowToMs) };
25354
25463
  if (paging.countOnly) return countPostedState(http, filter, OP9, paging.budget, window);
25355
- const { items, hasMore, nextCursor } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _305 => _305.limit])), OP9, http, paging.cursor);
25464
+ const { items, hasMore, nextCursor } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _313 => _313.limit])), OP9, http, paging.cursor);
25356
25465
  const { states, incomplete } = await postedStateOf(http, items, OP9);
25357
25466
  let postedCount = 0;
25358
25467
  let unpostedCount = 0;
@@ -25360,7 +25469,7 @@ async function postedWithin(_resource, from, to, http, opts, opLabel = "time_ent
25360
25469
  if (state === "posted") postedCount += 1;
25361
25470
  else unpostedCount += 1;
25362
25471
  }
25363
- const keep = _optionalChain([opts, 'optionalAccess', _306 => _306.posted]) === void 0 ? void 0 : opts.posted ? "posted" : "unposted";
25472
+ const keep = _optionalChain([opts, 'optionalAccess', _314 => _314.posted]) === void 0 ? void 0 : opts.posted ? "posted" : "unposted";
25364
25473
  return {
25365
25474
  items: keep === void 0 ? items : items.filter((e) => states.get(e.id) === keep),
25366
25475
  postedCount,
@@ -25810,7 +25919,7 @@ function sameValue(a, b) {
25810
25919
  async function readTicket(http, id, retries, operation) {
25811
25920
  try {
25812
25921
  const res = await http.request({ method: "GET", path: `/V1.0/Tickets/${id}`, operation, maxRetries: retries });
25813
- const item = _optionalChain([res, 'optionalAccess', _307 => _307.item]);
25922
+ const item = _optionalChain([res, 'optionalAccess', _315 => _315.item]);
25814
25923
  return _nullishCoalesce(item, () => ( null));
25815
25924
  } catch (e) {
25816
25925
  if (isAutotaskError(e) && (e.httpStatus === 404 || e.code === "NOT_FOUND")) return null;
@@ -25855,7 +25964,7 @@ async function preview(http, spec, sourceId, toTicketId, opts) {
25855
25964
  const facts = {
25856
25965
  closedStatus: { closedIds: closedStatus.closedIds, source: closedStatus.source, note: closedStatus.note },
25857
25966
  sourceTicketId,
25858
- sourceCompanyID: _nullishCoalesce(_optionalChain([origin, 'optionalAccess', _308 => _308.companyID]), () => ( null)),
25967
+ sourceCompanyID: _nullishCoalesce(_optionalChain([origin, 'optionalAccess', _316 => _316.companyID]), () => ( null)),
25859
25968
  targetCompanyID: _nullishCoalesce(target.companyID, () => ( null)),
25860
25969
  companyChanged: origin === null ? null : origin.companyID !== target.companyID,
25861
25970
  contractChanged: origin === null ? null : (_nullishCoalesce(origin.contractID, () => ( null))) !== (_nullishCoalesce(target.contractID, () => ( null)))
@@ -25973,7 +26082,7 @@ var CONTRACT_SCOPED = ["contractID", "contractServiceID", "contractServiceBundle
25973
26082
  async function readTimeEntry(http, id, retries) {
25974
26083
  try {
25975
26084
  const res = await http.request({ method: "GET", path: `/V1.0/TimeEntries/${id}`, operation: OP6, maxRetries: retries });
25976
- return _nullishCoalesce(_optionalChain([res, 'optionalAccess', _309 => _309.item]), () => ( null));
26085
+ return _nullishCoalesce(_optionalChain([res, 'optionalAccess', _317 => _317.item]), () => ( null));
25977
26086
  } catch (e) {
25978
26087
  if (isAutotaskError(e) && (e.httpStatus === 404 || e.code === "NOT_FOUND")) return null;
25979
26088
  throw e;
@@ -26192,17 +26301,17 @@ async function recentTickets(_resource, from, to, http, opts) {
26192
26301
  for (const [ticketID, g] of groups) {
26193
26302
  const t = tickets.get(ticketID);
26194
26303
  if (t === void 0) unresolvedTicketIDs.push(ticketID);
26195
- if (companyID !== void 0 && _optionalChain([t, 'optionalAccess', _310 => _310.companyID]) !== companyID) {
26304
+ if (companyID !== void 0 && _optionalChain([t, 'optionalAccess', _318 => _318.companyID]) !== companyID) {
26196
26305
  if (t !== void 0) excludedTickets += 1;
26197
26306
  continue;
26198
26307
  }
26199
26308
  items.push({
26200
26309
  ticketID,
26201
- ..._optionalChain([t, 'optionalAccess', _311 => _311.ticketNumber]) !== void 0 ? { ticketNumber: t.ticketNumber } : {},
26202
- ..._optionalChain([t, 'optionalAccess', _312 => _312.title]) !== void 0 ? { title: t.title } : {},
26203
- ..._optionalChain([t, 'optionalAccess', _313 => _313.status]) !== void 0 ? { status: t.status } : {},
26204
- ..._optionalChain([t, 'optionalAccess', _314 => _314.assignedResourceID]) !== void 0 ? { assignedResourceID: t.assignedResourceID } : {},
26205
- ..._optionalChain([t, 'optionalAccess', _315 => _315.companyID]) !== void 0 ? { companyID: t.companyID } : {},
26310
+ ..._optionalChain([t, 'optionalAccess', _319 => _319.ticketNumber]) !== void 0 ? { ticketNumber: t.ticketNumber } : {},
26311
+ ..._optionalChain([t, 'optionalAccess', _320 => _320.title]) !== void 0 ? { title: t.title } : {},
26312
+ ..._optionalChain([t, 'optionalAccess', _321 => _321.status]) !== void 0 ? { status: t.status } : {},
26313
+ ..._optionalChain([t, 'optionalAccess', _322 => _322.assignedResourceID]) !== void 0 ? { assignedResourceID: t.assignedResourceID } : {},
26314
+ ..._optionalChain([t, 'optionalAccess', _323 => _323.companyID]) !== void 0 ? { companyID: t.companyID } : {},
26206
26315
  entryCount: g.entryCount,
26207
26316
  totalHours: Math.round(g.totalHours * 100) / 100,
26208
26317
  lastWorked: g.lastWorked
@@ -26246,7 +26355,7 @@ var TimeEntriesResource = class extends BaseResource {
26246
26355
  }
26247
26356
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
26248
26357
  async get(id, opts = {}) {
26249
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _316 => _316.fresh]) === true);
26358
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _324 => _324.fresh]) === true);
26250
26359
  }
26251
26360
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
26252
26361
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -26579,4 +26688,6 @@ var TimeEntriesResource = class extends BaseResource {
26579
26688
 
26580
26689
 
26581
26690
 
26582
- exports.AUTH_HEADERS = AUTH_HEADERS; exports.buildAuthHeaders = buildAuthHeaders; exports.withAuthHeaders = withAuthHeaders; exports.AutotaskError = AutotaskError; exports.AutotaskConfigError = AutotaskConfigError; exports.isAutotaskError = isAutotaskError; exports.AutotaskNetworkError = AutotaskNetworkError; exports.AutotaskTimeoutError = AutotaskTimeoutError; exports.AutotaskAbortError = AutotaskAbortError; exports.ResponseRejectedError = ResponseRejectedError; exports.BadRequestError = BadRequestError; exports.UnauthorizedError = UnauthorizedError; exports.ForbiddenError = ForbiddenError; exports.NotFoundError = NotFoundError; exports.ConflictError = ConflictError; exports.UnprocessableEntityError = UnprocessableEntityError; exports.RateLimitError = RateLimitError; exports.ServerError = ServerError; exports.UnexpectedContentTypeError = UnexpectedContentTypeError; exports.EmptyResponseError = EmptyResponseError; exports.CircuitBreakerError = CircuitBreakerError; exports.HostPolicyDeniedError = HostPolicyDeniedError; exports.ResolutionError = ResolutionError; exports.PaginationLimitError = PaginationLimitError; exports.QueryTooLongError = QueryTooLongError; exports.parseVendorErrors = parseVendorErrors; exports.isDeterministicVendor500 = isDeterministicVendor500; exports.formatVendorDetail = formatVendorDetail; exports.NoopLogger = NoopLogger; exports.REDACTED = REDACTED; exports.CREDENTIAL_HEADER_NAMES = CREDENTIAL_HEADER_NAMES; exports.isCredentialHeaderName = isCredentialHeaderName; exports.redactRecord = redactRecord; exports.SECRET_RESPONSE_FIELDS = SECRET_RESPONSE_FIELDS; exports.PERSONAL_RESPONSE_FIELDS = PERSONAL_RESPONSE_FIELDS; exports.CONFIDENTIAL_RESPONSE_FIELDS = CONFIDENTIAL_RESPONSE_FIELDS; exports.isRedactedFieldName = isRedactedFieldName; exports.redactResponseBody = redactResponseBody; exports.CREDENTIAL_SHAPE_POINTER = CREDENTIAL_SHAPE_POINTER; exports.mergeDetails = mergeDetails; exports.errorFromStatus = errorFromStatus; exports.StaleObjectError = StaleObjectError; exports.ConfirmationRequiredError = ConfirmationRequiredError; exports.DeleteBoundaryError = DeleteBoundaryError; exports.MarkerUnsafeIdError = MarkerUnsafeIdError; exports.RecoveryTruncatedError = RecoveryTruncatedError; exports.MoveRefusedError = MoveRefusedError; exports.READ_CACHE_MAX_ENTRIES = READ_CACHE_MAX_ENTRIES; exports.ReadCache = ReadCache; exports.ZONE_CATALOG = ZONE_CATALOG; exports.ZONES = ZONES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.zoneUrl = zoneUrl; exports.resolveBaseUrl = resolveBaseUrl; exports.AGENT_PROFILE = AGENT_PROFILE; exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE; exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE; exports.DEFAULT_TIMEOUT_MS = DEFAULT_TIMEOUT_MS; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_MAINTENANCE_MAX_WAIT_MS = DEFAULT_MAINTENANCE_MAX_WAIT_MS; exports.DEFAULT_MAINTENANCE_POLL_MS = DEFAULT_MAINTENANCE_POLL_MS; exports.MAINTENANCE_WINDOW_MAX_MS = MAINTENANCE_WINDOW_MAX_MS; exports.DEFAULT_MAX_CONCURRENT = DEFAULT_MAX_CONCURRENT; exports.DEFAULT_MAX_RESPONSE_BYTES = DEFAULT_MAX_RESPONSE_BYTES; exports.DEFAULT_MAX_SCAN_RECORDS = DEFAULT_MAX_SCAN_RECORDS; exports.DEFAULT_MAX_SCAN_PAGES = DEFAULT_MAX_SCAN_PAGES; exports.DEFAULT_READ_CACHE_TTL_MS = DEFAULT_READ_CACHE_TTL_MS; exports.DEFAULT_FIELD_CACHE_TTL_MS = DEFAULT_FIELD_CACHE_TTL_MS; exports.DEFAULT_RESOURCE_NAME_CACHE_TTL_MS = DEFAULT_RESOURCE_NAME_CACHE_TTL_MS; exports.hasSurroundingQuotes = hasSurroundingQuotes; exports.credentialShapeProblem = credentialShapeProblem; exports.CREDENTIAL_ENV_LOAD_ACTION = CREDENTIAL_ENV_LOAD_ACTION; exports.MIN_PREFIX_SUMMARY_LENGTH = MIN_PREFIX_SUMMARY_LENGTH; exports.credentialValueSummary = credentialValueSummary; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.DEFAULT_CIRCUIT_BREAKER_WINDOW_MS = DEFAULT_CIRCUIT_BREAKER_WINDOW_MS; exports.DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD = DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD; exports.DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS = DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS; exports.DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE = DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE; exports.DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES = DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES; exports.InMemoryCircuitBreakerStore = InMemoryCircuitBreakerStore; exports.defaultCircuitBreakerStore = defaultCircuitBreakerStore; exports.resetDefaultCircuitBreakerStore = resetDefaultCircuitBreakerStore; exports.buildBreakerKey = buildBreakerKey; exports.isBreakerFailure = isBreakerFailure; exports.DEFAULT_COOLDOWN_MAX_MS = DEFAULT_COOLDOWN_MAX_MS; exports.DEFAULT_COOLDOWN_DEFAULT_MS = DEFAULT_COOLDOWN_DEFAULT_MS; exports.DEFAULT_COOLDOWN_MAX_ENTRIES = DEFAULT_COOLDOWN_MAX_ENTRIES; exports.InMemoryCooldownStore = InMemoryCooldownStore; exports.defaultCooldownStore = defaultCooldownStore; exports.resetDefaultCooldownStore = resetDefaultCooldownStore; exports.buildTenantKey = buildTenantKey; exports.cooldownDurationMs = cooldownDurationMs; exports.resolveCredentials = resolveCredentials; exports.buildReadCache = buildReadCache; exports.resolveConfig = resolveConfig; exports.IDEMPOTENT_METHODS = IDEMPOTENT_METHODS; exports.isRecord = isRecord2; exports.assertRecord = assertRecord; exports.deepMergeParams = deepMergeParams; exports.isIdentifierCandidate = isIdentifierCandidate; exports.parseIdentifier = parseIdentifier; exports.flattenUdfs = flattenUdfs; exports.newCorrelationId = newCorrelationId; exports.redactAuditBody = redactAuditBody; exports.camelKey = camelKey; exports.FILTER_OPERATORS = FILTER_OPERATORS; exports.GROUPING_OPERATORS = GROUPING_OPERATORS; exports.MAX_OR_CONDITIONS = MAX_OR_CONDITIONS; exports.MAX_UDF_PER_QUERY = MAX_UDF_PER_QUERY; exports.MAX_QUERY_LENGTH = MAX_QUERY_LENGTH; exports.MAX_GET_LENGTH = MAX_GET_LENGTH; exports.MAX_FIELD_LENGTH = MAX_FIELD_LENGTH; exports.isFilterOperator = isFilterOperator; exports.serializeFilter = serializeFilter; exports.validateFilter = validateFilter; exports.buildFilter = buildFilter; exports.normalizedConditions = normalizedConditions; exports.normalizeInValues = normalizeInValues; exports.assertNoRelationLeaf = assertNoRelationLeaf; exports.buildUrl = buildUrl; exports.cursorToPath = cursorToPath; exports.buildQueryBody = buildQueryBody; exports.buildQueryRequest = buildQueryRequest; exports.runWithSignal = runWithSignal; exports.RELATIONSHIP_ZONE = RELATIONSHIP_ZONE; exports.RELATIONSHIP_MAP = RELATIONSHIP_MAP; exports.DELETE_BOUNDARY_NOTES = DELETE_BOUNDARY_NOTES; exports.MARKER_FIELDS = MARKER_FIELDS; exports.BLIND_SURFACE_INVENTORY = BLIND_SURFACE_INVENTORY; exports.REACHABILITY_PROBE_DEFAULTS = REACHABILITY_PROBE_DEFAULTS; exports.CREATE_GUIDANCE = CREATE_GUIDANCE; exports.unwrapItems = unwrapItems; exports.unwrapItem = unwrapItem; exports.unwrapQueryCount = unwrapQueryCount; exports.unwrapOperation = unwrapOperation; exports.passthrough = passthrough; exports.HttpClient = HttpClient; exports.BOUNDED_QUERY_MAX_LIMIT = BOUNDED_QUERY_MAX_LIMIT; exports.buildDryRunResult = buildDryRunResult; exports.mergePartialBody = mergePartialBody; exports.effectiveRequiredFields = effectiveRequiredFields; exports.MAX_PAGES = MAX_PAGES; exports.clampPageSize = clampPageSize; exports.totalPagesFor = totalPagesFor; exports.paginate = paginate; exports.paginateItems = paginateItems; exports.collectAll = collectAll; exports.toArray = toArray; exports.FIELD_PRESETS = FIELD_PRESETS; exports.FIELD_PRESET_NAMES = FIELD_PRESET_NAMES; exports.resolveFieldsPreset = resolveFieldsPreset; exports.MODEL_DATE_FIELDS = MODEL_DATE_FIELDS; exports.EXPAND_RESOURCE_NAMES_MAX_IDS = EXPAND_RESOURCE_NAMES_MAX_IDS; exports.expandResourceNames = expandResourceNames; exports.ENTITY_TYPE_TO_RESOURCE = ENTITY_TYPE_TO_RESOURCE; exports.resourceForEntityType = resourceForEntityType; exports.isEnumerableResource = isEnumerableResource; exports.WORKFLOW_RESOURCES = WORKFLOW_RESOURCES; exports.MAX_FIELD_CATALOG_WIRE = MAX_FIELD_CATALOG_WIRE; exports.FIELD_CATALOG_HONESTY_NOTE = FIELD_CATALOG_HONESTY_NOTE; exports.fieldCatalog = fieldCatalog; exports.PICKLIST_VALUE_NOT_SERVED_NOTE = PICKLIST_VALUE_NOT_SERVED_NOTE; exports.TICKET_LABEL_FIELDS = TICKET_LABEL_FIELDS; exports.createNamePlan = createNamePlan; exports.addNameSibling = addNameSibling; exports.addLabelSibling = addLabelSibling; exports.vendorId = vendorId; exports.resolveLineOfBusinessChain = resolveLineOfBusinessChain; exports.resolveCompositeNames = resolveCompositeNames; exports.readNamesOpt = readNamesOpt; exports.labelRows = labelRows; exports.BaseResource = BaseResource; exports.BillingCodesResource = BillingCodesResource; exports.BillingItemsResource = BillingItemsResource; exports.isDateYMD = isDateYMD; exports.monthsInWindow = monthsInWindow; exports.dayAfter = dayAfter; exports.num = num; exports.collectFilterFieldNames = collectFilterFieldNames; exports.validateQueryFieldNames = validateQueryFieldNames; exports.findUnknownFieldNames = findUnknownFieldNames; exports.resolveTicketStatusSemantics = resolveTicketStatusSemantics; exports.openStatusFilter = openStatusFilter; exports.isClosedStatus = isClosedStatus; exports.CompaniesResource = CompaniesResource; exports.PROFITABILITY_MAX_WINDOW_MONTHS = PROFITABILITY_MAX_WINDOW_MONTHS; exports.SERVICE_LINE_FKS = SERVICE_LINE_FKS; exports.CHARGE_LINE_FKS = CHARGE_LINE_FKS; exports.billingLineType = billingLineType; exports.internalAmount = internalAmount; exports.FETCH_MANY_MAX_ITEMS = FETCH_MANY_MAX_ITEMS; exports.validateFetchManyItems = validateFetchManyItems; exports.fetchMany = fetchMany; exports.FETCH_BY_IDS_MAX_ITEMS = FETCH_BY_IDS_MAX_ITEMS; exports.FETCH_BY_IDS_CHUNK_SIZE = FETCH_BY_IDS_CHUNK_SIZE; exports.fetchByIds = fetchByIds; exports.readPicklists = readPicklists; exports.ContractsResource = ContractsResource; exports.InvoicesResource = InvoicesResource; exports.OrganizationalLevel1sResource = OrganizationalLevel1sResource; exports.OrganizationalLevel2sResource = OrganizationalLevel2sResource; exports.OrganizationalLevelAssociationsResource = OrganizationalLevelAssociationsResource; exports.ResourcesResource = ResourcesResource; exports.UI_LINK_ENTITIES = UI_LINK_ENTITIES; exports.buildUiLink = buildUiLink; exports.uiLink = uiLink; exports.refuse = refuse; exports.queryRows = queryRows; exports.runMove = runMove; exports.uiLinkFor = uiLinkFor; exports.TimeEntriesResource = TimeEntriesResource;
26691
+
26692
+
26693
+ exports.AUTH_HEADERS = AUTH_HEADERS; exports.buildAuthHeaders = buildAuthHeaders; exports.withAuthHeaders = withAuthHeaders; exports.AutotaskError = AutotaskError; exports.AutotaskConfigError = AutotaskConfigError; exports.isAutotaskError = isAutotaskError; exports.AutotaskNetworkError = AutotaskNetworkError; exports.AutotaskTimeoutError = AutotaskTimeoutError; exports.AutotaskAbortError = AutotaskAbortError; exports.ResponseRejectedError = ResponseRejectedError; exports.BadRequestError = BadRequestError; exports.UnauthorizedError = UnauthorizedError; exports.ForbiddenError = ForbiddenError; exports.NotFoundError = NotFoundError; exports.ConflictError = ConflictError; exports.UnprocessableEntityError = UnprocessableEntityError; exports.RateLimitError = RateLimitError; exports.ServerError = ServerError; exports.UnexpectedContentTypeError = UnexpectedContentTypeError; exports.EmptyResponseError = EmptyResponseError; exports.CircuitBreakerError = CircuitBreakerError; exports.HostPolicyDeniedError = HostPolicyDeniedError; exports.ResolutionError = ResolutionError; exports.PaginationLimitError = PaginationLimitError; exports.QueryTooLongError = QueryTooLongError; exports.parseVendorErrors = parseVendorErrors; exports.isDeterministicVendor500 = isDeterministicVendor500; exports.formatVendorDetail = formatVendorDetail; exports.NoopLogger = NoopLogger; exports.REDACTED = REDACTED; exports.CREDENTIAL_HEADER_NAMES = CREDENTIAL_HEADER_NAMES; exports.isCredentialHeaderName = isCredentialHeaderName; exports.redactRecord = redactRecord; exports.SECRET_RESPONSE_FIELDS = SECRET_RESPONSE_FIELDS; exports.PERSONAL_RESPONSE_FIELDS = PERSONAL_RESPONSE_FIELDS; exports.CONFIDENTIAL_RESPONSE_FIELDS = CONFIDENTIAL_RESPONSE_FIELDS; exports.isRedactedFieldName = isRedactedFieldName; exports.redactResponseBody = redactResponseBody; exports.CREDENTIAL_SHAPE_POINTER = CREDENTIAL_SHAPE_POINTER; exports.mergeDetails = mergeDetails; exports.errorFromStatus = errorFromStatus; exports.StaleObjectError = StaleObjectError; exports.ConfirmationRequiredError = ConfirmationRequiredError; exports.DeleteBoundaryError = DeleteBoundaryError; exports.MarkerUnsafeIdError = MarkerUnsafeIdError; exports.RecoveryTruncatedError = RecoveryTruncatedError; exports.MoveRefusedError = MoveRefusedError; exports.READ_CACHE_MAX_ENTRIES = READ_CACHE_MAX_ENTRIES; exports.ReadCache = ReadCache; exports.ZONE_CATALOG = ZONE_CATALOG; exports.ZONES = ZONES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.zoneUrl = zoneUrl; exports.resolveBaseUrl = resolveBaseUrl; exports.AGENT_PROFILE = AGENT_PROFILE; exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE; exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE; exports.DEFAULT_TIMEOUT_MS = DEFAULT_TIMEOUT_MS; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_MAINTENANCE_MAX_WAIT_MS = DEFAULT_MAINTENANCE_MAX_WAIT_MS; exports.DEFAULT_MAINTENANCE_POLL_MS = DEFAULT_MAINTENANCE_POLL_MS; exports.MAINTENANCE_WINDOW_MAX_MS = MAINTENANCE_WINDOW_MAX_MS; exports.DEFAULT_MAX_CONCURRENT = DEFAULT_MAX_CONCURRENT; exports.DEFAULT_MAX_RESPONSE_BYTES = DEFAULT_MAX_RESPONSE_BYTES; exports.DEFAULT_MAX_SCAN_RECORDS = DEFAULT_MAX_SCAN_RECORDS; exports.DEFAULT_MAX_SCAN_PAGES = DEFAULT_MAX_SCAN_PAGES; exports.DEFAULT_READ_CACHE_TTL_MS = DEFAULT_READ_CACHE_TTL_MS; exports.DEFAULT_FIELD_CACHE_TTL_MS = DEFAULT_FIELD_CACHE_TTL_MS; exports.DEFAULT_RESOURCE_NAME_CACHE_TTL_MS = DEFAULT_RESOURCE_NAME_CACHE_TTL_MS; exports.hasSurroundingQuotes = hasSurroundingQuotes; exports.credentialShapeProblem = credentialShapeProblem; exports.CREDENTIAL_ENV_LOAD_ACTION = CREDENTIAL_ENV_LOAD_ACTION; exports.MIN_PREFIX_SUMMARY_LENGTH = MIN_PREFIX_SUMMARY_LENGTH; exports.credentialValueSummary = credentialValueSummary; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.DEFAULT_CIRCUIT_BREAKER_WINDOW_MS = DEFAULT_CIRCUIT_BREAKER_WINDOW_MS; exports.DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD = DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD; exports.DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS = DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS; exports.DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE = DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE; exports.DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES = DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES; exports.InMemoryCircuitBreakerStore = InMemoryCircuitBreakerStore; exports.defaultCircuitBreakerStore = defaultCircuitBreakerStore; exports.resetDefaultCircuitBreakerStore = resetDefaultCircuitBreakerStore; exports.buildBreakerKey = buildBreakerKey; exports.isBreakerFailure = isBreakerFailure; exports.DEFAULT_COOLDOWN_MAX_MS = DEFAULT_COOLDOWN_MAX_MS; exports.DEFAULT_COOLDOWN_DEFAULT_MS = DEFAULT_COOLDOWN_DEFAULT_MS; exports.DEFAULT_COOLDOWN_MAX_ENTRIES = DEFAULT_COOLDOWN_MAX_ENTRIES; exports.InMemoryCooldownStore = InMemoryCooldownStore; exports.defaultCooldownStore = defaultCooldownStore; exports.resetDefaultCooldownStore = resetDefaultCooldownStore; exports.buildTenantKey = buildTenantKey; exports.cooldownDurationMs = cooldownDurationMs; exports.resolveCredentials = resolveCredentials; exports.buildReadCache = buildReadCache; exports.resolveConfig = resolveConfig; exports.IDEMPOTENT_METHODS = IDEMPOTENT_METHODS; exports.isRecord = isRecord2; exports.assertRecord = assertRecord; exports.deepMergeParams = deepMergeParams; exports.isIdentifierCandidate = isIdentifierCandidate; exports.parseIdentifier = parseIdentifier; exports.flattenUdfs = flattenUdfs; exports.newCorrelationId = newCorrelationId; exports.redactAuditBody = redactAuditBody; exports.camelKey = camelKey; exports.FILTER_OPERATORS = FILTER_OPERATORS; exports.GROUPING_OPERATORS = GROUPING_OPERATORS; exports.MAX_OR_CONDITIONS = MAX_OR_CONDITIONS; exports.MAX_UDF_PER_QUERY = MAX_UDF_PER_QUERY; exports.MAX_QUERY_LENGTH = MAX_QUERY_LENGTH; exports.MAX_GET_LENGTH = MAX_GET_LENGTH; exports.MAX_FIELD_LENGTH = MAX_FIELD_LENGTH; exports.isFilterOperator = isFilterOperator; exports.serializeFilter = serializeFilter; exports.validateFilter = validateFilter; exports.buildFilter = buildFilter; exports.normalizedConditions = normalizedConditions; exports.normalizeInValues = normalizeInValues; exports.assertNoRelationLeaf = assertNoRelationLeaf; exports.buildUrl = buildUrl; exports.cursorToPath = cursorToPath; exports.buildQueryBody = buildQueryBody; exports.buildQueryRequest = buildQueryRequest; exports.runWithSignal = runWithSignal; exports.RELATIONSHIP_ZONE = RELATIONSHIP_ZONE; exports.RELATIONSHIP_MAP = RELATIONSHIP_MAP; exports.DELETE_BOUNDARY_NOTES = DELETE_BOUNDARY_NOTES; exports.MARKER_FIELDS = MARKER_FIELDS; exports.BLIND_SURFACE_INVENTORY = BLIND_SURFACE_INVENTORY; exports.REACHABILITY_PROBE_DEFAULTS = REACHABILITY_PROBE_DEFAULTS; exports.CREATE_GUIDANCE = CREATE_GUIDANCE; exports.unwrapItems = unwrapItems; exports.unwrapItem = unwrapItem; exports.unwrapQueryCount = unwrapQueryCount; exports.unwrapOperation = unwrapOperation; exports.passthrough = passthrough; exports.HttpClient = HttpClient; exports.BOUNDED_QUERY_MAX_LIMIT = BOUNDED_QUERY_MAX_LIMIT; exports.buildDryRunResult = buildDryRunResult; exports.mergePartialBody = mergePartialBody; exports.effectiveRequiredFields = effectiveRequiredFields; exports.MAX_PAGES = MAX_PAGES; exports.clampPageSize = clampPageSize; exports.totalPagesFor = totalPagesFor; exports.paginate = paginate; exports.paginateItems = paginateItems; exports.collectAll = collectAll; exports.toArray = toArray; exports.FIELD_PRESETS = FIELD_PRESETS; exports.FIELD_PRESET_NAMES = FIELD_PRESET_NAMES; exports.resolveFieldsPreset = resolveFieldsPreset; exports.MODEL_DATE_FIELDS = MODEL_DATE_FIELDS; exports.EXPAND_RESOURCE_NAMES_MAX_IDS = EXPAND_RESOURCE_NAMES_MAX_IDS; exports.expandResourceNames = expandResourceNames; exports.ENTITY_TYPE_TO_RESOURCE = ENTITY_TYPE_TO_RESOURCE; exports.resourceForEntityType = resourceForEntityType; exports.isEnumerableResource = isEnumerableResource; exports.WORKFLOW_RESOURCES = WORKFLOW_RESOURCES; exports.MAX_FIELD_CATALOG_WIRE = MAX_FIELD_CATALOG_WIRE; exports.FIELD_CATALOG_HONESTY_NOTE = FIELD_CATALOG_HONESTY_NOTE; exports.MIN_FIELD_CATALOG_MAX_BYTES = MIN_FIELD_CATALOG_MAX_BYTES; exports.fieldCatalog = fieldCatalog; exports.PICKLIST_VALUE_NOT_SERVED_NOTE = PICKLIST_VALUE_NOT_SERVED_NOTE; exports.PICKLIST_CATALOG_UNAVAILABLE_NOTE = PICKLIST_CATALOG_UNAVAILABLE_NOTE; exports.TICKET_LABEL_FIELDS = TICKET_LABEL_FIELDS; exports.createNamePlan = createNamePlan; exports.addNameSibling = addNameSibling; exports.addLabelSibling = addLabelSibling; exports.vendorId = vendorId; exports.resolveLineOfBusinessChain = resolveLineOfBusinessChain; exports.resolveCompositeNames = resolveCompositeNames; exports.readNamesOpt = readNamesOpt; exports.labelRows = labelRows; exports.BaseResource = BaseResource; exports.BillingCodesResource = BillingCodesResource; exports.BillingItemsResource = BillingItemsResource; exports.isDateYMD = isDateYMD; exports.monthsInWindow = monthsInWindow; exports.dayAfter = dayAfter; exports.num = num; exports.collectFilterFieldNames = collectFilterFieldNames; exports.validateQueryFieldNames = validateQueryFieldNames; exports.findUnknownFieldNames = findUnknownFieldNames; exports.resolveTicketStatusSemantics = resolveTicketStatusSemantics; exports.openStatusFilter = openStatusFilter; exports.isClosedStatus = isClosedStatus; exports.CompaniesResource = CompaniesResource; exports.PROFITABILITY_MAX_WINDOW_MONTHS = PROFITABILITY_MAX_WINDOW_MONTHS; exports.SERVICE_LINE_FKS = SERVICE_LINE_FKS; exports.CHARGE_LINE_FKS = CHARGE_LINE_FKS; exports.billingLineType = billingLineType; exports.internalAmount = internalAmount; exports.FETCH_MANY_MAX_ITEMS = FETCH_MANY_MAX_ITEMS; exports.validateFetchManyItems = validateFetchManyItems; exports.fetchMany = fetchMany; exports.FETCH_BY_IDS_MAX_ITEMS = FETCH_BY_IDS_MAX_ITEMS; exports.FETCH_BY_IDS_CHUNK_SIZE = FETCH_BY_IDS_CHUNK_SIZE; exports.fetchByIds = fetchByIds; exports.readPicklists = readPicklists; exports.ContractsResource = ContractsResource; exports.InvoicesResource = InvoicesResource; exports.OrganizationalLevel1sResource = OrganizationalLevel1sResource; exports.OrganizationalLevel2sResource = OrganizationalLevel2sResource; exports.OrganizationalLevelAssociationsResource = OrganizationalLevelAssociationsResource; exports.ResourcesResource = ResourcesResource; exports.UI_LINK_ENTITIES = UI_LINK_ENTITIES; exports.buildUiLink = buildUiLink; exports.uiLink = uiLink; exports.refuse = refuse; exports.queryRows = queryRows; exports.runMove = runMove; exports.uiLinkFor = uiLinkFor; exports.TimeEntriesResource = TimeEntriesResource;