node-autotask 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/MCP_TOOL_CATALOG.json +27 -8
  3. package/MCP_TOOL_MANIFEST.md +138 -137
  4. package/N8N_MCP_MANIFEST.json +17 -17
  5. package/N8N_MCP_MANIFEST.md +18 -18
  6. package/README.md +6 -19
  7. package/capabilities.json +1815 -1432
  8. package/dist/{base-CVx2VMSj.d.cts → base-CftidiyZ.d.cts} +2 -1
  9. package/dist/{base-CVx2VMSj.d.ts → base-CftidiyZ.d.ts} +2 -1
  10. package/dist/capabilities.cjs +2 -2
  11. package/dist/capabilities.d.cts +2 -1
  12. package/dist/capabilities.d.ts +2 -1
  13. package/dist/capabilities.js +1 -1
  14. package/dist/{chunk-TH7B5H4P.cjs → chunk-6WLGHKIU.cjs} +285 -285
  15. package/dist/{chunk-KTEDPS4X.js → chunk-7MCKJTSA.js} +2 -2
  16. package/dist/{chunk-5VHSLJMR.js → chunk-A6LHCJQP.js} +30 -9
  17. package/dist/{chunk-4EFXIE53.js → chunk-BKTOMNT2.js} +2 -2
  18. package/dist/{chunk-VFLAMMIJ.cjs → chunk-EMYDC5SG.cjs} +151 -120
  19. package/dist/{chunk-SK3GYRNA.cjs → chunk-KWQSGWY5.cjs} +143 -143
  20. package/dist/{chunk-Q23JULNN.js → chunk-LYI5FRPX.js} +55 -24
  21. package/dist/{chunk-JY2BWYXY.js → chunk-N6IWPGHB.js} +1814 -1431
  22. package/dist/{chunk-5BDUMDAQ.cjs → chunk-PH3ESYAF.cjs} +1814 -1431
  23. package/dist/{chunk-MJTKK3QG.cjs → chunk-SN4BMQ2N.cjs} +31 -10
  24. package/dist/{index-C7rMJ4IV.d.ts → index-D8FtzUGP.d.ts} +54 -41
  25. package/dist/{index-C3KFMnRT.d.cts → index-DgBA1JMH.d.cts} +131 -130
  26. package/dist/{index-C3KFMnRT.d.ts → index-DgBA1JMH.d.ts} +131 -130
  27. package/dist/{index-Cm_Xpt7X.d.cts → index-YbEk0awP.d.cts} +54 -41
  28. package/dist/index.cjs +23 -23
  29. package/dist/index.d.cts +8 -7
  30. package/dist/index.d.ts +8 -7
  31. package/dist/index.js +5 -5
  32. package/dist/operations/index.cjs +337 -244
  33. package/dist/operations/index.d.cts +53 -45
  34. package/dist/operations/index.d.ts +53 -45
  35. package/dist/operations/index.js +121 -28
  36. package/dist/pool.cjs +9 -9
  37. package/dist/pool.d.cts +4 -3
  38. package/dist/pool.d.ts +4 -3
  39. package/dist/pool.js +5 -5
  40. package/dist/resources/index.cjs +5 -5
  41. package/dist/resources/index.d.cts +2 -2
  42. package/dist/resources/index.d.ts +2 -2
  43. package/dist/resources/index.js +4 -4
  44. package/dist/types/index.d.cts +1 -1
  45. package/dist/types/index.d.ts +1 -1
  46. package/dist/untrusted.cjs +2 -2
  47. package/dist/untrusted.d.cts +14 -5
  48. package/dist/untrusted.d.ts +14 -5
  49. package/dist/untrusted.js +1 -1
  50. package/docs/API.md +126 -37
  51. package/examples/mcp/schemas.ts +2 -0
  52. package/examples/mcp/tools-read.ts +3 -2
  53. package/package.json +10 -9
@@ -1,9 +1,9 @@
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;
2
2
 
3
- var _chunk5BDUMDAQcjs = require('./chunk-5BDUMDAQ.cjs');
3
+ var _chunkPH3ESYAFcjs = require('./chunk-PH3ESYAF.cjs');
4
4
 
5
5
 
6
- var _chunkMJTKK3QGcjs = require('./chunk-MJTKK3QG.cjs');
6
+ var _chunkSN4BMQ2Ncjs = require('./chunk-SN4BMQ2N.cjs');
7
7
 
8
8
  // src/auth.ts
