node-autotask 0.40.0 → 0.42.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/CHANGELOG.md +32 -0
- package/MCP_TOOL_CATALOG.json +147 -149
- package/MCP_TOOL_MANIFEST.md +9 -9
- package/N8N_MCP_MANIFEST.json +4 -43
- package/N8N_MCP_MANIFEST.md +6 -7
- package/README.md +3 -4
- package/capabilities.json +3945 -3405
- package/dist/capabilities.cjs +2 -2
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-VDVBXXJW.js → chunk-AETFO6BO.js} +1765 -1880
- package/dist/{chunk-EUGSF3U4.cjs → chunk-HD5BRA3Z.cjs} +285 -285
- package/dist/{chunk-E5W24BZB.cjs → chunk-MYL34QU5.cjs} +143 -143
- package/dist/{chunk-FEYVLIHD.cjs → chunk-SEFJJY4J.cjs} +2801 -2916
- package/dist/{chunk-O32L6GS5.js → chunk-TTPHVFPJ.js} +2 -2
- package/dist/{chunk-EVDVESQM.cjs → chunk-VEOSOIU4.cjs} +3944 -3404
- package/dist/{chunk-Y6YJYKBZ.js → chunk-WP33PQVM.js} +3944 -3404
- package/dist/{chunk-MTFRSD7P.js → chunk-ZR24JGW2.js} +2 -2
- package/dist/index-C3KFMnRT.d.cts +6860 -0
- package/dist/index-C3KFMnRT.d.ts +6860 -0
- package/dist/{index-BKp8_P2L.d.cts → index-C7rMJ4IV.d.ts} +139 -7236
- package/dist/{index-BKp8_P2L.d.ts → index-Cm_Xpt7X.d.cts} +139 -7236
- package/dist/index.cjs +22 -24
- package/dist/index.d.cts +58 -34
- package/dist/index.d.ts +58 -34
- package/dist/index.js +8 -10
- package/dist/operations/index.cjs +363 -242
- package/dist/operations/index.d.cts +281 -25
- package/dist/operations/index.d.ts +281 -25
- package/dist/operations/index.js +178 -57
- package/dist/pool.cjs +8 -8
- package/dist/pool.d.cts +2 -1
- package/dist/pool.d.ts +2 -1
- package/dist/pool.js +4 -4
- package/dist/resources/index.cjs +4 -4
- package/dist/resources/index.d.cts +2 -1
- package/dist/resources/index.d.ts +2 -1
- package/dist/resources/index.js +3 -3
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/docs/API.md +101 -139
- package/docs/LIVE-TESTING.md +9 -5
- package/docs/N8N-ADAPTER.md +1 -1
- package/docs/RELEASING.md +121 -0
- package/package.json +3 -2
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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';
|
|
3
5
|
import { CapabilityRecord } from '../capabilities.cjs';
|
|
4
6
|
import { b as AutotaskConfigError } from '../base-CVx2VMSj.cjs';
|
|
5
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
|
+
}
|
|
18
|
+
|
|
6
19
|
/**
|
|
7
20
|
* Cross-resource operations layer — shared types (ARCHITECTURE section 19.1,
|
|
8
21
|
* 19.5). The operations layer is MCP-independent: plain SDK code, no MCP
|
|
@@ -81,6 +94,19 @@ interface FetchManyResult {
|
|
|
81
94
|
interface ResolveAnyOptions {
|
|
82
95
|
/** Resource keys to resolve against (default: the five workflow resources). */
|
|
83
96
|
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
|
+
*/
|
|
109
|
+
match?: 'exact' | 'auto';
|
|
84
110
|
}
|
|
85
111
|
/**
|
|
86
112
|
* One resource's outcome. Unlike single-resource `resolve`, a miss does NOT
|
|
@@ -92,11 +118,22 @@ interface ResolveAnyResourceOutcome {
|
|
|
92
118
|
value: Record<string, unknown> | null;
|
|
93
119
|
/** How the match was found (or what was attempted). */
|
|
94
120
|
resolutionCost: 'direct' | 'server-filter' | 'client-scan';
|
|
95
|
-
/**
|
|
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
|
+
*/
|
|
96
128
|
scanned: number;
|
|
97
129
|
/** True when the scan hit its cap (a complete non-match is unproven). */
|
|
98
130
|
scanTruncated: boolean;
|
|
99
|
-
/**
|
|
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
|
+
*/
|
|
100
137
|
candidates: (number | string)[];
|
|
101
138
|
/** Error code when the resource could not resolve (e.g. `NOT_FOUND`, `CONFIG_ERROR`). */
|
|
102
139
|
error?: string;
|
|
@@ -246,8 +283,18 @@ interface AggregateOptions {
|
|
|
246
283
|
top?: number;
|
|
247
284
|
/** The total-record cap for the walk modes (default = max = the house 2500 — `queryBounded`'s hard limit). */
|
|
248
285
|
limit?: number;
|
|
249
|
-
/** Issue #276
|
|
286
|
+
/** Issue #276 (issue #287: default flipped off): label siblings on the
|
|
287
|
+
* returned group keys (`key.ticketIDName`, `key.statusLabel`, …). Absent
|
|
288
|
+
* = the client's `labels` option (off by default); true adds them,
|
|
289
|
+
* false = raw ids. */
|
|
250
290
|
names?: boolean;
|
|
291
|
+
/** Issue #287 (D3): acknowledge the UNSCOPED group/sum walk. A group/sum
|
|
292
|
+
* with no filter (absent/empty) walks the whole tenant table and is
|
|
293
|
+
* REFUSED pre-request (zero wire, the typed `SCOPE_REQUIRED`) unless
|
|
294
|
+
* this is `true` — the count mode is unaffected (one vendor count, no
|
|
295
|
+
* walk). A filter with an id scope (eq/in on an id field) is the
|
|
296
|
+
* narrow remedy. */
|
|
297
|
+
acknowledgeUnscoped?: boolean;
|
|
251
298
|
}
|
|
252
299
|
/** One folded group (the key = the groupBy field tuple; `sums` present iff `sum` was given). */
|
|
253
300
|
interface AggregateGroup {
|
|
@@ -270,6 +317,10 @@ interface AggregateResult {
|
|
|
270
317
|
totalScanned?: number;
|
|
271
318
|
/** group/sum mode: the walk's truncation flag (true → groups/sums cover the returned rows only). */
|
|
272
319
|
hasMore?: boolean;
|
|
320
|
+
/** Issue #287 (D6): the walk hit its limit and the groups may be
|
|
321
|
+
* incomplete (walk modes: the walk's truncation flag — `hasMore`; count
|
|
322
|
+
* mode: no walk, always `false`). */
|
|
323
|
+
truncated: boolean;
|
|
273
324
|
/** count mode: true exactly when the S12-C sentinel stamped the 0 (the filter-aware predicate). */
|
|
274
325
|
blind?: boolean;
|
|
275
326
|
/** The S12-C typed sentinel (count mode: the blind 0; walk mode: the 0-row walk stamp). */
|
|
@@ -754,33 +805,238 @@ interface UiLinkResult {
|
|
|
754
805
|
/** Zero-wire meta op: build the deep link from the client's live REST base (or an explicit `host`). */
|
|
755
806
|
declare function uiLink(client: AutotaskClient, input: UiLinkInput): Promise<UiLinkResult>;
|
|
756
807
|
|
|
808
|
+
/** The helper's result shape (issue #224: every helper names its result type). */
|
|
809
|
+
type SanitiseResult = Record<string, unknown>;
|
|
757
810
|
/**
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
*
|
|
811
|
+
* `operations.sanitiseResult(result, operation)` — wrap the result's
|
|
812
|
+
* untrusted fields per the operation's own registry record.
|
|
813
|
+
*
|
|
814
|
+
* @param client The wired client (unused — zero wire by construction).
|
|
815
|
+
* @param result The raw result of a prior SDK read (a query envelope, a
|
|
816
|
+
* record or the op's result object).
|
|
817
|
+
* @param operation The registry operation key of the call the result came
|
|
818
|
+
* from (e.g. `tickets.query`) — the record whose
|
|
819
|
+
* `metadata.untrustedFields` decides the field list.
|
|
820
|
+
* @returns A promise for a NEW result object with the present untrusted
|
|
821
|
+
* 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.
|
|
824
|
+
* @throws {AutotaskConfigError} an unknown (non-string/empty, or not-in-the-
|
|
825
|
+
* registry) operation — typed, zero wire.
|
|
761
826
|
*/
|
|
762
|
-
declare
|
|
827
|
+
declare function sanitiseResult(client: AutotaskClient, result: Record<string, unknown>, operation: string): Promise<SanitiseResult>;
|
|
828
|
+
|
|
829
|
+
/** The pinned wire cap: `resources × include` above it is refused
|
|
830
|
+
* pre-request (CONFIG_ERROR naming the computed cost and the cap) —
|
|
831
|
+
* refused, never truncated. */
|
|
832
|
+
declare const MAX_FIELD_CATALOG_WIRE = 60;
|
|
833
|
+
/** The stable honesty sentence served in the result (the live catalog
|
|
834
|
+
* reports field SHAPE as FLAGS and NAMES; with the opt-in `labels: true`
|
|
835
|
+
* the projected picklist rows carry the vendor's exposed picklist
|
|
836
|
+
* VALUES; it cannot resolve a picklist VALUE the vendor does not expose
|
|
837
|
+
* to this API user — the W-A4 wall). */
|
|
838
|
+
declare const FIELD_CATALOG_HONESTY_NOTE: string;
|
|
839
|
+
/** One projected field row (the stable, small served shape — not the raw
|
|
840
|
+
* vendor blob; the raw one stays available through the resource's own
|
|
841
|
+
* `getFieldInfo` / `getUdfInfo` op). */
|
|
842
|
+
interface FieldCatalogFieldRow {
|
|
843
|
+
/** The vendor field name. */
|
|
844
|
+
name: string;
|
|
845
|
+
/** The display label (UDF catalog rows only; vendor standard fields carry none). */
|
|
846
|
+
label?: string;
|
|
847
|
+
/** The vendor field type (`dataType` on standard fields, `type` on UDFs). */
|
|
848
|
+
type: string;
|
|
849
|
+
isRequired: boolean;
|
|
850
|
+
isReadOnly: boolean;
|
|
851
|
+
/** The vendor `isQueryable` flag — ABSENT on a UDF row: the vendor reports UDFs as queryable, but a filter on a UDF name is accepted only with the `udf: true` marker, so the row states the mechanism in `filterable` instead of a boolean the vendor contradicts (issue #219 N7). */
|
|
852
|
+
isQueryable?: boolean;
|
|
853
|
+
isPickList: boolean;
|
|
854
|
+
/** Present exactly on a UDF row: the filter mechanism a consumer must send to filter on this name (`udf: true` in the filter condition) — never infer plain filterability from the vendor's `isQueryable` (issue #219 N7). */
|
|
855
|
+
filterable?: 'udf-marker';
|
|
856
|
+
/** The write shape for an object/array field: `merge` (a sent subset is merged — `userDefinedFields` is the proven case) or `replace-all` (the vendor's full-model PUT replaces the collection). Absent on scalar fields (issue #219 N7). */
|
|
857
|
+
writeShape?: 'merge' | 'replace-all';
|
|
858
|
+
/** The vendor `length` bound (null when the catalog names none). */
|
|
859
|
+
maxLength: number | null;
|
|
860
|
+
/** The referenced entity type for reference fields ('' when none). */
|
|
861
|
+
referenceEntityType: string;
|
|
862
|
+
/** Present exactly when the plan declares this field DERIVED for the resource (issue #219 N8): the vendor overwrites or inherits the value, so a submitted one is not authoritative. Distinct from `isReadOnly` (never write at all) — a derived field can be absent from that list and still be recomputed. */
|
|
863
|
+
derived?: DerivationRule;
|
|
864
|
+
/** 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). */
|
|
865
|
+
picklistValues?: PickListValue[];
|
|
866
|
+
}
|
|
867
|
+
/** One compact field row (`compact: true`, issue #282): the five columns a
|
|
868
|
+
* caller needs to pick a field name — the full row's flags, lengths and
|
|
869
|
+
* reference targets are dropped. `picklistValues` rides only when `labels`
|
|
870
|
+
* AND a `fields` filter are both given (a targeted value lookup). */
|
|
871
|
+
interface FieldCatalogCompactFieldRow {
|
|
872
|
+
name: string;
|
|
873
|
+
type: string;
|
|
874
|
+
isPickList: boolean;
|
|
875
|
+
/** True when the vendor names a referenced entity (`referenceEntityType` non-empty). */
|
|
876
|
+
isReference: boolean;
|
|
877
|
+
/** True on a `udf`-kind row, false on a standard field. */
|
|
878
|
+
udf: boolean;
|
|
879
|
+
picklistValues?: PickListValue[];
|
|
880
|
+
}
|
|
881
|
+
/** The derivation rule of one field (issue #219 N8) — a closed plan token, served without the field name it decorates. */
|
|
882
|
+
interface DerivationRule {
|
|
883
|
+
/** elapsed(<start>,<end>) (recomputed from those timestamps) | parent (inherited from the parent record) | mirror(<field>) (the vendor copies that field) | external (written by another entity's op — writableRoute names it). */
|
|
884
|
+
rule: string;
|
|
885
|
+
/** The op that actually writes the value (the external rule names it — billing_item_approval_levels.create for a time entry's approval level). */
|
|
886
|
+
writableRoute?: string;
|
|
887
|
+
}
|
|
888
|
+
/** One declared derived field of a resource (issue #219 N8) — the declaration the plan pins. */
|
|
889
|
+
interface FieldDerivation extends DerivationRule {
|
|
890
|
+
/** The vendor field name. */
|
|
891
|
+
field: string;
|
|
892
|
+
}
|
|
893
|
+
/** One per-resource fault (partial failures are typed PER ROW — never all-or-nothing). */
|
|
894
|
+
interface FieldCatalogRowError {
|
|
895
|
+
code: string;
|
|
896
|
+
message: string;
|
|
897
|
+
}
|
|
898
|
+
/** One resource's catalog row (`F` = the field-row shape: compact by default when `fields` is absent and `labels` is not `true`, the full row under `compact: false` / `labels: true`). */
|
|
899
|
+
interface FieldCatalogRow<F = FieldCatalogFieldRow> {
|
|
900
|
+
/** The plan resource key. */
|
|
901
|
+
resource: string;
|
|
902
|
+
/** The vendor entity name (the path segment; plan-derived). */
|
|
903
|
+
apiEntity: string;
|
|
904
|
+
/** The plan resource's `udfCapable` flag, read from the registry record (`CapabilityRecord.udfCapable`, issue #254): true for the resources whose records carry `userDefinedFields`. Every vendor entity has a `getUdfInfo` catalog endpoint, so the `udf` include works on any row; that endpoint's presence does not make a resource UDF-capable. */
|
|
905
|
+
udfCapable: boolean;
|
|
906
|
+
/** The filter mechanism for a UDF name — present exactly when `udfCapable`: a filter on a UDF name is accepted only with the vendor's `udf: true` marker (a plain filter is refused), so the row states the marker rather than leaving a consumer to read the UDF rows' `isQueryable` (issue #219 N7). */
|
|
907
|
+
udfFilter?: 'udf-marker';
|
|
908
|
+
/** The write shape of a record's `userDefinedFields` collection — present exactly when `udfCapable`: the vendor MERGES a sent list, so a subset is correct (issue #219 N7). */
|
|
909
|
+
udfWriteShape?: 'merge';
|
|
910
|
+
/** The entity information model (present exactly when `info` was included and fetched). */
|
|
911
|
+
info?: Record<string, unknown> | null;
|
|
912
|
+
/** The plan's derived-field declaration for this resource (issue #219 N8) — present exactly when the plan declares any, in plan order; the same list the create guidance row and the describe channel serve. Read it before treating a submitted field value as authoritative. */
|
|
913
|
+
derivedFields?: FieldDerivation[];
|
|
914
|
+
/** 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`). */
|
|
915
|
+
fields?: F[];
|
|
916
|
+
/** 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. */
|
|
917
|
+
unmatchedFields: string[];
|
|
918
|
+
/** The projected UDF catalog (present exactly when `udf` was included and fetched). */
|
|
919
|
+
udf?: F[] | null;
|
|
920
|
+
/** Present exactly when a `fields` projection was applied (the `fields` opt was given): the four derived lists below then describe the PROJECTED set only. A full row omits the key (it never carries `false`). */
|
|
921
|
+
projected?: true;
|
|
922
|
+
/** `isRequired === true` names, in catalog order (the `fields` catalog). */
|
|
923
|
+
required: string[];
|
|
924
|
+
/** `isReadOnly === true` names, in catalog order. */
|
|
925
|
+
readOnly: string[];
|
|
926
|
+
/** `isQueryable === true` names, in catalog order. */
|
|
927
|
+
queryable: string[];
|
|
928
|
+
/** `isPickList === true` names, in catalog order — NAMES only (see `honesty`: the VALUES may be vendor-walled). */
|
|
929
|
+
picklistFields: string[];
|
|
930
|
+
/** The FieldCache state for this row: `hit` = every included kind was served from the cache (no wire for the row); `age` = the oldest entry's age in ms (null when `hit` is false). */
|
|
931
|
+
cache: {
|
|
932
|
+
hit: boolean;
|
|
933
|
+
age: number | null;
|
|
934
|
+
};
|
|
935
|
+
/** The metadata reads this row issued (0 = fully cached; one per included kind otherwise — in-flight de-dup may make the actual wire smaller than this). */
|
|
936
|
+
wire: number;
|
|
937
|
+
/** The first per-kind failure (code + message); the sweep keeps going. */
|
|
938
|
+
error: FieldCatalogRowError | null;
|
|
939
|
+
}
|
|
940
|
+
/** The sweep result. */
|
|
941
|
+
interface FieldCatalogResult<F = FieldCatalogFieldRow> {
|
|
942
|
+
/** The resolved client zone ('unknown' for a bare explicit baseUrl). */
|
|
943
|
+
zone: string;
|
|
944
|
+
/** The zone label (a live op has no plan-pinned tenant label — it mirrors `zone`). */
|
|
945
|
+
label: string;
|
|
946
|
+
/** Whether a FieldCache was configured at all. */
|
|
947
|
+
cached: boolean;
|
|
948
|
+
/** The resolved `labels` opt (the served payload names what it carries: `true` = the picklist rows may carry `picklistValues`). */
|
|
949
|
+
labels: boolean;
|
|
950
|
+
/** The configured TTL (null when no cache). */
|
|
951
|
+
ttlMs: number | null;
|
|
952
|
+
/** The call instant (ISO). */
|
|
953
|
+
fetchedAt: string;
|
|
954
|
+
/** One row per requested resource, in request order. */
|
|
955
|
+
rows: FieldCatalogRow<F>[];
|
|
956
|
+
/** The metadata reads actually issued across the call (≤ `cap` by construction). */
|
|
957
|
+
wireUsed: number;
|
|
958
|
+
/** The wire cap the call ran under. */
|
|
959
|
+
cap: number;
|
|
960
|
+
/** The resolved `compact` opt (true = the field rows are FieldCatalogCompactFieldRow). */
|
|
961
|
+
compact: boolean;
|
|
962
|
+
/** True only when the `maxBytes` size cap dropped field rows (see `truncation`). Over the WIRE cap the call is still refused (CONFIG_ERROR), never truncated. */
|
|
963
|
+
truncated: boolean;
|
|
964
|
+
/** Present exactly when `truncated`: the typed note naming what the `maxBytes` cap dropped (issue #282) — the payload stays valid JSON, never cut mid-document. */
|
|
965
|
+
truncation?: FieldCatalogTruncation;
|
|
966
|
+
counts: {
|
|
967
|
+
/** The requested (deduplicated) resource count. */
|
|
968
|
+
resources: number;
|
|
969
|
+
/** The plan's `getFieldInfo`-bearing resource count (the field-capable set). */
|
|
970
|
+
fieldCapableResources: number;
|
|
971
|
+
/** The plan's `udfCapable` resource count (issue #254: the resources whose records carry `userDefinedFields` — not the wider set with a `getUdfInfo` catalog endpoint). */
|
|
972
|
+
udfCapableResources: number;
|
|
973
|
+
/** The rows served fully from the cache. */
|
|
974
|
+
cached: number;
|
|
975
|
+
};
|
|
976
|
+
/** The honest scope: what the live catalog can and cannot report. */
|
|
977
|
+
honesty: {
|
|
978
|
+
/** 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. */
|
|
979
|
+
picklistValues: 'unexposed' | 'partial';
|
|
980
|
+
note: string;
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
/** The typed size-cap note (issue #282). */
|
|
984
|
+
interface FieldCatalogTruncation {
|
|
985
|
+
reason: 'maxBytes';
|
|
986
|
+
/** The cap the call ran under (UTF-8 bytes of the JSON result). */
|
|
987
|
+
maxBytes: number;
|
|
988
|
+
/** The UTF-8 byte size of the untruncated JSON result. */
|
|
989
|
+
fullBytes: number;
|
|
990
|
+
/** The entries dropped, per resource and list (taken from the end: the udf rows, then the fields rows, last resource first; the name lists only when the field rows alone could not fit). */
|
|
991
|
+
omitted: Array<{
|
|
992
|
+
resource: string;
|
|
993
|
+
kind: FieldCatalogTrimKind;
|
|
994
|
+
count: number;
|
|
995
|
+
}>;
|
|
996
|
+
note: string;
|
|
997
|
+
}
|
|
998
|
+
/** The smallest accepted `maxBytes` (a cap below it could not hold a one-resource result envelope; a larger envelope that still cannot fit is refused at result-build). */
|
|
999
|
+
declare const MIN_FIELD_CATALOG_MAX_BYTES = 4096;
|
|
1000
|
+
/** The optional call bag for `operations.fieldCatalog` (closed: unknown keys refuse). */
|
|
1001
|
+
interface FieldCatalogOptions {
|
|
1002
|
+
/** The plan resource keys to read. Omitted → the five workflow resources (never the full set — an on-demand op must not fan out 121 wire calls by default). */
|
|
1003
|
+
resources?: string[];
|
|
1004
|
+
/** What to fetch per resource (closed set `info` | `fields` | `udf`; default `['fields']`). */
|
|
1005
|
+
include?: FieldCacheKind[];
|
|
1006
|
+
/** Bypass the fieldCache for this call (fetch live, refresh the entries). Default false. */
|
|
1007
|
+
fresh?: boolean;
|
|
1008
|
+
/** 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). */
|
|
1009
|
+
fields?: string[];
|
|
1010
|
+
/** 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. */
|
|
1011
|
+
labels?: boolean;
|
|
1012
|
+
/** Issue #282: when `true`, every field row is a FieldCatalogCompactFieldRow `{ name, type, isPickList, isReference, udf }` (a live tickets result: ~11 KB compact against ~20 KB full and ~137 KB full with `labels: true`). `picklistValues` ride a compact row only with `labels: true` AND a `fields` filter. Issue #287: an ABSENT `compact` is compact BY DEFAULT — compact ONLY when `fields` is absent AND `labels` is not `true` (an explicit `compact: false` restores the full rows; `labels: true` without `fields` keeps the full rows + picklist values — the server's current ~137 KB case, unchanged). */
|
|
1013
|
+
compact?: boolean;
|
|
1014
|
+
/** Issue #282: a UTF-8 byte cap on the JSON result (integer ≥ MIN_FIELD_CATALOG_MAX_BYTES). Over it, field rows are dropped from the end until the result fits, `truncated` is `true` and `truncation` names what was dropped — never an invalid, cut-off document. The row-level name lists (required, readOnly, queryable, picklistFields) keep every name unless the field rows alone cannot fit (then they are trimmed too). A served result never exceeds the cap: when the envelope alone (it grows with the resource count) cannot fit, the call is refused with CONFIG_ERROR. The cost is linear in the result size. Default: no cap. */
|
|
1015
|
+
maxBytes?: number;
|
|
1016
|
+
}
|
|
1017
|
+
/** The lists the size cap trims, in drop order within a row: the field rows
|
|
1018
|
+
* first, then the name lists (only when the field rows alone cannot fit). */
|
|
1019
|
+
declare const TRIM_KINDS: readonly ["udf", "fields", "picklistFields", "queryable", "readOnly", "required"];
|
|
1020
|
+
type FieldCatalogTrimKind = (typeof TRIM_KINDS)[number];
|
|
763
1021
|
/**
|
|
764
|
-
*
|
|
765
|
-
* would enumerate (the same derivation the field-catalog row serves as
|
|
766
|
-
* `targetResource`).
|
|
1022
|
+
* Run the bounded live field-metadata sweep.
|
|
767
1023
|
*
|
|
768
1024
|
* ```ts
|
|
769
|
-
* import {
|
|
770
|
-
*
|
|
771
|
-
*
|
|
1025
|
+
* import { fieldCatalog } from 'node-autotask/operations';
|
|
1026
|
+
* const res = await fieldCatalog(client); // the 5 workflow resources, fields only (compact rows by default)
|
|
1027
|
+
* const fresh = await fieldCatalog(client, { resources: ['tickets'], include: ['fields', 'udf'], fresh: true });
|
|
772
1028
|
* ```
|
|
773
1029
|
*
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
*/
|
|
777
|
-
declare function resourceForEntityType(entityType: string | null | undefined): string | null;
|
|
778
|
-
/**
|
|
779
|
-
* True when `resource` is a plan resource with a read path (`query` or `get`) —
|
|
780
|
-
* the `targetEnumerable` half of the field-catalog row. A null/unknown key is
|
|
781
|
-
* false (a reference the plan cannot enumerate).
|
|
1030
|
+
* @param client The wired client (the reads issue entityInformation GETs).
|
|
1031
|
+
* @param opts The call bag ({ resources?, include?, fresh?, fields?, labels?, compact?, maxBytes? }).
|
|
782
1032
|
*/
|
|
783
|
-
declare function
|
|
1033
|
+
declare function fieldCatalog(client: AutotaskClient, opts: FieldCatalogOptions & {
|
|
1034
|
+
compact: true;
|
|
1035
|
+
}): Promise<FieldCatalogResult<FieldCatalogCompactFieldRow>>;
|
|
1036
|
+
declare function fieldCatalog(client: AutotaskClient, opts?: FieldCatalogOptions & {
|
|
1037
|
+
compact?: false;
|
|
1038
|
+
}): Promise<FieldCatalogResult>;
|
|
1039
|
+
declare function fieldCatalog(client: AutotaskClient, opts?: FieldCatalogOptions): Promise<FieldCatalogResult<FieldCatalogFieldRow | FieldCatalogCompactFieldRow>>;
|
|
784
1040
|
|
|
785
1041
|
/** The pinned per-call id cap (mirrors `FETCH_BY_IDS_MAX_ITEMS` — the house bulk cap; over → pre-request refusal, zero wire). */
|
|
786
1042
|
declare const EXPAND_RESOURCE_NAMES_MAX_IDS = 500;
|
|
@@ -1065,4 +1321,4 @@ declare function invokeWrite(client: AutotaskClient, operation: string, args?: r
|
|
|
1065
1321
|
*/
|
|
1066
1322
|
declare function invokeDelete(client: AutotaskClient, operation: string, args?: readonly unknown[] | Record<string, unknown>, opts?: InvokeOptions): Promise<unknown>;
|
|
1067
1323
|
|
|
1068
|
-
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,
|
|
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 };
|