node-autotask 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/MCP_TOOL_CATALOG.json +27 -8
  3. package/MCP_TOOL_MANIFEST.md +138 -137
  4. package/N8N_MCP_MANIFEST.json +17 -17
  5. package/N8N_MCP_MANIFEST.md +18 -18
  6. package/README.md +6 -19
  7. package/capabilities.json +1815 -1432
  8. package/dist/{base-CVx2VMSj.d.cts → base-CftidiyZ.d.cts} +2 -1
  9. package/dist/{base-CVx2VMSj.d.ts → base-CftidiyZ.d.ts} +2 -1
  10. package/dist/capabilities.cjs +2 -2
  11. package/dist/capabilities.d.cts +2 -1
  12. package/dist/capabilities.d.ts +2 -1
  13. package/dist/capabilities.js +1 -1
  14. package/dist/{chunk-TH7B5H4P.cjs → chunk-6WLGHKIU.cjs} +285 -285
  15. package/dist/{chunk-KTEDPS4X.js → chunk-7MCKJTSA.js} +2 -2
  16. package/dist/{chunk-5VHSLJMR.js → chunk-A6LHCJQP.js} +30 -9
  17. package/dist/{chunk-4EFXIE53.js → chunk-BKTOMNT2.js} +2 -2
  18. package/dist/{chunk-VFLAMMIJ.cjs → chunk-EMYDC5SG.cjs} +151 -120
  19. package/dist/{chunk-SK3GYRNA.cjs → chunk-KWQSGWY5.cjs} +143 -143
  20. package/dist/{chunk-Q23JULNN.js → chunk-LYI5FRPX.js} +55 -24
  21. package/dist/{chunk-JY2BWYXY.js → chunk-N6IWPGHB.js} +1814 -1431
  22. package/dist/{chunk-5BDUMDAQ.cjs → chunk-PH3ESYAF.cjs} +1814 -1431
  23. package/dist/{chunk-MJTKK3QG.cjs → chunk-SN4BMQ2N.cjs} +31 -10
  24. package/dist/{index-C7rMJ4IV.d.ts → index-D8FtzUGP.d.ts} +54 -41
  25. package/dist/{index-C3KFMnRT.d.cts → index-DgBA1JMH.d.cts} +131 -130
  26. package/dist/{index-C3KFMnRT.d.ts → index-DgBA1JMH.d.ts} +131 -130
  27. package/dist/{index-Cm_Xpt7X.d.cts → index-YbEk0awP.d.cts} +54 -41
  28. package/dist/index.cjs +23 -23
  29. package/dist/index.d.cts +8 -7
  30. package/dist/index.d.ts +8 -7
  31. package/dist/index.js +5 -5
  32. package/dist/operations/index.cjs +337 -244
  33. package/dist/operations/index.d.cts +53 -45
  34. package/dist/operations/index.d.ts +53 -45
  35. package/dist/operations/index.js +121 -28
  36. package/dist/pool.cjs +9 -9
  37. package/dist/pool.d.cts +4 -3
  38. package/dist/pool.d.ts +4 -3
  39. package/dist/pool.js +5 -5
  40. package/dist/resources/index.cjs +5 -5
  41. package/dist/resources/index.d.cts +2 -2
  42. package/dist/resources/index.d.ts +2 -2
  43. package/dist/resources/index.js +4 -4
  44. package/dist/types/index.d.cts +1 -1
  45. package/dist/types/index.d.ts +1 -1
  46. package/dist/untrusted.cjs +2 -2
  47. package/dist/untrusted.d.cts +14 -5
  48. package/dist/untrusted.d.ts +14 -5
  49. package/dist/untrusted.js +1 -1
  50. package/docs/API.md +126 -37
  51. package/examples/mcp/schemas.ts +2 -0
  52. package/examples/mcp/tools-read.ts +3 -2
  53. package/package.json +10 -9
