node-autotask 0.38.0 → 0.39.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 (39) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/MCP_TOOL_CATALOG.json +2 -2
  3. package/MCP_TOOL_MANIFEST.md +7 -7
  4. package/N8N_MCP_MANIFEST.json +2 -2
  5. package/N8N_MCP_MANIFEST.md +3 -3
  6. package/capabilities.json +1460 -1429
  7. package/capabilities.schema.json +2 -1
  8. package/dist/capabilities.cjs +2 -2
  9. package/dist/capabilities.d.cts +4 -4
  10. package/dist/capabilities.d.ts +4 -4
  11. package/dist/capabilities.js +1 -1
  12. package/dist/{chunk-U3K6IDKB.js → chunk-2KQS3RHQ.js} +1459 -1428
  13. package/dist/{chunk-IY5QZZVF.cjs → chunk-45PLS73K.cjs} +213 -135
  14. package/dist/{chunk-7FNKFNIJ.cjs → chunk-6ROB5KXB.cjs} +285 -285
  15. package/dist/{chunk-4QHGCYEI.js → chunk-FV5PJLIZ.js} +94 -16
  16. package/dist/{chunk-DCTUBUIZ.cjs → chunk-KSNK6UEW.cjs} +143 -143
  17. package/dist/{chunk-KPYXO7F5.js → chunk-LD5UPSDB.js} +2 -2
  18. package/dist/{chunk-IY3WCPCK.js → chunk-OKFTECIE.js} +2 -2
  19. package/dist/{chunk-73JMTV4O.cjs → chunk-RAZEXOLC.cjs} +1459 -1428
  20. package/dist/{index-BFbUB5YD.d.cts → index-BVOOHPvr.d.cts} +1 -1
  21. package/dist/{index-Q-4HQEEb.d.ts → index-Bmoiwhx2.d.ts} +1 -1
  22. package/dist/index.cjs +22 -22
  23. package/dist/index.d.cts +2 -2
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.js +4 -4
  26. package/dist/operations/index.cjs +179 -177
  27. package/dist/operations/index.d.cts +62 -13
  28. package/dist/operations/index.d.ts +62 -13
  29. package/dist/operations/index.js +4 -2
  30. package/dist/pool.cjs +9 -9
  31. package/dist/pool.d.cts +1 -1
  32. package/dist/pool.d.ts +1 -1
  33. package/dist/pool.js +4 -4
  34. package/dist/resources/index.cjs +4 -4
  35. package/dist/resources/index.d.cts +1 -1
  36. package/dist/resources/index.d.ts +1 -1
  37. package/dist/resources/index.js +3 -3
  38. package/docs/API.md +31 -6
  39. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;
2
2
 
3
- var _chunk73JMTV4Ocjs = require('./chunk-73JMTV4O.cjs');
3
+ var _chunkRAZEXOLCcjs = require('./chunk-RAZEXOLC.cjs');
4
4
 
5
5
 
6
6
  var _chunkMJTKK3QGcjs = require('./chunk-MJTKK3QG.cjs');
@@ -17853,7 +17853,7 @@ function buildEntityTypeMap() {
17853
17853
  }
17854
17854
  var ENTITY_TYPE_TO_RESOURCE = buildEntityTypeMap();