9
9
  var AUTH_HEADERS = {
@@ -16924,7 +16924,7 @@ function capabilitySets() {
16924
16924
  const fieldOps = /* @__PURE__ */ new Map();
16925
16925
  const udfCapable = /* @__PURE__ */ new Set();
16926
16926
  const resources = /* @__PURE__ */ new Set();
16927
- for (const rec of _chunk5BDUMDAQcjs.CAPABILITIES) {
16927
+ for (const rec of _chunkPH3ESYAFcjs.CAPABILITIES) {
16928
16928
  if (rec.resource === "operations") continue;
16929
16929
  resources.add(rec.resource);
16930
16930
  if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
@@ -16936,7 +16936,7 @@ var derivedIndex = null;
16936
16936
  function derivedFieldsFor(resource) {
16937
16937
  if (derivedIndex === null) {
16938
16938
  derivedIndex = /* @__PURE__ */ new Map();
16939
- for (const rec of _chunk5BDUMDAQcjs.CAPABILITIES) {
16939
+ for (const rec of _chunkPH3ESYAFcjs.CAPABILITIES) {
16940
16940
  const declared = _optionalChain([rec, 'access', _110 => _110.metadata, 'optionalAccess', _111 => _111.derivedFields]);
16941
16941
  if (!Array.isArray(declared) || derivedIndex.has(rec.resource)) continue;
16942
16942
  const rows = [];
@@ -17788,7 +17788,6 @@ async function resolveCompositeNames(http, plan, opts = {}) {
17788
17788
  const lobId = _nullishCoalesce(plan.lineOfBusinessId, () => ( contractLobPointer));
17789
17789
  if (lobId !== void 0) {
17790
17790
  const chain = await resolveLineOfBusinessChain(http, lobId, { budget: remaining, onError: "degrade" });
17791
- remaining -= chain.used;
17792
17791
  if (chain.truncated) section.truncated = true;
17793
17792
  const fromContract = plan.lineOfBusinessId === void 0;
17794
17793
  lineOfBusiness2 = {
@@ -18061,6 +18060,18 @@ function selfPrefixes(resourceKey) {
18061
18060
  const rels = Object.keys(RELATION_TARGETS).filter((rel) => RELATION_TARGETS[rel].resource === resourceKey);
18062
18061
  return [resourceKey, ...rels];
18063
18062
  }
18063
+ function normalizeOwnField(resourceKey, field) {
18064
+ const parts = field.split(".");
18065
+ return parts.length === 2 && selfPrefixes(resourceKey).includes(parts[0]) ? parts[1] : field;
18066
+ }
18067
+ function assertUndottedUdfField(condition, operation) {
18068
+ if (condition.udf === true && typeof condition.field === "string" && condition.field.includes(".")) {
18069
+ throw new AutotaskConfigError(`${operation}: a dotted filter field cannot be a UDF condition \u2014 the request was not issued`, {
18070
+ operation,
18071
+ suggestedAction: "Use an undotted tenant UDF name with udf: true; own-field prefixes and relation paths apply only to ordinary fields."
18072
+ });
18073
+ }
18074
+ }
18064
18075
  var isRelationLeaf = (c) => isRecord2(c) && c.op !== "and" && c.op !== "or" && typeof c.field === "string" && c.field.includes(".");
18065
18076
  function hasRelationConditions(conditions) {
18066
18077
  if (conditions === void 0) return false;
@@ -18072,6 +18083,7 @@ function validateRelationLeaves(resourceKey, conditions, op) {
18072
18083
  for (const c of conds) {
18073
18084
  if (isRecord2(c) && Array.isArray(c.items)) walk(c.items);
18074
18085
  if (!isRelationLeaf(c)) continue;
18086
+ assertUndottedUdfField(c, op);
18075
18087
  const field = c.field;
18076
18088
  const [rel, sub, ...rest] = field.split(".");
18077
18089
  const fail = (why) => {
@@ -18084,7 +18096,6 @@ function validateRelationLeaves(resourceKey, conditions, op) {
18084
18096
  if (rest.length > 0 || !sub) fail("is not <resource>.<field> (multi-hop relations are not supported)");
18085
18097
  continue;
18086
18098
  }
18087
- if (c.udf === true) fail("cannot be a UDF condition");
18088
18099
  if (rest.length > 0 || !sub) fail("is not <relation>.<field> (multi-hop relations are not supported)");
18089
18100
  if (!valid.includes(rel)) fail(`names an unknown relation for ${resourceKey} (valid: ${valid.join(", ") || "none"})`);
18090
18101
  const parentFields = MODEL_FIELD_SETS[RELATION_TARGETS[rel].resource];
@@ -18169,7 +18180,7 @@ var LABEL_NAME_MAX_CHARS = 200;
18169
18180
  function untrustedName(name) {
18170
18181
  if (name === null) return null;
18171
18182
  const [[capped]] = truncateNoteChars([{ v: name }], LABEL_NAME_MAX_CHARS, ["v"]);
18172
- return _nullishCoalesce(_chunkMJTKK3QGcjs.wrapUntrusted.call(void 0, capped.v), () => ( capped.v));
18183
+ return _nullishCoalesce(_chunkSN4BMQ2Ncjs.wrapUntrusted.call(void 0, capped.v), () => ( capped.v));
18173
18184
  }
18174
18185
  function readNamesOpt(client, value, where) {
18175
18186
  if (value === void 0) return _nullishCoalesce(_optionalChain([client, 'optionalAccess', _146 => _146.config, 'optionalAccess', _147 => _147.labels]), () => ( false));
@@ -18257,7 +18268,7 @@ function validateWalkBag(walk, prefix, details) {
18257
18268
  const wr = typeof walk === "object" && walk !== null && !Array.isArray(walk) ? walk.maxRows : void 0;
18258
18269
  if (!Number.isInteger(wr) || wr < 1) {
18259
18270
  throw new AutotaskConfigError(
18260
- `${prefix} walk.maxRows must be a positive integer (got ${String(wr)}) \u2014 it is the walk's TOTAL row cap (the bounding cap = min(limit, walk.maxRows))`,
18271
+ `${prefix} walk.maxRows must be a positive integer (got ${String(wr)}) \u2014 it is the walk's TOTAL row cap, independent of limit`,
18261
18272
  details
18262
18273
  );
18263
18274
  }
@@ -18303,6 +18314,9 @@ var QueryBase = class {
18303
18314
  // ------------------------------------------------------------------
18304
18315
  /** One page fetch: page 1 POSTs the QueryModel body; later pages POST the same body (`buildQueryBody`) to the absolute cursor (issue #118). */
18305
18316
  async fetchPage(params, page, pageSize, state) {
18317
+ if (params.includeFields !== void 0) {
18318
+ params = { ...params, includeFields: params.includeFields.map((field) => normalizeOwnField(this.config.key, field)) };
18319
+ }
18306
18320
  const operation = `${this.config.key}.query`;
18307
18321
  if (page === 1) {
18308
18322
  const req = buildQueryRequest(this.http.baseUrl, this.resourcePath, { ...params, maxRecords: pageSize });
@@ -18407,7 +18421,8 @@ var QueryBase = class {
18407
18421
  * - `limit` = total records (default 500, hard max 2500 — above it throws
18408
18422
  * AutotaskConfigError; it is NOT a page size). The page-1 request uses
18409
18423
  * the internal page size min(500, limit) (the `latest` mechanism sizes
18410
- * its walk from the matching count); every follow-up page POSTs the
18424
+ * its walk from the matching count). Explicit `walk.maxRows` replaces
18425
+ * the total cap; `limit` then only sizes pages. Every follow-up page POSTs the
18411
18426
  * SAME QueryModel body (`buildQueryBody`: MaxRecords, IncludeFields and
18412
18427
  * the preserved filter) to the absolute cursor (issue #118 — the vendor
18413
18428
  * honours IncludeFields there and ignores MaxRecords, serving its own
@@ -18466,20 +18481,20 @@ var QueryBase = class {
18466
18481
  "queryBounded: walk.maxRows is not combinable with latest \u2014 the count-anchored mechanism has its own walk window"
18467
18482
  );
18468
18483
  }
18469
- const cap = maxRows !== void 0 ? Math.min(limit, maxRows) : limit;
18484
+ const cap = _nullishCoalesce(maxRows, () => ( limit));
18485
+ const labelPages = maxRows !== void 0 && readNamesOpt(this.http.client, _optionalChain([params, 'optionalAccess', _159 => _159.names]), `${this.config.key}.query`);
18470
18486
  let walkParams = _nullishCoalesce(params, () => ( {}));
18471
18487
  const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(walkParams.filter), `${this.config.key}.query`);
18472
- if (_optionalChain([relation, 'optionalAccess', _159 => _159.never]) === true) return { items: [], fetched: 0, hasMore: false, pagesWalked: 0, relationNote: relation.note };
18488
+ if (_optionalChain([relation, 'optionalAccess', _160 => _160.never]) === true) return { items: [], fetched: 0, hasMore: false, pagesWalked: 0, relationNote: relation.note, ...maxRows === void 0 ? {} : { truncated: false } };
18473
18489
  if (relation !== void 0) walkParams = { ...walkParams, filter: relation.conditions };
18474
18490
  if (latest !== void 0) {
18475
18491
  return this.applyNoteChars(await this.latestWalk(walkParams, Math.max(limit, latest), latest), noteChars);
18476
18492
  }
18477
- const { items, pages, guard, sliced, cursor } = await this.walkBounded(walkParams, cap, limit);
18478
- const hasMore = (items.length >= cap || guard) && (sliced > 0 || cursor !== null);
18493
+ const { items, pages, guard, sliced, cursor, names } = await this.walkBounded(walkParams, cap, limit, labelPages);
18494
+ const hasMore = maxRows === void 0 ? (items.length >= cap || guard) && (sliced > 0 || cursor !== null) : guard || sliced > 0 || cursor !== null;
18479
18495
  const result = { items, fetched: items.length, hasMore, pagesWalked: pages };
18480
- if (maxRows !== void 0) {
18481
- result.truncated = items.length >= maxRows && (sliced > 0 || cursor !== null || guard);
18482
- }
18496
+ if (maxRows !== void 0) result.truncated = hasMore;
18497
+ if (names !== void 0) result.names = names;
18483
18498
  this.stampEmptyQueryResult(result, params);
18484
18499
  return this.applyNoteChars(result, noteChars);
18485
18500
  }
@@ -18510,12 +18525,14 @@ var QueryBase = class {
18510
18525
  * SOFT stop (never a throw). ONE per-walk closure (walks never share
18511
18526
  * state).
18512
18527
  * @internal */
18513
- async walkBounded(p, limit, pageSizeBase) {
18528
+ async walkBounded(p, limit, pageSizeBase, labelPages = false) {
18514
18529
  const state = { cursor: null };
18515
18530
  const items = [];
18516
18531
  let pages = 0;
18517
18532
  let sliced = 0;
18518
18533
  let guard = false;
18534
+ const nameNotes = /* @__PURE__ */ new Set();
18535
+ const nameReasons = {};
18519
18536
  const pageSize = Math.min(MAX_PAGE_SIZE, _nullishCoalesce(pageSizeBase, () => ( limit)));
18520
18537
  for (; ; ) {
18521
18538
  if (pages >= MAX_PAGES) {
@@ -18524,6 +18541,14 @@ var QueryBase = class {
18524
18541
  }
18525
18542
  const page = await this.fetchPage(p, pages + 1, pageSize, state);
18526
18543
  pages += 1;
18544
+ if (labelPages && this.http.client !== void 0) {
18545
+ const labelled = await labelRows(this.http.client, this.config.key, page.items);
18546
+ page.items = labelled.rows;
18547
+ if (labelled.names !== void 0) {
18548
+ nameNotes.add(labelled.names.note.replace("the per-call cap", "the per-page cap"));
18549
+ Object.assign(nameReasons, labelled.names.reasons);
18550
+ }
18551
+ }
18527
18552
  const remaining = limit - items.length;
18528
18553
  const take = page.items.slice(0, remaining);
18529
18554
  sliced += Math.max(0, page.items.length - remaining);
@@ -18531,7 +18556,11 @@ var QueryBase = class {
18531
18556
  if (items.length >= limit) break;
18532
18557
  if (!page.hasMore || page.items.length === 0) break;
18533
18558
  }
18534
- return { items, pages, guard, sliced, cursor: state.cursor };
18559
+ const names = nameNotes.size === 0 ? void 0 : {
18560
+ note: [...nameNotes].join("; "),
18561
+ ...Object.keys(nameReasons).length === 0 ? {} : { reasons: nameReasons }
18562
+ };
18563
+ return { items, pages, guard, sliced, cursor: state.cursor, ...names === void 0 ? {} : { names } };
18535
18564
  }
18536
18565
  /** A walk stop is TRUNCATED when the 1000-page guard fired, or the limit
18537
18566
  * was met with a live next cursor (or a sliced final page): rows exist
@@ -18556,8 +18585,8 @@ var QueryBase = class {
18556
18585
  * @internal */
18557
18586
  stampEmptyQueryResult(result, params) {
18558
18587
  if (result.items.length !== 0) return;
18559
- result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _160 => _160[this.config.key], 'optionalAccess', _161 => _161.query]), _optionalChain([params, 'optionalAccess', _162 => _162.filter]));
18560
- const pinnedReason = normalizedConditions(_optionalChain([params, 'optionalAccess', _163 => _163.filter])) === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _164 => _164[this.config.key], 'optionalAccess', _165 => _165.query]) : void 0;
18588
+ result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _161 => _161[this.config.key], 'optionalAccess', _162 => _162.query]), _optionalChain([params, 'optionalAccess', _163 => _163.filter]));
18589
+ const pinnedReason = normalizedConditions(_optionalChain([params, 'optionalAccess', _164 => _164.filter])) === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _165 => _165[this.config.key], 'optionalAccess', _166 => _166.query]) : void 0;
18561
18590
  if (result.blindSurface !== void 0 || pinnedReason !== void 0) {
18562
18591
  result.emptyReason = result.blindSurface !== void 0 ? blindEmptyReason(result.blindSurface) : pinnedReason;
18563
18592
  }
@@ -18663,7 +18692,7 @@ var QueryBase = class {
18663
18692
  if (probes > LATEST_MAX_COUNT_PROBES) throw this.latestThresholdUnresolvedError();
18664
18693
  };
18665
18694
  let lo = 0n;
18666
- let hi = 0n;
18695
+ let hi;
18667
18696
  for (let t = 1n; ; t = t << 1n) {
18668
18697
  spend();
18669
18698
  if (await this.countAboveId(baseConds, t) <= latest) {
@@ -18713,7 +18742,7 @@ var QueryBase = class {
18713
18742
  if (result.items.length === 0) {
18714
18743
  this.stampEmptyQueryResult(result, params);
18715
18744
  } else {
18716
- result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _166 => _166[this.config.key], 'optionalAccess', _167 => _167.query]), params.filter);
18745
+ result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _167 => _167[this.config.key], 'optionalAccess', _168 => _168.query]), params.filter);
18717
18746
  }
18718
18747
  return result;
18719
18748
  }
@@ -18754,9 +18783,9 @@ var QueryBase = class {
18754
18783
  * or, on a plan-pinned blind surface, the `{ count: 0, blindSurface }`
18755
18784
  * typed sentinel (S12-C T10; see `BlindCountResult`). */
18756
18785
  async countGlobal(params) {
18757
- const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(_optionalChain([params, 'optionalAccess', _168 => _168.filter])), `${this.config.key}.count`);
18758
- if (_optionalChain([relation, 'optionalAccess', _169 => _169.never]) === true) return 0;
18759
- const conditions = relation !== void 0 ? relation.conditions : normalizedConditions(_optionalChain([params, 'optionalAccess', _170 => _170.filter]));
18786
+ const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(_optionalChain([params, 'optionalAccess', _169 => _169.filter])), `${this.config.key}.count`);
18787
+ if (_optionalChain([relation, 'optionalAccess', _170 => _170.never]) === true) return 0;
18788
+ const conditions = relation !== void 0 ? relation.conditions : normalizedConditions(_optionalChain([params, 'optionalAccess', _171 => _171.filter]));
18760
18789
  const body = {};
18761
18790
  body.filter = conditions === void 0 ? [] : buildFilter(conditions).filter;
18762
18791
  const res = await this.http.request({
@@ -18767,9 +18796,9 @@ var QueryBase = class {
18767
18796
  idempotent: true
18768
18797
  });
18769
18798
  const count = unwrapQueryCount(res, `${this.config.key}.count`);
18770
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _171 => _171[this.config.key], 'optionalAccess', _172 => _172.count]), _optionalChain([params, 'optionalAccess', _173 => _173.filter]));
18799
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _172 => _172[this.config.key], 'optionalAccess', _173 => _173.count]), _optionalChain([params, 'optionalAccess', _174 => _174.filter]));
18771
18800
  if (count === 0) {
18772
- const pinnedReason = conditions === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _174 => _174[this.config.key], 'optionalAccess', _175 => _175.count]) : void 0;
18801
+ const pinnedReason = conditions === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _175 => _175[this.config.key], 'optionalAccess', _176 => _176.count]) : void 0;
18773
18802
  if (stamp !== void 0 || pinnedReason !== void 0) {
18774
18803
  return {
18775
18804
  count,
@@ -18803,9 +18832,9 @@ var MetaBase = class extends QueryBase {
18803
18832
  const hit = cache.get(path);
18804
18833
  if (hit !== void 0) return hit;
18805
18834
  }
18806
- const epoch = _optionalChain([cache, 'optionalAccess', _176 => _176.epoch]);
18835
+ const epoch = _optionalChain([cache, 'optionalAccess', _177 => _177.epoch]);
18807
18836
  const res = await this.http.request({ method: "GET", path, operation });
18808
- _optionalChain([cache, 'optionalAccess', _177 => _177.set, 'call', _178 => _178(path, res, epoch)]);
18837
+ _optionalChain([cache, 'optionalAccess', _178 => _178.set, 'call', _179 => _179(path, res, epoch)]);
18809
18838
  return res;
18810
18839
  }
18811
18840
  /**
@@ -18845,7 +18874,7 @@ var MetaBase = class extends QueryBase {
18845
18874
  return value;
18846
18875
  });
18847
18876
  work.catch((err) => {
18848
- if (err instanceof AutotaskError && (err.code === "INVALID_RESPONSE" || _optionalChain([err, 'access', _179 => _179.details, 'optionalAccess', _180 => _180.deterministic]) === true)) {
18877
+ if (err instanceof AutotaskError && (err.code === "INVALID_RESPONSE" || _optionalChain([err, 'access', _180 => _180.details, 'optionalAccess', _181 => _181.deterministic]) === true)) {
18849
18878
  cache.invalidate(`${this.config.key}:`);
18850
18879
  }
18851
18880
  });
@@ -18875,7 +18904,7 @@ var MetaBase = class extends QueryBase {
18875
18904
  path: `${this.resourcePath}/${numeric}`,
18876
18905
  operation: `${this.config.key}.get`,
18877
18906
  skipResponseRedaction: true,
18878
- maxRetries: _optionalChain([readOpts, 'optionalAccess', _181 => _181.maxRetries])
18907
+ maxRetries: _optionalChain([readOpts, 'optionalAccess', _182 => _182.maxRetries])
18879
18908
  });
18880
18909
  return unwrapItem(res, numeric, `${this.config.key}.get`, this.entityName);
18881
18910
  }
@@ -18894,7 +18923,7 @@ var MetaBase = class extends QueryBase {
18894
18923
  path: this.scopedItemPath(parentId, numeric),
18895
18924
  operation: `${this.config.key}.get`,
18896
18925
  skipResponseRedaction: true,
18897
- maxRetries: _optionalChain([readOpts, 'optionalAccess', _182 => _182.maxRetries])
18926
+ maxRetries: _optionalChain([readOpts, 'optionalAccess', _183 => _183.maxRetries])
18898
18927
  });
18899
18928
  return unwrapItem(res, numeric, `${this.config.key}.get`, this.entityName);
18900
18929
  }
@@ -19102,12 +19131,12 @@ var MetaBase = class extends QueryBase {
19102
19131
  return null;
19103
19132
  }
19104
19133
  }
19105
- const epoch = _optionalChain([cache, 'optionalAccess', _183 => _183.epoch]);
19134
+ const epoch = _optionalChain([cache, 'optionalAccess', _184 => _184.epoch]);
19106
19135
  try {
19107
19136
  return await this.fetchRecordRaw(entityPath, referenceId);
19108
19137
  } catch (err) {
19109
19138
  if (err instanceof NotFoundError) {
19110
- _optionalChain([cache, 'optionalAccess', _184 => _184.set, 'call', _185 => _185(absentKey, CONTEXT_ABSENT_MARKER, epoch)]);
19139
+ _optionalChain([cache, 'optionalAccess', _185 => _185.set, 'call', _186 => _186(absentKey, CONTEXT_ABSENT_MARKER, epoch)]);
19111
19140
  return null;
19112
19141
  }
19113
19142
  throw err;
@@ -19224,7 +19253,7 @@ var MetaBase = class extends QueryBase {
19224
19253
  missDetail(operator, fields) {
19225
19254
  const key = this.config.key;
19226
19255
  const probe = fields.map((field) => ({ field, op: operator, value: "" }));
19227
- const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _186 => _186[key], 'optionalAccess', _187 => _187.query]), probe);
19256
+ const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _187 => _187[key], 'optionalAccess', _188 => _188.query]), probe);
19228
19257
  const next = [];
19229
19258
  if (blind !== void 0) {
19230
19259
  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.`);
@@ -19878,7 +19907,7 @@ var MutationBase = class extends MetaBase {
19878
19907
  }
19879
19908
  }
19880
19909
  if (isRecord2(data)) {
19881
- const eff = effectiveRequiredFields(void 0, _nullishCoalesce(_optionalChain([RELATIONSHIP_MAP, 'access', _188 => _188[this.config.key], 'optionalAccess', _189 => _189.zoneFacts]), () => ( null)));
19910
+ const eff = effectiveRequiredFields(void 0, _nullishCoalesce(_optionalChain([RELATIONSHIP_MAP, 'access', _189 => _189[this.config.key], 'optionalAccess', _190 => _190.zoneFacts]), () => ( null)));
19882
19911
  const missing = eff.fields.filter((f) => f !== this.config.parentField && data[f] === void 0);
19883
19912
  if (missing.length > 0) {
19884
19913
  warnings.push(`required field(s) not in the data: ${missing.join(", ")} (${eff.from}); the vendor would likely reject the create`);
@@ -19913,12 +19942,12 @@ var MutationBase = class extends MetaBase {
19913
19942
  const collectionUpdate = scopedUpdate || this.config.collectionUpdate === true;
19914
19943
  const path = scopedUpdate ? this.scopedCollectionPath(parentId) : collectionUpdate ? this.resourcePath : `${this.resourcePath}/${id}`;
19915
19944
  const method = scopedUpdate ? "PATCH" : "PUT";
19916
- let current = null;
19945
+ let current;
19917
19946
  try {
19918
19947
  current = parentId === void 0 ? await this.getGlobal(id, true) : this.config.attachmentGet ? await this.getScopedModel(parentId, id, true) : await this.getScopedRaw(parentId, id, true);
19919
19948
  } catch (err) {
19920
19949
  if (err instanceof NotFoundError) {
19921
- const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _190 => _190[this.config.key], 'optionalAccess', _191 => _191.update]);
19950
+ const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _191 => _191[this.config.key], 'optionalAccess', _192 => _192.update]);
19922
19951
  checks.push({
19923
19952
  name: "current-record-exists",
19924
19953
  ok: false,
@@ -19972,7 +20001,7 @@ var MutationBase = class extends MetaBase {
19972
20001
  const checks = [];
19973
20002
  const warnings = [];
19974
20003
  const path = parentId === void 0 ? `${this.resourcePath}/${id}` : this.scopedItemPath(parentId, id);
19975
- let current = null;
20004
+ let current;
19976
20005
  try {
19977
20006
  current = parentId === void 0 ? await this.getGlobal(id, true) : this.config.attachmentGet ? await this.getScopedModel(parentId, id, true) : await this.getScopedRaw(parentId, id, true);
19978
20007
  } catch (err) {
@@ -20036,7 +20065,7 @@ var BillingCodesResource = class extends BaseResource {
20036
20065
  }
20037
20066
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
20038
20067
  async get(id, opts = {}) {
20039
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _192 => _192.fresh]) === true);
20068
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _193 => _193.fresh]) === true);
20040
20069
  }
20041
20070
  /** Resolve a BillingCode from a numeric id (or, where the vendor indexes a primary text field,
20042
20071
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -20051,7 +20080,7 @@ var BillingCodesResource = class extends BaseResource {
20051
20080
  /** Search BillingCode records: bounded contains on name (no vendor free-text search exists);
20052
20081
  * limit defaults to 25, max 500. */
20053
20082
  async search(query, opts) {
20054
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _193 => _193.limit]) });
20083
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _194 => _194.limit]) });
20055
20084
  }
