node-autotask 0.8.3 → 0.10.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.
- package/ARCHITECTURE.md +13 -10
- package/MCP_TOOL_CATALOG.json +733 -251
- package/MCP_TOOL_MANIFEST.md +162 -133
- package/MCP_TOOL_OVERRIDES.json +2 -2
- package/N8N_MCP_MANIFEST.json +88 -25
- package/N8N_MCP_MANIFEST.md +26 -24
- package/README.md +12 -4
- package/capabilities.json +12503 -9316
- package/dist/capabilities.cjs +2 -3
- package/dist/capabilities.js +1 -2
- package/dist/{chunk-4WJCXIY2.js → chunk-3VB6N44U.js} +1141 -2977
- package/dist/{chunk-32AKZMY4.js → chunk-6KFP5HV3.js} +12502 -9316
- package/dist/chunk-DMMMWO6A.js +0 -0
- package/dist/chunk-FLB2X6O5.cjs +1 -0
- package/dist/{chunk-GYI4ZQID.js → chunk-HWC2WPX2.js} +4781 -89
- package/dist/chunk-IDPB4N2Q.cjs +1 -0
- package/dist/{chunk-F6YSQRZV.js → chunk-NVJ2PTN3.js} +7 -7
- package/dist/{chunk-5UGSQLLO.cjs → chunk-QUM74WLQ.cjs} +136 -136
- package/dist/{chunk-LAKEIYET.cjs → chunk-S7VMY5KN.cjs} +1468 -3304
- package/dist/chunk-UPQIUWOS.js +0 -0
- package/dist/{chunk-KNTUX3RR.cjs → chunk-WTVD2JZN.cjs} +12502 -9316
- package/dist/{chunk-V3XPLTIR.cjs → chunk-WTVLHMZA.cjs} +4784 -92
- package/dist/{index-B6JeThrY.d.ts → index-BOyh7S65.d.cts} +870 -79
- package/dist/{index-B0I2bGtx.d.cts → index-DGgMD8aq.d.ts} +870 -79
- package/dist/{index-DOCRp_83.d.cts → index-cQ6CRexR.d.cts} +158 -90
- package/dist/{index-DOCRp_83.d.ts → index-cQ6CRexR.d.ts} +158 -90
- package/dist/index.cjs +37 -22
- package/dist/index.d.cts +46 -5
- package/dist/index.d.ts +46 -5
- package/dist/index.js +48 -33
- package/dist/operations/index.cjs +480 -359
- package/dist/operations/index.d.cts +195 -16
- package/dist/operations/index.d.ts +195 -16
- package/dist/operations/index.js +370 -249
- package/dist/pool.cjs +36 -12
- package/dist/pool.d.cts +2 -3
- package/dist/pool.d.ts +2 -3
- package/dist/pool.js +33 -9
- package/dist/resources/index.cjs +5 -6
- package/dist/resources/index.d.cts +2 -2
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +4 -5
- package/dist/types/index.cjs +1 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -2
- package/dist/untrusted.cjs +0 -1
- package/dist/untrusted.js +0 -1
- package/docs/API.md +693 -48
- package/docs/N8N-ADAPTER.md +4 -4
- package/examples/basic.ts +1 -1
- package/package.json +5 -3
- package/dist/capabilities.cjs.map +0 -1
- package/dist/capabilities.js.map +0 -1
- package/dist/chunk-32AKZMY4.js.map +0 -1
- package/dist/chunk-4WJCXIY2.js.map +0 -1
- package/dist/chunk-5UGSQLLO.cjs.map +0 -1
- package/dist/chunk-CXM35TEC.cjs +0 -1
- package/dist/chunk-CXM35TEC.cjs.map +0 -1
- package/dist/chunk-F6YSQRZV.js.map +0 -1
- package/dist/chunk-GIVD2CQ3.js +0 -1
- package/dist/chunk-GIVD2CQ3.js.map +0 -1
- package/dist/chunk-GYI4ZQID.js.map +0 -1
- package/dist/chunk-KNTUX3RR.cjs.map +0 -1
- package/dist/chunk-LAKEIYET.cjs.map +0 -1
- package/dist/chunk-MHBMSBTA.js +0 -1
- package/dist/chunk-MHBMSBTA.js.map +0 -1
- package/dist/chunk-NZUFSSIZ.cjs +0 -1
- package/dist/chunk-NZUFSSIZ.cjs.map +0 -1
- package/dist/chunk-V3XPLTIR.cjs.map +0 -1
- package/dist/client-DHmr0Oyx.d.ts +0 -203
- package/dist/client-Q6NoqinP.d.cts +0 -203
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/operations/index.cjs.map +0 -1
- package/dist/operations/index.js.map +0 -1
- package/dist/pool.cjs.map +0 -1
- package/dist/pool.js.map +0 -1
- package/dist/resources/index.cjs.map +0 -1
- package/dist/resources/index.js.map +0 -1
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/untrusted.cjs.map +0 -1
- package/dist/untrusted.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { a as AutotaskClient, eN as BlindSurfaceInfo, eO as RelationshipResource, eP as BlindSurfaceInventory, eQ as BlindSurfaceRow, eR as CreateBlockerKind, eS as CreateGuidanceReport, eT as FieldCacheKind, g as AutotaskConfigError } from '../index-BOyh7S65.cjs';
|
|
2
|
+
export { eU as FIELD_CACHE_KINDS } from '../index-BOyh7S65.cjs';
|
|
3
|
+
import { I as Identifier, cE as EmptyReasonInfo, dI as PickListValue, a as FilterCondition } from '../index-cQ6CRexR.cjs';
|
|
4
|
+
export { hp as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-cQ6CRexR.cjs';
|
|
5
5
|
import { CapabilityRecord } from '../capabilities.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -136,13 +136,43 @@ declare const FETCH_MANY_MAX_ITEMS = 20;
|
|
|
136
136
|
interface FetchManyOptions {
|
|
137
137
|
/** May LOWER the {@link FETCH_MANY_MAX_ITEMS} cap (integer >= 1) — never raise it. */
|
|
138
138
|
maxItems?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Opt-in live field validation (issue #66): when `true`, each item's
|
|
141
|
+
* requested `fields` are validated against the tenant's LIVE entity field
|
|
142
|
+
* metadata (the cached metadata channel — a warm fieldCache costs zero
|
|
143
|
+
* wire; a cold run is one `entityInformation/fields` GET per distinct
|
|
144
|
+
* resource in the batch) instead of the vendored-spec field set alone.
|
|
145
|
+
* When a resource's metadata is unavailable the validation falls back to
|
|
146
|
+
* the vendored-spec field set for THAT resource (unavailability never
|
|
147
|
+
* throws and never blocks the batch); when available the live set is
|
|
148
|
+
* authoritative — a field it lacks is refused even if the spec lists it,
|
|
149
|
+
* and a live field the spec lacks (e.g. `time_entries` `postedDate`) is
|
|
150
|
+
* accepted. Default `false` = today's vendored-spec-only validation,
|
|
151
|
+
* bit-for-bit (zero metadata wire).
|
|
152
|
+
*/
|
|
153
|
+
liveFields?: boolean;
|
|
154
|
+
}
|
|
155
|
+
interface ValidateFetchManyValidation {
|
|
156
|
+
/**
|
|
157
|
+
* The resolved authoritative per-resource field sets (the `liveFields`
|
|
158
|
+
* mode, issue #66): the live entity field set when available, `null` when
|
|
159
|
+
* that resource's metadata read rejected (the vendored-spec fallback was
|
|
160
|
+
* applied at resolution). Absent / no entry = the vendored-spec set.
|
|
161
|
+
*/
|
|
162
|
+
fieldSetsByResource?: ReadonlyMap<string, readonly string[] | null>;
|
|
163
|
+
/** Run the field-NAME membership check (the live mode's shape-only pass passes `false`). */
|
|
164
|
+
fieldCheck?: boolean;
|
|
139
165
|
}
|
|
140
166
|
/**
|
|
141
167
|
* The pre-request validation (zero wire): one `CONFIG_ERROR` carries the
|
|
142
168
|
* COMPLETE problem list for ALL items (shape, limits, unknown resource,
|
|
143
169
|
* string id, unknown field key) — the caller fixes everything in one round.
|
|
170
|
+
*
|
|
171
|
+
* `validation` (the `liveFields` mode, issue #66): the resolved
|
|
172
|
+
* authoritative per-resource field sets to validate `fields` against; absent
|
|
173
|
+
* = the vendored-spec sets, bit-for-bit the default.
|
|
144
174
|
*/
|
|
145
|
-
declare function validateFetchManyItems(items: unknown, cap: number): void;
|
|
175
|
+
declare function validateFetchManyItems(items: unknown, cap: number, opName?: string, capRef?: string, validation?: ValidateFetchManyValidation): void;
|
|
146
176
|
/**
|
|
147
177
|
* Fetch up to 20 single records across mixed resources in ONE call
|
|
148
178
|
* (sequential GETs; per-item typed partial failure; the op throws only
|
|
@@ -159,6 +189,91 @@ declare function validateFetchManyItems(items: unknown, cap: number): void;
|
|
|
159
189
|
*/
|
|
160
190
|
declare function fetchMany(client: AutotaskClient, items: readonly FetchManyItem[], opts?: FetchManyOptions): Promise<FetchManyResult>;
|
|
161
191
|
|
|
192
|
+
/** The group-row cap (top may lower it, never raise it). */
|
|
193
|
+
declare const AGGREGATE_TOP_MAX = 100;
|
|
194
|
+
/** The default group-row count. */
|
|
195
|
+
declare const AGGREGATE_DEFAULT_TOP = 25;
|
|
196
|
+
/** The walk-mode default record cap = the house `BOUNDED_QUERY_MAX_LIMIT` (the hard max — `queryBounded` rejects above it). */
|
|
197
|
+
declare const AGGREGATE_DEFAULT_LIMIT = 2500;
|
|
198
|
+
/** The closed opts bag for `operations.aggregate`. */
|
|
199
|
+
interface AggregateOptions {
|
|
200
|
+
/** The group-by vendor field names (the group key = the field tuple). */
|
|
201
|
+
groupBy?: string[];
|
|
202
|
+
/** The numeric vendor field names to sum per group. */
|
|
203
|
+
sum?: string[];
|
|
204
|
+
/** The group-row cap (default 25, clamped 1..100). */
|
|
205
|
+
top?: number;
|
|
206
|
+
/** The total-record cap for the walk modes (default = max = the house 2500 — `queryBounded`'s hard limit). */
|
|
207
|
+
limit?: number;
|
|
208
|
+
}
|
|
209
|
+
/** One folded group (the key = the groupBy field tuple; `sums` present iff `sum` was given). */
|
|
210
|
+
interface AggregateGroup {
|
|
211
|
+
key: Record<string, unknown>;
|
|
212
|
+
count: number;
|
|
213
|
+
sums?: Record<string, number>;
|
|
214
|
+
}
|
|
215
|
+
/** The aggregate result (the mode discards the other mode's fields). */
|
|
216
|
+
interface AggregateResult {
|
|
217
|
+
mode: 'count' | 'group' | 'sum';
|
|
218
|
+
/** count mode: the count value (a plain number; 0 + `blind` on a pinned blind shape). */
|
|
219
|
+
count?: number;
|
|
220
|
+
/** group/sum mode: the top-N folded groups (the returned rows ONLY when `hasMore`). */
|
|
221
|
+
groups?: AggregateGroup[];
|
|
222
|
+
/** group/sum mode: the number of DISTINCT groups the fold found (before `top` cut them). */
|
|
223
|
+
totalGroups?: number;
|
|
224
|
+
/** group/sum mode: true when `top` dropped groups (`totalGroups > groups.length`): the returned groups are the top-N only. */
|
|
225
|
+
groupsTruncated?: boolean;
|
|
226
|
+
/** group/sum mode: the walk's fetched record count. */
|
|
227
|
+
totalScanned?: number;
|
|
228
|
+
/** group/sum mode: the walk's truncation flag (true → groups/sums cover the returned rows only). */
|
|
229
|
+
hasMore?: boolean;
|
|
230
|
+
/** count mode: true exactly when the S12-C sentinel stamped the 0 (the filter-aware predicate). */
|
|
231
|
+
blind?: boolean;
|
|
232
|
+
/** The S12-C typed sentinel (count mode: the blind 0; walk mode: the 0-row walk stamp). */
|
|
233
|
+
blindSurface?: BlindSurfaceInfo;
|
|
234
|
+
/** The typed empty-reason stamp (the base's 0-row/0-count channel, when attached). */
|
|
235
|
+
emptyReason?: EmptyReasonInfo;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* `operations.aggregate` — fold any query surface into groups/sums in one
|
|
239
|
+
* bounded call, or count it with the vendor count endpoint when no folding
|
|
240
|
+
* is needed (the `groupBy`/`sum`-absent mode). See the module header for
|
|
241
|
+
* the pinned semantics (the mode table, the blind-surface marking, the
|
|
242
|
+
* truncation honesty, the closed-arg contract).
|
|
243
|
+
*
|
|
244
|
+
* ```ts
|
|
245
|
+
* import { aggregate } from 'node-autotask/operations';
|
|
246
|
+
* const count = await aggregate(client, 'billing_items.query', [{ field: 'companyID', op: 'eq', value: 30132785 }]);
|
|
247
|
+
* const fold = await aggregate(client, 'time_entries.query', [{ field: 'dateWorked', op: 'gte', value: '2026-09-01' }], { groupBy: ['ticketID'], sum: ['hoursWorked'], top: 10 });
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
declare function aggregate(client: AutotaskClient, operation: string, filter: unknown, opts?: AggregateOptions): Promise<AggregateResult>;
|
|
251
|
+
|
|
252
|
+
/** The pinned per-call item cap (total items per call, mixed resources — the issue's "500 ids" budget; over → CONFIG_ERROR pre-request, zero wire). */
|
|
253
|
+
declare const FETCH_BY_IDS_MAX_ITEMS = 500;
|
|
254
|
+
/** The pinned `id in` chunk size (250/chunk — the chunk query is a single page: 250 is well under the 500 vendor page max). */
|
|
255
|
+
declare const FETCH_BY_IDS_CHUNK_SIZE = 250;
|
|
256
|
+
interface FetchByIdsOptions {
|
|
257
|
+
/** May LOWER the {@link FETCH_BY_IDS_MAX_ITEMS} cap (integer >= 1) — never raise it. */
|
|
258
|
+
maxItems?: number;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Fetch up to 500 single records by vendor numeric id across mixed
|
|
262
|
+
* resources in ONE call (query-first chunked `id in` reads + the per-id
|
|
263
|
+
* `get` fallback; per-item typed partial failure; the op throws only
|
|
264
|
+
* pre-request).
|
|
265
|
+
*
|
|
266
|
+
* ```ts
|
|
267
|
+
* import { fetchByIds } from 'node-autotask/operations';
|
|
268
|
+
* const { results, ok, failed } = await fetchByIds(client, [
|
|
269
|
+
* { resource: 'tickets', id: 527119 },
|
|
270
|
+
* { resource: 'tickets', id: 527118, fields: ['id', 'title', 'status'] },
|
|
271
|
+
* { resource: 'projects', id: 693 },
|
|
272
|
+
* ]);
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
declare function fetchByIds(client: AutotaskClient, items: readonly FetchManyItem[], opts?: FetchByIdsOptions): Promise<FetchManyResult>;
|
|
276
|
+
|
|
162
277
|
/**
|
|
163
278
|
* Serve one resource's relationship entry (zero wire).
|
|
164
279
|
*
|
|
@@ -313,10 +428,11 @@ declare function createGuidance(client: AutotaskClient, opts?: CreateGuidanceOpt
|
|
|
313
428
|
* pre-request (CONFIG_ERROR naming the computed cost and the cap) —
|
|
314
429
|
* refused, never truncated. */
|
|
315
430
|
declare const MAX_FIELD_CATALOG_WIRE = 60;
|
|
316
|
-
/** The stable honesty sentence served in the result (
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
431
|
+
/** The stable honesty sentence served in the result (the live catalog
|
|
432
|
+
* reports field SHAPE as FLAGS and NAMES; with the opt-in `labels: true`
|
|
433
|
+
* the projected picklist rows carry the vendor's exposed picklist
|
|
434
|
+
* VALUES; it cannot resolve a picklist VALUE the vendor does not expose
|
|
435
|
+
* to this API user — the W-A4 wall). */
|
|
320
436
|
declare const FIELD_CATALOG_HONESTY_NOTE: string;
|
|
321
437
|
/** One projected field row (the stable, small served shape — not the raw
|
|
322
438
|
* vendor blob; the raw one stays available through the resource's own
|
|
@@ -336,6 +452,8 @@ interface FieldCatalogFieldRow {
|
|
|
336
452
|
maxLength: number | null;
|
|
337
453
|
/** The referenced entity type for reference fields ('' when none). */
|
|
338
454
|
referenceEntityType: string;
|
|
455
|
+
/** The vendor's exposed picklist VALUES, verbatim (present exactly when the `labels` opt is `true` and the vendor exposed values for this picklist field — the vendor-walled and non-picklist rows carry none). */
|
|
456
|
+
picklistValues?: PickListValue[];
|
|
339
457
|
}
|
|
340
458
|
/** One per-resource fault (partial failures are typed PER ROW — never all-or-nothing). */
|
|
341
459
|
interface FieldCatalogRowError {
|
|
@@ -352,8 +470,10 @@ interface FieldCatalogRow {
|
|
|
352
470
|
udfCapable: boolean;
|
|
353
471
|
/** The entity information model (present exactly when `info` was included and fetched). */
|
|
354
472
|
info?: Record<string, unknown> | null;
|
|
355
|
-
/** The projected standard-field catalog (present exactly when `fields` was included and fetched). */
|
|
473
|
+
/** The projected standard-field catalog (present exactly when `fields` was included and fetched; when the `fields` opt is given, only the matching rows — the requested names absent here land in `unmatchedFields`). */
|
|
356
474
|
fields?: FieldCatalogFieldRow[];
|
|
475
|
+
/** The requested `fields`-filter names absent from this resource's fields catalog (in request order); `[]` when no filter is given, when the row carries no fields catalog (an `info`/`udf`-only include or a row error), or when nothing was missing. Reported, never an error. */
|
|
476
|
+
unmatchedFields: string[];
|
|
357
477
|
/** The projected UDF catalog (present exactly when `udf` was included and fetched). */
|
|
358
478
|
udf?: FieldCatalogFieldRow[] | null;
|
|
359
479
|
/** `isRequired === true` names, in catalog order (the `fields` catalog). */
|
|
@@ -382,6 +502,8 @@ interface FieldCatalogResult {
|
|
|
382
502
|
label: string;
|
|
383
503
|
/** Whether a FieldCache was configured at all. */
|
|
384
504
|
cached: boolean;
|
|
505
|
+
/** The resolved `labels` opt (the served payload names what it carries: `true` = the picklist rows may carry `picklistValues`). */
|
|
506
|
+
labels: boolean;
|
|
385
507
|
/** The configured TTL (null when no cache). */
|
|
386
508
|
ttlMs: number | null;
|
|
387
509
|
/** The call instant (ISO). */
|
|
@@ -406,7 +528,7 @@ interface FieldCatalogResult {
|
|
|
406
528
|
};
|
|
407
529
|
/** The honest scope: what the live catalog can and cannot report. */
|
|
408
530
|
honesty: {
|
|
409
|
-
/** 'partial' when any
|
|
531
|
+
/** The vendor's WIRE exposure of picklist values, informational only (orthogonal to the `labels` opt — it reports what the vendor exposed on the wire, not what the caller opted into): 'partial' when any row's raw vendor response carried picklist VALUES on the wire — computed over the full raw list, not the filtered subset; 'unexposed' otherwise. */
|
|
410
532
|
picklistValues: 'unexposed' | 'partial';
|
|
411
533
|
note: string;
|
|
412
534
|
};
|
|
@@ -419,6 +541,10 @@ interface FieldCatalogOptions {
|
|
|
419
541
|
include?: FieldCacheKind[];
|
|
420
542
|
/** Bypass the fieldCache for this call (fetch live, refresh the entries). Default false. */
|
|
421
543
|
fresh?: boolean;
|
|
544
|
+
/** The optional post-projection filter on the `fields`-kind rows only: keep the named fields (vendor names, trimmed, de-duplicated). Report-not-error: names absent from a resource's fields catalog land on that row's `unmatchedFields`, never an error; the `info` and `udf` rows are unaffected (the filter is a no-op on them). Applied after projection, on cache hits and wire reads alike — the cache entries stay the full raw list (zero extra wire, no invalidation). */
|
|
545
|
+
fields?: string[];
|
|
546
|
+
/** Opt-in: when `true`, the projected `fields`-kind and `udf`-kind picklist rows carry the vendor's exposed `picklistValues` (the raw vendor shape as-is — `{ value, label, parentValue?, isActive?, ... }`, `value` a string, zero transform) for the picklist fields. The W-A4 wall still applies (a value the vendor does not expose to this API user is not resolvable — retrying will not surface it). Default `false`: the rows carry no VALUES (today's exact output). Zero extra wire: the values ride the same cached raw rows. */
|
|
547
|
+
labels?: boolean;
|
|
422
548
|
}
|
|
423
549
|
/**
|
|
424
550
|
* Run the bounded live field-metadata sweep.
|
|
@@ -430,10 +556,62 @@ interface FieldCatalogOptions {
|
|
|
430
556
|
* ```
|
|
431
557
|
*
|
|
432
558
|
* @param client The wired client (the reads issue entityInformation GETs).
|
|
433
|
-
* @param opts The call bag ({ resources?, include?, fresh? }).
|
|
559
|
+
* @param opts The call bag ({ resources?, include?, fresh?, fields?, labels? }).
|
|
434
560
|
*/
|
|
435
561
|
declare function fieldCatalog(client: AutotaskClient, opts?: FieldCatalogOptions): Promise<FieldCatalogResult>;
|
|
436
562
|
|
|
563
|
+
/** The pinned per-call id cap (mirrors `FETCH_BY_IDS_MAX_ITEMS` — the house bulk cap; over → pre-request refusal, zero wire). */
|
|
564
|
+
declare const EXPAND_RESOURCE_NAMES_MAX_IDS = 500;
|
|
565
|
+
interface ExpandResourceNamesOptions {
|
|
566
|
+
/** May LOWER the {@link EXPAND_RESOURCE_NAMES_MAX_IDS} cap (integer >= 1) — never raise it. */
|
|
567
|
+
maxIds?: number;
|
|
568
|
+
/** Bypass + refresh the NAME cache AND the ReadCache (default false — the name-cache lookup runs unless `resourceNameCache: false`; the per-id `resources.get` otherwise rides the ReadCache when `cache` is configured). With `fresh: true`, the per-id GET fetches live and refreshes BOTH caches — a rename made elsewhere is served on the very next call, never a stale snapshot (issue #77). */
|
|
569
|
+
fresh?: boolean;
|
|
570
|
+
}
|
|
571
|
+
/** One per-id outcome (input order; duplicates get identical rows). */
|
|
572
|
+
interface ExpandResourceNameRow {
|
|
573
|
+
/** The canonical id as requested (safe integer, or the exact-digit string). */
|
|
574
|
+
id: Identifier;
|
|
575
|
+
/** The composed display name (`firstName [middleName] lastName`,
|
|
576
|
+
* single spaces); null when the vendor returned no name part (a
|
|
577
|
+
* data gap — distinct from blind) or the id is blind. */
|
|
578
|
+
name: string | null;
|
|
579
|
+
/** True when the per-id read is the vendor's true not-found (404 or
|
|
580
|
+
* `200 item: null`) — the table-invisible case: the id is kept, no
|
|
581
|
+
* error, no throw. */
|
|
582
|
+
blind: boolean;
|
|
583
|
+
/** A transient per-id fault (code + httpStatus + message) — present
|
|
584
|
+
* exactly when the id neither resolved nor came back blind; never
|
|
585
|
+
* cached, never aborting the remaining ids. */
|
|
586
|
+
error?: FetchManyItemError;
|
|
587
|
+
}
|
|
588
|
+
/** The batch result: one row per input occurrence, in input order. */
|
|
589
|
+
interface ExpandResourceNamesResult {
|
|
590
|
+
results: ExpandResourceNameRow[];
|
|
591
|
+
/** Rows with a composed name. */
|
|
592
|
+
resolved: number;
|
|
593
|
+
/** Rows marked blind (the vendor's true not-found). */
|
|
594
|
+
blind: number;
|
|
595
|
+
/** Rows carrying a per-id fault. */
|
|
596
|
+
failed: number;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Resolve vendor numeric resource ids to display names in ONE opt-in
|
|
600
|
+
* call (per-id `resources.get` reads ONLY — never an `id in` query;
|
|
601
|
+
* blind-marked rows for ids the API user cannot resolve; the opt-in
|
|
602
|
+
* name cache when configured).
|
|
603
|
+
*
|
|
604
|
+
* ```ts
|
|
605
|
+
* import { expandResourceNames } from 'node-autotask/operations';
|
|
606
|
+
* const { results, resolved, blind, failed } = await expandResourceNames(
|
|
607
|
+
* client,
|
|
608
|
+
* [101, 102, '103'],
|
|
609
|
+
* { maxIds: 500, fresh: false },
|
|
610
|
+
* );
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
declare function expandResourceNames(client: AutotaskClient, ids: readonly Identifier[], opts?: ExpandResourceNamesOptions): Promise<ExpandResourceNamesResult>;
|
|
614
|
+
|
|
437
615
|
/** The exact confirmation string the destructive apply requires (R4 style: the op key). */
|
|
438
616
|
declare const RECOVERY_CONFIRM = "operations.recovery";
|
|
439
617
|
/** The default TOTAL match cap of the marker search. */
|
|
@@ -600,9 +778,10 @@ declare function recovery(client: AutotaskClient, input: RecoveryInput, opts?: R
|
|
|
600
778
|
* - the query-family params bag (`args[0]` for `query` / `queryAll` /
|
|
601
779
|
* `count`) is CLOSED at its top level: the valid key set is per-verb
|
|
602
780
|
* (PARAMS_BAG_KEYS — for `query` routed to `queryBounded`:
|
|
603
|
-
* filter / limit / includeFields / via) and an unknown key
|
|
604
|
-
* `lmit`, `pageSize`, `cursor`, …) is refused pre-request
|
|
605
|
-
* error naming the key + the valid keys + a did-you-mean
|
|
781
|
+
* filter / limit / latest / includeFields / via) and an unknown key
|
|
782
|
+
* (`filters`, `lmit`, `pageSize`, `cursor`, …) is refused pre-request
|
|
783
|
+
* with a typed error naming the key + the valid keys + a did-you-mean
|
|
784
|
+
* (`last` → `latest`, issue #59); entity bodies,
|
|
606
785
|
* UDF maps and the filter tree stay open (strictness applies to tool
|
|
607
786
|
* arguments, not vendor payloads);
|
|
608
787
|
* - the caller's `args` are validated against the record's declared
|
|
@@ -715,4 +894,4 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
|
|
|
715
894
|
*/
|
|
716
895
|
declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[], opts?: InvokeOptions): Promise<unknown>;
|
|
717
896
|
|
|
718
|
-
export { BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, 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 ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, WORKFLOW_RESOURCES, blindSurfaces, createGuidance, fetchMany, fieldCatalog, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, searchAcrossResources, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|
|
897
|
+
export { 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, EXPAND_RESOURCE_NAMES_MAX_IDS, 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 FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, 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 ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, WORKFLOW_RESOURCES, aggregate, blindSurfaces, createGuidance, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, searchAcrossResources, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { a as AutotaskClient, eN as BlindSurfaceInfo, eO as RelationshipResource, eP as BlindSurfaceInventory, eQ as BlindSurfaceRow, eR as CreateBlockerKind, eS as CreateGuidanceReport, eT as FieldCacheKind, g as AutotaskConfigError } from '../index-DGgMD8aq.js';
|
|
2
|
+
export { eU as FIELD_CACHE_KINDS } from '../index-DGgMD8aq.js';
|
|
3
|
+
import { I as Identifier, cE as EmptyReasonInfo, dI as PickListValue, a as FilterCondition } from '../index-cQ6CRexR.js';
|
|
4
|
+
export { hp as PICKLIST_VALUE_NOT_SERVED_NOTE } from '../index-cQ6CRexR.js';
|
|
5
5
|
import { CapabilityRecord } from '../capabilities.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -136,13 +136,43 @@ declare const FETCH_MANY_MAX_ITEMS = 20;
|
|
|
136
136
|
interface FetchManyOptions {
|
|
137
137
|
/** May LOWER the {@link FETCH_MANY_MAX_ITEMS} cap (integer >= 1) — never raise it. */
|
|
138
138
|
maxItems?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Opt-in live field validation (issue #66): when `true`, each item's
|
|
141
|
+
* requested `fields` are validated against the tenant's LIVE entity field
|
|
142
|
+
* metadata (the cached metadata channel — a warm fieldCache costs zero
|
|
143
|
+
* wire; a cold run is one `entityInformation/fields` GET per distinct
|
|
144
|
+
* resource in the batch) instead of the vendored-spec field set alone.
|
|
145
|
+
* When a resource's metadata is unavailable the validation falls back to
|
|
146
|
+
* the vendored-spec field set for THAT resource (unavailability never
|
|
147
|
+
* throws and never blocks the batch); when available the live set is
|
|
148
|
+
* authoritative — a field it lacks is refused even if the spec lists it,
|
|
149
|
+
* and a live field the spec lacks (e.g. `time_entries` `postedDate`) is
|
|
150
|
+
* accepted. Default `false` = today's vendored-spec-only validation,
|
|
151
|
+
* bit-for-bit (zero metadata wire).
|
|
152
|
+
*/
|
|
153
|
+
liveFields?: boolean;
|
|
154
|
+
}
|
|
155
|
+
interface ValidateFetchManyValidation {
|
|
156
|
+
/**
|
|
157
|
+
* The resolved authoritative per-resource field sets (the `liveFields`
|
|
158
|
+
* mode, issue #66): the live entity field set when available, `null` when
|
|
159
|
+
* that resource's metadata read rejected (the vendored-spec fallback was
|
|
160
|
+
* applied at resolution). Absent / no entry = the vendored-spec set.
|
|
161
|
+
*/
|
|
162
|
+
fieldSetsByResource?: ReadonlyMap<string, readonly string[] | null>;
|
|
163
|
+
/** Run the field-NAME membership check (the live mode's shape-only pass passes `false`). */
|
|
164
|
+
fieldCheck?: boolean;
|
|
139
165
|
}
|
|
140
166
|
/**
|
|
141
167
|
* The pre-request validation (zero wire): one `CONFIG_ERROR` carries the
|
|
142
168
|
* COMPLETE problem list for ALL items (shape, limits, unknown resource,
|
|
143
169
|
* string id, unknown field key) — the caller fixes everything in one round.
|
|
170
|
+
*
|
|
171
|
+
* `validation` (the `liveFields` mode, issue #66): the resolved
|
|
172
|
+
* authoritative per-resource field sets to validate `fields` against; absent
|
|
173
|
+
* = the vendored-spec sets, bit-for-bit the default.
|
|
144
174
|
*/
|
|
145
|
-
declare function validateFetchManyItems(items: unknown, cap: number): void;
|
|
175
|
+
declare function validateFetchManyItems(items: unknown, cap: number, opName?: string, capRef?: string, validation?: ValidateFetchManyValidation): void;
|
|
146
176
|
/**
|
|
147
177
|
* Fetch up to 20 single records across mixed resources in ONE call
|
|
148
178
|
* (sequential GETs; per-item typed partial failure; the op throws only
|
|
@@ -159,6 +189,91 @@ declare function validateFetchManyItems(items: unknown, cap: number): void;
|
|
|
159
189
|
*/
|
|
160
190
|
declare function fetchMany(client: AutotaskClient, items: readonly FetchManyItem[], opts?: FetchManyOptions): Promise<FetchManyResult>;
|
|
161
191
|
|
|
192
|
+
/** The group-row cap (top may lower it, never raise it). */
|
|
193
|
+
declare const AGGREGATE_TOP_MAX = 100;
|
|
194
|
+
/** The default group-row count. */
|
|
195
|
+
declare const AGGREGATE_DEFAULT_TOP = 25;
|
|
196
|
+
/** The walk-mode default record cap = the house `BOUNDED_QUERY_MAX_LIMIT` (the hard max — `queryBounded` rejects above it). */
|
|
197
|
+
declare const AGGREGATE_DEFAULT_LIMIT = 2500;
|
|
198
|
+
/** The closed opts bag for `operations.aggregate`. */
|
|
199
|
+
interface AggregateOptions {
|
|
200
|
+
/** The group-by vendor field names (the group key = the field tuple). */
|
|
201
|
+
groupBy?: string[];
|
|
202
|
+
/** The numeric vendor field names to sum per group. */
|
|
203
|
+
sum?: string[];
|
|
204
|
+
/** The group-row cap (default 25, clamped 1..100). */
|
|
205
|
+
top?: number;
|
|
206
|
+
/** The total-record cap for the walk modes (default = max = the house 2500 — `queryBounded`'s hard limit). */
|
|
207
|
+
limit?: number;
|
|
208
|
+
}
|
|
209
|
+
/** One folded group (the key = the groupBy field tuple; `sums` present iff `sum` was given). */
|
|
210
|
+
interface AggregateGroup {
|
|
211
|
+
key: Record<string, unknown>;
|
|
212
|
+
count: number;
|
|
213
|
+
sums?: Record<string, number>;
|
|
214
|
+
}
|
|
215
|
+
/** The aggregate result (the mode discards the other mode's fields). */
|
|
216
|
+
interface AggregateResult {
|
|
217
|
+
mode: 'count' | 'group' | 'sum';
|
|
218
|
+
/** count mode: the count value (a plain number; 0 + `blind` on a pinned blind shape). */
|
|
219
|
+
count?: number;
|
|
220
|
+
/** group/sum mode: the top-N folded groups (the returned rows ONLY when `hasMore`). */
|
|
221
|
+
groups?: AggregateGroup[];
|
|
222
|
+
/** group/sum mode: the number of DISTINCT groups the fold found (before `top` cut them). */
|
|
223
|
+
totalGroups?: number;
|
|
224
|
+
/** group/sum mode: true when `top` dropped groups (`totalGroups > groups.length`): the returned groups are the top-N only. */
|
|
225
|
+
groupsTruncated?: boolean;
|
|
226
|
+
/** group/sum mode: the walk's fetched record count. */
|
|
227
|
+
totalScanned?: number;
|
|
228
|
+
/** group/sum mode: the walk's truncation flag (true → groups/sums cover the returned rows only). */
|
|
229
|
+
hasMore?: boolean;
|
|
230
|
+
/** count mode: true exactly when the S12-C sentinel stamped the 0 (the filter-aware predicate). */
|
|
231
|
+
blind?: boolean;
|
|
232
|
+
/** The S12-C typed sentinel (count mode: the blind 0; walk mode: the 0-row walk stamp). */
|
|
233
|
+
blindSurface?: BlindSurfaceInfo;
|
|
234
|
+
/** The typed empty-reason stamp (the base's 0-row/0-count channel, when attached). */
|
|
235
|
+
emptyReason?: EmptyReasonInfo;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* `operations.aggregate` — fold any query surface into groups/sums in one
|
|
239
|
+
* bounded call, or count it with the vendor count endpoint when no folding
|
|
240
|
+
* is needed (the `groupBy`/`sum`-absent mode). See the module header for
|
|
241
|
+
* the pinned semantics (the mode table, the blind-surface marking, the
|
|
242
|
+
* truncation honesty, the closed-arg contract).
|
|
243
|
+
*
|
|
244
|
+
* ```ts
|
|
245
|
+
* import { aggregate } from 'node-autotask/operations';
|
|
246
|
+
* const count = await aggregate(client, 'billing_items.query', [{ field: 'companyID', op: 'eq', value: 30132785 }]);
|
|
247
|
+
* const fold = await aggregate(client, 'time_entries.query', [{ field: 'dateWorked', op: 'gte', value: '2026-09-01' }], { groupBy: ['ticketID'], sum: ['hoursWorked'], top: 10 });
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
declare function aggregate(client: AutotaskClient, operation: string, filter: unknown, opts?: AggregateOptions): Promise<AggregateResult>;
|
|
251
|
+
|
|
252
|
+
/** The pinned per-call item cap (total items per call, mixed resources — the issue's "500 ids" budget; over → CONFIG_ERROR pre-request, zero wire). */
|
|
253
|
+
declare const FETCH_BY_IDS_MAX_ITEMS = 500;
|
|
254
|
+
/** The pinned `id in` chunk size (250/chunk — the chunk query is a single page: 250 is well under the 500 vendor page max). */
|
|
255
|
+
declare const FETCH_BY_IDS_CHUNK_SIZE = 250;
|
|
256
|
+
interface FetchByIdsOptions {
|
|
257
|
+
/** May LOWER the {@link FETCH_BY_IDS_MAX_ITEMS} cap (integer >= 1) — never raise it. */
|
|
258
|
+
maxItems?: number;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Fetch up to 500 single records by vendor numeric id across mixed
|
|
262
|
+
* resources in ONE call (query-first chunked `id in` reads + the per-id
|
|
263
|
+
* `get` fallback; per-item typed partial failure; the op throws only
|
|
264
|
+
* pre-request).
|
|
265
|
+
*
|
|
266
|
+
* ```ts
|
|
267
|
+
* import { fetchByIds } from 'node-autotask/operations';
|
|
268
|
+
* const { results, ok, failed } = await fetchByIds(client, [
|
|
269
|
+
* { resource: 'tickets', id: 527119 },
|
|
270
|
+
* { resource: 'tickets', id: 527118, fields: ['id', 'title', 'status'] },
|
|
271
|
+
* { resource: 'projects', id: 693 },
|
|
272
|
+
* ]);
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
declare function fetchByIds(client: AutotaskClient, items: readonly FetchManyItem[], opts?: FetchByIdsOptions): Promise<FetchManyResult>;
|
|
276
|
+
|
|
162
277
|
/**
|
|
163
278
|
* Serve one resource's relationship entry (zero wire).
|
|
164
279
|
*
|
|
@@ -313,10 +428,11 @@ declare function createGuidance(client: AutotaskClient, opts?: CreateGuidanceOpt
|
|
|
313
428
|
* pre-request (CONFIG_ERROR naming the computed cost and the cap) —
|
|
314
429
|
* refused, never truncated. */
|
|
315
430
|
declare const MAX_FIELD_CATALOG_WIRE = 60;
|
|
316
|
-
/** The stable honesty sentence served in the result (
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
431
|
+
/** The stable honesty sentence served in the result (the live catalog
|
|
432
|
+
* reports field SHAPE as FLAGS and NAMES; with the opt-in `labels: true`
|
|
433
|
+
* the projected picklist rows carry the vendor's exposed picklist
|
|
434
|
+
* VALUES; it cannot resolve a picklist VALUE the vendor does not expose
|
|
435
|
+
* to this API user — the W-A4 wall). */
|
|
320
436
|
declare const FIELD_CATALOG_HONESTY_NOTE: string;
|
|
321
437
|
/** One projected field row (the stable, small served shape — not the raw
|
|
322
438
|
* vendor blob; the raw one stays available through the resource's own
|
|
@@ -336,6 +452,8 @@ interface FieldCatalogFieldRow {
|
|
|
336
452
|
maxLength: number | null;
|
|
337
453
|
/** The referenced entity type for reference fields ('' when none). */
|
|
338
454
|
referenceEntityType: string;
|
|
455
|
+
/** The vendor's exposed picklist VALUES, verbatim (present exactly when the `labels` opt is `true` and the vendor exposed values for this picklist field — the vendor-walled and non-picklist rows carry none). */
|
|
456
|
+
picklistValues?: PickListValue[];
|
|
339
457
|
}
|
|
340
458
|
/** One per-resource fault (partial failures are typed PER ROW — never all-or-nothing). */
|
|
341
459
|
interface FieldCatalogRowError {
|
|
@@ -352,8 +470,10 @@ interface FieldCatalogRow {
|
|
|
352
470
|
udfCapable: boolean;
|
|
353
471
|
/** The entity information model (present exactly when `info` was included and fetched). */
|
|
354
472
|
info?: Record<string, unknown> | null;
|
|
355
|
-
/** The projected standard-field catalog (present exactly when `fields` was included and fetched). */
|
|
473
|
+
/** The projected standard-field catalog (present exactly when `fields` was included and fetched; when the `fields` opt is given, only the matching rows — the requested names absent here land in `unmatchedFields`). */
|
|
356
474
|
fields?: FieldCatalogFieldRow[];
|
|
475
|
+
/** The requested `fields`-filter names absent from this resource's fields catalog (in request order); `[]` when no filter is given, when the row carries no fields catalog (an `info`/`udf`-only include or a row error), or when nothing was missing. Reported, never an error. */
|
|
476
|
+
unmatchedFields: string[];
|
|
357
477
|
/** The projected UDF catalog (present exactly when `udf` was included and fetched). */
|
|
358
478
|
udf?: FieldCatalogFieldRow[] | null;
|
|
359
479
|
/** `isRequired === true` names, in catalog order (the `fields` catalog). */
|
|
@@ -382,6 +502,8 @@ interface FieldCatalogResult {
|
|
|
382
502
|
label: string;
|
|
383
503
|
/** Whether a FieldCache was configured at all. */
|
|
384
504
|
cached: boolean;
|
|
505
|
+
/** The resolved `labels` opt (the served payload names what it carries: `true` = the picklist rows may carry `picklistValues`). */
|
|
506
|
+
labels: boolean;
|
|
385
507
|
/** The configured TTL (null when no cache). */
|
|
386
508
|
ttlMs: number | null;
|
|
387
509
|
/** The call instant (ISO). */
|
|
@@ -406,7 +528,7 @@ interface FieldCatalogResult {
|
|
|
406
528
|
};
|
|
407
529
|
/** The honest scope: what the live catalog can and cannot report. */
|
|
408
530
|
honesty: {
|
|
409
|
-
/** 'partial' when any
|
|
531
|
+
/** The vendor's WIRE exposure of picklist values, informational only (orthogonal to the `labels` opt — it reports what the vendor exposed on the wire, not what the caller opted into): 'partial' when any row's raw vendor response carried picklist VALUES on the wire — computed over the full raw list, not the filtered subset; 'unexposed' otherwise. */
|
|
410
532
|
picklistValues: 'unexposed' | 'partial';
|
|
411
533
|
note: string;
|
|
412
534
|
};
|
|
@@ -419,6 +541,10 @@ interface FieldCatalogOptions {
|
|
|
419
541
|
include?: FieldCacheKind[];
|
|
420
542
|
/** Bypass the fieldCache for this call (fetch live, refresh the entries). Default false. */
|
|
421
543
|
fresh?: boolean;
|
|
544
|
+
/** The optional post-projection filter on the `fields`-kind rows only: keep the named fields (vendor names, trimmed, de-duplicated). Report-not-error: names absent from a resource's fields catalog land on that row's `unmatchedFields`, never an error; the `info` and `udf` rows are unaffected (the filter is a no-op on them). Applied after projection, on cache hits and wire reads alike — the cache entries stay the full raw list (zero extra wire, no invalidation). */
|
|
545
|
+
fields?: string[];
|
|
546
|
+
/** Opt-in: when `true`, the projected `fields`-kind and `udf`-kind picklist rows carry the vendor's exposed `picklistValues` (the raw vendor shape as-is — `{ value, label, parentValue?, isActive?, ... }`, `value` a string, zero transform) for the picklist fields. The W-A4 wall still applies (a value the vendor does not expose to this API user is not resolvable — retrying will not surface it). Default `false`: the rows carry no VALUES (today's exact output). Zero extra wire: the values ride the same cached raw rows. */
|
|
547
|
+
labels?: boolean;
|
|
422
548
|
}
|
|
423
549
|
/**
|
|
424
550
|
* Run the bounded live field-metadata sweep.
|
|
@@ -430,10 +556,62 @@ interface FieldCatalogOptions {
|
|
|
430
556
|
* ```
|
|
431
557
|
*
|
|
432
558
|
* @param client The wired client (the reads issue entityInformation GETs).
|
|
433
|
-
* @param opts The call bag ({ resources?, include?, fresh? }).
|
|
559
|
+
* @param opts The call bag ({ resources?, include?, fresh?, fields?, labels? }).
|
|
434
560
|
*/
|
|
435
561
|
declare function fieldCatalog(client: AutotaskClient, opts?: FieldCatalogOptions): Promise<FieldCatalogResult>;
|
|
436
562
|
|
|
563
|
+
/** The pinned per-call id cap (mirrors `FETCH_BY_IDS_MAX_ITEMS` — the house bulk cap; over → pre-request refusal, zero wire). */
|
|
564
|
+
declare const EXPAND_RESOURCE_NAMES_MAX_IDS = 500;
|
|
565
|
+
interface ExpandResourceNamesOptions {
|
|
566
|
+
/** May LOWER the {@link EXPAND_RESOURCE_NAMES_MAX_IDS} cap (integer >= 1) — never raise it. */
|
|
567
|
+
maxIds?: number;
|
|
568
|
+
/** Bypass + refresh the NAME cache AND the ReadCache (default false — the name-cache lookup runs unless `resourceNameCache: false`; the per-id `resources.get` otherwise rides the ReadCache when `cache` is configured). With `fresh: true`, the per-id GET fetches live and refreshes BOTH caches — a rename made elsewhere is served on the very next call, never a stale snapshot (issue #77). */
|
|
569
|
+
fresh?: boolean;
|
|
570
|
+
}
|
|
571
|
+
/** One per-id outcome (input order; duplicates get identical rows). */
|
|
572
|
+
interface ExpandResourceNameRow {
|
|
573
|
+
/** The canonical id as requested (safe integer, or the exact-digit string). */
|
|
574
|
+
id: Identifier;
|
|
575
|
+
/** The composed display name (`firstName [middleName] lastName`,
|
|
576
|
+
* single spaces); null when the vendor returned no name part (a
|
|
577
|
+
* data gap — distinct from blind) or the id is blind. */
|
|
578
|
+
name: string | null;
|
|
579
|
+
/** True when the per-id read is the vendor's true not-found (404 or
|
|
580
|
+
* `200 item: null`) — the table-invisible case: the id is kept, no
|
|
581
|
+
* error, no throw. */
|
|
582
|
+
blind: boolean;
|
|
583
|
+
/** A transient per-id fault (code + httpStatus + message) — present
|
|
584
|
+
* exactly when the id neither resolved nor came back blind; never
|
|
585
|
+
* cached, never aborting the remaining ids. */
|
|
586
|
+
error?: FetchManyItemError;
|
|
587
|
+
}
|
|
588
|
+
/** The batch result: one row per input occurrence, in input order. */
|
|
589
|
+
interface ExpandResourceNamesResult {
|
|
590
|
+
results: ExpandResourceNameRow[];
|
|
591
|
+
/** Rows with a composed name. */
|
|
592
|
+
resolved: number;
|
|
593
|
+
/** Rows marked blind (the vendor's true not-found). */
|
|
594
|
+
blind: number;
|
|
595
|
+
/** Rows carrying a per-id fault. */
|
|
596
|
+
failed: number;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Resolve vendor numeric resource ids to display names in ONE opt-in
|
|
600
|
+
* call (per-id `resources.get` reads ONLY — never an `id in` query;
|
|
601
|
+
* blind-marked rows for ids the API user cannot resolve; the opt-in
|
|
602
|
+
* name cache when configured).
|
|
603
|
+
*
|
|
604
|
+
* ```ts
|
|
605
|
+
* import { expandResourceNames } from 'node-autotask/operations';
|
|
606
|
+
* const { results, resolved, blind, failed } = await expandResourceNames(
|
|
607
|
+
* client,
|
|
608
|
+
* [101, 102, '103'],
|
|
609
|
+
* { maxIds: 500, fresh: false },
|
|
610
|
+
* );
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
declare function expandResourceNames(client: AutotaskClient, ids: readonly Identifier[], opts?: ExpandResourceNamesOptions): Promise<ExpandResourceNamesResult>;
|
|
614
|
+
|
|
437
615
|
/** The exact confirmation string the destructive apply requires (R4 style: the op key). */
|
|
438
616
|
declare const RECOVERY_CONFIRM = "operations.recovery";
|
|
439
617
|
/** The default TOTAL match cap of the marker search. */
|
|
@@ -600,9 +778,10 @@ declare function recovery(client: AutotaskClient, input: RecoveryInput, opts?: R
|
|
|
600
778
|
* - the query-family params bag (`args[0]` for `query` / `queryAll` /
|
|
601
779
|
* `count`) is CLOSED at its top level: the valid key set is per-verb
|
|
602
780
|
* (PARAMS_BAG_KEYS — for `query` routed to `queryBounded`:
|
|
603
|
-
* filter / limit / includeFields / via) and an unknown key
|
|
604
|
-
* `lmit`, `pageSize`, `cursor`, …) is refused pre-request
|
|
605
|
-
* error naming the key + the valid keys + a did-you-mean
|
|
781
|
+
* filter / limit / latest / includeFields / via) and an unknown key
|
|
782
|
+
* (`filters`, `lmit`, `pageSize`, `cursor`, …) is refused pre-request
|
|
783
|
+
* with a typed error naming the key + the valid keys + a did-you-mean
|
|
784
|
+
* (`last` → `latest`, issue #59); entity bodies,
|
|
606
785
|
* UDF maps and the filter tree stay open (strictness applies to tool
|
|
607
786
|
* arguments, not vendor payloads);
|
|
608
787
|
* - the caller's `args` are validated against the record's declared
|
|
@@ -715,4 +894,4 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
|
|
|
715
894
|
*/
|
|
716
895
|
declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[], opts?: InvokeOptions): Promise<unknown>;
|
|
717
896
|
|
|
718
|
-
export { BLIND_SURFACE_KINDS, type BlindSurfaceKind, type BlindSurfaceOptions, BlindSurfaceRow, CREATE_BLOCKER_KINDS, type CreateGuidanceOptions, FETCH_MANY_MAX_ITEMS, FIELD_CATALOG_HONESTY_NOTE, type FetchManyItem, type FetchManyItemError, type FetchManyItemResult, type FetchManyOptions, type FetchManyResult, FieldCacheKind, type FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, 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 ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, WORKFLOW_RESOURCES, blindSurfaces, createGuidance, fetchMany, fieldCatalog, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, searchAcrossResources, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|
|
897
|
+
export { 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, EXPAND_RESOURCE_NAMES_MAX_IDS, 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 FieldCatalogFieldRow, type FieldCatalogOptions, type FieldCatalogResult, type FieldCatalogRow, type FieldCatalogRowError, INVOKE_OPTION_KEYS, type InvokeMode, type InvokeOptions, MAX_FIELD_CATALOG_WIRE, 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 ResolveAnyOptions, type ResolveAnyResourceOutcome, type ResolveAnyResult, type SearchAcrossResourcesOptions, type SearchAcrossResourcesResult, type SearchAcrossResourcesRow, WORKFLOW_RESOURCES, aggregate, blindSurfaces, createGuidance, expandResourceNames, fetchByIds, fetchMany, fieldCatalog, invoke, invokeDelete, invokeRead, invokeWrite, needsConfirmation, probeReachability, recovery, relationshipMap, resolveAny, searchAcrossResources, unknownKeysRefusal, validateDispatchArgs, validateFetchManyItems, validateInvokeOptions, validateParamsBag };
|