17855
17855
  var ENUMERABLE_RESOURCES = new Set(
17856
- _chunk73JMTV4Ocjs.CAPABILITIES.filter((rec) => rec.resource !== "operations" && (rec.operation === "query" || rec.operation === "get")).map(
17856
+ _chunkRAZEXOLCcjs.CAPABILITIES.filter((rec) => rec.resource !== "operations" && (rec.operation === "query" || rec.operation === "get")).map(
17857
17857
  (rec) => rec.resource
17858
17858
  )
17859
17859
  );
@@ -17878,7 +17878,8 @@ var WORKFLOW_RESOURCES = [
17878
17878
  // src/operations/fieldCatalog.ts
17879
17879
  var MAX_FIELD_CATALOG_WIRE = 60;
17880
17880
  var FIELD_CATALOG_HONESTY_NOTE = "Live field metadata reports the SHAPE of a field (existence, requiredness, type, maxLength, read-only, queryable, picklist-ness) as FLAGS and NAMES: picklist-ness as a flag (isPickList) and picklist field names (picklistFields). With the opt-in `labels: true`, picklist rows carry the vendor's exposed picklist VALUES (labels next to each value); without it the op serves no VALUES. It cannot resolve a picklist VALUE the vendor does not expose to this API user (the W-A4 wall \u2014 e.g. the attachments Type picklist): retrying the catalog will not surface a withheld value; that gap is vendor-side, not a client defect.";
17881
- var FIELD_CATALOG_OPT_KEYS = ["resources", "include", "fresh", "fields", "labels"];
17881
+ var MIN_FIELD_CATALOG_MAX_BYTES = 4096;
17882
+ var FIELD_CATALOG_OPT_KEYS = ["resources", "include", "fresh", "fields", "labels", "compact", "maxBytes"];
17882
17883
  function projectFieldRow(raw, labels = false, udf = false) {
17883
17884
  const r = typeof raw === "object" && raw !== null ? raw : {};
17884
17885
  const name = typeof r.name === "string" ? r.name : "";
@@ -17905,6 +17906,16 @@ function projectFieldRow(raw, labels = false, udf = false) {
17905
17906
  ...values !== void 0 ? { picklistValues: values } : {}
17906
17907
  };
17907
17908
  }
17909
+ function compactFieldRow(f, udf, keepValues) {
17910
+ return {
17911
+ name: f.name,
17912
+ type: f.type,
17913
+ isPickList: f.isPickList,
17914
+ isReference: f.referenceEntityType !== "",
17915
+ udf,
17916
+ ...keepValues && f.picklistValues !== void 0 ? { picklistValues: f.picklistValues } : {}
17917
+ };
17918
+ }
17908
17919
  function isObjectOrArrayType(type) {
17909
17920
  const t = type.trim().toLowerCase();
17910
17921
  return t === "object" || t === "array" || t === "collection" || t.endsWith("[]");
@@ -17930,7 +17941,7 @@ function capabilitySets() {
17930
17941
  const fieldOps = /* @__PURE__ */ new Map();
17931
17942
  const udfCapable = /* @__PURE__ */ new Set();
17932
17943
  const resources = /* @__PURE__ */ new Set();
17933
- for (const rec of _chunk73JMTV4Ocjs.CAPABILITIES) {
17944
+ for (const rec of _chunkRAZEXOLCcjs.CAPABILITIES) {
17934
17945
  if (rec.resource === "operations") continue;
17935
17946
  resources.add(rec.resource);
17936
17947
  if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
@@ -17942,7 +17953,7 @@ var derivedIndex = null;
17942
17953
  function derivedFieldsFor(resource) {
17943
17954
  if (derivedIndex === null) {
17944
17955
  derivedIndex = /* @__PURE__ */ new Map();
17945
- for (const rec of _chunk73JMTV4Ocjs.CAPABILITIES) {
17956
+ for (const rec of _chunkRAZEXOLCcjs.CAPABILITIES) {
17946
17957
  const declared = _optionalChain([rec, 'access', _136 => _136.metadata, 'optionalAccess', _137 => _137.derivedFields]);
17947
17958
  if (!Array.isArray(declared) || derivedIndex.has(rec.resource)) continue;
17948
17959
  const rows = [];
@@ -17972,7 +17983,7 @@ function apiEntityFor(rec) {
17972
17983
  function validateCatalogOptsShape(opts) {
17973
17984
  if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
17974
17985
  throw new AutotaskConfigError(
17975
- "fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean, fields?: string[], labels?: boolean }"
17986
+ "fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean, fields?: string[], labels?: boolean, compact?: boolean, maxBytes?: number }"
17976
17987
  );
17977
17988
  }
17978
17989
  for (const key of Object.keys(_nullishCoalesce(opts, () => ( {})))) {
@@ -18061,6 +18072,61 @@ function resolveLabels(opts) {
18061
18072
  }
18062
18073
  return _optionalChain([opts, 'optionalAccess', _142 => _142.labels]) === true;
18063
18074
  }
18075
+ function resolveSizeOpts(opts) {
18076
+ if (_optionalChain([opts, 'optionalAccess', _143 => _143.compact]) !== void 0 && typeof opts.compact !== "boolean") {
18077
+ throw new AutotaskConfigError(`fieldCatalog: opts.compact must be a boolean (got ${typeof opts.compact})`);
18078
+ }
18079
+ const maxBytes = _optionalChain([opts, 'optionalAccess', _144 => _144.maxBytes]);
18080
+ if (maxBytes !== void 0 && (typeof maxBytes !== "number" || !Number.isInteger(maxBytes) || maxBytes < MIN_FIELD_CATALOG_MAX_BYTES)) {
18081
+ throw new AutotaskConfigError(
18082
+ `fieldCatalog: opts.maxBytes must be an integer >= ${MIN_FIELD_CATALOG_MAX_BYTES} (got ${String(maxBytes)})`
18083
+ );
18084
+ }
18085
+ return { compact: _optionalChain([opts, 'optionalAccess', _145 => _145.compact]) === true, maxBytes };
18086
+ }
18087
+ var jsonBytes = (v) => Buffer.byteLength(JSON.stringify(v), "utf8");
18088
+ var TRIM_KINDS = ["udf", "fields", "picklistFields", "queryable", "readOnly", "required"];
18089
+ function applyMaxBytes(result, maxBytes) {
18090
+ const fullBytes = jsonBytes(result);
18091
+ if (fullBytes <= maxBytes) return;
18092
+ result.truncated = true;
18093
+ const omitted = /* @__PURE__ */ new Map();
18094
+ const truncation = { reason: "maxBytes", maxBytes, fullBytes, omitted: [], note: "" };
18095
+ result.truncation = truncation;
18096
+ const lists = [];
18097
+ for (const kind of TRIM_KINDS.slice(0, 2)) {
18098
+ for (let i = result.rows.length - 1; i >= 0; i--) {
18099
+ const row = result.rows[i];
18100
+ if (Array.isArray(row[kind])) lists.push({ resource: row.resource, kind, list: row[kind] });
18101
+ }
18102
+ }
18103
+ for (const kind of TRIM_KINDS.slice(2)) {
18104
+ for (let i = result.rows.length - 1; i >= 0; i--) lists.push({ resource: result.rows[i].resource, kind, list: result.rows[i][kind] });
18105
+ }
18106
+ for (; ; ) {
18107
+ truncation.omitted = [...omitted.values()];
18108
+ const rowsDropped = truncation.omitted.filter((o) => o.kind === "fields" || o.kind === "udf").reduce((a, o) => a + o.count, 0);
18109
+ const namesDropped = truncation.omitted.length > 0 && truncation.omitted.some((o) => o.kind !== "fields" && o.kind !== "udf");
18110
+ truncation.note = `${rowsDropped} field row(s) omitted to fit maxBytes ${maxBytes} (the full result is ${fullBytes} bytes); ` + (namesDropped ? "the row name lists were trimmed as well (see omitted). " : "the row name lists (required, readOnly, queryable, picklistFields) still name every field. ") + `Narrow with fields: [...], ${result.compact ? "" : "use compact: true, "}or raise maxBytes.`;
18111
+ let bytes = jsonBytes(result);
18112
+ if (bytes <= maxBytes) return;
18113
+ if (lists.every((l) => l.list.length === 0)) {
18114
+ throw new AutotaskConfigError(
18115
+ `fieldCatalog: maxBytes ${maxBytes} cannot hold this result: with every field row and name list dropped it is still ${bytes} bytes for ${result.rows.length} resource row(s); request fewer resources or raise maxBytes`
18116
+ );
18117
+ }
18118
+ for (const { resource, kind, list } of lists) {
18119
+ while (list.length > 0 && bytes > maxBytes) {
18120
+ bytes -= jsonBytes(list.pop()) + 1;
18121
+ const key = `${resource}:${kind}`;
18122
+ const entry = _nullishCoalesce(omitted.get(key), () => ( { resource, kind, count: 0 }));
18123
+ entry.count += 1;
18124
+ omitted.set(key, entry);
18125
+ }
18126
+ if (bytes <= maxBytes) break;
18127
+ }
18128
+ }
18129
+ }
18064
18130
  function assertWithinWireCap(targetCount, kindCount) {
18065
18131
  const cost = targetCount * kindCount;
18066
18132
  if (cost > MAX_FIELD_CATALOG_WIRE) {
@@ -18072,9 +18138,9 @@ function assertWithinWireCap(targetCount, kindCount) {
18072
18138
  }
18073
18139
  function kindFetches(holder, resource) {
18074
18140
  return {
18075
- info: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _143 => _143.getEntityInfo, 'optionalCall', _144 => _144()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getEntityInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18076
- fields: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _145 => _145.getFieldInfo, 'optionalCall', _146 => _146()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getFieldInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18077
- udf: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _147 => _147.getUdfInfo, 'optionalCall', _148 => _148()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getUdfInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" }))))
18141
+ info: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _146 => _146.getEntityInfo, 'optionalCall', _147 => _147()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getEntityInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18142
+ fields: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _148 => _148.getFieldInfo, 'optionalCall', _149 => _149()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getFieldInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" })))),
18143
+ udf: () => _nullishCoalesce(_optionalChain([holder, 'optionalAccess', _150 => _150.getUdfInfo, 'optionalCall', _151 => _151()]), () => ( Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getUdfInfo read for "${resource}"`, { code: "INVALID_RESPONSE", category: "server" }))))
18078
18144
  };
18079
18145
  }
18080
18146
  async function sweepResource(ctx, resource, tally) {
@@ -18100,7 +18166,7 @@ async function sweepResource(ctx, resource, tally) {
18100
18166
  error: null
18101
18167
  };
18102
18168
  const fetches = kindFetches(holder, resource);
18103
- if (fresh) _optionalChain([cache, 'optionalAccess', _149 => _149.invalidate, 'call', _150 => _150(resource)]);
18169
+ if (fresh) _optionalChain([cache, 'optionalAccess', _152 => _152.invalidate, 'call', _153 => _153(resource)]);
18104
18170
  const projectList = (kind, list) => {
18105
18171
  const projected = list.map((f) => projectFieldRow(f, labels, kind === "udf"));
18106
18172
  if (kind === "fields") applyFieldsFilter(projected, fieldsFilter, row);
@@ -18142,11 +18208,16 @@ async function sweepResource(ctx, resource, tally) {
18142
18208
  }
18143
18209
  }
18144
18210
  row.cache = allCached ? { hit: true, age: ages.length > 0 ? Math.max(...ages) : 0 } : { hit: false, age: null };
18211
+ if (ctx.compact) {
18212
+ const keepValues = labels && fieldsFilter !== void 0;
18213
+ if (row.fields !== void 0) row.fields = row.fields.map((f) => compactFieldRow(f, false, keepValues));
18214
+ if (Array.isArray(row.udf)) row.udf = row.udf.map((f) => compactFieldRow(f, true, keepValues));
18215
+ }
18145
18216
  const declared = derivedFieldsFor(resource);
18146
18217
  if (declared.length > 0) {
18147
18218
  const byField = new Map(declared.map((d) => [d.field, d]));
18148
18219
  row.derivedFields = declared;
18149
- for (const field of _nullishCoalesce(row.fields, () => ( []))) {
18220
+ for (const field of ctx.compact ? [] : _nullishCoalesce(row.fields, () => ( []))) {
18150
18221
  const derivation = byField.get(field.name);
18151
18222
  if (derivation === void 0) continue;
18152
18223
  field.derived = {
@@ -18164,22 +18235,24 @@ async function fieldCatalog(client, opts) {
18164
18235
  const targets = resolveTargets(opts, fieldOps, allResources);
18165
18236
  const fieldsFilter = resolveFieldsFilter(opts);
18166
18237
  const labels = resolveLabels(opts);
18238
+ const { compact, maxBytes } = resolveSizeOpts(opts);
18167
18239
  assertWithinWireCap(targets.length, include.length);
18168
18240
  const cache = client.http.fieldCache;
18169
18241
  const zone = _nullishCoalesce(client.config.zone, () => ( "unknown"));
18170
18242
  const rows = [];
18171
18243
  const tally = { wireUsed: 0, anyPicklistValues: false };
18172
- const ctx = { client, include, fieldsFilter, labels, fresh: _optionalChain([opts, 'optionalAccess', _151 => _151.fresh]) === true, fieldOps, udfCapable };
18244
+ const ctx = { client, include, fieldsFilter, labels, compact, fresh: _optionalChain([opts, 'optionalAccess', _154 => _154.fresh]) === true, fieldOps, udfCapable };
18173
18245
  for (const resource of targets) {
18174
18246
  const row = await sweepResource(ctx, resource, tally);
18175
18247
  if (row !== void 0) rows.push(row);
18176
18248
  }
18177
- return {
18249
+ const result = {
18178
18250
  zone,
18179
18251
  label: zone,
18180
18252
  cached: cache !== void 0,
18181
18253
  labels,
18182
- ttlMs: _nullishCoalesce(_optionalChain([cache, 'optionalAccess', _152 => _152.ttlMs]), () => ( null)),
18254
+ compact,
18255
+ ttlMs: _nullishCoalesce(_optionalChain([cache, 'optionalAccess', _155 => _155.ttlMs]), () => ( null)),
18183
18256
  fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
18184
18257
  rows,
18185
18258
  wireUsed: tally.wireUsed,
@@ -18196,6 +18269,8 @@ async function fieldCatalog(client, opts) {
18196
18269
  note: FIELD_CATALOG_HONESTY_NOTE
18197
18270
  }
18198
18271
  };
18272
+ if (maxBytes !== void 0) applyMaxBytes(result, maxBytes);
18273
+ return result;
18199
18274
  }
18200
18275
 
18201
18276
  // src/field-sets.ts
@@ -18450,7 +18525,7 @@ function blindEmptyReason(stamp) {
18450
18525
  };
18451
18526
  }
18452
18527
  function attachUpdateTargetMissReason(err, key) {
18453
- const pinned = _optionalChain([EMPTY_REASON_STAMPS, 'access', _153 => _153[key], 'optionalAccess', _154 => _154.update]);
18528
+ const pinned = _optionalChain([EMPTY_REASON_STAMPS, 'access', _156 => _156[key], 'optionalAccess', _157 => _157.update]);
18454
18529
  if (pinned === void 0) return;
18455
18530
  err.details = { ..._nullishCoalesce(err.details, () => ( {})), emptyReason: pinned };
18456
18531
  }
@@ -18753,7 +18828,7 @@ var QueryBase = class {
18753
18828
  }
18754
18829
  /** @internal */
18755
18830
  walkPageSize(params) {
18756
- return clampPageSize(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _155 => _155.maxRecords]), () => ( this.defaultPageSize)));
18831
+ return clampPageSize(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _158 => _158.maxRecords]), () => ( this.defaultPageSize)));
18757
18832
  }
18758
18833
  /** Issue #281: relation filters (`ticket.<field>` …) resolve before a walk,
18759
18834
  * through the same rewrite as queryBounded / count. `undefined` = no parent
@@ -18761,7 +18836,7 @@ var QueryBase = class {
18761
18836
  async relationWalkParams(params, op) {
18762
18837
  const p = _nullishCoalesce(params, () => ( {}));
18763
18838
  const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(p.filter), op);
18764
- if (_optionalChain([relation, 'optionalAccess', _156 => _156.never]) === true) return void 0;
18839
+ if (_optionalChain([relation, 'optionalAccess', _159 => _159.never]) === true) return void 0;
18765
18840
  return relation === void 0 ? p : { ...p, filter: relation.conditions };
18766
18841
  }
18767
18842
  /**
@@ -18836,19 +18911,19 @@ var QueryBase = class {
18836
18911
  "queryBounded: params must be an object { filter?, limit?, latest?, includeFields? } \u2014 a bare conditions array is not accepted (wrap it: { filter: [...] })"
18837
18912
  );
18838
18913
  }
18839
- const limit = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _157 => _157.limit]), () => ( BOUNDED_QUERY_DEFAULT_LIMIT));
18914
+ const limit = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _160 => _160.limit]), () => ( BOUNDED_QUERY_DEFAULT_LIMIT));
18840
18915
  if (!Number.isInteger(limit) || limit < 1 || limit > BOUNDED_QUERY_MAX_LIMIT) {
18841
18916
  throw new AutotaskConfigError(
18842
18917
  `queryBounded: limit must be an integer 1..${BOUNDED_QUERY_MAX_LIMIT} (got ${String(limit)}) \u2014 it is the TOTAL record cap, not a page size`
18843
18918
  );
18844
18919
  }
18845
- const noteChars = _optionalChain([params, 'optionalAccess', _158 => _158.noteChars]);
18920
+ const noteChars = _optionalChain([params, 'optionalAccess', _161 => _161.noteChars]);
18846
18921
  if (noteChars !== void 0 && (!Number.isInteger(noteChars) || noteChars < 1)) {
18847
18922
  throw new AutotaskConfigError(
18848
18923
  `queryBounded: noteChars must be an integer >= 1 (got ${String(noteChars)}) \u2014 it is the per-field char cap on the untrusted-class free-text fields (absent = the raw, untruncated result)`
18849
18924
  );
18850
18925
  }
18851
- let walkParams = _optionalChain([params, 'optionalAccess', _159 => _159.fieldsPreset]) !== void 0 ? { ...params, includeFields: resolveFieldsPreset(params.fieldsPreset, this.config.key, params.includeFields) } : _nullishCoalesce(params, () => ( {}));
18926
+ let walkParams = _optionalChain([params, 'optionalAccess', _162 => _162.fieldsPreset]) !== void 0 ? { ...params, includeFields: resolveFieldsPreset(params.fieldsPreset, this.config.key, params.includeFields) } : _nullishCoalesce(params, () => ( {}));
18852
18927
  const latest = walkParams.latest;
18853
18928
  if (latest !== void 0) {
18854
18929
  if (!Number.isInteger(latest) || latest < 1 || latest > BOUNDED_QUERY_MAX_LIMIT) {
@@ -18856,14 +18931,14 @@ var QueryBase = class {
18856
18931
  `queryBounded: latest must be an integer 1..${BOUNDED_QUERY_MAX_LIMIT} (got ${String(latest)}) \u2014 it is the count of the highest-id rows to return`
18857
18932
  );
18858
18933
  }
18859
- if (_optionalChain([params, 'optionalAccess', _160 => _160.limit]) !== void 0 && limit < latest) {
18934
+ if (_optionalChain([params, 'optionalAccess', _163 => _163.limit]) !== void 0 && limit < latest) {
18860
18935
  throw new AutotaskConfigError(
18861
18936
  `queryBounded: limit (${String(limit)}) must be >= latest (${String(latest)}) \u2014 latest governs the returned count and limit is the walk window`
18862
18937
  );
18863
18938
  }
18864
18939
  }
18865
18940
  const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(walkParams.filter), `${this.config.key}.query`);
18866
- if (_optionalChain([relation, 'optionalAccess', _161 => _161.never]) === true) return { items: [], fetched: 0, hasMore: false, pagesWalked: 0, relationNote: relation.note };
18941
+ if (_optionalChain([relation, 'optionalAccess', _164 => _164.never]) === true) return { items: [], fetched: 0, hasMore: false, pagesWalked: 0, relationNote: relation.note };
18867
18942
  if (relation !== void 0) walkParams = { ...walkParams, filter: relation.conditions };
18868
18943
  if (latest !== void 0) {
18869
18944
  return this.applyNoteChars(await this.latestWalk(walkParams, Math.max(limit, latest), latest), noteChars);
@@ -18947,8 +19022,8 @@ var QueryBase = class {
18947
19022
  * @internal */
18948
19023
  stampEmptyQueryResult(result, params) {
18949
19024
  if (result.items.length !== 0) return;
18950
- result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _162 => _162[this.config.key], 'optionalAccess', _163 => _163.query]), _optionalChain([params, 'optionalAccess', _164 => _164.filter]));
18951
- const pinnedReason = normalizedConditions(_optionalChain([params, 'optionalAccess', _165 => _165.filter])) === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _166 => _166[this.config.key], 'optionalAccess', _167 => _167.query]) : void 0;
19025
+ result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _165 => _165[this.config.key], 'optionalAccess', _166 => _166.query]), _optionalChain([params, 'optionalAccess', _167 => _167.filter]));
19026
+ const pinnedReason = normalizedConditions(_optionalChain([params, 'optionalAccess', _168 => _168.filter])) === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _169 => _169[this.config.key], 'optionalAccess', _170 => _170.query]) : void 0;
18952
19027
  if (result.blindSurface !== void 0 || pinnedReason !== void 0) {
18953
19028
  result.emptyReason = result.blindSurface !== void 0 ? blindEmptyReason(result.blindSurface) : pinnedReason;
18954
19029
  }
@@ -19177,7 +19252,7 @@ var QueryBase = class {
19177
19252
  if (result.items.length === 0) {
19178
19253
  this.stampEmptyQueryResult(result, params);
19179
19254
  } else {
19180
- result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _168 => _168[this.config.key], 'optionalAccess', _169 => _169.query]), params.filter);
19255
+ result.blindSurface = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _171 => _171[this.config.key], 'optionalAccess', _172 => _172.query]), params.filter);
19181
19256
  }
19182
19257
  return result;
19183
19258
  }
@@ -19218,9 +19293,9 @@ var QueryBase = class {
19218
19293
  * or, on a plan-pinned blind surface, the `{ count: 0, blindSurface }`
19219
19294
  * typed sentinel (S12-C T10; see `BlindCountResult`). */
19220
19295
  async countGlobal(params) {
19221
- const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(_optionalChain([params, 'optionalAccess', _170 => _170.filter])), `${this.config.key}.count`);
19222
- if (_optionalChain([relation, 'optionalAccess', _171 => _171.never]) === true) return 0;
19223
- const conditions = relation !== void 0 ? relation.conditions : normalizedConditions(_optionalChain([params, 'optionalAccess', _172 => _172.filter]));
19296
+ const relation = await rewriteRelationFilters(this.http, this.config.key, normalizedConditions(_optionalChain([params, 'optionalAccess', _173 => _173.filter])), `${this.config.key}.count`);
19297
+ if (_optionalChain([relation, 'optionalAccess', _174 => _174.never]) === true) return 0;
19298
+ const conditions = relation !== void 0 ? relation.conditions : normalizedConditions(_optionalChain([params, 'optionalAccess', _175 => _175.filter]));
19224
19299
  const body = {};
19225
19300
  body.filter = conditions === void 0 ? [] : buildFilter(conditions).filter;
19226
19301
  const res = await this.http.request({
@@ -19231,9 +19306,9 @@ var QueryBase = class {
19231
19306
  idempotent: true
19232
19307
  });
19233
19308
  const count = unwrapQueryCount(res, `${this.config.key}.count`);
19234
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _173 => _173[this.config.key], 'optionalAccess', _174 => _174.count]), _optionalChain([params, 'optionalAccess', _175 => _175.filter]));
19309
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _176 => _176[this.config.key], 'optionalAccess', _177 => _177.count]), _optionalChain([params, 'optionalAccess', _178 => _178.filter]));
19235
19310
  if (count === 0) {
19236
- const pinnedReason = conditions === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _176 => _176[this.config.key], 'optionalAccess', _177 => _177.count]) : void 0;
19311
+ const pinnedReason = conditions === void 0 ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _179 => _179[this.config.key], 'optionalAccess', _180 => _180.count]) : void 0;
19237
19312
  if (stamp !== void 0 || pinnedReason !== void 0) {
19238
19313
  return {
19239
19314
  count,
@@ -19269,9 +19344,9 @@ var MetaBase = class extends QueryBase {
19269
19344
  const hit = cache.get(path);
19270
19345
  if (hit !== void 0) return hit;
19271
19346
  }
19272
- const epoch = _optionalChain([cache, 'optionalAccess', _178 => _178.epoch]);
19347
+ const epoch = _optionalChain([cache, 'optionalAccess', _181 => _181.epoch]);
19273
19348
  const res = await this.http.request({ method: "GET", path, operation });
19274
- _optionalChain([cache, 'optionalAccess', _179 => _179.set, 'call', _180 => _180(path, res, resource, epoch)]);
19349
+ _optionalChain([cache, 'optionalAccess', _182 => _182.set, 'call', _183 => _183(path, res, resource, epoch)]);
19275
19350
  return res;
19276
19351
  }
19277
19352
  /**
@@ -19311,7 +19386,7 @@ var MetaBase = class extends QueryBase {
19311
19386
  return value;
19312
19387
  });
19313
19388
  work.catch((err) => {
19314
- if (err instanceof AutotaskError && (err.code === "INVALID_RESPONSE" || _optionalChain([err, 'access', _181 => _181.details, 'optionalAccess', _182 => _182.deterministic]) === true)) {
19389
+ if (err instanceof AutotaskError && (err.code === "INVALID_RESPONSE" || _optionalChain([err, 'access', _184 => _184.details, 'optionalAccess', _185 => _185.deterministic]) === true)) {
19315
19390
  cache.invalidate(key);
19316
19391
  }
19317
19392
  });
@@ -19341,7 +19416,7 @@ var MetaBase = class extends QueryBase {
19341
19416
  path: `${this.resourcePath}/${numeric}`,
19342
19417
  operation: `${this.config.key}.get`,
19343
19418
  skipResponseRedaction: true,
19344
- maxRetries: _optionalChain([readOpts, 'optionalAccess', _183 => _183.maxRetries])
19419
+ maxRetries: _optionalChain([readOpts, 'optionalAccess', _186 => _186.maxRetries])
19345
19420
  });
19346
19421
  return unwrapItem(res, numeric, `${this.config.key}.get`, this.entityName);
19347
19422
  }
@@ -19360,7 +19435,7 @@ var MetaBase = class extends QueryBase {
19360
19435
  path: this.scopedItemPath(parentId, numeric),
19361
19436
  operation: `${this.config.key}.get`,
19362
19437
  skipResponseRedaction: true,
19363
- maxRetries: _optionalChain([readOpts, 'optionalAccess', _184 => _184.maxRetries])
19438
+ maxRetries: _optionalChain([readOpts, 'optionalAccess', _187 => _187.maxRetries])
19364
19439
  });
19365
19440
  return unwrapItem(res, numeric, `${this.config.key}.get`, this.entityName);
19366
19441
  }
@@ -19569,12 +19644,12 @@ var MetaBase = class extends QueryBase {
19569
19644
  return null;
19570
19645
  }
19571
19646
  }
19572
- const epoch = _optionalChain([cache, 'optionalAccess', _185 => _185.epoch]);
19647
+ const epoch = _optionalChain([cache, 'optionalAccess', _188 => _188.epoch]);
19573
19648
  try {
19574
19649
  return await this.fetchRecordRaw(entityPath, referenceId);
19575
19650
  } catch (err) {
19576
19651
  if (err instanceof NotFoundError) {
19577
- _optionalChain([cache, 'optionalAccess', _186 => _186.set, 'call', _187 => _187(absentKey, CONTEXT_ABSENT_MARKER, RESOURCE_KEY_BY_PATH[entityPath], epoch)]);
19652
+ _optionalChain([cache, 'optionalAccess', _189 => _189.set, 'call', _190 => _190(absentKey, CONTEXT_ABSENT_MARKER, RESOURCE_KEY_BY_PATH[entityPath], epoch)]);
19578
19653
  return null;
19579
19654
  }
19580
19655
  throw err;
@@ -19691,7 +19766,7 @@ var MetaBase = class extends QueryBase {
19691
19766
  missDetail(operator, fields) {
19692
19767
  const key = this.config.key;
19693
19768
  const probe = fields.map((field) => ({ field, op: operator, value: "" }));
19694
- const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _188 => _188[key], 'optionalAccess', _189 => _189.query]), probe);
19769
+ const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _191 => _191[key], 'optionalAccess', _192 => _192.query]), probe);
19695
19770
  const next = [];
19696
19771
  if (blind !== void 0) {
19697
19772
  next.push(`This surface is blind to records the API user does not own, so a miss is not proof of absence: ${blind.authority} returns the record when the id is known.`);
@@ -20320,7 +20395,7 @@ var MutationBase = class extends MetaBase {
20320
20395
  }
20321
20396
  }
20322
20397
  if (isRecord2(data)) {
20323
- const eff = effectiveRequiredFields(void 0, _nullishCoalesce(_optionalChain([RELATIONSHIP_MAP, 'access', _190 => _190[this.config.key], 'optionalAccess', _191 => _191.zoneFacts]), () => ( null)));
20398
+ const eff = effectiveRequiredFields(void 0, _nullishCoalesce(_optionalChain([RELATIONSHIP_MAP, 'access', _193 => _193[this.config.key], 'optionalAccess', _194 => _194.zoneFacts]), () => ( null)));
20324
20399
  const missing = eff.fields.filter((f) => f !== this.config.parentField && data[f] === void 0);
20325
20400
  if (missing.length > 0) {
20326
20401
  warnings.push(`required field(s) not in the data: ${missing.join(", ")} (${eff.from}); the vendor would likely reject the create`);
@@ -20360,7 +20435,7 @@ var MutationBase = class extends MetaBase {
20360
20435
  current = parentId === void 0 ? await this.getGlobal(id, true) : this.config.attachmentGet ? await this.getScopedModel(parentId, id, true) : await this.getScopedRaw(parentId, id, true);
20361
20436
  } catch (err) {
20362
20437
  if (err instanceof NotFoundError) {
20363
- const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _192 => _192[this.config.key], 'optionalAccess', _193 => _193.update]);
20438
+ const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _195 => _195[this.config.key], 'optionalAccess', _196 => _196.update]);
20364
20439
  checks.push({
20365
20440
  name: "current-record-exists",
20366
20441
  ok: false,
@@ -20720,7 +20795,7 @@ async function resolveCompositeNames(http, plan, opts = {}) {
20720
20795
  } else {
20721
20796
  for (const f of plan.labelFields) {
20722
20797
  const frow = row.fields.find((x) => x.name === f);
20723
- picklists[f] = _optionalChain([frow, 'optionalAccess', _194 => _194.picklistValues]);
20798
+ picklists[f] = _optionalChain([frow, 'optionalAccess', _197 => _197.picklistValues]);
20724
20799
  }
20725
20800
  }
20726
20801
  } catch (err) {
@@ -20754,8 +20829,8 @@ async function resolveCompositeNames(http, plan, opts = {}) {
20754
20829
  return {
20755
20830
  section,
20756
20831
  lineOfBusiness: lineOfBusiness2,
20757
- resourceName: (id) => _nullishCoalesce(_optionalChain([section, 'access', _195 => _195.rows, 'access', _196 => _196[`resource:${id}`], 'optionalAccess', _197 => _197.name]), () => ( null)),
20758
- recordName: (table, id) => _nullishCoalesce(_optionalChain([section, 'access', _198 => _198.rows, 'access', _199 => _199[`${table}:${id}`], 'optionalAccess', _200 => _200.name]), () => ( null)),
20832
+ resourceName: (id) => _nullishCoalesce(_optionalChain([section, 'access', _198 => _198.rows, 'access', _199 => _199[`resource:${id}`], 'optionalAccess', _200 => _200.name]), () => ( null)),
20833
+ recordName: (table, id) => _nullishCoalesce(_optionalChain([section, 'access', _201 => _201.rows, 'access', _202 => _202[`${table}:${id}`], 'optionalAccess', _203 => _203.name]), () => ( null)),
20759
20834
  labelFor: (field, value) => {
20760
20835
  if (value === null || value === void 0) return null;
20761
20836
  const values = picklists[field];
@@ -20794,19 +20869,21 @@ function readNamesOpt(value, where) {
20794
20869
  return value;
20795
20870
  }
20796
20871
  async function labelRows(client, resourceKey, rows) {
20797
- const present = /* @__PURE__ */ new Set();
20798
- for (const row of rows) for (const [k, v] of Object.entries(row)) if (v !== null && v !== void 0) present.add(k);
20799
- if (present.size === 0) return { rows: [...rows] };
20872
+ const keys = /* @__PURE__ */ new Set();
20873
+ for (const row of rows) for (const k of Object.keys(row)) keys.add(k);
20874
+ if (keys.size === 0) return { rows: [...rows] };
20800
20875
  let picklistFields = [];
20801
20876
  const modelFields = _nullishCoalesce(MODEL_FIELD_SETS[resourceKey], () => ( []));
20802
- const candidates = [...present].filter((f) => f !== "id" && modelFields.includes(f) && ROW_FK_TABLES[f] === void 0 && !isResourceFkField(f));
20877
+ const candidates = [...keys].filter((f) => f !== "id" && modelFields.includes(f) && ROW_FK_TABLES[f] === void 0 && !isResourceFkField(f));
20803
20878
  if (candidates.length > 0) try {
20804
20879
  const catalog = await fieldCatalog(client, { resources: [resourceKey], labels: true });
20805
- const fields = _nullishCoalesce(_optionalChain([catalog, 'access', _201 => _201.rows, 'access', _202 => _202.find, 'call', _203 => _203((r) => r.resource === resourceKey), 'optionalAccess', _204 => _204.fields]), () => ( []));
20880
+ const fields = _nullishCoalesce(_optionalChain([catalog, 'access', _204 => _204.rows, 'access', _205 => _205.find, 'call', _206 => _206((r) => r.resource === resourceKey), 'optionalAccess', _207 => _207.fields]), () => ( []));
20806
20881
  picklistFields = fields.filter((f) => f.isPickList && candidates.includes(f.name)).map((f) => f.name);
20807
20882
  } catch (err) {
20808
20883
  if (!isAutotaskError(err) || err.code === "ABORTED") throw err;
20809
20884
  }
20885
+ const labelled = (field) => picklistFields.includes(field) || ROW_FK_TABLES[field] !== void 0 || isResourceFkField(field);
20886
+ if (![...keys].some(labelled)) return { rows: [...rows] };
20810
20887
  const builder = createNamePlan(picklistFields, resourceKey);
20811
20888
  for (const row of rows) {
20812
20889
  for (const [field, value] of Object.entries(row)) {
@@ -20817,20 +20894,20 @@ async function labelRows(client, resourceKey, rows) {
20817
20894
  }
20818
20895
  }
20819
20896
  const plan = builder.plan();
20820
- if (plan.resourceIds.length === 0 && plan.recordFks.length === 0 && picklistFields.length === 0) return { rows: [...rows] };
20821
- const names = await resolveCompositeNames(client.http, plan);
20897
+ const names = plan.resourceIds.length === 0 && plan.recordFks.length === 0 && picklistFields.length === 0 ? void 0 : await resolveCompositeNames(client.http, plan);
20822
20898
  const out = rows.map((row) => {
20823
20899
  const r = { ...row };
20824
20900
  for (const [field, value] of Object.entries(row)) {
20825
- if (value === null || value === void 0 || value === 0 || value === "0") continue;
20826
- if (picklistFields.includes(field)) r[`${field}Label`] = names.labelFor(field, value);
20901
+ const set = value !== null && value !== void 0 && value !== 0 && value !== "0" && names !== void 0;
20902
+ if (picklistFields.includes(field)) r[`${field}Label`] = set ? names.labelFor(field, value) : null;
20827
20903
  const table = ROW_FK_TABLES[field];
20828
- if (table !== void 0 && isVendorId(value)) r[`${field}Name`] = untrustedName(names.recordName(table, value));
20829
- else if (isResourceFkField(field) && isVendorId(value)) r[`${field}Name`] = untrustedName(names.resourceName(value));
20904
+ if (table !== void 0) r[`${field}Name`] = set && isVendorId(value) ? untrustedName(names.recordName(table, value)) : null;
20905
+ else if (isResourceFkField(field)) r[`${field}Name`] = set && isVendorId(value) ? untrustedName(names.resourceName(value)) : null;
20830
20906
  }
20831
20907
  if (r["assignedResourceIDName"] !== void 0) r["assignedResourceName"] = r["assignedResourceIDName"];
20832
20908
  return r;
20833
20909
  });
20910
+ if (names === void 0) return { rows: out };
20834
20911
  const capped = Object.values(names.section.rows).filter((row) => row.capped).length;
20835
20912
  const reasons = names.section.reasons;
20836
20913
  if (capped === 0 && Object.keys(reasons).length === 0) return { rows: out };
@@ -20892,7 +20969,7 @@ var BillingCodesResource = class extends BaseResource {
20892
20969
  }
20893
20970
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
20894
20971
  async get(id, opts = {}) {
20895
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _205 => _205.fresh]) === true);
20972
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _208 => _208.fresh]) === true);
20896
20973
  }
20897
20974
  /** Resolve a BillingCode from a numeric id (or, where the vendor indexes a primary text field,
20898
20975
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -20907,7 +20984,7 @@ var BillingCodesResource = class extends BaseResource {
20907
20984
  /** Search BillingCode records: bounded contains on name (no vendor free-text search exists);
20908
20985
  * limit defaults to 25, max 500. */
20909
20986
  async search(query, opts) {
20910
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _206 => _206.limit]) });
20987
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _209 => _209.limit]) });
20911
20988
  }
20912
20989
  };
20913
20990
 
@@ -21211,28 +21288,28 @@ async function customRangeQuery(http, path, field, from, to, limit, operation, z
21211
21288
 
21212
21289
  // src/resources/special/billing_items.ts
21213
21290
  async function windowQuery(_resource, kind, http, opts) {
21214
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _207 => _207.now]), () => ( /* @__PURE__ */ new Date()));
21215
- const tz = _optionalChain([opts, 'optionalAccess', _208 => _208.tz]) === void 0 ? void 0 : validateZone(opts.tz, `billing_items.${kind}`);
21291
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _210 => _210.now]), () => ( /* @__PURE__ */ new Date()));
21292
+ const tz = _optionalChain([opts, 'optionalAccess', _211 => _211.tz]) === void 0 ? void 0 : validateZone(opts.tz, `billing_items.${kind}`);
21216
21293
  return dateWindowQuery(
21217
21294
  http,
21218
21295
  "/V1.0/BillingItems/query",
21219
21296
  "itemDate",
21220
21297
  kind,
21221
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _209 => _209.limit])),
21298
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _212 => _212.limit])),
21222
21299
  `billing_items.${kind}`,
21223
21300
  now,
21224
21301
  tz
21225
21302
  );
21226
21303
  }
21227
21304
  async function customRange(_resource, from, to, http, opts) {
21228
- const zone = _optionalChain([opts, 'optionalAccess', _210 => _210.tz]) === void 0 ? void 0 : validateZone(opts.tz, "billing_items.customRange");
21305
+ const zone = _optionalChain([opts, 'optionalAccess', _213 => _213.tz]) === void 0 ? void 0 : validateZone(opts.tz, "billing_items.customRange");
21229
21306
  return customRangeQuery(
21230
21307
  http,
21231
21308
  "/V1.0/BillingItems/query",
21232
21309
  "itemDate",
21233
21310
  from,
21234
21311
  to,
21235
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _211 => _211.limit])),
21312
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _214 => _214.limit])),
21236
21313
  "billing_items.customRange",
21237
21314
  zone
21238
21315
  );
@@ -21264,7 +21341,7 @@ var BillingItemsResource = class extends BaseResource {
21264
21341
  }
21265
21342
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
21266
21343
  async get(id, opts = {}) {
21267
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _212 => _212.fresh]) === true);
21344
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _215 => _215.fresh]) === true);
21268
21345
  }
21269
21346
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
21270
21347
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -21456,9 +21533,9 @@ async function searchByDomain(_resource, domain, opts = {}, http) {
21456
21533
  return fetchCompanies(http, ids2, limit);
21457
21534
  }
21458
21535
  async function searchByIdentity(_resource, identity, opts = {}, http) {
21459
- const name = _nullishCoalesce(_optionalChain([identity, 'access', _213 => _213.companyName, 'optionalAccess', _214 => _214.trim, 'call', _215 => _215()]), () => ( ""));
21460
- const email = _nullishCoalesce(_optionalChain([identity, 'access', _216 => _216.email, 'optionalAccess', _217 => _217.trim, 'call', _218 => _218()]), () => ( ""));
21461
- const website = _nullishCoalesce(_optionalChain([identity, 'access', _219 => _219.website, 'optionalAccess', _220 => _220.trim, 'call', _221 => _221()]), () => ( ""));
21536
+ const name = _nullishCoalesce(_optionalChain([identity, 'access', _216 => _216.companyName, 'optionalAccess', _217 => _217.trim, 'call', _218 => _218()]), () => ( ""));
21537
+ const email = _nullishCoalesce(_optionalChain([identity, 'access', _219 => _219.email, 'optionalAccess', _220 => _220.trim, 'call', _221 => _221()]), () => ( ""));
21538
+ const website = _nullishCoalesce(_optionalChain([identity, 'access', _222 => _222.website, 'optionalAccess', _223 => _223.trim, 'call', _224 => _224()]), () => ( ""));
21462
21539
  if (name === "" && email === "" && website === "") {
21463
21540
  throw new AutotaskConfigError("searchByIdentity: at least one of companyName / email / website is required");
21464
21541
  }
@@ -21597,7 +21674,7 @@ function validateUpsertInput(companyName, params) {
21597
21674
  if (typeof companyName !== "string" || companyName.trim() === "") {
21598
21675
  throw new AutotaskConfigError("upsertByName: companyName is required (a non-empty string)", { operation: OP_UPSERT_NAME });
21599
21676
  }
21600
- if (typeof _optionalChain([params, 'optionalAccess', _222 => _222.phone]) !== "string" || params.phone.trim() === "") {
21677
+ if (typeof _optionalChain([params, 'optionalAccess', _225 => _225.phone]) !== "string" || params.phone.trim() === "") {
21601
21678
  throw new AutotaskConfigError("upsertByName: params.phone is required (a non-empty string \u2014 the ww29 live-required set is { companyName, companyType, phone, ownerResourceID })", { operation: OP_UPSERT_NAME });
21602
21679
  }
21603
21680
  const companyType = _nullishCoalesce(params.companyType, () => ( DEFAULT_COMPANY_TYPE));
@@ -21822,7 +21899,7 @@ function readIncludeNames(record, includeFields) {
21822
21899
  function resolveAuthority(record, live) {
21823
21900
  if (live !== null) return { known: live, authority: "the tenant's live entity field metadata" };
21824
21901
  const vendored = MODEL_FIELD_SETS[record.resource];
21825
- const liveOnlyExempt = Array.isArray(_optionalChain([record, 'access', _223 => _223.metadata, 'optionalAccess', _224 => _224.liveOnlyFields])) ? record.metadata.liveOnlyFields : [];
21902
+ const liveOnlyExempt = Array.isArray(_optionalChain([record, 'access', _226 => _226.metadata, 'optionalAccess', _227 => _227.liveOnlyFields])) ? record.metadata.liveOnlyFields : [];
21826
21903
  if (vendored === void 0) return void 0;
21827
21904
  return {
21828
21905
  known: [...vendored, ...liveOnlyExempt],
@@ -21878,11 +21955,11 @@ var CLOSED_STATUS_LABELS = ["complete", "completed", "closed", "cancelled", "can
21878
21955
  var OP = "tickets.statusSemantics";
21879
21956
  function picklistOf(fields) {
21880
21957
  if (!Array.isArray(fields)) return [];
21881
- const status = fields.find((f) => typeof _optionalChain([f, 'optionalAccess', _225 => _225.name]) === "string" && f.name.toLowerCase() === "status");
21958
+ const status = fields.find((f) => typeof _optionalChain([f, 'optionalAccess', _228 => _228.name]) === "string" && f.name.toLowerCase() === "status");
21882
21959
  if (status === void 0 || status.isPickList !== true || !Array.isArray(status.picklistValues)) return [];
21883
21960
  const out = [];
21884
21961
  for (const v of status.picklistValues) {
21885
- const id = Number(_optionalChain([v, 'optionalAccess', _226 => _226.value]));
21962
+ const id = Number(_optionalChain([v, 'optionalAccess', _229 => _229.value]));
21886
21963
  if (!Number.isSafeInteger(id)) continue;
21887
21964
  out.push({ id, label: typeof v.label === "string" ? v.label : "" });
21888
21965
  }
@@ -21898,11 +21975,11 @@ async function readFields(http, fresh) {
21898
21975
  if (hit !== void 0) return hit;
21899
21976
  }
21900
21977
  const res = await http.request({ method: "GET", path: "/V1.0/Tickets/entityInformation/fields", operation: OP, maxRetries: 0 });
21901
- const fields = _optionalChain([res, 'optionalAccess', _227 => _227.fields]);
21978
+ const fields = _optionalChain([res, 'optionalAccess', _230 => _230.fields]);
21902
21979
  if (!Array.isArray(fields)) {
21903
21980
  throw new AutotaskError("Expected the FieldInformationResultModel envelope { fields: [] }; got a different shape", { code: "INVALID_RESPONSE", category: "server" });
21904
21981
  }
21905
- _optionalChain([cache, 'optionalAccess', _228 => _228.set, 'call', _229 => _229(key, "fields", fields)]);
21982
+ _optionalChain([cache, 'optionalAccess', _231 => _231.set, 'call', _232 => _232(key, "fields", fields)]);
21906
21983
  return fields;
21907
21984
  }
21908
21985
  function assumed(allowAssumed, operation) {
@@ -22054,7 +22131,7 @@ async function readOpenTickets(http, companyID, ticketLimit, includeFields, stat
22054
22131
  closedStatus
22055
22132
  };
22056
22133
  if (openRows.length === 0) {
22057
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _230 => _230["tickets"], 'optionalAccess', _231 => _231.query]), [{ field: "companyID", op: "eq", value: companyID }, openLeaf]);
22134
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _233 => _233["tickets"], 'optionalAccess', _234 => _234.query]), [{ field: "companyID", op: "eq", value: companyID }, openLeaf]);
22058
22135
  if (stamp !== void 0) {
22059
22136
  openTickets = {
22060
22137
  items: openRows,
@@ -22224,7 +22301,7 @@ async function prepareCrmWrite(resource, input, http) {
22224
22301
  const rows = await readRows(http, "/V1.0/CompanyLocations/query", [{ field: "companyID", op: "eq", value: companyID }]);
22225
22302
  const items = rows.map((r) => ({ id: r.id, name: str(r.name), isPrimary: bool(r.isPrimary), isActive: bool(r.isActive), city: str(r.city), state: str(r.state), postalCode: str(r.postalCode) }));
22226
22303
  const active = items.filter((l) => l.isActive !== false);
22227
- const m = active.filter((l) => has(ct.city) && _optionalChain([l, 'access', _232 => _232.city, 'optionalAccess', _233 => _233.toLowerCase, 'call', _234 => _234()]) === String(ct.city).toLowerCase() || has(ct.postalCode) && l.postalCode === String(ct.postalCode));
22304
+ const m = active.filter((l) => has(ct.city) && _optionalChain([l, 'access', _235 => _235.city, 'optionalAccess', _236 => _236.toLowerCase, 'call', _237 => _237()]) === String(ct.city).toLowerCase() || has(ct.postalCode) && l.postalCode === String(ct.postalCode));
22228
22305
  const pick = has(ct.companyLocationID) ? { rule: "matched", locationID: ct.companyLocationID } : active.length === 1 ? { rule: "single", locationID: active[0].id } : active.length > 1 && m.length === 1 ? { rule: "matched", locationID: m[0].id } : active.length > 1 ? { rule: "ask", locationID: null } : { rule: "none", locationID: null };
22229
22306
  locations = { items, pick };
22230
22307
  if (input.intent === "add_contact" && pick.locationID === null) {
@@ -22259,7 +22336,7 @@ async function prepareCrmWrite(resource, input, http) {
22259
22336
  }
22260
22337
  }
22261
22338
  if (input.intent === "create_company" && status !== "matched") {
22262
- const eff = effectiveRequiredFields(null, _optionalChain([RELATIONSHIP_MAP, 'access', _235 => _235.companies, 'optionalAccess', _236 => _236.zoneFacts]));
22339
+ const eff = effectiveRequiredFields(null, _optionalChain([RELATIONSHIP_MAP, 'access', _238 => _238.companies, 'optionalAccess', _239 => _239.zoneFacts]));
22263
22340
  const research = (f) => ["companyType", "ownerResourceID", "countryID"].includes(f) ? "lookup" : "web_if_available_else_ask";
22264
22341
  const lookups = {
22265
22342
  companyType: { via: "operations.fieldCatalog", resource: "companies", field: "companyType", labels: true, note: "map the user wording to one returned label; never hardcode ids" },
@@ -22281,16 +22358,16 @@ async function prepareCrmWrite(resource, input, http) {
22281
22358
  }
22282
22359
  let next = null;
22283
22360
  const isInactive = (d) => d.isActive === false || d.isActive === 0;
22284
- const dups = _nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _237 => _237.duplicates]), () => ( []));
22361
+ const dups = _nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _240 => _240.duplicates]), () => ( []));
22285
22362
  const sameCompany = companyID === null ? dups : dups.filter((d) => d.companyID === companyID);
22286
22363
  const elsewhere = companyID === null ? [] : dups.filter((d) => d.companyID !== companyID && !isInactive(d));
22287
22364
  if (input.intent === "add_contact" && sameCompany.length === 0 && elsewhere.length > 0) {
22288
- needsInput.push({ field: "contact", why: `a contact with this ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _238 => _238.matchedBy]), () => ( "identity"))} is active at another company: update it, move it with contacts.moveToCompany, or confirm a second record`, source: "policy", lookup: { duplicates: elsewhere }, research: "ask" });
22365
+ needsInput.push({ field: "contact", why: `a contact with this ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _241 => _241.matchedBy]), () => ( "identity"))} is active at another company: update it, move it with contacts.moveToCompany, or confirm a second record`, source: "policy", lookup: { duplicates: elsewhere }, research: "ask" });
22289
22366
  }
22290
22367
  if (needsInput.length === 0) {
22291
22368
  const dup = sameCompany[0];
22292
22369
  if (input.intent === "create_company") next = status === "matched" ? { operation: "companies.update", note: "the company already exists: update it instead of creating" } : { operation: "companies.create", note: 'then re-run with intent add_contact: the vendor auto-creates a "Primary Address" location (rename it with company_locations.update; locations cannot be deleted via the API)' };
22293
- else if (input.intent === "add_contact") next = dup ? { operation: "contacts.update", note: `a contact already matches by ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _239 => _239.matchedBy]), () => ( "id"))} (id ${String(dup.id)}): update it, or move it with contacts.moveToCompany if it belongs to another company` } : { operation: "contacts.create", note: `set companyID ${String(companyID)} and companyLocationID ${String(_optionalChain([locations, 'optionalAccess', _240 => _240.pick, 'access', _241 => _241.locationID]))}` };
22370
+ else if (input.intent === "add_contact") next = dup ? { operation: "contacts.update", note: `a contact already matches by ${_nullishCoalesce(_optionalChain([contacts, 'optionalAccess', _242 => _242.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', _243 => _243.pick, 'access', _244 => _244.locationID]))}` };
22294
22371
  else if (input.intent === "update_contact") next = { operation: "contacts.update", note: "send only the changed fields" };
22295
22372
  else next = { operation: "companies.update", note: "send only the changed fields" };
22296
22373
  }
@@ -22410,7 +22487,7 @@ function validateUnbilledWorkOptions(companyId, opts) {
22410
22487
  var OP3 = "companies.unbilledWork";
22411
22488
  function unbilledWorkPartStatus(key, conditions, items) {
22412
22489
  if (items.length !== 0) return { status: "ok" };
22413
- const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _242 => _242[key], 'optionalAccess', _243 => _243.query]), conditions);
22490
+ const stamp = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _245 => _245[key], 'optionalAccess', _246 => _246.query]), conditions);
22414
22491
  if (stamp !== void 0) return { status: "blind", blindSurface: stamp, note: stamp.note };
22415
22492
  return {
22416
22493
  status: "ok",
@@ -22660,7 +22737,7 @@ var CompaniesResource = class extends BaseResource {
22660
22737
  }
22661
22738
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
22662
22739
  async get(id, opts = {}) {
22663
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _244 => _244.fresh]) === true);
22740
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _247 => _247.fresh]) === true);
22664
22741
  }