20056
20085
  };
20057
20086
 
@@ -20355,28 +20384,28 @@ async function customRangeQuery(http, path, field, from, to, limit, operation, z
20355
20384
 
20356
20385
  // src/resources/special/billing_items.ts
20357
20386
  async function windowQuery(_resource, kind, http, opts) {
20358
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _194 => _194.now]), () => ( /* @__PURE__ */ new Date()));
20359
- const tz = _optionalChain([opts, 'optionalAccess', _195 => _195.tz]) === void 0 ? void 0 : validateZone(opts.tz, `billing_items.${kind}`);
20387
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _195 => _195.now]), () => ( /* @__PURE__ */ new Date()));
20388
+ const tz = _optionalChain([opts, 'optionalAccess', _196 => _196.tz]) === void 0 ? void 0 : validateZone(opts.tz, `billing_items.${kind}`);
20360
20389
  return dateWindowQuery(
20361
20390
  http,
20362
20391
  "/V1.0/BillingItems/query",
20363
20392
  "itemDate",
20364
20393
  kind,
20365
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _196 => _196.limit])),
20394
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _197 => _197.limit])),
20366
20395
  `billing_items.${kind}`,
20367
20396
  now,
20368
20397
  tz
20369
20398
  );
20370
20399
  }
20371
20400
  async function customRange(_resource, from, to, http, opts) {
20372
- const zone = _optionalChain([opts, 'optionalAccess', _197 => _197.tz]) === void 0 ? void 0 : validateZone(opts.tz, "billing_items.customRange");
20401
+ const zone = _optionalChain([opts, 'optionalAccess', _198 => _198.tz]) === void 0 ? void 0 : validateZone(opts.tz, "billing_items.customRange");
20373
20402
  return customRangeQuery(
20374
20403
  http,
20375
20404
  "/V1.0/BillingItems/query",
20376
20405
  "itemDate",
20377
20406
  from,
20378
20407
  to,
20379
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _198 => _198.limit])),
20408
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _199 => _199.limit])),
20380
20409
  "billing_items.customRange",