@@ -1,20 +1,10 @@
1
- import { a as AutotaskClient, el as BlindSurfaceInfo, em as RelationshipResource, en as BlindSurfaceInventory, eo as BlindSurfaceRow, ep as CreateGuidanceValueRequirement, eq as CreateGuidanceRow, er as CreateBlockerKind, es as CreateGuidanceReport, Z as ZoneName, be as FieldCacheKind } from '../index-Cm_Xpt7X.cjs';
2
- export { bd as FIELD_CACHE_KINDS } from '../index-Cm_Xpt7X.cjs';
3
- import { I as Identifier, cX as EmptyReasonInfo, e9 as PickListValue, a as FilterCondition } from '../index-C3KFMnRT.cjs';
4
- export { hV as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-C3KFMnRT.cjs';
1
+ import { el as RowNamesSummary, em as BlindSurfaceInfo, en as RelationshipResource, eo as BlindSurfaceInventory, ep as BlindSurfaceRow, eq as CreateGuidanceValueRequirement, er as CreateGuidanceRow, es as CreateBlockerKind, et as CreateGuidanceReport, be as FieldCacheKind } from '../index-YbEk0awP.cjs';
2
+ import { AutotaskClient, ZoneName } from '../index.cjs';
3
+ export { bd as FIELD_CACHE_KINDS } from '../index-YbEk0awP.cjs';
4
+ import { Identifier, EmptyReasonInfo, PickListValue, FilterCondition } from '../index.cjs';
5
+ export { hV as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-DgBA1JMH.cjs';
5
6
  import { CapabilityRecord } from '../capabilities.cjs';
6
- import { b as AutotaskConfigError } from '../base-CVx2VMSj.cjs';
7
-
8
- /** The `names` summary a labelled result carries ONLY when something was
9
- * left unlabelled: the cold-read cap was hit or a picklist could not be
10
- * resolved. Issue #287: the structured `truncated` / `capped` / catalogError
11
- * bookkeeping was trimmed — the note is the summary. */
12
- interface RowNamesSummary {
13
- /** One line a reader can act on. */
14
- note: string;
15
- /** Picklist field -> why its `*Label` is null (the fieldCatalog honesty note / the value-not-served note). */
16
- reasons?: Record<string, string>;
17
- }
7
+ import { AutotaskConfigError } from '../index.cjs';
18
8
 
19
9
  /**
20
10
  * Cross-resource operations layer — shared types (ARCHITECTURE section 19.1,
@@ -94,19 +84,10 @@ interface FetchManyResult {
94
84
  interface ResolveAnyOptions {
95
85
  /** Resource keys to resolve against (default: the five workflow resources). */
96
86
  resources?: readonly string[];
97
- /**
98
- * Issue #287 (D7): the match mode (default `'exact'`).
99
- * - `'exact'` — the per-resource exact resolution (numeric id first, then
100
- * exact on the primary text field); the historical behaviour.
101
- * - `'auto'` — exact first (the same per-resource order); on a clean miss of a
102
- * NON-NUMERIC string identifier, a bounded case-insensitive CONTAINS on the
103
- * resource's primary text field (bounded by the resource's scan record cap —
104
- * default 500 records): exactly one hit resolves it (cost `'server-filter'`),
105
- * several hits report that resource as `RESOLUTION_AMBIGUOUS` with the
106
- * candidate ids, zero hits report the miss unchanged. A numeric id miss is
107
- * never re-scanned (the contains fallback is for text values only).
108
- */
87
+ /** Default exact. Auto runs a contains sweep only after EVERY exact lookup cleanly misses; numeric ids never fall back. Hits, ambiguity, truncation and faults suppress the sweep. */
109
88
  match?: 'exact' | 'auto';
89
+ /** Maximum contains matches per resource: integer 1..500. Defaults to the configured resolution.maxScanRecords capped at 500; an explicit limit may narrow, never raise that cap. Exact lookup sizes are unchanged. A full result is conservatively marked truncated. */
90
+ limit?: number;
110
91
  }
111
92
  /**
112
93
  * One resource's outcome. Unlike single-resource `resolve`, a miss does NOT
@@ -118,27 +99,20 @@ interface ResolveAnyResourceOutcome {
118
99
  value: Record<string, unknown> | null;
119
100
  /** How the match was found (or what was attempted). */
120
101
  resolutionCost: 'direct' | 'server-filter' | 'client-scan';
121
- /**
122
- * Records read by the bounded CLIENT scan fallback. The `match: 'auto'`
123
- * server-filter contains fallback reads ZERO records client-side (the
124
- * vendor applies the contains filter; the client receives at most the
125
- * scan-cap matching rows) and reports `scanned: 0` with
126
- * `resolutionCost: 'server-filter'`.
127
- */
102
+ /** Records read by the bounded client scan. Server-filter contains outcomes report zero. */
128
103
  scanned: number;
129
- /** True when the scan hit its cap (a complete non-match is unproven). */
104
+ /** True when a client scan or contains result hit its cap (completeness is unproven). */
130
105
  scanTruncated: boolean;
131
- /**
132
- * Candidate ids when the resource matched more than one record. The
133
- * server-filter contains fallback's list is bounded by the scan record
134
- * cap — a `RESOLUTION_AMBIGUOUS` outcome can carry up to the cap
135
- * candidate ids (default 500).
136
- */
106
+ /** Candidate ids on ambiguity or a cap-full contains result; contains candidates are bounded by limit. */
137
107
  candidates: (number | string)[];
138
108
  /** Error code when the resource could not resolve (e.g. `NOT_FOUND`, `CONFIG_ERROR`). */
139
109
  error?: string;
140
110
  }