22665
22742
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
22666
22743
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -22817,8 +22894,8 @@ function validateFetchManyItems(items, cap, opName = "fetchMany", capRef = `FETC
22817
22894
  problems.push(`${at}.fields: must be an array of exact vendor field names (discover them via operations.fieldCatalog)`);
22818
22895
  continue;
22819
22896
  }
22820
- if (_optionalChain([validation, 'optionalAccess', _245 => _245.fieldCheck]) !== false) {
22821
- const authoritative = _nullishCoalesce(_optionalChain([validation, 'optionalAccess', _246 => _246.fieldSetsByResource, 'optionalAccess', _247 => _247.get, 'call', _248 => _248(resourceKey)]), () => ( fields));
22897
+ if (_optionalChain([validation, 'optionalAccess', _248 => _248.fieldCheck]) !== false) {
22898
+ const authoritative = _nullishCoalesce(_optionalChain([validation, 'optionalAccess', _249 => _249.fieldSetsByResource, 'optionalAccess', _250 => _250.get, 'call', _251 => _251(resourceKey)]), () => ( fields));
22822
22899
  for (const f of item.fields) {
22823
22900
  if (!authoritative.includes(f)) {
22824
22901
  problems.push(
@@ -22924,7 +23001,7 @@ function project3(value, fields) {
22924
23001
  return out;
22925
23002
  }
22926
23003
  function resourcePathOf(key, holder) {
22927
- const path = _optionalChain([holder, 'optionalAccess', _249 => _249.resourcePath]);
23004
+ const path = _optionalChain([holder, 'optionalAccess', _252 => _252.resourcePath]);
22928
23005
  if (typeof path !== "string" || path === "") {
22929
23006
  throw new AutotaskConfigError(`fetchByIds: the client exposes no ${key} resource path (registry drift)`, {
22930
23007
  suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
@@ -23537,7 +23614,7 @@ var stampPart = (key, raw, conditions, extraNotes) => {
23537
23614
  status: st.status,
23538
23615
  blindSurface: st.blindSurface,
23539
23616
  note: [st.note, ..._nullishCoalesce(extraNotes, () => ( []))].filter(Boolean).join(" | ") || void 0,
23540
- emptyReason: raw.items.length === 0 && st.status === "ok" ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _250 => _250[key], 'optionalAccess', _251 => _251.query]) : void 0
23617
+ emptyReason: raw.items.length === 0 && st.status === "ok" ? _optionalChain([EMPTY_REASON_STAMPS, 'access', _253 => _253[key], 'optionalAccess', _254 => _254.query]) : void 0
23541
23618
  };
23542
23619
  };
23543
23620
  function appendWiresNote(wires, note) {
@@ -23602,7 +23679,7 @@ async function resolveContractType(ctx, contractType) {
23602
23679
  if (contractType > 0) {
23603
23680
  ctx.wires.issued += 1;
23604
23681
  try {
23605
- contractTypeLabel = await _asyncNullishCoalesce(await _asyncOptionalChain([(await readPicklists(ctx.http, "/V1.0/Contracts", ctx.OP)), 'access', async _252 => _252.get, 'call', async _253 => _253("contractType"), 'optionalAccess', async _254 => _254.get, 'call', async _255 => _255(contractType)]), async () => ( null));
23682
+ contractTypeLabel = await _asyncNullishCoalesce(await _asyncOptionalChain([(await readPicklists(ctx.http, "/V1.0/Contracts", ctx.OP)), 'access', async _255 => _255.get, 'call', async _256 => _256("contractType"), 'optionalAccess', async _257 => _257.get, 'call', async _258 => _258(contractType)]), async () => ( null));
23606
23683
  } catch (err) {
23607
23684
  if (!(err instanceof AutotaskError)) throw err;
23608
23685
  }
@@ -23613,7 +23690,7 @@ async function resolveContractType(ctx, contractType) {
23613
23690
  return { contractTypeLabel, contractTypeKnown, isBlockHours, isTimeAndMaterials };
23614
23691
  }
23615
23692
  async function fetchRoot(ctx, resource) {
23616
- const contractCached = _optionalChain([ctx, 'access', _256 => _256.rawHttp, 'access', _257 => _257.readCache, 'optionalAccess', _258 => _258.get, 'call', _259 => _259(`/V1.0/Contracts/${ctx.id}`)]) !== void 0;
23693
+ const contractCached = _optionalChain([ctx, 'access', _259 => _259.rawHttp, 'access', _260 => _260.readCache, 'optionalAccess', _261 => _261.get, 'call', _262 => _262(`/V1.0/Contracts/${ctx.id}`)]) !== void 0;
23617
23694
  const contract = await resource.get(ctx.id);
23618
23695
  ctx.wires.issued += 1;
23619
23696
  if (!contractCached) ctx.wires.requests += 1;
@@ -23828,10 +23905,10 @@ async function fetchSubscriptions(ctx, cis) {
23828
23905
  const labels = await readSubscriptionLabels(ctx, subscriptions);
23829
23906
  for (const x of subscriptions) {
23830
23907
  const sid = num(x["id"]);
23831
- const periodLabel = _optionalChain([labels, 'optionalAccess', _260 => _260.get, 'call', _261 => _261("periodType"), 'optionalAccess', _262 => _262.get, 'call', _263 => _263(num(x["periodType"]))]);
23908
+ const periodLabel = _optionalChain([labels, 'optionalAccess', _263 => _263.get, 'call', _264 => _264("periodType"), 'optionalAccess', _265 => _265.get, 'call', _266 => _266(num(x["periodType"]))]);
23832
23909
  subFactor.set(sid, periodMonthlyFactor(x["periodType"], periodLabel));
23833
23910
  if (isOneTimePeriod(x["periodType"], periodLabel)) oneTimeSubs.add(sid);
23834
- const statusLabel = _optionalChain([labels, 'optionalAccess', _264 => _264.get, 'call', _265 => _265("status"), 'optionalAccess', _266 => _266.get, 'call', _267 => _267(num(x["status"]))]);
23911
+ const statusLabel = _optionalChain([labels, 'optionalAccess', _267 => _267.get, 'call', _268 => _268("status"), 'optionalAccess', _269 => _269.get, 'call', _270 => _270(num(x["status"]))]);
23835
23912
  const notActive = statusLabel !== void 0 ? NOT_ACTIVE_LABEL_RE.test(statusLabel) : labels === null && SUBSCRIPTION_NOT_ACTIVE_STATUS_IDS.has(num(x["status"]));
23836
23913
  if (notActive) cancelledSubs.add(sid);
23837
23914
  }
@@ -24532,7 +24609,7 @@ var ContractsResource = class extends BaseResource {
24532
24609
  }
24533
24610
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24534
24611
  async get(id, opts = {}) {
24535
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _268 => _268.fresh]) === true);
24612
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _271 => _271.fresh]) === true);
24536
24613
  }
24537
24614
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24538
24615
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24568,7 +24645,7 @@ var ContractsResource = class extends BaseResource {
24568
24645
  /** Search Contract records: bounded contains on contractName (no vendor free-text search exists);
24569
24646
  * limit defaults to 25, max 500. */
24570
24647
  async search(query, opts) {
24571
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _269 => _269.limit]) });
24648
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _272 => _272.limit]) });
24572
24649
  }
24573
24650
  /** Node-parity special op (hand-written in src/resources/special/contracts.ts). */
24574
24651
  profitability(id, opts) {
@@ -24608,28 +24685,28 @@ async function pdf(_resource, id, http) {
24608
24685
  return decodeFileData(res);
24609
24686
  }
24610
24687
  async function windowQuery2(_resource, kind, http, opts) {
24611
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _270 => _270.now]), () => ( /* @__PURE__ */ new Date()));
24612
- const tz = _optionalChain([opts, 'optionalAccess', _271 => _271.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
24688
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _273 => _273.now]), () => ( /* @__PURE__ */ new Date()));
24689
+ const tz = _optionalChain([opts, 'optionalAccess', _274 => _274.tz]) === void 0 ? void 0 : validateZone(opts.tz, `invoices.${kind}`);
24613
24690
  return dateWindowQuery(
24614
24691
  http,
24615
24692
  "/V1.0/Invoices/query",
24616
24693
  "invoiceDateTime",
24617
24694
  kind,
24618
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _272 => _272.limit])),
24695
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _275 => _275.limit])),
24619
24696
  `invoices.${kind}`,
24620
24697
  now,
24621
24698
  tz
24622
24699
  );
24623
24700
  }
24624
24701
  async function customRange2(_resource, from, to, http, opts) {
24625
- const zone = _optionalChain([opts, 'optionalAccess', _273 => _273.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
24702
+ const zone = _optionalChain([opts, 'optionalAccess', _276 => _276.tz]) === void 0 ? void 0 : validateZone(opts.tz, "invoices.customRange");
24626
24703
  return customRangeQuery(
24627
24704
  http,
24628
24705
  "/V1.0/Invoices/query",
24629
24706
  "invoiceDateTime",
24630
24707
  from,
24631
24708
  to,
24632
- clampWindowLimit(_optionalChain([opts, 'optionalAccess', _274 => _274.limit])),
24709
+ clampWindowLimit(_optionalChain([opts, 'optionalAccess', _277 => _277.limit])),
24633
24710
  "invoices.customRange",
24634
24711
  zone
24635
24712
  );
@@ -24661,7 +24738,7 @@ var InvoicesResource = class extends BaseResource {
24661
24738
  }
24662
24739
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24663
24740
  async get(id, opts = {}) {
24664
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _275 => _275.fresh]) === true);
24741
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _278 => _278.fresh]) === true);
24665
24742
  }
24666
24743
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
24667
24744
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -24775,7 +24852,7 @@ var OrganizationalLevel1sResource = class extends BaseResource {
24775
24852
  }
24776
24853
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24777
24854
  async get(id, opts = {}) {
24778
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _276 => _276.fresh]) === true);
24855
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _279 => _279.fresh]) === true);
24779
24856
  }
24780
24857
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24781
24858
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24826,7 +24903,7 @@ var OrganizationalLevel2sResource = class extends BaseResource {
24826
24903
  }
24827
24904
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24828
24905
  async get(id, opts = {}) {
24829
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _277 => _277.fresh]) === true);
24906
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _280 => _280.fresh]) === true);
24830
24907
  }
24831
24908
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24832
24909
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24877,7 +24954,7 @@ var OrganizationalLevelAssociationsResource = class extends BaseResource {
24877
24954
  }
24878
24955
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
24879
24956
  async get(id, opts = {}) {
24880
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _278 => _278.fresh]) === true);
24957
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _281 => _281.fresh]) === true);
24881
24958
  }
24882
24959
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
24883
24960
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -24949,7 +25026,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24949
25026
  if (typeof destination === "number" && destination < 1) {
24950
25027
  throw new AutotaskConfigError("transferOwnership: destinationResourceId must be a positive integer");
24951
25028
  }
24952
- const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _279 => _279.dryRun]), () => ( true));
25029
+ const dryRun = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _282 => _282.dryRun]), () => ( true));
24953
25030
  const changes = [];
24954
25031
  const applied = [];
24955
25032
  for (const id of ids2) {
@@ -24958,7 +25035,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24958
25035
  method: "GET",
24959
25036
  path: `/V1.0/Companies/${id}`,
24960
25037
  operation: "resources.transferOwnership",
24961
- maxRetries: _optionalChain([opts, 'optionalAccess', _280 => _280.maxRetries])
25038
+ maxRetries: _optionalChain([opts, 'optionalAccess', _283 => _283.maxRetries])
24962
25039
  });
24963
25040
  const company = unwrapItem(res, id, void 0, "company");
24964
25041
  const current = typeof company.ownerResourceID === "number" ? company.ownerResourceID : null;
@@ -24969,7 +25046,7 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
24969
25046
  path: "/V1.0/Companies",
24970
25047
  body: { id, ownerResourceID: destination },
24971
25048
  operation: "resources.transferOwnership",
24972
- maxRetries: _optionalChain([opts, 'optionalAccess', _281 => _281.maxRetries])
25049
+ maxRetries: _optionalChain([opts, 'optionalAccess', _284 => _284.maxRetries])
24973
25050
  });
24974
25051
  unwrapOperation(update);
24975
25052
  applied.push(id);
@@ -25038,7 +25115,7 @@ var ResourcesResource = class extends BaseResource {
25038
25115
  }
25039
25116
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
25040
25117
  async get(id, opts = {}) {
25041
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _282 => _282.fresh]) === true);
25118
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _285 => _285.fresh]) === true);
25042
25119
  }
25043
25120
  /** Update a record (PUT on the COLLECTION — the vendored spec's item path is GET-only; the vendor
25044
25121
  * keys the record by the id in the body). The vendor validates the FULL model on this route (V2), so a
@@ -25066,7 +25143,7 @@ var ResourcesResource = class extends BaseResource {
25066
25143
  /** Search Resource records: bounded contains on firstName + lastName (no vendor free-text search exists);
25067
25144
  * limit defaults to 25, max 500. */
25068
25145
  async search(query, opts) {
25069
- return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _283 => _283.limit]) });
25146
+ return this.searchBase(query, { limit: _optionalChain([opts, 'optionalAccess', _286 => _286.limit]) });
25070
25147
  }
25071
25148
  /** Node-parity special op (hand-written in src/resources/special/resources.ts). */
25072
25149
  transferOwnership(sourceResourceIds, destinationResourceId, opts = {}) {
@@ -25101,7 +25178,7 @@ function uiHostFromBase(baseUrl) {
25101
25178
  } catch (e20) {
25102
25179
  return void 0;
25103
25180
  }
25104
- const n = _optionalChain([REST_HOST, 'access', _284 => _284.exec, 'call', _285 => _285(hostname), 'optionalAccess', _286 => _286[1]]);
25181
+ const n = _optionalChain([REST_HOST, 'access', _287 => _287.exec, 'call', _288 => _288(hostname), 'optionalAccess', _289 => _289[1]]);
25105
25182
  return n === void 0 ? void 0 : `ww${n}.autotask.net`;
25106
25183
  }
25107
25184
  function buildUiLink(input) {
@@ -25154,7 +25231,7 @@ async function postedStateOf(http, entries, op, beforeRequest) {
25154
25231
  let incomplete = false;
25155
25232
  for (let c = 0; c < ids2.length; c += FETCH_BY_IDS_CHUNK_SIZE) {
25156
25233
  const chunk = ids2.slice(c, c + FETCH_BY_IDS_CHUNK_SIZE);
25157
- _optionalChain([beforeRequest, 'optionalCall', _287 => _287()]);
25234
+ _optionalChain([beforeRequest, 'optionalCall', _290 => _290()]);
25158
25235
  const res = await http.request({
25159
25236
  method: "POST",
25160
25237
  idempotent: true,
@@ -25201,11 +25278,11 @@ async function queryTimeEntries(_resource, filter, limit, operation, http, curso
25201
25278
  return { items, hasMore: pageDetails.nextPageUrl != null, nextCursor: _nullishCoalesce(pageDetails.nextPageUrl, () => ( null)) };
25202
25279
  }
25203
25280
  function pagingOpts(opts, OP9) {
25204
- if (_optionalChain([opts, 'optionalAccess', _288 => _288.countOnly]) !== void 0 && typeof opts.countOnly !== "boolean") {
25281
+ if (_optionalChain([opts, 'optionalAccess', _291 => _291.countOnly]) !== void 0 && typeof opts.countOnly !== "boolean") {
25205
25282
  throw new AutotaskConfigError(`${OP9}: countOnly must be a boolean`, { operation: OP9 });
25206
25283
  }
25207
- const countOnly = _optionalChain([opts, 'optionalAccess', _289 => _289.countOnly]) === true;
25208
- const cursor = _optionalChain([opts, 'optionalAccess', _290 => _290.cursor]);
25284
+ const countOnly = _optionalChain([opts, 'optionalAccess', _292 => _292.countOnly]) === true;
25285
+ const cursor = _optionalChain([opts, 'optionalAccess', _293 => _293.cursor]);
25209
25286
  if (cursor !== void 0 && (typeof cursor !== "string" || cursor.trim() === "")) {
25210
25287
  throw new AutotaskConfigError(`${OP9}: cursor must be the non-empty nextCursor of a previous call`, { operation: OP9 });
25211
25288
  }
@@ -25215,9 +25292,9 @@ function pagingOpts(opts, OP9) {
25215
25292
  if (cursor !== void 0 && countOnly) {
25216
25293
  throw new AutotaskConfigError(`${OP9}: cursor does not apply with countOnly (countOnly reads every page itself)`, { operation: OP9 });
25217
25294
  }
25218
- const budget = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _291 => _291.maxVendorCalls]), () => ( COUNT_BUDGET_DEFAULT));
25295
+ const budget = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _294 => _294.maxVendorCalls]), () => ( COUNT_BUDGET_DEFAULT));
25219
25296
  if (!Number.isInteger(budget) || budget < 1 || budget > COUNT_BUDGET_MAX) {
25220
- throw new AutotaskConfigError(`${OP9}: maxVendorCalls must be an integer 1-${COUNT_BUDGET_MAX} (got ${String(_optionalChain([opts, 'optionalAccess', _292 => _292.maxVendorCalls]))})`, { operation: OP9 });
25297
+ throw new AutotaskConfigError(`${OP9}: maxVendorCalls must be an integer 1-${COUNT_BUDGET_MAX} (got ${String(_optionalChain([opts, 'optionalAccess', _295 => _295.maxVendorCalls]))})`, { operation: OP9 });
25221
25298
  }
25222
25299
  return { ...cursor === void 0 ? {} : { cursor }, countOnly, budget };
25223
25300
  }
@@ -25288,18 +25365,18 @@ async function countPostedState(http, filter, OP9, budget, window) {
25288
25365
  return { window, total: states.size, postedCount, unpostedCount: states.size - postedCount, vendorCalls: issued, estimate, budget };
25289
25366
  }
25290
25367
  async function windowQuery3(_resource, kind, http, opts) {
25291
- const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _293 => _293.now]), () => ( /* @__PURE__ */ new Date()));
25292
- const tz = _optionalChain([opts, 'optionalAccess', _294 => _294.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
25368
+ const now = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _296 => _296.now]), () => ( /* @__PURE__ */ new Date()));
25369
+ const tz = _optionalChain([opts, 'optionalAccess', _297 => _297.tz]) === void 0 ? void 0 : validateZone(opts.tz, `time_entries.${kind}`);
25293
25370
  const { from, to } = dateOnlyWindowBounds(kind, now, tz);
25294
25371
  const filter = [
25295
25372
  { field: "dateWorked", op: "gte", value: from },
25296
25373
  { field: "dateWorked", op: "lte", value: to }
25297
25374
  ];
25298
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _295 => _295.limit])), `time_entries.${kind}`, http);
25375
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _298 => _298.limit])), `time_entries.${kind}`, http);
25299
25376
  return items;
25300
25377
  }
25301
25378
  async function customRange3(_resource, from, to, http, opts) {
25302
- if (_optionalChain([opts, 'optionalAccess', _296 => _296.tz]) !== void 0) validateZone(opts.tz, "time_entries.customRange");
25379
+ if (_optionalChain([opts, 'optionalAccess', _299 => _299.tz]) !== void 0) validateZone(opts.tz, "time_entries.customRange");
25303
25380
  const fromB = customRangeDay(from, "from", void 0, "customRange");
25304
25381
  const toB = customRangeDay(to, "to", void 0, "customRange");
25305
25382
  if (fromB.ms > toB.ms) {
@@ -25310,7 +25387,7 @@ async function customRange3(_resource, from, to, http, opts) {
25310
25387
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
25311
25388
  { field: "dateWorked", op: "lte", value: iso2(toEndMs) }
25312
25389
  ];
25313
- const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _297 => _297.limit])), "time_entries.customRange", http);
25390
+ const { items } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _300 => _300.limit])), "time_entries.customRange", http);
25314
25391
  return items;
25315
25392
  }
25316
25393
  async function postedStateQuery(_resource, mode, http, opts) {
@@ -25318,16 +25395,16 @@ async function postedStateQuery(_resource, mode, http, opts) {
25318
25395
  const paging = pagingOpts(opts, operation);
25319
25396
  const window = { from: null, to: null };
25320
25397
  const filter = [];
25321
- const fromB = _optionalChain([opts, 'optionalAccess', _298 => _298.dateFrom]) === void 0 ? void 0 : customRangeDay(opts.dateFrom, "from", void 0, operation);
25322
- const toB = _optionalChain([opts, 'optionalAccess', _299 => _299.dateTo]) === void 0 ? void 0 : customRangeDay(opts.dateTo, "to", void 0, operation);
25398
+ const fromB = _optionalChain([opts, 'optionalAccess', _301 => _301.dateFrom]) === void 0 ? void 0 : customRangeDay(opts.dateFrom, "from", void 0, operation);
25399
+ const toB = _optionalChain([opts, 'optionalAccess', _302 => _302.dateTo]) === void 0 ? void 0 : customRangeDay(opts.dateTo, "to", void 0, operation);
25323
25400
  if (fromB && toB && fromB.ms > toB.ms) {
25324
25401
  throw new AutotaskConfigError(`${operation}: dateFrom (${iso2(fromB.ms)}) must not be after dateTo (${iso2(toB.ms)})`, { operation });
25325
25402
  }
25326
25403
  if (fromB) filter.push({ field: "dateWorked", op: "gte", value: window.from = iso2(fromB.ms) });
25327
25404
  if (toB) filter.push({ field: "dateWorked", op: "lte", value: window.to = iso2(toB.ms + DAY_MS2 - 1) });
25328
- if (_optionalChain([opts, 'optionalAccess', _300 => _300.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25405
+ if (_optionalChain([opts, 'optionalAccess', _303 => _303.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25329
25406
  if (paging.countOnly) return countPostedState(http, filter, operation, paging.budget, window);
25330
- const read = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _301 => _301.limit])), operation, http, paging.cursor);
25407
+ const read = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _304 => _304.limit])), operation, http, paging.cursor);
25331
25408
  const { states, incomplete } = await postedStateOf(http, read.items, operation);
25332
25409
  const items = read.items.filter((e) => states.get(e.id) === mode);
25333
25410
  const approvedCount = items.filter(isApproved).length;
@@ -25337,7 +25414,7 @@ async function postedStateQuery(_resource, mode, http, opts) {
25337
25414
  async function postedWithin(_resource, from, to, http, opts, opLabel = "time_entries.postedWithin") {
25338
25415
  const OP9 = opLabel;
25339
25416
  const paging = pagingOpts(opts, OP9);
25340
- if (_optionalChain([opts, 'optionalAccess', _302 => _302.tz]) !== void 0) validateZone(opts.tz, OP9);
25417
+ if (_optionalChain([opts, 'optionalAccess', _305 => _305.tz]) !== void 0) validateZone(opts.tz, OP9);
25341
25418
  const fromB = customRangeDay(from, "from", void 0, OP9);
25342
25419
  const toB = customRangeDay(to, "to", void 0, OP9);
25343
25420
  if (fromB.ms > toB.ms) {
@@ -25348,11 +25425,11 @@ async function postedWithin(_resource, from, to, http, opts, opLabel = "time_ent
25348
25425
  { field: "dateWorked", op: "gte", value: iso2(fromB.ms) },
25349
25426
  { field: "dateWorked", op: "lte", value: iso2(windowToMs) }
25350
25427
  ];
25351
- if (_optionalChain([opts, 'optionalAccess', _303 => _303.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25352
- if (_optionalChain([opts, 'optionalAccess', _304 => _304.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
25428
+ if (_optionalChain([opts, 'optionalAccess', _306 => _306.ticketID]) !== void 0) filter.push({ field: "ticketID", op: "eq", value: opts.ticketID });
25429
+ if (_optionalChain([opts, 'optionalAccess', _307 => _307.resourceID]) !== void 0) filter.push({ field: "resourceID", op: "eq", value: opts.resourceID });
25353
25430
  const window = { from: iso2(fromB.ms), to: iso2(windowToMs) };
25354
25431
  if (paging.countOnly) return countPostedState(http, filter, OP9, paging.budget, window);
25355
- const { items, hasMore, nextCursor } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _305 => _305.limit])), OP9, http, paging.cursor);
25432
+ const { items, hasMore, nextCursor } = await queryTimeEntries(_resource, filter, clampWindowLimit(_optionalChain([opts, 'optionalAccess', _308 => _308.limit])), OP9, http, paging.cursor);
25356
25433
  const { states, incomplete } = await postedStateOf(http, items, OP9);
25357
25434
  let postedCount = 0;
25358
25435
  let unpostedCount = 0;
@@ -25360,7 +25437,7 @@ async function postedWithin(_resource, from, to, http, opts, opLabel = "time_ent
25360
25437
  if (state === "posted") postedCount += 1;
25361
25438
  else unpostedCount += 1;
25362
25439
  }
25363
- const keep = _optionalChain([opts, 'optionalAccess', _306 => _306.posted]) === void 0 ? void 0 : opts.posted ? "posted" : "unposted";
25440
+ const keep = _optionalChain([opts, 'optionalAccess', _309 => _309.posted]) === void 0 ? void 0 : opts.posted ? "posted" : "unposted";
25364
25441
  return {
25365
25442
  items: keep === void 0 ? items : items.filter((e) => states.get(e.id) === keep),
25366
25443
  postedCount,
@@ -25810,7 +25887,7 @@ function sameValue(a, b) {
25810
25887
  async function readTicket(http, id, retries, operation) {
25811
25888
  try {
25812
25889
  const res = await http.request({ method: "GET", path: `/V1.0/Tickets/${id}`, operation, maxRetries: retries });
25813
- const item = _optionalChain([res, 'optionalAccess', _307 => _307.item]);
25890
+ const item = _optionalChain([res, 'optionalAccess', _310 => _310.item]);
25814
25891
  return _nullishCoalesce(item, () => ( null));
25815
25892
  } catch (e) {
25816
25893
  if (isAutotaskError(e) && (e.httpStatus === 404 || e.code === "NOT_FOUND")) return null;
@@ -25855,7 +25932,7 @@ async function preview(http, spec, sourceId, toTicketId, opts) {
25855
25932
  const facts = {
25856
25933
  closedStatus: { closedIds: closedStatus.closedIds, source: closedStatus.source, note: closedStatus.note },
25857
25934
  sourceTicketId,
25858
- sourceCompanyID: _nullishCoalesce(_optionalChain([origin, 'optionalAccess', _308 => _308.companyID]), () => ( null)),
25935
+ sourceCompanyID: _nullishCoalesce(_optionalChain([origin, 'optionalAccess', _311 => _311.companyID]), () => ( null)),
25859
25936
  targetCompanyID: _nullishCoalesce(target.companyID, () => ( null)),
25860
25937
  companyChanged: origin === null ? null : origin.companyID !== target.companyID,
25861
25938
  contractChanged: origin === null ? null : (_nullishCoalesce(origin.contractID, () => ( null))) !== (_nullishCoalesce(target.contractID, () => ( null)))
@@ -25973,7 +26050,7 @@ var CONTRACT_SCOPED = ["contractID", "contractServiceID", "contractServiceBundle
25973
26050
  async function readTimeEntry(http, id, retries) {
25974
26051
  try {
25975
26052
  const res = await http.request({ method: "GET", path: `/V1.0/TimeEntries/${id}`, operation: OP6, maxRetries: retries });
25976
- return _nullishCoalesce(_optionalChain([res, 'optionalAccess', _309 => _309.item]), () => ( null));
26053
+ return _nullishCoalesce(_optionalChain([res, 'optionalAccess', _312 => _312.item]), () => ( null));
25977
26054
  } catch (e) {
25978
26055
  if (isAutotaskError(e) && (e.httpStatus === 404 || e.code === "NOT_FOUND")) return null;
25979
26056
  throw e;
@@ -26192,17 +26269,17 @@ async function recentTickets(_resource, from, to, http, opts) {
26192
26269
  for (const [ticketID, g] of groups) {
26193
26270
  const t = tickets.get(ticketID);
26194
26271
  if (t === void 0) unresolvedTicketIDs.push(ticketID);
26195
- if (companyID !== void 0 && _optionalChain([t, 'optionalAccess', _310 => _310.companyID]) !== companyID) {
26272
+ if (companyID !== void 0 && _optionalChain([t, 'optionalAccess', _313 => _313.companyID]) !== companyID) {
26196
26273
  if (t !== void 0) excludedTickets += 1;
26197
26274
  continue;
26198
26275
  }
26199
26276
  items.push({
26200
26277
  ticketID,
26201
- ..._optionalChain([t, 'optionalAccess', _311 => _311.ticketNumber]) !== void 0 ? { ticketNumber: t.ticketNumber } : {},
26202
- ..._optionalChain([t, 'optionalAccess', _312 => _312.title]) !== void 0 ? { title: t.title } : {},
26203
- ..._optionalChain([t, 'optionalAccess', _313 => _313.status]) !== void 0 ? { status: t.status } : {},
26204
- ..._optionalChain([t, 'optionalAccess', _314 => _314.assignedResourceID]) !== void 0 ? { assignedResourceID: t.assignedResourceID } : {},
26205
- ..._optionalChain([t, 'optionalAccess', _315 => _315.companyID]) !== void 0 ? { companyID: t.companyID } : {},
26278
+ ..._optionalChain([t, 'optionalAccess', _314 => _314.ticketNumber]) !== void 0 ? { ticketNumber: t.ticketNumber } : {},
26279
+ ..._optionalChain([t, 'optionalAccess', _315 => _315.title]) !== void 0 ? { title: t.title } : {},
26280
+ ..._optionalChain([t, 'optionalAccess', _316 => _316.status]) !== void 0 ? { status: t.status } : {},
26281
+ ..._optionalChain([t, 'optionalAccess', _317 => _317.assignedResourceID]) !== void 0 ? { assignedResourceID: t.assignedResourceID } : {},
26282
+ ..._optionalChain([t, 'optionalAccess', _318 => _318.companyID]) !== void 0 ? { companyID: t.companyID } : {},
26206
26283
  entryCount: g.entryCount,
26207
26284
  totalHours: Math.round(g.totalHours * 100) / 100,
26208
26285
  lastWorked: g.lastWorked
@@ -26246,7 +26323,7 @@ var TimeEntriesResource = class extends BaseResource {
26246
26323
  }
26247
26324
  /** Get one record by id (item envelope; item: null → NotFoundError). `fresh: true` bypasses the read-cache lookup and refreshes the entry (issue #250). */
26248
26325
  async get(id, opts = {}) {
26249
- return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _316 => _316.fresh]) === true);
26326
+ return this.getGlobal(id, _optionalChain([opts, 'optionalAccess', _319 => _319.fresh]) === true);
26250
26327
  }
26251
26328
  /** Create a record (OperationResultModel → { id}). `dryRun: true` returns the
26252
26329
  * pinned envelope (section 19.3) and never issues the create. A 2xx that is not the
@@ -26579,4 +26656,5 @@ var TimeEntriesResource = class extends BaseResource {
26579
26656
 
26580
26657
 
26581
26658
 
26582
- exports.AUTH_HEADERS = AUTH_HEADERS; exports.buildAuthHeaders = buildAuthHeaders; exports.withAuthHeaders = withAuthHeaders; exports.AutotaskError = AutotaskError; exports.AutotaskConfigError = AutotaskConfigError; exports.isAutotaskError = isAutotaskError; exports.AutotaskNetworkError = AutotaskNetworkError; exports.AutotaskTimeoutError = AutotaskTimeoutError; exports.AutotaskAbortError = AutotaskAbortError; exports.ResponseRejectedError = ResponseRejectedError; exports.BadRequestError = BadRequestError; exports.UnauthorizedError = UnauthorizedError; exports.ForbiddenError = ForbiddenError; exports.NotFoundError = NotFoundError; exports.ConflictError = ConflictError; exports.UnprocessableEntityError = UnprocessableEntityError; exports.RateLimitError = RateLimitError; exports.ServerError = ServerError; exports.UnexpectedContentTypeError = UnexpectedContentTypeError; exports.EmptyResponseError = EmptyResponseError; exports.CircuitBreakerError = CircuitBreakerError; exports.HostPolicyDeniedError = HostPolicyDeniedError; exports.ResolutionError = ResolutionError; exports.PaginationLimitError = PaginationLimitError; exports.QueryTooLongError = QueryTooLongError; exports.parseVendorErrors = parseVendorErrors; exports.isDeterministicVendor500 = isDeterministicVendor500; exports.formatVendorDetail = formatVendorDetail; exports.NoopLogger = NoopLogger; exports.REDACTED = REDACTED; exports.CREDENTIAL_HEADER_NAMES = CREDENTIAL_HEADER_NAMES; exports.isCredentialHeaderName = isCredentialHeaderName; exports.redactRecord = redactRecord; exports.SECRET_RESPONSE_FIELDS = SECRET_RESPONSE_FIELDS; exports.PERSONAL_RESPONSE_FIELDS = PERSONAL_RESPONSE_FIELDS; exports.CONFIDENTIAL_RESPONSE_FIELDS = CONFIDENTIAL_RESPONSE_FIELDS; exports.isRedactedFieldName = isRedactedFieldName; exports.redactResponseBody = redactResponseBody; exports.CREDENTIAL_SHAPE_POINTER = CREDENTIAL_SHAPE_POINTER; exports.mergeDetails = mergeDetails; exports.errorFromStatus = errorFromStatus; exports.StaleObjectError = StaleObjectError; exports.ConfirmationRequiredError = ConfirmationRequiredError; exports.DeleteBoundaryError = DeleteBoundaryError; exports.MarkerUnsafeIdError = MarkerUnsafeIdError; exports.RecoveryTruncatedError = RecoveryTruncatedError; exports.MoveRefusedError = MoveRefusedError; exports.READ_CACHE_MAX_ENTRIES = READ_CACHE_MAX_ENTRIES; exports.ReadCache = ReadCache; exports.ZONE_CATALOG = ZONE_CATALOG; exports.ZONES = ZONES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.zoneUrl = zoneUrl; exports.resolveBaseUrl = resolveBaseUrl; exports.AGENT_PROFILE = AGENT_PROFILE; exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE; exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE; exports.DEFAULT_TIMEOUT_MS = DEFAULT_TIMEOUT_MS; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_MAINTENANCE_MAX_WAIT_MS = DEFAULT_MAINTENANCE_MAX_WAIT_MS; exports.DEFAULT_MAINTENANCE_POLL_MS = DEFAULT_MAINTENANCE_POLL_MS; exports.MAINTENANCE_WINDOW_MAX_MS = MAINTENANCE_WINDOW_MAX_MS; exports.DEFAULT_MAX_CONCURRENT = DEFAULT_MAX_CONCURRENT; exports.DEFAULT_MAX_RESPONSE_BYTES = DEFAULT_MAX_RESPONSE_BYTES; exports.DEFAULT_MAX_SCAN_RECORDS = DEFAULT_MAX_SCAN_RECORDS; exports.DEFAULT_MAX_SCAN_PAGES = DEFAULT_MAX_SCAN_PAGES; exports.DEFAULT_READ_CACHE_TTL_MS = DEFAULT_READ_CACHE_TTL_MS; exports.DEFAULT_FIELD_CACHE_TTL_MS = DEFAULT_FIELD_CACHE_TTL_MS; exports.DEFAULT_RESOURCE_NAME_CACHE_TTL_MS = DEFAULT_RESOURCE_NAME_CACHE_TTL_MS; exports.hasSurroundingQuotes = hasSurroundingQuotes; exports.credentialShapeProblem = credentialShapeProblem; exports.CREDENTIAL_ENV_LOAD_ACTION = CREDENTIAL_ENV_LOAD_ACTION; exports.MIN_PREFIX_SUMMARY_LENGTH = MIN_PREFIX_SUMMARY_LENGTH; exports.credentialValueSummary = credentialValueSummary; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.DEFAULT_CIRCUIT_BREAKER_WINDOW_MS = DEFAULT_CIRCUIT_BREAKER_WINDOW_MS; exports.DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD = DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD; exports.DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS = DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS; exports.DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE = DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE; exports.DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES = DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES; exports.InMemoryCircuitBreakerStore = InMemoryCircuitBreakerStore; exports.defaultCircuitBreakerStore = defaultCircuitBreakerStore; exports.resetDefaultCircuitBreakerStore = resetDefaultCircuitBreakerStore; exports.buildBreakerKey = buildBreakerKey; exports.isBreakerFailure = isBreakerFailure; exports.DEFAULT_COOLDOWN_MAX_MS = DEFAULT_COOLDOWN_MAX_MS; exports.DEFAULT_COOLDOWN_DEFAULT_MS = DEFAULT_COOLDOWN_DEFAULT_MS; exports.DEFAULT_COOLDOWN_MAX_ENTRIES = DEFAULT_COOLDOWN_MAX_ENTRIES; exports.InMemoryCooldownStore = InMemoryCooldownStore; exports.defaultCooldownStore = defaultCooldownStore; exports.resetDefaultCooldownStore = resetDefaultCooldownStore; exports.buildTenantKey = buildTenantKey; exports.cooldownDurationMs = cooldownDurationMs; exports.resolveCredentials = resolveCredentials; exports.buildReadCache = buildReadCache; exports.resolveConfig = resolveConfig; exports.IDEMPOTENT_METHODS = IDEMPOTENT_METHODS; exports.isRecord = isRecord2; exports.assertRecord = assertRecord; exports.deepMergeParams = deepMergeParams; exports.isIdentifierCandidate = isIdentifierCandidate; exports.parseIdentifier = parseIdentifier; exports.flattenUdfs = flattenUdfs; exports.newCorrelationId = newCorrelationId; exports.redactAuditBody = redactAuditBody; exports.camelKey = camelKey; exports.FILTER_OPERATORS = FILTER_OPERATORS; exports.GROUPING_OPERATORS = GROUPING_OPERATORS; exports.MAX_OR_CONDITIONS = MAX_OR_CONDITIONS; exports.MAX_UDF_PER_QUERY = MAX_UDF_PER_QUERY; exports.MAX_QUERY_LENGTH = MAX_QUERY_LENGTH; exports.MAX_GET_LENGTH = MAX_GET_LENGTH; exports.MAX_FIELD_LENGTH = MAX_FIELD_LENGTH; exports.isFilterOperator = isFilterOperator; exports.serializeFilter = serializeFilter; exports.validateFilter = validateFilter; exports.buildFilter = buildFilter; exports.normalizedConditions = normalizedConditions; exports.normalizeInValues = normalizeInValues; exports.assertNoRelationLeaf = assertNoRelationLeaf; exports.buildUrl = buildUrl; exports.cursorToPath = cursorToPath; exports.buildQueryBody = buildQueryBody; exports.buildQueryRequest = buildQueryRequest; exports.runWithSignal = runWithSignal; exports.RELATIONSHIP_ZONE = RELATIONSHIP_ZONE; exports.RELATIONSHIP_MAP = RELATIONSHIP_MAP; exports.DELETE_BOUNDARY_NOTES = DELETE_BOUNDARY_NOTES; exports.MARKER_FIELDS = MARKER_FIELDS; exports.BLIND_SURFACE_INVENTORY = BLIND_SURFACE_INVENTORY; exports.REACHABILITY_PROBE_DEFAULTS = REACHABILITY_PROBE_DEFAULTS; exports.CREATE_GUIDANCE = CREATE_GUIDANCE; exports.unwrapItems = unwrapItems; exports.unwrapItem = unwrapItem; exports.unwrapQueryCount = unwrapQueryCount; exports.unwrapOperation = unwrapOperation; exports.passthrough = passthrough; exports.HttpClient = HttpClient; exports.BOUNDED_QUERY_MAX_LIMIT = BOUNDED_QUERY_MAX_LIMIT; exports.buildDryRunResult = buildDryRunResult; exports.mergePartialBody = mergePartialBody; exports.effectiveRequiredFields = effectiveRequiredFields; exports.MAX_PAGES = MAX_PAGES; exports.clampPageSize = clampPageSize; exports.totalPagesFor = totalPagesFor; exports.paginate = paginate; exports.paginateItems = paginateItems; exports.collectAll = collectAll; exports.toArray = toArray; exports.FIELD_PRESETS = FIELD_PRESETS; exports.FIELD_PRESET_NAMES = FIELD_PRESET_NAMES; exports.resolveFieldsPreset = resolveFieldsPreset; exports.MODEL_DATE_FIELDS = MODEL_DATE_FIELDS; exports.EXPAND_RESOURCE_NAMES_MAX_IDS = EXPAND_RESOURCE_NAMES_MAX_IDS; exports.expandResourceNames = expandResourceNames; exports.ENTITY_TYPE_TO_RESOURCE = ENTITY_TYPE_TO_RESOURCE; exports.resourceForEntityType = resourceForEntityType; exports.isEnumerableResource = isEnumerableResource; exports.WORKFLOW_RESOURCES = WORKFLOW_RESOURCES; exports.MAX_FIELD_CATALOG_WIRE = MAX_FIELD_CATALOG_WIRE; exports.FIELD_CATALOG_HONESTY_NOTE = FIELD_CATALOG_HONESTY_NOTE; exports.fieldCatalog = fieldCatalog; exports.PICKLIST_VALUE_NOT_SERVED_NOTE = PICKLIST_VALUE_NOT_SERVED_NOTE; exports.TICKET_LABEL_FIELDS = TICKET_LABEL_FIELDS; exports.createNamePlan = createNamePlan; exports.addNameSibling = addNameSibling; exports.addLabelSibling = addLabelSibling; exports.vendorId = vendorId; exports.resolveLineOfBusinessChain = resolveLineOfBusinessChain; exports.resolveCompositeNames = resolveCompositeNames; exports.readNamesOpt = readNamesOpt; exports.labelRows = labelRows; exports.BaseResource = BaseResource; exports.BillingCodesResource = BillingCodesResource; exports.BillingItemsResource = BillingItemsResource; exports.isDateYMD = isDateYMD; exports.monthsInWindow = monthsInWindow; exports.dayAfter = dayAfter; exports.num = num; exports.collectFilterFieldNames = collectFilterFieldNames; exports.validateQueryFieldNames = validateQueryFieldNames; exports.findUnknownFieldNames = findUnknownFieldNames; exports.resolveTicketStatusSemantics = resolveTicketStatusSemantics; exports.openStatusFilter = openStatusFilter; exports.isClosedStatus = isClosedStatus; exports.CompaniesResource = CompaniesResource; exports.PROFITABILITY_MAX_WINDOW_MONTHS = PROFITABILITY_MAX_WINDOW_MONTHS; exports.SERVICE_LINE_FKS = SERVICE_LINE_FKS; exports.CHARGE_LINE_FKS = CHARGE_LINE_FKS; exports.billingLineType = billingLineType; exports.internalAmount = internalAmount; exports.FETCH_MANY_MAX_ITEMS = FETCH_MANY_MAX_ITEMS; exports.validateFetchManyItems = validateFetchManyItems; exports.fetchMany = fetchMany; exports.FETCH_BY_IDS_MAX_ITEMS = FETCH_BY_IDS_MAX_ITEMS; exports.FETCH_BY_IDS_CHUNK_SIZE = FETCH_BY_IDS_CHUNK_SIZE; exports.fetchByIds = fetchByIds; exports.readPicklists = readPicklists; exports.ContractsResource = ContractsResource; exports.InvoicesResource = InvoicesResource; exports.OrganizationalLevel1sResource = OrganizationalLevel1sResource; exports.OrganizationalLevel2sResource = OrganizationalLevel2sResource; exports.OrganizationalLevelAssociationsResource = OrganizationalLevelAssociationsResource; exports.ResourcesResource = ResourcesResource; exports.UI_LINK_ENTITIES = UI_LINK_ENTITIES; exports.buildUiLink = buildUiLink; exports.uiLink = uiLink; exports.refuse = refuse; exports.queryRows = queryRows; exports.runMove = runMove; exports.uiLinkFor = uiLinkFor; exports.TimeEntriesResource = TimeEntriesResource;
26659
+
26660
+ exports.AUTH_HEADERS = AUTH_HEADERS; exports.buildAuthHeaders = buildAuthHeaders; exports.withAuthHeaders = withAuthHeaders; exports.AutotaskError = AutotaskError; exports.AutotaskConfigError = AutotaskConfigError; exports.isAutotaskError = isAutotaskError; exports.AutotaskNetworkError = AutotaskNetworkError; exports.AutotaskTimeoutError = AutotaskTimeoutError; exports.AutotaskAbortError = AutotaskAbortError; exports.ResponseRejectedError = ResponseRejectedError; exports.BadRequestError = BadRequestError; exports.UnauthorizedError = UnauthorizedError; exports.ForbiddenError = ForbiddenError; exports.NotFoundError = NotFoundError; exports.ConflictError = ConflictError; exports.UnprocessableEntityError = UnprocessableEntityError; exports.RateLimitError = RateLimitError; exports.ServerError = ServerError; exports.UnexpectedContentTypeError = UnexpectedContentTypeError; exports.EmptyResponseError = EmptyResponseError; exports.CircuitBreakerError = CircuitBreakerError; exports.HostPolicyDeniedError = HostPolicyDeniedError; exports.ResolutionError = ResolutionError; exports.PaginationLimitError = PaginationLimitError; exports.QueryTooLongError = QueryTooLongError; exports.parseVendorErrors = parseVendorErrors; exports.isDeterministicVendor500 = isDeterministicVendor500; exports.formatVendorDetail = formatVendorDetail; exports.NoopLogger = NoopLogger; exports.REDACTED = REDACTED; exports.CREDENTIAL_HEADER_NAMES = CREDENTIAL_HEADER_NAMES; exports.isCredentialHeaderName = isCredentialHeaderName; exports.redactRecord = redactRecord; exports.SECRET_RESPONSE_FIELDS = SECRET_RESPONSE_FIELDS; exports.PERSONAL_RESPONSE_FIELDS = PERSONAL_RESPONSE_FIELDS; exports.CONFIDENTIAL_RESPONSE_FIELDS = CONFIDENTIAL_RESPONSE_FIELDS; exports.isRedactedFieldName = isRedactedFieldName; exports.redactResponseBody = redactResponseBody; exports.CREDENTIAL_SHAPE_POINTER = CREDENTIAL_SHAPE_POINTER; exports.mergeDetails = mergeDetails; exports.errorFromStatus = errorFromStatus; exports.StaleObjectError = StaleObjectError; exports.ConfirmationRequiredError = ConfirmationRequiredError; exports.DeleteBoundaryError = DeleteBoundaryError; exports.MarkerUnsafeIdError = MarkerUnsafeIdError; exports.RecoveryTruncatedError = RecoveryTruncatedError; exports.MoveRefusedError = MoveRefusedError; exports.READ_CACHE_MAX_ENTRIES = READ_CACHE_MAX_ENTRIES; exports.ReadCache = ReadCache; exports.ZONE_CATALOG = ZONE_CATALOG; exports.ZONES = ZONES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.zoneUrl = zoneUrl; exports.resolveBaseUrl = resolveBaseUrl; exports.AGENT_PROFILE = AGENT_PROFILE; exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE; exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE; exports.DEFAULT_TIMEOUT_MS = DEFAULT_TIMEOUT_MS; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_MAINTENANCE_MAX_WAIT_MS = DEFAULT_MAINTENANCE_MAX_WAIT_MS; exports.DEFAULT_MAINTENANCE_POLL_MS = DEFAULT_MAINTENANCE_POLL_MS; exports.MAINTENANCE_WINDOW_MAX_MS = MAINTENANCE_WINDOW_MAX_MS; exports.DEFAULT_MAX_CONCURRENT = DEFAULT_MAX_CONCURRENT; exports.DEFAULT_MAX_RESPONSE_BYTES = DEFAULT_MAX_RESPONSE_BYTES; exports.DEFAULT_MAX_SCAN_RECORDS = DEFAULT_MAX_SCAN_RECORDS; exports.DEFAULT_MAX_SCAN_PAGES = DEFAULT_MAX_SCAN_PAGES; exports.DEFAULT_READ_CACHE_TTL_MS = DEFAULT_READ_CACHE_TTL_MS; exports.DEFAULT_FIELD_CACHE_TTL_MS = DEFAULT_FIELD_CACHE_TTL_MS; exports.DEFAULT_RESOURCE_NAME_CACHE_TTL_MS = DEFAULT_RESOURCE_NAME_CACHE_TTL_MS; exports.hasSurroundingQuotes = hasSurroundingQuotes; exports.credentialShapeProblem = credentialShapeProblem; exports.CREDENTIAL_ENV_LOAD_ACTION = CREDENTIAL_ENV_LOAD_ACTION; exports.MIN_PREFIX_SUMMARY_LENGTH = MIN_PREFIX_SUMMARY_LENGTH; exports.credentialValueSummary = credentialValueSummary; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.DEFAULT_CIRCUIT_BREAKER_WINDOW_MS = DEFAULT_CIRCUIT_BREAKER_WINDOW_MS; exports.DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD = DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD; exports.DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS = DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS; exports.DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE = DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE; exports.DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES = DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES; exports.InMemoryCircuitBreakerStore = InMemoryCircuitBreakerStore; exports.defaultCircuitBreakerStore = defaultCircuitBreakerStore; exports.resetDefaultCircuitBreakerStore = resetDefaultCircuitBreakerStore; exports.buildBreakerKey = buildBreakerKey; exports.isBreakerFailure = isBreakerFailure; exports.DEFAULT_COOLDOWN_MAX_MS = DEFAULT_COOLDOWN_MAX_MS; exports.DEFAULT_COOLDOWN_DEFAULT_MS = DEFAULT_COOLDOWN_DEFAULT_MS; exports.DEFAULT_COOLDOWN_MAX_ENTRIES = DEFAULT_COOLDOWN_MAX_ENTRIES; exports.InMemoryCooldownStore = InMemoryCooldownStore; exports.defaultCooldownStore = defaultCooldownStore; exports.resetDefaultCooldownStore = resetDefaultCooldownStore; exports.buildTenantKey = buildTenantKey; exports.cooldownDurationMs = cooldownDurationMs; exports.resolveCredentials = resolveCredentials; exports.buildReadCache = buildReadCache; exports.resolveConfig = resolveConfig; exports.IDEMPOTENT_METHODS = IDEMPOTENT_METHODS; exports.isRecord = isRecord2; exports.assertRecord = assertRecord; exports.deepMergeParams = deepMergeParams; exports.isIdentifierCandidate = isIdentifierCandidate; exports.parseIdentifier = parseIdentifier; exports.flattenUdfs = flattenUdfs; exports.newCorrelationId = newCorrelationId; exports.redactAuditBody = redactAuditBody; exports.camelKey = camelKey; exports.FILTER_OPERATORS = FILTER_OPERATORS; exports.GROUPING_OPERATORS = GROUPING_OPERATORS; exports.MAX_OR_CONDITIONS = MAX_OR_CONDITIONS; exports.MAX_UDF_PER_QUERY = MAX_UDF_PER_QUERY; exports.MAX_QUERY_LENGTH = MAX_QUERY_LENGTH; exports.MAX_GET_LENGTH = MAX_GET_LENGTH; exports.MAX_FIELD_LENGTH = MAX_FIELD_LENGTH; exports.isFilterOperator = isFilterOperator; exports.serializeFilter = serializeFilter; exports.validateFilter = validateFilter; exports.buildFilter = buildFilter; exports.normalizedConditions = normalizedConditions; exports.normalizeInValues = normalizeInValues; exports.assertNoRelationLeaf = assertNoRelationLeaf; exports.buildUrl = buildUrl; exports.cursorToPath = cursorToPath; exports.buildQueryBody = buildQueryBody; exports.buildQueryRequest = buildQueryRequest; exports.runWithSignal = runWithSignal; exports.RELATIONSHIP_ZONE = RELATIONSHIP_ZONE; exports.RELATIONSHIP_MAP = RELATIONSHIP_MAP; exports.DELETE_BOUNDARY_NOTES = DELETE_BOUNDARY_NOTES; exports.MARKER_FIELDS = MARKER_FIELDS; exports.BLIND_SURFACE_INVENTORY = BLIND_SURFACE_INVENTORY; exports.REACHABILITY_PROBE_DEFAULTS = REACHABILITY_PROBE_DEFAULTS; exports.CREATE_GUIDANCE = CREATE_GUIDANCE; exports.unwrapItems = unwrapItems; exports.unwrapItem = unwrapItem; exports.unwrapQueryCount = unwrapQueryCount; exports.unwrapOperation = unwrapOperation; exports.passthrough = passthrough; exports.HttpClient = HttpClient; exports.BOUNDED_QUERY_MAX_LIMIT = BOUNDED_QUERY_MAX_LIMIT; exports.buildDryRunResult = buildDryRunResult; exports.mergePartialBody = mergePartialBody; exports.effectiveRequiredFields = effectiveRequiredFields; exports.MAX_PAGES = MAX_PAGES; exports.clampPageSize = clampPageSize; exports.totalPagesFor = totalPagesFor; exports.paginate = paginate; exports.paginateItems = paginateItems; exports.collectAll = collectAll; exports.toArray = toArray; exports.FIELD_PRESETS = FIELD_PRESETS; exports.FIELD_PRESET_NAMES = FIELD_PRESET_NAMES; exports.resolveFieldsPreset = resolveFieldsPreset; exports.MODEL_DATE_FIELDS = MODEL_DATE_FIELDS; exports.EXPAND_RESOURCE_NAMES_MAX_IDS = EXPAND_RESOURCE_NAMES_MAX_IDS; exports.expandResourceNames = expandResourceNames; exports.ENTITY_TYPE_TO_RESOURCE = ENTITY_TYPE_TO_RESOURCE; exports.resourceForEntityType = resourceForEntityType; exports.isEnumerableResource = isEnumerableResource; exports.WORKFLOW_RESOURCES = WORKFLOW_RESOURCES; exports.MAX_FIELD_CATALOG_WIRE = MAX_FIELD_CATALOG_WIRE; exports.FIELD_CATALOG_HONESTY_NOTE = FIELD_CATALOG_HONESTY_NOTE; exports.MIN_FIELD_CATALOG_MAX_BYTES = MIN_FIELD_CATALOG_MAX_BYTES; exports.fieldCatalog = fieldCatalog; exports.PICKLIST_VALUE_NOT_SERVED_NOTE = PICKLIST_VALUE_NOT_SERVED_NOTE; exports.TICKET_LABEL_FIELDS = TICKET_LABEL_FIELDS; exports.createNamePlan = createNamePlan; exports.addNameSibling = addNameSibling; exports.addLabelSibling = addLabelSibling; exports.vendorId = vendorId; exports.resolveLineOfBusinessChain = resolveLineOfBusinessChain; exports.resolveCompositeNames = resolveCompositeNames; exports.readNamesOpt = readNamesOpt; exports.labelRows = labelRows; exports.BaseResource = BaseResource; exports.BillingCodesResource = BillingCodesResource; exports.BillingItemsResource = BillingItemsResource; exports.isDateYMD = isDateYMD; exports.monthsInWindow = monthsInWindow; exports.dayAfter = dayAfter; exports.num = num; exports.collectFilterFieldNames = collectFilterFieldNames; exports.validateQueryFieldNames = validateQueryFieldNames; exports.findUnknownFieldNames = findUnknownFieldNames; exports.resolveTicketStatusSemantics = resolveTicketStatusSemantics; exports.openStatusFilter = openStatusFilter; exports.isClosedStatus = isClosedStatus; exports.CompaniesResource = CompaniesResource; exports.PROFITABILITY_MAX_WINDOW_MONTHS = PROFITABILITY_MAX_WINDOW_MONTHS; exports.SERVICE_LINE_FKS = SERVICE_LINE_FKS; exports.CHARGE_LINE_FKS = CHARGE_LINE_FKS; exports.billingLineType = billingLineType; exports.internalAmount = internalAmount; exports.FETCH_MANY_MAX_ITEMS = FETCH_MANY_MAX_ITEMS; exports.validateFetchManyItems = validateFetchManyItems; exports.fetchMany = fetchMany; exports.FETCH_BY_IDS_MAX_ITEMS = FETCH_BY_IDS_MAX_ITEMS; exports.FETCH_BY_IDS_CHUNK_SIZE = FETCH_BY_IDS_CHUNK_SIZE; exports.fetchByIds = fetchByIds; exports.readPicklists = readPicklists; exports.ContractsResource = ContractsResource; exports.InvoicesResource = InvoicesResource; exports.OrganizationalLevel1sResource = OrganizationalLevel1sResource; exports.OrganizationalLevel2sResource = OrganizationalLevel2sResource; exports.OrganizationalLevelAssociationsResource = OrganizationalLevelAssociationsResource; exports.ResourcesResource = ResourcesResource; exports.UI_LINK_ENTITIES = UI_LINK_ENTITIES; exports.buildUiLink = buildUiLink; exports.uiLink = uiLink; exports.refuse = refuse; exports.queryRows = queryRows; exports.runMove = runMove; exports.uiLinkFor = uiLinkFor; exports.TimeEntriesResource = TimeEntriesResource;