20381
20410
  zone
20382
20411
  );
@@ -20408,7 +20437,7 @@ var BillingItemsResource = class extends BaseResource {
20408
20437
  }
20409
20438
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
20410
20439
  async get(id, opts = {}) {
20411
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _199 => _199.fresh]) === true);
20440
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _200 => _200.fresh]) === true);
20412
20441
  }
20413
20442
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
20414
20443
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -20600,9 +20629,9 @@ async function searchByDomain(_resource, domain, opts = {}, http) {
20600
20629
  return fetchCompanies(http, ids2, limit);
20601
20630
  }
20602
20631
  async function searchByIdentity(_resource, identity, opts = {}, http) {
20603
- const name = _nullishCoalesce(_optionalChain([identity, 'access', _200 => _200.companyName, 'optionalAccess', _201 => _201.trim, 'call', _202 => _202()]), () => ( ""));
20604
- const email = _nullishCoalesce(_optionalChain([identity, 'access', _203 => _203.email, 'optionalAccess', _204 => _204.trim, 'call', _205 => _205()]), () => ( ""));
20605
- const website = _nullishCoalesce(_optionalChain([identity, 'access', _206 => _206.website, 'optionalAccess', _207 => _207.trim, 'call', _208 => _208()]), () => ( ""));
20632
+ const name = _nullishCoalesce(_optionalChain([identity, 'access', _201 => _201.companyName, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203()]), () => ( ""));
20633
+ const email = _nullishCoalesce(_optionalChain([identity, 'access', _204 => _204.email, 'optionalAccess', _205 => _205.trim, 'call', _206 => _206()]), () => ( ""));
20634
+ const website = _nullishCoalesce(_optionalChain([identity, 'access', _207 => _207.website, 'optionalAccess', _208 => _208.trim, 'call', _209 => _209()]), () => ( ""));
20606
20635
  if (name === "" && email === "" && website === "") {
20607
20636
  throw new AutotaskConfigError("searchByIdentity: at least one of companyName / email / website is required");
20608
20637
  }
@@ -20741,7 +20770,7 @@ function validateUpsertInput(companyName, params) {
20741
20770
  if (typeof companyName !== "string" || companyName.trim() === "") {
20742
20771
  throw new AutotaskConfigError("upsertByName: companyName is required (a non-empty string)", { operation: OP_UPSERT_NAME });
20743
20772
  }
20744
- if (typeof _optionalChain([params, 'optionalAccess', _209 => _209.phone]) !== "string" || params.phone.trim() === "") {
20773
+ if (typeof _optionalChain([params, 'optionalAccess', _210 => _210.phone]) !== "string" || params.phone.trim() === "") {
20745
20774
  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 });
20746
20775
  }
20747
20776
  const companyType = _nullishCoalesce(params.companyType, () => ( DEFAULT_COMPANY_TYPE));
@@ -20913,7 +20942,7 @@ function formatUnknownNameList(names, cap = UNKNOWN_NAME_LIST_CAP) {
20913
20942
  const more = names.length > cap ? ` (and ${names.length - cap} more)` : "";
20914
20943
  return `${listed}${more}`;
20915
20944
  }
20916
- function collectFilterFieldNames(conditions, resourceKey) {
20945
+ function collectFilterFieldNames(conditions, resourceKey, operation = `${_nullishCoalesce(resourceKey, () => ( "resource"))}.query`) {
20917
20946
  const out = [];
20918
20947
  const walk = (conds) => {
20919
20948
  for (const cond of conds) {
@@ -20922,6 +20951,7 @@ function collectFilterFieldNames(conditions, resourceKey) {
20922
20951
  if (Array.isArray(cond.items)) walk(cond.items);
20923
20952
  continue;
20924
20953
  }
20954
+ assertUndottedUdfField(cond, operation);
20925
20955
  if (cond.udf === true) continue;
20926
20956
  if (typeof cond.field === "string" && cond.field.length > 0) {
20927
20957
  if (!cond.field.includes(".")) {
@@ -20929,8 +20959,8 @@ function collectFilterFieldNames(conditions, resourceKey) {
20929
20959
  continue;
20930
20960
  }
20931
20961
  if (resourceKey !== void 0) {
20932
- const parts = cond.field.split(".");
20933
- if (parts.length === 2 && selfPrefixes(resourceKey).includes(parts[0])) out.push(parts[1]);
20962
+ const own = normalizeOwnField(resourceKey, cond.field);
20963
+ if (own !== cond.field) out.push(own);
20934
20964
  }
20935
20965
  }
20936
20966
  }
@@ -20958,7 +20988,7 @@ function readIncludeNames(record, includeFields) {
20958
20988
  shapeOk = false;
20959
20989
  break;
20960
20990
  }
20961
- names.push(entry);
20991
+ names.push(normalizeOwnField(record.resource, entry));
20962
20992
  }
20963
20993
  }
20964
20994
  if (!shapeOk) {
@@ -20975,7 +21005,7 @@ function readIncludeNames(record, includeFields) {
20975
21005
  function resolveAuthority(record, live) {
20976
21006
  if (live !== null) return { known: live, authority: "the tenant's live entity field metadata" };
20977
21007
  const vendored = MODEL_FIELD_SETS[record.resource];
20978
- const liveOnlyExempt = Array.isArray(_optionalChain([record, 'access', _210 => _210.metadata, 'optionalAccess', _211 => _211.liveOnlyFields])) ? record.metadata.liveOnlyFields : [];
21008
+ const liveOnlyExempt = Array.isArray(_optionalChain([record, 'access', _211 => _211.metadata, 'optionalAccess', _212 => _212.liveOnlyFields])) ? record.metadata.liveOnlyFields : [];
20979
21009
  if (vendored === void 0) return void 0;
20980
21010
  return {
20981
21011
  known: [...vendored, ...liveOnlyExempt],
@@ -21014,7 +21044,7 @@ async function validateQueryFieldNames(record, holder, args) {
21014
21044
  let filterNames;
21015
21045
  if (bag["filter"] !== void 0) {
21016
21046
  const conditions = normalizedConditions(bag["filter"]);
21017
- filterNames = collectFilterFieldNames(_nullishCoalesce(conditions, () => ( [])), record.resource);
21047
+ filterNames = collectFilterFieldNames(_nullishCoalesce(conditions, () => ( [])), record.resource, record.id);
21018
21048
  }
21019
21049
  if (fieldCheck === false) return;
21020
21050
  const found = await findUnknownFieldNames(record, holder, { includeFields: _nullishCoalesce(includeNames, () => ( [])), filter: _nullishCoalesce(filterNames, () => ( [])) });
@@ -21038,11 +21068,11 @@ var CLOSED_STATUS_LABELS = ["complete", "completed", "closed", "cancelled", "can
21038
21068
  var OP = "tickets.statusSemantics";
21039
21069
  function picklistOf(fields) {
21040
21070
  if (!Array.isArray(fields)) return [];
21041
- const status = fields.find((f) => typeof _optionalChain([f, 'optionalAccess', _212 => _212.name]) === "string" && f.name.toLowerCase() === "status");
21071
+ const status = fields.find((f) => typeof _optionalChain([f, 'optionalAccess', _213 => _213.name]) === "string" && f.name.toLowerCase() === "status");
21042
21072
  if (status === void 0 || status.isPickList !== true || !Array.isArray(status.picklistValues)) return [];
21043
21073
  const out = [];
21044
21074
  for (const v of status.picklistValues) {
21045
- const id = Number(_optionalChain([v, 'optionalAccess', _213 => _213.value]));
21075
+ const id = Number(_optionalChain([v, 'optionalAccess', _214 => _214.value]));
21046
21076
  if (!Number.isSafeInteger(id)) continue;
21047
21077
  out.push({ id, label: typeof v.label === "string" ? v.label : "" });
21048
21078
  }
@@ -21058,11 +21088,11 @@ async function readFields(http, fresh) {
21058
21088
  if (hit !== void 0) return hit;
21059
21089
  }
21060
21090
  const res = await http.request({ method: "GET", path: "/V1.0/Tickets/entityInformation/fields", operation: OP, maxRetries: 0 });
21061
- const fields = _optionalChain([res, 'optionalAccess', _214 => _214.fields]);
21091
+ const fields = _optionalChain([res, 'optionalAccess', _215 => _215.fields]);
21062
21092
  if (!Array.isArray(fields)) {
21063
21093
  throw new AutotaskError("Expected the FieldInformationResultModel envelope { fields: [] }; got a different shape", { code: "INVALID_RESPONSE", category: "server" });
21064
21094
  }
21065
- if (fields.length > 0) _optionalChain([cache, 'optionalAccess', _215 => _215.set, 'call', _216 => _216(key, fields)]);
21095
+ if (fields.length > 0) _optionalChain([cache, 'optionalAccess', _216 => _216.set, 'call', _217 => _217(key, fields)]);
21066
21096
  return fields;
21067
21097
  }
21068
21098
  function assumed(allowAssumed, operation) {
@@ -21214,7 +21244,7 @@ async function readOpenTickets(http, companyID, ticketLimit, includeFields, stat
21214
21244
  closedStatus
21215
21245
  };
21216
21246
  if (openRows.length === 0) {
21217
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _217 => _217["tickets"], 'optionalAccess', _218 => _218.query]), [{ field: "companyID", op: "eq", value: companyID }, openLeaf]);
21247
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _218 => _218["tickets"], 'optionalAccess', _219 => _219.query]), [{ field: "companyID", op: "eq", value: companyID }, openLeaf]);
21218
21248
  if (stamp !== void 0) {
21219
21249
  openTickets = {
21220
21250
  items: openRows,
@@ -21384,7 +21414,7 @@ async function prepareCrmWrite(resource, input, http) {
21384
21414
  const rows = await readRows(http, "/V1.0/CompanyLocations/query", [{ field: "companyID", op: "eq", value: companyID }]);
21385
21415
  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) }));
21386
21416
  const active = items.filter((l) => l.isActive !== false);
21387
- const m = active.filter((l) => has(ct.city) && _optionalChain([l, 'access', _219 => _219.city, 'optionalAccess', _220 => _220.toLowerCase, 'call', _221 => _221()]) === String(ct.city).toLowerCase() || has(ct.postalCode) && l.postalCode === String(ct.postalCode));
21417
+ const m = active.filter((l) => has(ct.city) && _optionalChain([l, 'access', _220 => _220.city, 'optionalAccess', _221 => _221.toLowerCase, 'call', _222 => _222()]) === String(ct.city).toLowerCase() || has(ct.postalCode) && l.postalCode === String(ct.postalCode));
21388
21418
  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 };
21389
21419
  locations = { items, pick };
21390
21420
  if (input.intent === "add_contact" && pick.locationID === null) {
@@ -21419,7 +21449,7 @@ async function prepareCrmWrite(resource, input, http) {
21419
21449
  }
21420
21450
  }
21421
21451
  if (input.intent === "create_company" && status !== "matched") {
21422
- const eff = effectiveRequiredFields(null, _optionalChain([RELATIONSHIP_MAP, 'access', _222 => _222.companies, 'optionalAccess', _223 => _223.zoneFacts]));
21452
+ const eff = effectiveRequiredFields(null, _optionalChain([RELATIONSHIP_MAP, 'access', _223 => _223.companies, 'optionalAccess', _224 => _224.zoneFacts]));
21423
21453
  const research = (f) => ["companyType", "ownerResourceID", "countryID"].includes(f) ? "lookup" : "web_if_available_else_ask";
21424
21454
  const lookups = {
21425
21455
  companyType: { via: "operations.fieldCatalog", resource: "companies", field: "companyType", labels: true, note: "map the user wording to one returned label; never hardcode ids" },
@@ -21441,16 +21471,16 @@ async function prepareCrmWrite(resource, input, http) {
21441
21471
  }
21442
21472
  let next = null;
21443
21473
  const isInactive = (d) => d.isActive === false || d.isActive === 0;
21444
- const dups = _nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _224 => _224.duplicates]), () => ( []));
21474
+ const dups = _nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _225 => _225.duplicates]), () => ( []));
21445
21475
  const sameCompany = companyID === null ? dups : dups.filter((d) => d.companyID === companyID);