141
111
  interface ResolveAnyResult {
112
+ /** Which lookup phase produced this result, including an empty contains sweep. */
113
+ matched: 'exact' | 'contains';
114
+ /** Full per-resource records from the fallback sweep; present exactly when matched is contains. */
115
+ contains?: SearchAcrossResourcesResult;
142
116
  identifier: number | string;
143
117
  /** One outcome per requested resource, in request order. */
144
118
  results: ResolveAnyResourceOutcome[];
@@ -189,6 +163,39 @@ declare function searchAcrossResources(client: AutotaskClient, query: string, op
189
163
 
190
164
  declare function resolveAny(client: AutotaskClient, identifier: number | string, opts?: ResolveAnyOptions): Promise<ResolveAnyResult>;
191
165
 
166
+ /** Staff lookup with tenant-labelled API-user exclusions and honest metadata state. */
167
+
168
+ interface ResolveStaffOptions {
169
+ /** Match only email; even a digit string is treated as email. */
170
+ emailOnly?: boolean;
171
+ /** Include API users in text matches (default false). Numeric ids always bypass exclusions. */
172
+ includeApiUsers?: boolean;
173
+ /** Maximum returned candidates, 1..10 (default 10); the matched count remains available. */
174
+ limit?: number;
175
+ }
176
+ interface ResolveStaffMatch {
177
+ record: Record<string, unknown>;
178
+ /** Present only when tenant labels identify API users AND this record has a labelled value. */
179
+ apiUser?: boolean;
180
+ /** The tenant's label, verbatim. */
181
+ licenseTypeLabel?: string;
182
+ }
183
+ interface ResolveStaffResult {
184
+ identifier: Identifier;
185
+ lookup: 'id' | 'text';
186
+ matches: ResolveStaffMatch[];
187
+ /** Matches found after exclusions, before the candidate limit; a lower bound when truncated. */
188
+ matchedCount: number;
189
+ /** More records may exist, or candidates were cut by limit. Never treat a truncated singleton as unique. */
190
+ truncated: boolean;
191
+ /** ok: API labels found; none: labels found but no API label; absent: no labels exposed; error: metadata read failed. */
192
+ metadataState: 'ok' | 'none' | 'absent' | 'error';
193
+ /** Label coverage when the existing client labels option is enabled. */
194
+ names?: RowNamesSummary;
195
+ }
196
+ /** Active email/userName/name lookup; numeric ids fetch directly regardless of active/licence status. */
197
+ declare function resolveStaff(client: AutotaskClient, identifier: Identifier, opts?: ResolveStaffOptions): Promise<ResolveStaffResult>;
198
+
192
199
  /** The pinned per-call item cap (over → CONFIG_ERROR pre-request, zero wire). */
193
200
  declare const FETCH_MANY_MAX_ITEMS = 20;
194
201
  interface FetchManyOptions {
@@ -819,8 +826,8 @@ type SanitiseResult = Record<string, unknown>;
819
826
  * `metadata.untrustedFields` decides the field list.
820
827
  * @returns A promise for a NEW result object with the present untrusted
821
828
  * fields wrapped (the input is never mutated) when the operation
822
- * declares untrusted fields — or the input returned unchanged
823
- * (the same reference) when it declares none.
829
+ * declares untrusted fields or contains UDF values to fence; otherwise
830
+ * the input is returned unchanged (the same reference).
824
831
  * @throws {AutotaskConfigError} an unknown (non-string/empty, or not-in-the-
825
832
  * registry) operation — typed, zero wire.
826
833
  */
@@ -1321,4 +1328,5 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
1321
1328
  */
1322
1329
  declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[] | Record<string, unknown>, opts?: InvokeOptions): Promise<unknown>;
1323
1330
 
1324
- export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, type AggregateGroup, type AggregateOptions, type AggregateResult, BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, type DateBucket, type DerivationRule, EXPAND_RESOURCE_NAMES_MAX_IDS, type EffectiveRequiredFields, type ExpandResourceNameRow, type ExpandResourceNamesOptions, type ExpandResourceNamesResult, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchByIdsOptions, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogCompactFieldRow, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, type FieldCatalogTrimKind, type FieldCatalogTruncation, type FieldDerivation, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, MIN_FIELD_CATALOG_MAX_BYTES, PARAMS_BAG_KEYS, type ProbeReachabilityOptions, type ProbeReachabilityResult, type ProbeSurfaceRow, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, type RecoveryDeleteBoundary, type RecoveryInput, type RecoveryMatch, type RecoveryOptions, type RecoveryResult, type RequiredFieldsRecord, type RequiredFieldsSource, type RequiredFieldsZoneFacts, type ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type RevenueRollupAmount, type RevenueRollupDimension, type RevenueRollupKey, type RevenueRollupNonChargeable, type RevenueRollupNonChargeableAmount, type RevenueRollupOptions, type RevenueRollupResult, type RevenueRollupRow, type RowNamesSummary, type SanitiseResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, type ServedCreateGuidanceReport, type ServedCreateGuidanceRow, UI_LINK_ENTITIES, type UiLinkEntity, type UiLinkInput, type UiLinkResult, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, revenueRollup, sanitiseResult, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
1331
+ export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, BLIND_SURFACE_KINDS, BlindSurfaceRow, CREATE_BLOCKER_KINDS, EXPAND_RESOURCE_NAMES_MAX_IDS, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, FieldCacheKind, INVOKE_OPTION_KEYS, MAX_FIELD_CATALOG_WIRE, MIN_FIELD_CATALOG_MAX_BYTES, PARAMS_BAG_KEYS, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, RowNamesSummary, UI_LINK_ENTITIES, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, resolveStaff, revenueRollup, sanitiseResult, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
1332
+ export type { AggregateGroup, AggregateOptions, AggregateResult, BlindSurfaceKind, BlindSurfaceOptions, CreateGuidanceOptions, DateBucket, DerivationRule, EffectiveRequiredFields, ExpandResourceNameRow, ExpandResourceNamesOptions, ExpandResourceNamesResult, FetchByIdsOptions, FetchManyItem, FetchManyItemError, FetchManyItemResult, FetchManyOptions, FetchManyResult, FieldCatalogCompactFieldRow, FieldCatalogFieldRow, FieldCatalogOptions, FieldCatalogResult, FieldCatalogRow, FieldCatalogRowError, FieldCatalogTrimKind, FieldCatalogTruncation, FieldDerivation, InvokeMode, InvokeOptions, ProbeReachabilityOptions, ProbeReachabilityResult, ProbeSurfaceRow, RecoveryDeleteBoundary, RecoveryInput, RecoveryMatch, RecoveryOptions, RecoveryResult, RequiredFieldsRecord, RequiredFieldsSource, RequiredFieldsZoneFacts, ResolveAnyOptions, ResolveAnyResourceOutcome, ResolveAnyResult, ResolveStaffMatch, ResolveStaffOptions, ResolveStaffResult, RevenueRollupAmount, RevenueRollupDimension, RevenueRollupKey, RevenueRollupNonChargeable, RevenueRollupNonChargeableAmount, RevenueRollupOptions, RevenueRollupResult, RevenueRollupRow, SanitiseResult, SearchAcrossResourcesOptions, SearchAcrossResourcesResult, SearchAcrossResourcesRow, ServedCreateGuidanceReport, ServedCreateGuidanceRow, UiLinkEntity, UiLinkInput, UiLinkResult };
@@ -1,20 +1,10 @@
1
- import { a as AutotaskClient, el as BlindSurfaceInfo, em as RelationshipResource, en as BlindSurfaceInventory, eo as BlindSurfaceRow, ep as CreateGuidanceValueRequirement, eq as CreateGuidanceRow, er as CreateBlockerKind, es as CreateGuidanceReport, Z as ZoneName, be as FieldCacheKind } from '../index-C7rMJ4IV.js';
2
- export { bd as FIELD_CACHE_KINDS } from '../index-C7rMJ4IV.js';
3
- import { I as Identifier, cX as EmptyReasonInfo, e9 as PickListValue, a as FilterCondition } from '../index-C3KFMnRT.js';
4
- export { hV as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-C3KFMnRT.js';
1
+ import { el as RowNamesSummary, em as BlindSurfaceInfo, en as RelationshipResource, eo as BlindSurfaceInventory, ep as BlindSurfaceRow, eq as CreateGuidanceValueRequirement, er as CreateGuidanceRow, es as CreateBlockerKind, et as CreateGuidanceReport, be as FieldCacheKind } from '../index-D8FtzUGP.js';
2
+ import { AutotaskClient, ZoneName } from '../index.js';
3
+ export { bd as FIELD_CACHE_KINDS } from '../index-D8FtzUGP.js';
4
+ import { Identifier, EmptyReasonInfo, PickListValue, FilterCondition } from '../index.js';
5
+ export { hV as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-DgBA1JMH.js';
5
6
  import { CapabilityRecord } from '../capabilities.js';
6
- import { b as AutotaskConfigError } from '../base-CVx2VMSj.js';
7
-
8
- /** The `names` summary a labelled result carries ONLY when something was
9
- * left unlabelled: the cold-read cap was hit or a picklist could not be
10
- * resolved. Issue #287: the structured `truncated` / `capped` / catalogError
11
- * bookkeeping was trimmed — the note is the summary. */
12
- interface RowNamesSummary {
13
- /** One line a reader can act on. */
14
- note: string;
15
- /** Picklist field -> why its `*Label` is null (the fieldCatalog honesty note / the value-not-served note). */
16
- reasons?: Record<string, string>;
17
- }
7
+ import { AutotaskConfigError } from '../index.js';
18
8
 
19
9
  /**
20
10
  * Cross-resource operations layer — shared types (ARCHITECTURE section 19.1,
@@ -94,19 +84,10 @@ interface FetchManyResult {
94
84
  interface ResolveAnyOptions {
95
85
  /** Resource keys to resolve against (default: the five workflow resources). */
96
86
  resources?: readonly string[];
97
- /**
98
- * Issue #287 (D7): the match mode (default `'exact'`).
99
- * - `'exact'` — the per-resource exact resolution (numeric id first, then
100
- * exact on the primary text field); the historical behaviour.
101
- * - `'auto'` — exact first (the same per-resource order); on a clean miss of a
102
- * NON-NUMERIC string identifier, a bounded case-insensitive CONTAINS on the
103
- * resource's primary text field (bounded by the resource's scan record cap —
104
- * default 500 records): exactly one hit resolves it (cost `'server-filter'`),
105
- * several hits report that resource as `RESOLUTION_AMBIGUOUS` with the
106
- * candidate ids, zero hits report the miss unchanged. A numeric id miss is
107
- * never re-scanned (the contains fallback is for text values only).
108
- */
87
+ /** Default exact. Auto runs a contains sweep only after EVERY exact lookup cleanly misses; numeric ids never fall back. Hits, ambiguity, truncation and faults suppress the sweep. */
109
88
  match?: 'exact' | 'auto';
89
+ /** Maximum contains matches per resource: integer 1..500. Defaults to the configured resolution.maxScanRecords capped at 500; an explicit limit may narrow, never raise that cap. Exact lookup sizes are unchanged. A full result is conservatively marked truncated. */
90
+ limit?: number;
110
91
  }
111
92
  /**
112
93
  * One resource's outcome. Unlike single-resource `resolve`, a miss does NOT
@@ -118,27 +99,20 @@ interface ResolveAnyResourceOutcome {
118
99
  value: Record<string, unknown> | null;
119
100
  /** How the match was found (or what was attempted). */
120
101
  resolutionCost: 'direct' | 'server-filter' | 'client-scan';
121
- /**
122
- * Records read by the bounded CLIENT scan fallback. The `match: 'auto'`
123
- * server-filter contains fallback reads ZERO records client-side (the
124
- * vendor applies the contains filter; the client receives at most the
125
- * scan-cap matching rows) and reports `scanned: 0` with
126
- * `resolutionCost: 'server-filter'`.
127
- */
102
+ /** Records read by the bounded client scan. Server-filter contains outcomes report zero. */
128
103
  scanned: number;
129
- /** True when the scan hit its cap (a complete non-match is unproven). */
104
+ /** True when a client scan or contains result hit its cap (completeness is unproven). */
130
105
  scanTruncated: boolean;
131
- /**
132
- * Candidate ids when the resource matched more than one record. The
133
- * server-filter contains fallback's list is bounded by the scan record
134
- * cap — a `RESOLUTION_AMBIGUOUS` outcome can carry up to the cap
135
- * candidate ids (default 500).
136
- */
106
+ /** Candidate ids on ambiguity or a cap-full contains result; contains candidates are bounded by limit. */
137
107
  candidates: (number | string)[];
138
108
  /** Error code when the resource could not resolve (e.g. `NOT_FOUND`, `CONFIG_ERROR`). */
139
109
  error?: string;
140
110
  }
141
111
  interface ResolveAnyResult {
112
+ /** Which lookup phase produced this result, including an empty contains sweep. */
113
+ matched: 'exact' | 'contains';
114
+ /** Full per-resource records from the fallback sweep; present exactly when matched is contains. */
115
+ contains?: SearchAcrossResourcesResult;
142
116
  identifier: number | string;
143
117
  /** One outcome per requested resource, in request order. */
144
118
  results: ResolveAnyResourceOutcome[];
@@ -189,6 +163,39 @@ declare function searchAcrossResources(client: AutotaskClient, query: string, op
189
163
 
190
164
  declare function resolveAny(client: AutotaskClient, identifier: number | string, opts?: ResolveAnyOptions): Promise<ResolveAnyResult>;
191
165
 
166
+ /** Staff lookup with tenant-labelled API-user exclusions and honest metadata state. */
167
+
168
+ interface ResolveStaffOptions {
169
+ /** Match only email; even a digit string is treated as email. */
170
+ emailOnly?: boolean;
171
+ /** Include API users in text matches (default false). Numeric ids always bypass exclusions. */
172
+ includeApiUsers?: boolean;
173
+ /** Maximum returned candidates, 1..10 (default 10); the matched count remains available. */
174
+ limit?: number;
175
+ }
176
+ interface ResolveStaffMatch {
177
+ record: Record<string, unknown>;
178
+ /** Present only when tenant labels identify API users AND this record has a labelled value. */
179
+ apiUser?: boolean;
180
+ /** The tenant's label, verbatim. */
181
+ licenseTypeLabel?: string;
182
+ }
183
+ interface ResolveStaffResult {
184
+ identifier: Identifier;
185
+ lookup: 'id' | 'text';
186
+ matches: ResolveStaffMatch[];
187
+ /** Matches found after exclusions, before the candidate limit; a lower bound when truncated. */
188
+ matchedCount: number;
189
+ /** More records may exist, or candidates were cut by limit. Never treat a truncated singleton as unique. */
190
+ truncated: boolean;
191
+ /** ok: API labels found; none: labels found but no API label; absent: no labels exposed; error: metadata read failed. */
192
+ metadataState: 'ok' | 'none' | 'absent' | 'error';
193
+ /** Label coverage when the existing client labels option is enabled. */
194
+ names?: RowNamesSummary;
195
+ }
196
+ /** Active email/userName/name lookup; numeric ids fetch directly regardless of active/licence status. */
197
+ declare function resolveStaff(client: AutotaskClient, identifier: Identifier, opts?: ResolveStaffOptions): Promise<ResolveStaffResult>;
198
+
192
199
  /** The pinned per-call item cap (over → CONFIG_ERROR pre-request, zero wire). */
193
200
  declare const FETCH_MANY_MAX_ITEMS = 20;
194
201
  interface FetchManyOptions {
@@ -819,8 +826,8 @@ type SanitiseResult = Record<string, unknown>;
819
826
  * `metadata.untrustedFields` decides the field list.
820
827
  * @returns A promise for a NEW result object with the present untrusted
821
828
  * fields wrapped (the input is never mutated) when the operation
822
- * declares untrusted fields — or the input returned unchanged
823
- * (the same reference) when it declares none.
829
+ * declares untrusted fields or contains UDF values to fence; otherwise
830
+ * the input is returned unchanged (the same reference).
824
831
  * @throws {AutotaskConfigError} an unknown (non-string/empty, or not-in-the-
825
832
  * registry) operation — typed, zero wire.
826
833
  */
@@ -1321,4 +1328,5 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
1321
1328
  */
1322
1329
  declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[] | Record<string, unknown>, opts?: InvokeOptions): Promise<unknown>;
1323
1330
 
1324
- export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, type AggregateGroup, type AggregateOptions, type AggregateResult, BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, type DateBucket, type DerivationRule, EXPAND_RESOURCE_NAMES_MAX_IDS, type EffectiveRequiredFields, type ExpandResourceNameRow, type ExpandResourceNamesOptions, type ExpandResourceNamesResult, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchByIdsOptions, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogCompactFieldRow, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, type FieldCatalogTrimKind, type FieldCatalogTruncation, type FieldDerivation, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, MIN_FIELD_CATALOG_MAX_BYTES, PARAMS_BAG_KEYS, type ProbeReachabilityOptions, type ProbeReachabilityResult, type ProbeSurfaceRow, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, type RecoveryDeleteBoundary, type RecoveryInput, type RecoveryMatch, type RecoveryOptions, type RecoveryResult, type RequiredFieldsRecord, type RequiredFieldsSource, type RequiredFieldsZoneFacts, type ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type RevenueRollupAmount, type RevenueRollupDimension, type RevenueRollupKey, type RevenueRollupNonChargeable, type RevenueRollupNonChargeableAmount, type RevenueRollupOptions, type RevenueRollupResult, type RevenueRollupRow, type RowNamesSummary, type SanitiseResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, type ServedCreateGuidanceReport, type ServedCreateGuidanceRow, UI_LINK_ENTITIES, type UiLinkEntity, type UiLinkInput, type UiLinkResult, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, revenueRollup, sanitiseResult, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
1331
+ export { AGGREGATE_DATE_BUCKETS, AGGREGATE_DEFAULT_LIMIT, AGGREGATE_DEFAULT_TOP, AGGREGATE_TOP_MAX, BLIND_SURFACE_KINDS, BlindSurfaceRow, CREATE_BLOCKER_KINDS, EXPAND_RESOURCE_NAMES_MAX_IDS, FETCH_BY_IDS_CHUNK_SIZE, FETCH_BY_IDS_MAX_ITEMS, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, FieldCacheKind, INVOKE_OPTION_KEYS, MAX_FIELD_CATALOG_WIRE, MIN_FIELD_CATALOG_MAX_BYTES, PARAMS_BAG_KEYS, RECOVERY_CONFIRM, RECOVERY_DEFAULT_LIMIT, RECOVERY_MAX_LIMIT, RowNamesSummary, UI_LINK_ENTITIES, WORKFLOW_RESOURCES, aggregate, blindSurfaces, buildUiLink, createGuidance, dateBucketLabel, effectiveRequiredFields, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, foldFlattenedOpts, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, resolveStaff, revenueRollup, sanitiseResult, searchAcrossResources, uiLink, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
1332
+ export type { AggregateGroup, AggregateOptions, AggregateResult, BlindSurfaceKind, BlindSurfaceOptions, CreateGuidanceOptions, DateBucket, DerivationRule, EffectiveRequiredFields, ExpandResourceNameRow, ExpandResourceNamesOptions, ExpandResourceNamesResult, FetchByIdsOptions, FetchManyItem, FetchManyItemError, FetchManyItemResult, FetchManyOptions, FetchManyResult, FieldCatalogCompactFieldRow, FieldCatalogFieldRow, FieldCatalogOptions, FieldCatalogResult, FieldCatalogRow, FieldCatalogRowError, FieldCatalogTrimKind, FieldCatalogTruncation, FieldDerivation, InvokeMode, InvokeOptions, ProbeReachabilityOptions, ProbeReachabilityResult, ProbeSurfaceRow, RecoveryDeleteBoundary, RecoveryInput, RecoveryMatch, RecoveryOptions, RecoveryResult, RequiredFieldsRecord, RequiredFieldsSource, RequiredFieldsZoneFacts, ResolveAnyOptions, ResolveAnyResourceOutcome, ResolveAnyResult, ResolveStaffMatch, ResolveStaffOptions, ResolveStaffResult, RevenueRollupAmount, RevenueRollupDimension, RevenueRollupKey, RevenueRollupNonChargeable, RevenueRollupNonChargeableAmount, RevenueRollupOptions, RevenueRollupResult, RevenueRollupRow, SanitiseResult, SearchAcrossResourcesOptions, SearchAcrossResourcesResult, SearchAcrossResourcesRow, ServedCreateGuidanceReport, ServedCreateGuidanceRow, UiLinkEntity, UiLinkInput, UiLinkResult };
@@ -61,6 +61,7 @@ import {
61
61
  isRecord,
62
62
  labelRows,
63
63
  monthsInWindow,
64
+ normalizeOwnField,
64
65
  normalizedConditions,
65
66
  num,
66
67
  parseIdentifier,
@@ -70,13 +71,13 @@ import {
70
71
  validateFetchManyItems,
71
72
  validateQueryFieldNames,
72
73
  validateWalkBag
73
- } from "../chunk-Q23JULNN.js";
74
+ } from "../chunk-LYI5FRPX.js";
74
75
  import {
75
76
  CAPABILITIES
76
- } from "../chunk-JY2BWYXY.js";
77
+ } from "../chunk-N6IWPGHB.js";
77
78
  import {
78
79
  deepMarkUntrusted
79
- } from "../chunk-5VHSLJMR.js";
80
+ } from "../chunk-A6LHCJQP.js";
80
81
 
81
82
  // src/operations/searchAcrossResources.ts
82
83
  var DEFAULT_LIMIT = 25;
@@ -147,6 +148,11 @@ async function resolveAny(client, identifier, opts = {}) {
147
148
  if (match !== "exact" && match !== "auto") {
148
149
  throw new AutotaskConfigError(`resolveAny: match must be 'exact' or 'auto' (got ${JSON.stringify(match)})`);
149
150
  }
151
+ if (opts.limit !== void 0 && (!Number.isInteger(opts.limit) || opts.limit < 1 || opts.limit > 500)) {
152
+ throw new AutotaskConfigError("resolveAny: limit must be an integer 1..500");
153
+ }
154
+ const configuredCap = Math.min(client.config?.resolution?.maxScanRecords ?? 500, 500);
155
+ const limit = Math.min(opts.limit ?? configuredCap, configuredCap);
150
156
  const results = [];
151
157
  for (const key of keys) {
152
158
  const holder = resourceFor2(client, key);
@@ -164,7 +170,7 @@ async function resolveAny(client, identifier, opts = {}) {
164
170
  }
165
171
  try {
166
172
  const r = await holder.resolveDetailed(identifier);
167
- let outcome = {
173
+ const outcome = {
168
174
  resource: key,
169
175
  value: r.value ?? null,
170
176
  resolutionCost: r.resolutionCost,
@@ -172,22 +178,6 @@ async function resolveAny(client, identifier, opts = {}) {
172
178
  scanTruncated: r.scanTruncated,
173
179
  candidates: (r.candidates ?? []).map((c) => c.id)
174
180
  };
175
- if (match === "auto" && outcome.value === null && typeof identifier === "string") {
176
- const hits = await holder.resolveContainsMatches(identifier);
177
- if (hits.length === 1) {
178
- outcome = { resource: key, value: hits[0], resolutionCost: "server-filter", scanned: 0, scanTruncated: false, candidates: [] };
179
- } else if (hits.length > 1) {
180
- outcome = {
181
- resource: key,
182
- value: null,
183
- resolutionCost: "server-filter",
184
- scanned: 0,
185
- scanTruncated: false,
186
- candidates: hits.map((h) => h.id).filter((id) => typeof id === "number"),
187
- error: "RESOLUTION_AMBIGUOUS"
188
- };
189
- }
190
- }
191
181
  results.push(outcome);
192
182
  } catch (err) {
193
183
  let code;
@@ -214,8 +204,104 @@ async function resolveAny(client, identifier, opts = {}) {
214
204
  });
215
205
  }
216
206
  }
217
- const matches = results.filter((r) => r.value !== null).map((r) => r.resource);
218
- return { identifier, results, matches };
207
+ const cleanMiss = results.every((r) => r.value === null && r.candidates.length === 0 && !r.scanTruncated && (r.error === void 0 || r.error === "NOT_FOUND"));
208
+ if (match === "auto" && typeof identifier === "string" && !/^\d+$/.test(identifier.trim()) && cleanMiss) {
209
+ const contains = await searchAcrossResources(client, identifier, { resources: keys, limit });
210
+ for (const row of contains.results) {
211
+ const outcome = results.find((r) => r.resource === row.resource);
212
+ if (outcome === void 0 || row.matches.length === 0) continue;
213
+ const truncated = row.matches.length >= limit;
214
+ outcome.resolutionCost = "server-filter";
215
+ outcome.scanned = 0;
216
+ outcome.scanTruncated = truncated;
217
+ if (row.matches.length === 1 && !truncated) {
218
+ outcome.value = row.matches[0];
219
+ delete outcome.error;
220
+ } else {
221
+ outcome.candidates = row.matches.map((r) => r.id).filter((id) => typeof id === "number" || typeof id === "string");
222
+ outcome.error = truncated ? "RESOLUTION_TRUNCATED" : "RESOLUTION_AMBIGUOUS";
223
+ }
224
+ }
225
+ return { identifier, results, matches: results.filter((r) => r.value !== null).map((r) => r.resource), matched: "contains", contains };
226
+ }
227
+ return { identifier, results, matches: results.filter((r) => r.value !== null).map((r) => r.resource), matched: "exact" };
228
+ }
229
+
230
+ // src/operations/resolveStaff.ts
231
+ async function staffLabels(client) {
232
+ const out = { api: {}, labels: {}, state: "absent" };
233
+ try {
234
+ const catalog = await fieldCatalog(client, { resources: ["resources"], fields: ["licenseType", "userType"], labels: true });
235
+ const row = catalog.rows[0];
236
+ if (row === void 0 || row.error !== null) return { ...out, state: "error" };
237
+ for (const field of row.fields ?? []) {
238
+ if (!field.picklistValues?.length) continue;
239
+ const labels = /* @__PURE__ */ new Map();
240
+ out.labels[field.name] = labels;
241
+ for (const value of field.picklistValues) {
242
+ if (typeof value.label !== "string") continue;
243
+ labels.set(String(value.value), value.label);
244
+ if (/\bapi\b/i.test(value.label)) (out.api[field.name] ??= /* @__PURE__ */ new Set()).add(String(value.value));
245
+ }
246
+ }
247
+ out.state = Object.keys(out.api).length > 0 ? "ok" : Object.keys(out.labels).length > 0 ? "none" : "absent";
248
+ return out;
249
+ } catch {
250
+ return { ...out, state: "error" };
251
+ }
252
+ }
253
+ function staffFilter(text, api, emailOnly) {
254
+ const base = [
255
+ { field: "isActive", op: "eq", value: true },
256
+ ...Object.entries(api).map(([field, values]) => ({ field, op: "notIn", value: [...values] }))
257
+ ];
258
+ if (emailOnly) return [...base, { field: "email", op: "eq", value: text }];
259
+ const words = text.split(/\s+/);
260
+ const names = words.length === 1 ? [{ field: "firstName", op: "eq", value: text }, { field: "lastName", op: "eq", value: text }] : Array.from({ length: words.length - 1 }, (_, i) => ({ op: "and", items: [
261
+ { field: "firstName", op: "eq", value: words.slice(0, i + 1).join(" ") },
262
+ { field: "lastName", op: "eq", value: words.slice(i + 1).join(" ") }
263
+ ] }));
264
+ return [...base, { op: "or", items: [{ field: "email", op: "eq", value: text }, { field: "userName", op: "eq", value: text }, ...names] }];
265
+ }
266
+ async function resolveStaff(client, identifier, opts = {}) {
267
+ if (!isRecord(opts) || ![Object.prototype, null].includes(Object.getPrototypeOf(opts))) {
268
+ throw new AutotaskConfigError("resolveStaff: opts must be a plain options object");
269
+ }
270
+ const keys = ["emailOnly", "includeApiUsers", "limit"];
271
+ const unknown = Object.keys(opts).filter((key) => !keys.includes(key));
272
+ if (unknown.length > 0) {
273
+ const listed = unknown.slice(0, 10).map((key) => JSON.stringify(key.length > 40 ? `${key.slice(0, 40)}\u2026` : key)).join(", ");
274
+ throw new AutotaskConfigError(`resolveStaff: unknown opts key(s) ${listed}${unknown.length > 10 ? ` (and ${unknown.length - 10} more)` : ""} \u2014 the bag is closed: ${keys.join(", ")}`);
275
+ }
276
+ for (const key of ["emailOnly", "includeApiUsers"]) {
277
+ if (opts[key] !== void 0 && typeof opts[key] !== "boolean") {
278
+ throw new AutotaskConfigError(`resolveStaff: ${key} must be a boolean`);
279
+ }
280
+ }
281
+ const limit = opts.limit === void 0 ? 10 : opts.limit;
282
+ if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 10) throw new AutotaskConfigError("resolveStaff: limit must be an integer 1..10");
283
+ if (typeof identifier !== "number" && typeof identifier !== "string") throw new AutotaskConfigError("resolveStaff: identifier must be a number or string");
284
+ const text = String(identifier).trim();
285
+ if (text === "") throw new AutotaskConfigError("resolveStaff: identifier must be non-empty");
286
+ if (typeof identifier === "number") parseIdentifier(identifier, "resolveStaff identifier");
287
+ const id = !opts.emailOnly && (typeof identifier === "number" || /^\d+$/.test(text)) ? parseIdentifier(identifier, "resolveStaff identifier") : void 0;
288
+ const meta = await staffLabels(client);
289
+ const isApi = (record) => Object.entries(meta.api).some(([field, values]) => record[field] != null && values.has(String(record[field])));
290
+ const match = (record) => {
291
+ const known = meta.state === "ok" && Object.entries(meta.labels).some(([field, labels]) => record[field] != null && labels.has(String(record[field])));
292
+ const label = meta.labels.licenseType?.get(String(record.licenseType));
293
+ return { record, ...known ? { apiUser: isApi(record) } : {}, ...label === void 0 ? {} : { licenseTypeLabel: label } };
294
+ };
295
+ if (id !== void 0) {
296
+ const record = await client.resources.get(id);
297
+ const matches = [match(record)];
298
+ return { identifier, lookup: "id", matches, matchedCount: matches.length, truncated: false, metadataState: meta.state };
299
+ }
300
+ const page = await client.resources.queryBounded({ filter: staffFilter(text, opts.includeApiUsers ? {} : meta.api, opts.emailOnly === true), limit: 50 });
301
+ const rawRows = page.items;
302
+ const labelled = readNamesOpt(client, void 0, "resolveStaff") ? await labelRows(client, "resources", rawRows) : void 0;
303
+ const rows = (labelled?.rows ?? rawRows).filter((record) => opts.includeApiUsers || !isApi(record)).sort((a, b) => Number(isApi(a)) - Number(isApi(b)));
304
+ return { identifier, lookup: "text", matches: rows.slice(0, limit).map(match), matchedCount: rows.length, truncated: page.hasMore || rows.length > limit, metadataState: meta.state, ...labelled?.names === void 0 ? {} : { names: labelled.names } };
219
305
  }
220
306
 
221
307
  // src/operations/aggregate.ts
@@ -400,7 +486,7 @@ async function checkFieldNames(resourceKey, conditions, opts, problems) {
400
486
  const strings = (v) => Array.isArray(v) ? v.filter((f) => typeof f === "string" && f.trim() !== "") : [];
401
487
  const groupBy = strings(opts.groupBy);
402
488
  const found = await findUnknownFieldNames(record, void 0, {
403
- filter: collectFilterFieldNames(conditions, resourceKey),
489
+ filter: collectFilterFieldNames(conditions, resourceKey, "operations.aggregate"),
404
490
  groupBy: groupBy.map((f) => f.split("@")[0]),
405
491
  sum: strings(opts.sum)
406
492
  });
@@ -422,6 +508,13 @@ async function validateAggregate(operation, filter, opts) {
422
508
  const resourceKey = parseOperationKey(operation, problems);
423
509
  const conditions = parseFilterConditions(filter, problems);
424
510
  checkOptsBag(opts, problems);
511
+ if (resourceKey !== void 0) {
512
+ opts = {
513
+ ...opts,
514
+ ...Array.isArray(opts.groupBy) ? { groupBy: opts.groupBy.map((f) => typeof f === "string" ? normalizeOwnField(resourceKey, f) : f) } : {},
515
+ ...Array.isArray(opts.sum) ? { sum: opts.sum.map((f) => typeof f === "string" ? normalizeOwnField(resourceKey, f) : f) } : {}
516
+ };
517
+ }
425
518
  const oracles = {
426
519
  resourceKey,
427
520
  dateSets: resourceKey !== void 0 ? MODEL_DATE_FIELDS[resourceKey] : void 0
@@ -1437,8 +1530,7 @@ async function sanitiseResult(client, result, operation) {
1437
1530
  );
1438
1531
  }
1439
1532
  const fields = record.metadata?.untrustedFields;
1440
- if (!Array.isArray(fields) || fields.length === 0) return result;
1441
- return deepMarkUntrusted(result, fields);
1533
+ return deepMarkUntrusted(result, Array.isArray(fields) ? fields : []);
1442
1534
  }
1443
1535
 
1444
1536
  // src/operations/recovery.ts
@@ -1994,8 +2086,7 @@ async function guardUnscopedQueryWalk(holder, operation, bag) {
1994
2086
  const walk = typeof bag?.["walk"] === "object" && bag?.["walk"] !== null ? bag?.["walk"] : void 0;
1995
2087
  const maxRows = typeof walk?.maxRows === "number" ? walk.maxRows : void 0;
1996
2088
  const effectiveLimit = typeof limit === "number" ? limit : BOUNDED_QUERY_DEFAULT_LIMIT;
1997
- let walked = typeof latest === "number" ? Math.max(effectiveLimit, latest) : effectiveLimit;
1998
- if (maxRows !== void 0) walked = Math.min(walked, maxRows);
2089
+ const walked = maxRows ?? (typeof latest === "number" ? Math.max(effectiveLimit, latest) : effectiveLimit);
1999
2090
  if (walked <= UNSCOPED_WALK_THRESHOLD || hasIdScope(filter)) return {};
2000
2091
  let conditions;
2001
2092
  try {
@@ -2089,6 +2180,7 @@ function governPreRequest(record, operation, opts) {
2089
2180
  }
2090
2181
  function operationsHolder(client) {
2091
2182
  return {
2183
+ resolveStaff: (identifier, opts) => resolveStaff(client, identifier, opts),
2092
2184
  resolveAny: (identifier, opts) => resolveAny(client, identifier, opts),
2093
2185
  searchAcrossResources: (query, opts) => searchAcrossResources(client, query, opts),
2094
2186
  fetchMany: (items, opts) => fetchMany(client, items, opts),
@@ -2244,7 +2336,7 @@ async function invokeMode(client, operation, argsIn = [], opts = {}) {
2244
2336
  scopeNote = (await guardUnscopedQueryWalk(holder, record.id, args[0])).note;
2245
2337
  }
2246
2338
  const result = await method.apply(holder, callArgs);
2247
- if (labelQuery && Array.isArray(result?.items)) {
2339
+ if (labelQuery && args[0]?.["walk"] === void 0 && Array.isArray(result?.items)) {
2248
2340
  const bounded = result;
2249
2341
  const labelled = await labelRows(client, record.resource, bounded.items);
2250
2342
  return { ...bounded, items: labelled.rows, ...labelled.names !== void 0 ? { names: labelled.names } : {}, ...scopeNote !== void 0 ? { scopeNote } : {} };
@@ -2307,6 +2399,7 @@ export {
2307
2399
  recovery,
2308
2400
  relationshipMap,
2309
2401
  resolveAny,
2402
+ resolveStaff,
2310
2403
  revenueRollup,
2311
2404
  sanitiseResult,
2312
2405
  searchAcrossResources,
package/dist/pool.cjs CHANGED
@@ -1,21 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkSK3GYRNAcjs = require('./chunk-SK3GYRNA.cjs');
4
- require('./chunk-TH7B5H4P.cjs');
3
+ var _chunkKWQSGWY5cjs = require('./chunk-KWQSGWY5.cjs');
4
+ require('./chunk-6WLGHKIU.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _chunkVFLAMMIJcjs = require('./chunk-VFLAMMIJ.cjs');
10
- require('./chunk-5BDUMDAQ.cjs');
11
- require('./chunk-MJTKK3QG.cjs');
9
+ var _chunkEMYDC5SGcjs = require('./chunk-EMYDC5SG.cjs');
10
+ require('./chunk-PH3ESYAF.cjs');
11
+ require('./chunk-SN4BMQ2N.cjs');
12
12
 
13
13
  // src/pool.ts
14
14
  var _crypto = require('crypto');
15
15
  function createClientPool(options = {}) {
16
16
  const maxSize = _nullishCoalesce(options.maxSize, () => ( 128));
17
17
  if (!Number.isInteger(maxSize) || maxSize < 1) {
18
- throw new (0, _chunkVFLAMMIJcjs.AutotaskConfigError)(
18
+ throw new (0, _chunkEMYDC5SGcjs.AutotaskConfigError)(
19
19
  `ClientPool maxSize must be a positive integer (got ${String(options.maxSize)})`
20
20
  );
21
21
  }
@@ -30,7 +30,7 @@ function createClientPool(options = {}) {
30
30
  readCaches.set(key, existing);
31
31
  return existing;
32
32
  }
33
- const created = _chunkVFLAMMIJcjs.buildReadCache.call(void 0, config);
33
+ const created = _chunkEMYDC5SGcjs.buildReadCache.call(void 0, config);
34
34
  if (created === void 0) return void 0;
35
35
  readCaches.set(key, created);
36
36
  while (readCaches.size > maxSize) {
@@ -47,7 +47,7 @@ function createClientPool(options = {}) {
47
47
  return { ...config, cache };
48
48
  }
49
49
  function keyFor(config) {
50
- const resolved = _chunkVFLAMMIJcjs.resolveCredentials.call(void 0, config);
50
+ const resolved = _chunkEMYDC5SGcjs.resolveCredentials.call(void 0, config);
51
51
  const tuple = [
52
52
  resolved.userName,
53
53
  resolved.apiIntegrationCode,
@@ -70,7 +70,7 @@ function createClientPool(options = {}) {
70
70
  const oldest = entries.keys().next().value;
71
71
  if (oldest !== void 0) entries.delete(oldest);
72
72
  }
73
- const client = new (0, _chunkSK3GYRNAcjs.AutotaskClient)(withSharedCache(config, sharedCacheFor(key, config)));
73
+ const client = new (0, _chunkKWQSGWY5cjs.AutotaskClient)(withSharedCache(config, sharedCacheFor(key, config)));
74
74
  entries.set(key, client);
75
75
  return client;
76
76
  },
package/dist/pool.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AutotaskConfig, a as AutotaskClient } from './index-Cm_Xpt7X.cjs';
2
- import './index-C3KFMnRT.cjs';
1
+ import { AutotaskConfig, AutotaskClient } from './index.cjs';
2
+ import './index-DgBA1JMH.cjs';
3
3
 
4
4
  interface ClientPoolOptions {
5
5
  /** Bounded LRU capacity (positive integer). Default 128. */
@@ -44,4 +44,5 @@ interface ClientPool {
44
44
  */
45
45
  declare function createClientPool(options?: ClientPoolOptions): ClientPool;
46
46
 
47
- export { type ClientPool, type ClientPoolOptions, createClientPool };
47
+ export { createClientPool };
48
+ export type { ClientPool, ClientPoolOptions };
package/dist/pool.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AutotaskConfig, a as AutotaskClient } from './index-C7rMJ4IV.js';
2
- import './index-C3KFMnRT.js';
1
+ import { AutotaskConfig, AutotaskClient } from './index.js';
2
+ import './index-DgBA1JMH.js';
3
3
 
4
4
  interface ClientPoolOptions {
5
5
  /** Bounded LRU capacity (positive integer). Default 128. */
@@ -44,4 +44,5 @@ interface ClientPool {
44
44
  */
45
45
  declare function createClientPool(options?: ClientPoolOptions): ClientPool;
46
46
 
47
- export { type ClientPool, type ClientPoolOptions, createClientPool };
47
+ export { createClientPool };
48
+ export type { ClientPool, ClientPoolOptions };