21446
21476
  const elsewhere = companyID === null ? [] : dups.filter((d) => d.companyID !== companyID && !isInactive(d));
21447
21477
  if (input.intent === "add_contact" && sameCompany.length === 0 && elsewhere.length > 0) {
21448
- needsInput.push({ field: "contact", why: `a contact with this ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _225 => _225.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" });
21478
+ needsInput.push({ field: "contact", why: `a contact with this ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _226 => _226.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" });
21449
21479
  }
21450
21480
  if (needsInput.length === 0) {
21451
21481
  const dup = sameCompany[0];
21452
21482
  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)' };
21453
- else if (input.intent === "add_contact") next = dup ? { operation: "contacts.update", note: `a contact already matches by ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _226 => _226.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', _227 => _227.pick, 'access', _228 => _228.locationID]))}` };
21483
+ else if (input.intent === "add_contact") next = dup ? { operation: "contacts.update", note: `a contact already matches by ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _227 => _227.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', _228 => _228.pick, 'access', _229 => _229.locationID]))}` };
21454
21484
  else if (input.intent === "update_contact") next = { operation: "contacts.update", note: "send only the changed fields" };
21455
21485
  else next = { operation: "companies.update", note: "send only the changed fields" };
21456
21486
  }
@@ -21570,7 +21600,7 @@ function validateUnbilledWorkOptions(companyId, opts) {
21570
21600
  var OP3 = "companies.unbilledWork";
21571
21601
  function unbilledWorkPartStatus(key, conditions, items) {
21572
21602
  if (items.length !== 0) return { status: "ok" };
21573
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _229 => _229[key], 'optionalAccess', _230 => _230.query]), conditions);
21603
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _230 => _230[key], 'optionalAccess', _231 => _231.query]), conditions);
21574
21604
  if (stamp !== void 0) return { status: "blind", blindSurface: stamp, note: stamp.note };
21575
21605
  return {
21576
21606
  status: "ok",
@@ -21835,7 +21865,7 @@ var CompaniesResource = class extends BaseResource {
21835
21865
  }
21836
21866
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
21837
21867
  async get(id, opts = {}) {
21838
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _231 => _231.fresh]) === true);
21868
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _232 => _232.fresh]) === true);
21839
21869
  }
21840
21870
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
21841
21871
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -21992,8 +22022,8 @@ function validateFetchManyItems(items, cap, opName = "fetchMany", capRef = `FETC
21992
22022
  problems.push(`${at}.fields: must be an array of exact vendor field names (discover them via operations.fieldCatalog)`);
21993
22023
  continue;
21994
22024
  }
21995
- if (_optionalChain([validation, 'optionalAccess', _232 => _232.fieldCheck]) !== false) {
21996
- const authoritative = _nullishCoalesce(_optionalChain([validation, 'optionalAccess', _233 => _233.fieldSetsByResource, 'optionalAccess', _234 => _234.get, 'call', _235 => _235(resourceKey)]), () => ( fields));
22025
+ if (_optionalChain([validation, 'optionalAccess', _233 => _233.fieldCheck]) !== false) {
22026
+ const authoritative = _nullishCoalesce(_optionalChain([validation, 'optionalAccess', _234 => _234.fieldSetsByResource, 'optionalAccess', _235 => _235.get, 'call', _236 => _236(resourceKey)]), () => ( fields));
21997
22027
  for (const f of item.fields) {
21998
22028
  if (!authoritative.includes(f)) {
21999
22029
  problems.push(
@@ -22099,7 +22129,7 @@ function project3(value, fields) {
22099
22129
  return out;
22100
22130
  }
22101
22131
  function resourcePathOf(key, holder) {
22102
- const path = _optionalChain([holder, 'optionalAccess', _236 => _236.resourcePath]);
22132
+ const path = _optionalChain([holder, 'optionalAccess', _237 => _237.resourcePath]);
22103
22133
  if (typeof path !== "string" || path === "") {
22104
22134
  throw new AutotaskConfigError(`fetchByIds: the client exposes no ${key} resource path (registry drift)`, {
22105
22135
  suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
@@ -22712,7 +22742,7 @@ var stampPart = (key, raw, conditions, extraNotes) => {
22712
22742
  status: st.status,
22713
22743
  blindSurface: st.blindSurface,
22714
22744
  note: [st.note, ..._nullishCoalesce(extraNotes, () => ( []))].filter(Boolean).join(" | ") || void 0,
22715
- emptyReason: raw.items.length === 0 && st.status === "ok" ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _237 => _237[key], 'optionalAccess', _238 => _238.query]) : void 0
22745
+ emptyReason: raw.items.length === 0 && st.status === "ok" ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _238 => _238[key], 'optionalAccess', _239 => _239.query]) : void 0
22716
22746
  };
22717
22747
  };
22718
22748
  function appendWiresNote(wires, note) {
@@ -22777,7 +22807,7 @@ async function resolveContractType(ctx, contractType) {
22777
22807
  if (contractType > 0) {
22778
22808
  ctx.wires.issued += 1;
22779
22809
  try {
22780
- contractTypeLabel = await _asyncNullishCoalesce(await _asyncOptionalChain([(await readPicklists(ctx.http, "/V1.0/Contracts", ctx.OP)), 'access', async _239 => _239.get, 'call', async _240 => _240("contractType"), 'optionalAccess', async _241 => _241.get, 'call', async _242 => _242(contractType)]), async () => ( null));
22810
+ contractTypeLabel = await _asyncNullishCoalesce(await _asyncOptionalChain([(await readPicklists(ctx.http, "/V1.0/Contracts", ctx.OP)), 'access', async _240 => _240.get, 'call', async _241 => _241("contractType"), 'optionalAccess', async _242 => _242.get, 'call', async _243 => _243(contractType)]), async () => ( null));
22781
22811
  } catch (err) {
22782
22812
  if (!(err instanceof AutotaskError)) throw err;
22783
22813
  }
@@ -22788,7 +22818,7 @@ async function resolveContractType(ctx, contractType) {
22788
22818
  return { contractTypeLabel, contractTypeKnown, isBlockHours, isTimeAndMaterials };
22789
22819
  }
22790
22820
  async function fetchRoot(ctx, resource) {
22791
- const contractCached = _optionalChain([ctx, 'access', _243 => _243.rawHttp, 'access', _244 => _244.readCache, 'optionalAccess', _245 => _245.get, 'call', _246 => _246(`/V1.0/Contracts/${ctx.id}`)]) !== void 0;
22821
+ const contractCached = _optionalChain([ctx, 'access', _244 => _244.rawHttp, 'access', _245 => _245.readCache, 'optionalAccess', _246 => _246.get, 'call', _247 => _247(`/V1.0/Contracts/${ctx.id}`)]) !== void 0;
22792
22822
  const contract = await resource.get(ctx.id);
22793
22823
  ctx.wires.issued += 1;
22794
22824
  if (!contractCached) ctx.wires.requests += 1;
@@ -23003,10 +23033,10 @@ async function fetchSubscriptions(ctx, cis) {
23003
23033
  const labels = await readSubscriptionLabels(ctx, subscriptions);
23004
23034
  for (const x of subscriptions) {
23005
23035
  const sid = num(x["id"]);
23006
- const periodLabel = _optionalChain([labels, 'optionalAccess', _247 => _247.get, 'call', _248 => _248("periodType"), 'optionalAccess', _249 => _249.get, 'call', _250 => _250(num(x["periodType"]))]);
23036
+ const periodLabel = _optionalChain([labels, 'optionalAccess', _248 => _248.get, 'call', _249 => _249("periodType"), 'optionalAccess', _250 => _250.get, 'call', _251 => _251(num(x["periodType"]))]);
23007
23037
  subFactor.set(sid, periodMonthlyFactor(x["periodType"], periodLabel));
23008
23038
  if (isOneTimePeriod(x["periodType"], periodLabel)) oneTimeSubs.add(sid);
23009
- const statusLabel = _optionalChain([labels, 'optionalAccess', _251 => _251.get, 'call', _252 => _252("status"), 'optionalAccess', _253 => _253.get, 'call', _254 => _254(num(x["status"]))]);
23039
+ const statusLabel = _optionalChain([labels, 'optionalAccess', _252 => _252.get, 'call', _253 => _253("status"), 'optionalAccess', _254 => _254.get, 'call', _255 => _255(num(x["status"]))]);
23010
23040
  const notActive = statusLabel !== void 0 ? NOT_ACTIVE_LABEL_RE.test(statusLabel) : labels === null && SUBSCRIPTION_NOT_ACTIVE_STATUS_IDS.has(num(x["status"]));
23011
23041
  if (notActive) cancelledSubs.add(sid);
23012
23042
  }
@@ -23707,7 +23737,7 @@ var ContractsResource = class extends BaseResource {
23707
23737
  }
23708
23738
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
23709
23739
  async get(id, opts = {}) {
23710
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _255 => _255.fresh]) === true);
23740
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _256 => _256.fresh]) === true);
23711
23741
  }
23712
23742
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
23713
23743
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -23743,7 +23773,7 @@ var ContractsResource = class extends BaseResource {
23743
23773
  /** Search Contract records: bounded contains on contractName (no vendor free-text search exists);
23744
23774
  * limit defaults to 25, max 500. */
23745
23775
  async search(query, opts) {
23746
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _256 => _256.limit]) });
23776
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _257 => _257.limit]) });
23747
23777
  }
23748
23778
  /** Node-parity special op (hand-written in src/resources/special/contracts.ts). */
23749
23779
  profitability(id, opts) {
@@ -23783,28 +23813,28 @@ async function pdf(_resource, id, http) {
23783
23813
  return decodeFileData(res);
23784
23814
  }
23785
23815
  async function windowQuery2(_resource, kind, http, opts) {
23786
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _257 => _257.now]), () => ( /* @__PURE__ */ new Date()));
23787
- const tz = _optionalChain([opts, 'optionalAccess', _258 => _258.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
23816
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _258 => _258.now]), () => ( /* @__PURE__ */ new Date()));
23817
+ const tz = _optionalChain([opts, 'optionalAccess', _259 => _259.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
23788
23818
  return dateWindowQuery(
23789
23819
  http,
23790
23820
  "/V1.0/Invoices/query",
23791
23821
  "invoiceDateTime",
23792
23822
  kind,
23793
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _259 => _259.limit])),
23823
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _260 => _260.limit])),
23794
23824
  `invoices.${kind}`,
23795
23825
  now,
23796
23826
  tz
23797
23827
  );
23798
23828
  }
23799
23829
  async function customRange2(_resource, from, to, http, opts) {
23800
- const zone = _optionalChain([opts, 'optionalAccess', _260 => _260.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
23830
+ const zone = _optionalChain([opts, 'optionalAccess', _261 => _261.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
23801
23831
  return customRangeQuery(
23802
23832
  http,
23803
23833
  "/V1.0/Invoices/query",
23804
23834
  "invoiceDateTime",
23805
23835
  from,
23806
23836
  to,
23807
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _261 => _261.limit])),
23837
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _262 => _262.limit])),
23808
23838
  "invoices.customRange",
23809
23839
  zone
23810
23840
  );
@@ -23836,7 +23866,7 @@ var InvoicesResource = class extends BaseResource {
23836
23866
  }
23837
23867
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
23838
23868
  async get(id, opts = {}) {
23839
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _262 => _262.fresh]) === true);
23869
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _263 => _263.fresh]) === true);
23840
23870
  }
23841
23871
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
23842
23872
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -23950,7 +23980,7 @@ var OrganizationalLevel1sResource = class extends BaseResource {
23950
23980
  }
23951
23981
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
23952
23982
  async get(id, opts = {}) {
23953
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _263 => _263.fresh]) === true);
23983
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _264 => _264.fresh]) === true);
23954
23984
  }
23955
23985
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
23956
23986
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24001,7 +24031,7 @@ var OrganizationalLevel2sResource = class extends BaseResource {
24001
24031
  }
24002
24032
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24003
24033
  async get(id, opts = {}) {
24004
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _264 => _264.fresh]) === true);
24034
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _265 => _265.fresh]) === true);
24005
24035
  }
24006
24036
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24007
24037
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24052,7 +24082,7 @@ var OrganizationalLevelAssociationsResource = class extends BaseResource {
24052
24082
  }
24053
24083
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24054
24084
  async get(id, opts = {}) {
24055
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _265 => _265.fresh]) === true);
24085
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _266 => _266.fresh]) === true);
24056
24086
  }
24057
24087
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24058
24088
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24124,7 +24154,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24124
24154
  if (typeof destination === "number" && destination < 1) {
24125
24155
  throw new AutotaskConfigError("transferOwnership: destinationResourceId must be a positive integer");
24126
24156
  }
24127
- const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _266 => _266.dryRun]), () => ( true));
24157
+ const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _267 => _267.dryRun]), () => ( true));
24128
24158
  const changes = [];
24129
24159
  const applied = [];
24130
24160
  for (const id of ids2) {
@@ -24133,7 +24163,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24133
24163
  method: "GET",
24134
24164
  path: `/V1.0/Companies/${id}`,
24135
24165
  operation: "resources.transferOwnership",
24136
- maxRetries: _optionalChain([opts, 'optionalAccess', _267 => _267.maxRetries])
24166
+ maxRetries: _optionalChain([opts, 'optionalAccess', _268 => _268.maxRetries])
24137
24167
  });
24138
24168
  const company = unwrapItem(res, id, void 0, "company");
24139
24169
  const current = typeof company.ownerResourceID === "number" ? company.ownerResourceID : null;
@@ -24144,7 +24174,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24144
24174
  path: "/V1.0/Companies",
24145
24175
  body: { id, ownerResourceID: destination },
24146
24176
  operation: "resources.transferOwnership",
24147
- maxRetries: _optionalChain([opts, 'optionalAccess', _268 => _268.maxRetries])
24177
+ maxRetries: _optionalChain([opts, 'optionalAccess', _269 => _269.maxRetries])
24148
24178
  });
24149
24179
  unwrapOperation(update);
24150
24180
  applied.push(id);
@@ -24213,7 +24243,7 @@ var ResourcesResource = class extends BaseResource {
24213
24243
  }
24214
24244
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24215
24245
  async get(id, opts = {}) {
24216
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _269 => _269.fresh]) === true);
24246
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _270 => _270.fresh]) === true);
24217
24247
  }
24218
24248
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
24219
24249
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -24241,7 +24271,7 @@ var ResourcesResource = class extends BaseResource {
24241
24271
  /** Search Resource records: bounded contains on firstName + lastName (no vendor free-text search exists);
24242
24272
  * limit defaults to 25, max 500. */
24243
24273
  async search(query, opts) {
24244
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _270 => _270.limit]) });
24274
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _271 => _271.limit]) });
24245
24275
  }
24246
24276
  /** Node-parity special op (hand-written in src/resources/special/resources.ts). */
24247
24277
  transferOwnership(sourceResourceIds, destinationResourceId, opts = {}) {
@@ -24276,7 +24306,7 @@ function uiHostFromBase(baseUrl) {
24276
24306
  } catch (e19) {
24277
24307
  return void 0;
24278
24308
  }
24279
- const n = _optionalChain([REST_HOST, 'access', _271 => _271.exec, 'call', _272 => _272(hostname), 'optionalAccess', _273 => _273[1]]);
24309
+ const n = _optionalChain([REST_HOST, 'access', _272 => _272.exec, 'call', _273 => _273(hostname), 'optionalAccess', _274 => _274[1]]);
24280
24310
  return n === void 0 ? void 0 : `ww${n}.autotask.net`;
24281
24311
  }
24282
24312
  function buildUiLink(input) {
@@ -24329,7 +24359,7 @@ async function postedStateOf(http, entries, op, beforeRequest) {
24329
24359
  let incomplete = false;
24330
24360
  for (let c = 0; c < ids2.length; c += FETCH_BY_IDS_CHUNK_SIZE) {
24331
24361
  const chunk = ids2.slice(c, c + FETCH_BY_IDS_CHUNK_SIZE);
24332
- _optionalChain([beforeRequest, 'optionalCall', _274 => _274()]);
24362
+ _optionalChain([beforeRequest, 'optionalCall', _275 => _275()]);
24333
24363
  const res = await http.request({
24334
24364
  method: "POST",
24335
24365
  idempotent: true,
@@ -24376,11 +24406,11 @@ async function queryTimeEntries(_resource, filter, limit, operation, http, curso
24376
24406
  return { items, hasMore: pageDetails.nextPageUrl != null, nextCursor: _nullishCoalesce(pageDetails.nextPageUrl, () => ( null)) };
24377
24407
  }
24378
24408
  function pagingOpts(opts, OP8) {
24379
- if (_optionalChain([opts, 'optionalAccess', _275 => _275.countOnly]) !== void 0 && typeof opts.countOnly !== "boolean") {
24409
+ if (_optionalChain([opts, 'optionalAccess', _276 => _276.countOnly]) !== void 0 && typeof opts.countOnly !== "boolean") {
24380
24410
  throw new AutotaskConfigError(`${OP8}: countOnly must be a boolean`, { operation: OP8 });
24381
24411
  }
24382
- const countOnly = _optionalChain([opts, 'optionalAccess', _276 => _276.countOnly]) === true;
24383
- const cursor = _optionalChain([opts, 'optionalAccess', _277 => _277.cursor]);
24412
+ const countOnly = _optionalChain([opts, 'optionalAccess', _277 => _277.countOnly]) === true;
24413
+ const cursor = _optionalChain([opts, 'optionalAccess', _278 => _278.cursor]);
24384
24414
  if (cursor !== void 0 && (typeof cursor !== "string" || cursor.trim() === "")) {
24385
24415
  throw new AutotaskConfigError(`${OP8}: cursor must be the non-empty nextCursor of a previous call`, { operation: OP8 });
24386
24416
  }
@@ -24390,9 +24420,9 @@ function pagingOpts(opts, OP8) {
24390
24420
  if (cursor !== void 0 && countOnly) {
24391
24421
  throw new AutotaskConfigError(`${OP8}: cursor does not apply with countOnly (countOnly reads every page itself)`, { operation: OP8 });
24392
24422
  }
24393
- const budget = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _278 => _278.maxVendorCalls]), () => ( COUNT_BUDGET_DEFAULT));
24423
+ const budget = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _279 => _279.maxVendorCalls]), () => ( COUNT_BUDGET_DEFAULT));
24394
24424
  if (!Number.isInteger(budget) || budget < 1 || budget > COUNT_BUDGET_MAX) {
24395
- throw new AutotaskConfigError(`${OP8}: maxVendorCalls must be an integer 1-${COUNT_BUDGET_MAX} (got ${String(_optionalChain([opts, 'optionalAccess', _279 => _279.maxVendorCalls]))})`, { operation: OP8 });
24425
+ throw new AutotaskConfigError(`${OP8}: maxVendorCalls must be an integer 1-${COUNT_BUDGET_MAX} (got ${String(_optionalChain([opts, 'optionalAccess', _280 => _280.maxVendorCalls]))})`, { operation: OP8 });
24396
24426
  }
24397
24427
  return { ...cursor === void 0 ? {} : { cursor }, countOnly, budget };
24398
24428
  }
@@ -24463,18 +24493,18 @@ async function countPostedState(http, filter, OP8, budget, window) {
24463
24493
  return { window, total: states.size, postedCount, unpostedCount: states.size - postedCount, vendorCalls: issued, estimate, budget };
24464
24494
  }
24465
24495
  async function windowQuery3(_resource, kind, http, opts) {
24466
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _280 => _280.now]), () => ( /* @__PURE__ */ new Date()));
24467
- const tz = _optionalChain([opts, 'optionalAccess', _281 => _281.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
24496
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _281 => _281.now]), () => ( /* @__PURE__ */ new Date()));
24497
+ const tz = _optionalChain([opts, 'optionalAccess', _282 => _282.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
24468
24498
  const { from, to } = dateOnlyWindowBounds(kind, now, tz);
24469
24499
  const filter = [
24470
24500
  { field: "dateWorked", op: "gte", value: from },
24471
24501
  { field: "dateWorked", op: "lte", value: to }
24472
24502
  ];
24473
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _282 => _282.limit])), `time_entries.${kind}`, http);
24503
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _283 => _283.limit])), `time_entries.${kind}`, http);
24474
24504
  return items;
24475
24505
  }
24476
24506
  async function customRange3(_resource, from, to, http, opts) {
24477
- if (_optionalChain([opts, 'optionalAccess', _283 => _283.tz]) !== void 0) validateZone(opts.tz, "time_entries.customRange");
24507
+ if (_optionalChain([opts, 'optionalAccess', _284 => _284.tz]) !== void 0) validateZone(opts.tz, "time_entries.customRange");
24478
24508
  const fromB = customRangeDay(from, "from", void 0, "customRange");
24479
24509
  const toB = customRangeDay(to, "to", void 0, "customRange");
24480
24510
  if (fromB.ms > toB.ms) {
@@ -24485,7 +24515,7 @@ async function customRange3(_resource, from, to, http, opts) {
24485
24515
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
24486
24516
  { field: "dateWorked", op: "lte", value: iso2(toEndMs) }
24487
24517
  ];
24488
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _284 => _284.limit])), "time_entries.customRange", http);
24518
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _285 => _285.limit])), "time_entries.customRange", http);
24489
24519
  return items;
24490
24520
  }
24491
24521
  async function postedStateQuery(_resource, mode, http, opts) {
@@ -24493,16 +24523,16 @@ async function postedStateQuery(_resource, mode, http, opts) {
24493
24523
  const paging = pagingOpts(opts, operation);
24494
24524
  const window = { from: null, to: null };
24495
24525
  const filter = [];
24496
- const fromB = _optionalChain([opts, 'optionalAccess', _285 => _285.dateFrom]) === void 0 ? void 0 : customRangeDay(opts.dateFrom, "from", void 0, operation);
24497
- const toB = _optionalChain([opts, 'optionalAccess', _286 => _286.dateTo]) === void 0 ? void 0 : customRangeDay(opts.dateTo, "to", void 0, operation);
24526
+ const fromB = _optionalChain([opts, 'optionalAccess', _286 => _286.dateFrom]) === void 0 ? void 0 : customRangeDay(opts.dateFrom, "from", void 0, operation);
24527
+ const toB = _optionalChain([opts, 'optionalAccess', _287 => _287.dateTo]) === void 0 ? void 0 : customRangeDay(opts.dateTo, "to", void 0, operation);
24498
24528
  if (fromB && toB && fromB.ms > toB.ms) {
24499
24529
  throw new AutotaskConfigError(`${operation}: dateFrom (${iso2(fromB.ms)}) must not be after dateTo (${iso2(toB.ms)})`, { operation });
24500
24530
  }
24501
24531
  if (fromB) filter.push({ field: "dateWorked", op: "gte", value: window.from = iso2(fromB.ms) });
24502
24532
  if (toB) filter.push({ field: "dateWorked", op: "lte", value: window.to = iso2(toB.ms + DAY_MS2 - 1) });
24503
- if (_optionalChain([opts, 'optionalAccess', _287 => _287.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
24533
+ if (_optionalChain([opts, 'optionalAccess', _288 => _288.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
24504
24534
  if (paging.countOnly) return countPostedState(http, filter, operation, paging.budget, window);
24505
- const read = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _288 => _288.limit])), operation, http, paging.cursor);
24535
+ const read = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _289 => _289.limit])), operation, http, paging.cursor);
24506
24536
  const { states, incomplete } = await postedStateOf(http, read.items, operation);
24507
24537
  const items = read.items.filter((e) => states.get(e.id) === mode);
24508
24538
  const approvedCount = items.filter(isApproved).length;
@@ -24512,7 +24542,7 @@ async function postedStateQuery(_resource, mode, http, opts) {
24512
24542
  async function postedWithin(_resource, from, to, http, opts, opLabel = "time_entries.postedWithin") {
24513
24543
  const OP8 = opLabel;
24514
24544
  const paging = pagingOpts(opts, OP8);
24515
- if (_optionalChain([opts, 'optionalAccess', _289 => _289.tz]) !== void 0) validateZone(opts.tz, OP8);
24545
+ if (_optionalChain([opts, 'optionalAccess', _290 => _290.tz]) !== void 0) validateZone(opts.tz, OP8);
24516
24546
  const fromB = customRangeDay(from, "from", void 0, OP8);
24517
24547
  const toB = customRangeDay(to, "to", void 0, OP8);
24518
24548
  if (fromB.ms > toB.ms) {
@@ -24523,11 +24553,11 @@ async function postedWithin(_resource, from, to, http, opts, opLabel = "time_ent
24523
24553
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
24524
24554
  { field: "dateWorked", op: "lte", value: iso2(windowToMs) }
24525
24555
  ];
24526
- if (_optionalChain([opts, 'optionalAccess', _290 => _290.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
24527
- if (_optionalChain([opts, 'optionalAccess', _291 => _291.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
24556
+ if (_optionalChain([opts, 'optionalAccess', _291 => _291.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
24557
+ if (_optionalChain([opts, 'optionalAccess', _292 => _292.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
24528
24558
  const window = { from: iso2(fromB.ms), to: iso2(windowToMs) };
24529
24559
  if (paging.countOnly) return countPostedState(http, filter, OP8, paging.budget, window);
24530
- const { items, hasMore, nextCursor } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _292 => _292.limit])), OP8, http, paging.cursor);
24560
+ const { items, hasMore, nextCursor } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _293 => _293.limit])), OP8, http, paging.cursor);
24531
24561
  const { states, incomplete } = await postedStateOf(http, items, OP8);
24532
24562
  let postedCount = 0;
24533
24563
  let unpostedCount = 0;
@@ -24535,7 +24565,7 @@ async function postedWithin(_resource, from, to, http, opts, opLabel = "time_ent
24535
24565
  if (state === "posted") postedCount += 1;
24536
24566
  else unpostedCount += 1;
24537
24567
  }
24538
- const keep = _optionalChain([opts, 'optionalAccess', _293 => _293.posted]) === void 0 ? void 0 : opts.posted ? "posted" : "unposted";
24568
+ const keep = _optionalChain([opts, 'optionalAccess', _294 => _294.posted]) === void 0 ? void 0 : opts.posted ? "posted" : "unposted";
24539
24569
  return {
24540
24570
  items: keep === void 0 ? items : items.filter((e) => states.get(e.id) === keep),
24541
24571
  postedCount,
@@ -24816,7 +24846,7 @@ async function assertResourceActive(http, rid) {
24816
24846
  async function resolveAllocationCode(http, rid, linkage, pins, departments) {
24817
24847
  let usedLinkage = linkage;
24818
24848
  const pinnedForCode = pins.code !== void 0 ? pins.code : pins.role;
24819
- let code = null;
24849
+ let code;
24820
24850
  const familiesTried = [];
24821
24851
  code = await resolveCode(http, familyOf(linkage), familyLabel(familyOf(linkage)), pinnedForCode, departments, OP5);
24822
24852
  familiesTried.push({ family: familyOf(linkage), label: familyLabel(familyOf(linkage)), filters: [{ field: "useType", op: "eq", value: familyOf(linkage) }, { field: "isActive", op: "eq", value: true }] });
@@ -24985,7 +25015,7 @@ function sameValue(a, b) {
24985
25015
  async function readTicket(http, id, retries, operation) {
24986
25016
  try {
24987
25017
  const res = await http.request({ method: "GET", path: `/V1.0/Tickets/${id}`, operation, maxRetries: retries });
24988
- const item = _optionalChain([res, 'optionalAccess', _294 => _294.item]);
25018
+ const item = _optionalChain([res, 'optionalAccess', _295 => _295.item]);
24989
25019
  return _nullishCoalesce(item, () => ( null));
24990
25020
  } catch (e) {
24991
25021
  if (isAutotaskError(e) && (e.httpStatus === 404 || e.code === "NOT_FOUND")) return null;
@@ -25030,7 +25060,7 @@ async function preview(http, spec, sourceId, toTicketId, opts) {
25030
25060
  const facts = {
25031
25061
  closedStatus: { closedIds: closedStatus.closedIds, source: closedStatus.source, note: closedStatus.note },
25032
25062
  sourceTicketId,
25033
- sourceCompanyID: _nullishCoalesce(_optionalChain([origin, 'optionalAccess', _295 => _295.companyID]), () => ( null)),
25063
+ sourceCompanyID: _nullishCoalesce(_optionalChain([origin, 'optionalAccess', _296 => _296.companyID]), () => ( null)),
25034
25064
  targetCompanyID: _nullishCoalesce(target.companyID, () => ( null)),
25035
25065
  companyChanged: origin === null ? null : origin.companyID !== target.companyID,
25036
25066
  contractChanged: origin === null ? null : (_nullishCoalesce(origin.contractID, () => ( null))) !== (_nullishCoalesce(target.contractID, () => ( null)))
@@ -25148,7 +25178,7 @@ var CONTRACT_SCOPED = ["contractID", "contractServiceID", "contractServiceBundle
25148
25178
  async function readTimeEntry(http, id, retries) {
25149
25179
  try {
25150
25180
  const res = await http.request({ method: "GET", path: `/V1.0/TimeEntries/${id}`, operation: OP6, maxRetries: retries });
25151
- return _nullishCoalesce(_optionalChain([res, 'optionalAccess', _296 => _296.item]), () => ( null));
25181
+ return _nullishCoalesce(_optionalChain([res, 'optionalAccess', _297 => _297.item]), () => ( null));
25152
25182
  } catch (e) {
25153
25183
  if (isAutotaskError(e) && (e.httpStatus === 404 || e.code === "NOT_FOUND")) return null;
25154
25184
  throw e;
@@ -25324,7 +25354,7 @@ var TimeEntriesResource = class extends BaseResource {
25324
25354
  }
25325
25355
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
25326
25356
  async get(id, opts = {}) {
25327
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _297 => _297.fresh]) === true);
25357
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _298 => _298.fresh]) === true);
25328
25358
  }
25329
25359
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
25330
25360
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -25636,4 +25666,5 @@ var TimeEntriesResource = class extends BaseResource {
25636
25666
 
25637
25667
 
25638
25668
 
25639
- 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.MaintenanceError = MaintenanceError; 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.UNSCOPED_WALK_THRESHOLD = UNSCOPED_WALK_THRESHOLD; exports.ScopeRequiredError = ScopeRequiredError; exports.READ_CACHE_MAX_ENTRIES = READ_CACHE_MAX_ENTRIES; exports.REFERENCE_TTL_MS = REFERENCE_TTL_MS; exports.REFERENCE_ENTITIES = REFERENCE_ENTITIES; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.fieldKey = fieldKey; exports.readTtlFor = readTtlFor; exports.TtlCache = TtlCache; 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.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.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_DEFAULT_LIMIT = BOUNDED_QUERY_DEFAULT_LIMIT; 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.MODEL_DATE_FIELDS = MODEL_DATE_FIELDS; 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.EXPAND_RESOURCE_NAMES_MAX_IDS = EXPAND_RESOURCE_NAMES_MAX_IDS; exports.expandResourceNames = expandResourceNames; exports.vendorId = vendorId; exports.resolveLineOfBusinessChain = resolveLineOfBusinessChain; 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.resolveCompositeNames = resolveCompositeNames; exports.readNamesOpt = readNamesOpt; exports.labelRows = labelRows; exports.validateWalkBag = validateWalkBag; 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;
25669
+
25670
+ 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.MaintenanceError = MaintenanceError; 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.UNSCOPED_WALK_THRESHOLD = UNSCOPED_WALK_THRESHOLD; exports.ScopeRequiredError = ScopeRequiredError; exports.READ_CACHE_MAX_ENTRIES = READ_CACHE_MAX_ENTRIES; exports.REFERENCE_TTL_MS = REFERENCE_TTL_MS; exports.REFERENCE_ENTITIES = REFERENCE_ENTITIES; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.fieldKey = fieldKey; exports.readTtlFor = readTtlFor; exports.TtlCache = TtlCache; 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.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.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_DEFAULT_LIMIT = BOUNDED_QUERY_DEFAULT_LIMIT; 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.MODEL_DATE_FIELDS = MODEL_DATE_FIELDS; exports.normalizeOwnField = normalizeOwnField; 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.EXPAND_RESOURCE_NAMES_MAX_IDS = EXPAND_RESOURCE_NAMES_MAX_IDS; exports.expandResourceNames = expandResourceNames; exports.vendorId = vendorId; exports.resolveLineOfBusinessChain = resolveLineOfBusinessChain; 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.resolveCompositeNames = resolveCompositeNames; exports.readNamesOpt = readNamesOpt; exports.labelRows = labelRows; exports.validateWalkBag = validateWalkBag; 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;