node-autotask 0.23.0 → 0.24.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 +13 -0
- package/MCP_TOOL_CATALOG.json +29 -8
- package/MCP_TOOL_MANIFEST.md +15 -14
- package/N8N_MCP_MANIFEST.json +48 -9
- package/N8N_MCP_MANIFEST.md +8 -7
- package/README.md +2 -2
- package/capabilities.json +1888 -1702
- package/dist/capabilities.cjs +2 -2
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-JUO3URUI.cjs → chunk-4VAC2Z55.cjs} +1887 -1701
- package/dist/{chunk-B5SNZ3TZ.js → chunk-BBQBWVBE.js} +27 -2
- package/dist/{chunk-VYFO2N5F.js → chunk-ICCU2S62.js} +2 -2
- package/dist/{chunk-PVUUOM5G.js → chunk-IOVFTIW6.js} +167 -57
- package/dist/{chunk-D5TVBI4U.cjs → chunk-LVBFLSPL.cjs} +28 -3
- package/dist/{chunk-TTQB537V.cjs → chunk-SOHQ6SDI.cjs} +135 -135
- package/dist/{chunk-N27NUB4R.cjs → chunk-SW66OWM5.cjs} +627 -517
- package/dist/{chunk-OGNUI3UR.js → chunk-WJD26CPN.js} +1887 -1701
- package/dist/{index-NC-x-bYl.d.cts → index-C0OwQhon.d.cts} +55 -4
- package/dist/{index-DBoX-Dnk.d.ts → index-CZ94y401.d.ts} +55 -4
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/operations/index.cjs +106 -106
- package/dist/operations/index.d.cts +2 -2
- package/dist/operations/index.d.ts +2 -2
- package/dist/operations/index.js +2 -2
- package/dist/pool.cjs +8 -8
- package/dist/pool.d.cts +1 -1
- package/dist/pool.d.ts +1 -1
- package/dist/pool.js +4 -4
- package/dist/resources/index.cjs +4 -4
- package/dist/resources/index.d.cts +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +3 -3
- package/docs/API.md +40 -11
- package/package.json +1 -1
|
@@ -40,29 +40,29 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkLVBFLSPLcjs = require('../chunk-LVBFLSPL.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _chunk4VAC2Z55cjs = require('../chunk-4VAC2Z55.cjs');
|
|
47
47
|
|
|
48
48
|
// src/operations/searchAcrossResources.ts
|
|
49
49
|
var DEFAULT_LIMIT = 25;
|
|
50
50
|
function resourceFor(client, key) {
|
|
51
|
-
return client[
|
|
51
|
+
return client[_chunkLVBFLSPLcjs.camelKey.call(void 0, key)];
|
|
52
52
|
}
|
|
53
53
|
async function searchAcrossResources(client, query, opts = {}) {
|
|
54
54
|
const text = query.trim();
|
|
55
55
|
if (text === "") {
|
|
56
|
-
throw new (0,
|
|
56
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("searchAcrossResources: query must be a non-empty string");
|
|
57
57
|
}
|
|
58
|
-
const keys = _nullishCoalesce(opts.resources, () => (
|
|
58
|
+
const keys = _nullishCoalesce(opts.resources, () => ( _chunkLVBFLSPLcjs.WORKFLOW_RESOURCES));
|
|
59
59
|
if (keys.length === 0) {
|
|
60
|
-
throw new (0,
|
|
60
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("searchAcrossResources: no resources requested");
|
|
61
61
|
}
|
|
62
|
-
const limit =
|
|
62
|
+
const limit = _chunkLVBFLSPLcjs.clampPageSize.call(void 0, _nullishCoalesce(opts.limit, () => ( DEFAULT_LIMIT)));
|
|
63
63
|
const totalLimit = opts.totalLimit;
|
|
64
64
|
if (totalLimit !== void 0 && !(Number.isInteger(totalLimit) && totalLimit >= 1)) {
|
|
65
|
-
throw new (0,
|
|
65
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("searchAcrossResources: totalLimit must be a positive integer");
|
|
66
66
|
}
|
|
67
67
|
const results = [];
|
|
68
68
|
const skipped = [];
|
|
@@ -93,7 +93,7 @@ async function searchAcrossResources(client, query, opts = {}) {
|
|
|
93
93
|
|
|
94
94
|
// src/operations/resolveAny.ts
|
|
95
95
|
function resourceFor2(client, key) {
|
|
96
|
-
return client[
|
|
96
|
+
return client[_chunkLVBFLSPLcjs.camelKey.call(void 0, key)];
|
|
97
97
|
}
|
|
98
98
|
var FAULT_CATEGORIES = /* @__PURE__ */ new Set(["auth", "rate_limit", "server", "network", "timeout", "policy"]);
|
|
99
99
|
function missCost(identifier) {
|
|
@@ -102,13 +102,13 @@ function missCost(identifier) {
|
|
|
102
102
|
}
|
|
103
103
|
async function resolveAny(client, identifier, opts = {}) {
|
|
104
104
|
if (typeof identifier === "number") {
|
|
105
|
-
|
|
105
|
+
_chunkLVBFLSPLcjs.parseIdentifier.call(void 0, identifier, "identifier");
|
|
106
106
|
} else if (identifier.trim() === "") {
|
|
107
|
-
throw new (0,
|
|
107
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("resolveAny: identifier must be non-empty");
|
|
108
108
|
}
|
|
109
|
-
const keys = _nullishCoalesce(opts.resources, () => (
|
|
109
|
+
const keys = _nullishCoalesce(opts.resources, () => ( _chunkLVBFLSPLcjs.WORKFLOW_RESOURCES));
|
|
110
110
|
if (keys.length === 0) {
|
|
111
|
-
throw new (0,
|
|
111
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("resolveAny: no resources requested");
|
|
112
112
|
}
|
|
113
113
|
const results = [];
|
|
114
114
|
for (const key of keys) {
|
|
@@ -138,9 +138,9 @@ async function resolveAny(client, identifier, opts = {}) {
|
|
|
138
138
|
} catch (err) {
|
|
139
139
|
let code;
|
|
140
140
|
let candidates = [];
|
|
141
|
-
if (err instanceof
|
|
141
|
+
if (err instanceof _chunkLVBFLSPLcjs.AutotaskConfigError) {
|
|
142
142
|
code = "CONFIG_ERROR";
|
|
143
|
-
} else if (
|
|
143
|
+
} else if (_chunkLVBFLSPLcjs.isAutotaskError.call(void 0, err)) {
|
|
144
144
|
if (FAULT_CATEGORIES.has(err.category)) throw err;
|
|
145
145
|
code = err.code;
|
|
146
146
|
if (code === "RESOLUTION_AMBIGUOUS" && err.resourceIds !== void 0) {
|
|
@@ -167,7 +167,7 @@ async function resolveAny(client, identifier, opts = {}) {
|
|
|
167
167
|
// src/operations/aggregate.ts
|
|
168
168
|
var AGGREGATE_TOP_MAX = 100;
|
|
169
169
|
var AGGREGATE_DEFAULT_TOP = 25;
|
|
170
|
-
var AGGREGATE_DEFAULT_LIMIT =
|
|
170
|
+
var AGGREGATE_DEFAULT_LIMIT = _chunkLVBFLSPLcjs.BOUNDED_QUERY_MAX_LIMIT;
|
|
171
171
|
var AGGREGATE_DATE_BUCKETS = ["month", "week", "year"];
|
|
172
172
|
var DATE_ONLY_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
173
173
|
var DATETIME_RE = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?(Z|[+-]\d{2}:?\d{2})?$/;
|
|
@@ -224,7 +224,7 @@ function dateBucketLabel(value, bucket) {
|
|
|
224
224
|
}
|
|
225
225
|
var QUERY_RESOURCE_KEYS = (() => {
|
|
226
226
|
const s = /* @__PURE__ */ new Set();
|
|
227
|
-
for (const rec of
|
|
227
|
+
for (const rec of _chunk4VAC2Z55cjs.CAPABILITIES) if (rec.operation === "query") s.add(rec.resource);
|
|
228
228
|
return s;
|
|
229
229
|
})();
|
|
230
230
|
var AGGREGATE_OPT_KEYS = ["groupBy", "sum", "top", "limit"];
|
|
@@ -260,15 +260,15 @@ function parseFilterConditions(filter, problems) {
|
|
|
260
260
|
return [];
|
|
261
261
|
}
|
|
262
262
|
try {
|
|
263
|
-
return
|
|
263
|
+
return _chunkLVBFLSPLcjs.buildFilter.call(void 0, conds).filter;
|
|
264
264
|
} catch (err) {
|
|
265
|
-
problems.push(err instanceof
|
|
265
|
+
problems.push(err instanceof _chunkLVBFLSPLcjs.AutotaskConfigError ? err.message : `filter must be the query-bag filter (13 operators; caps 500 OR-conditions / 1 UDF / 8000 chars); ${String(err)}`);
|
|
266
266
|
return [];
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
function checkOptsBag(opts, problems) {
|
|
270
270
|
if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
|
|
271
|
-
throw new (0,
|
|
271
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
272
272
|
`aggregate: opts must be the options object (got ${Array.isArray(opts) ? "an array" : typeof opts})`,
|
|
273
273
|
{ operation: "operations.aggregate" }
|
|
274
274
|
);
|
|
@@ -348,7 +348,7 @@ function parseTopAndLimit(opts, problems) {
|
|
|
348
348
|
if (!Number.isInteger(opts.limit)) {
|
|
349
349
|
problems.push(`limit must be an integer (got ${String(opts.limit)})`);
|
|
350
350
|
} else {
|
|
351
|
-
limit = Math.min(Math.max(opts.limit, 1),
|
|
351
|
+
limit = Math.min(Math.max(opts.limit, 1), _chunkLVBFLSPLcjs.BOUNDED_QUERY_MAX_LIMIT);
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
return { top, limit };
|
|
@@ -360,14 +360,14 @@ function validateAggregate(operation, filter, opts) {
|
|
|
360
360
|
checkOptsBag(opts, problems);
|
|
361
361
|
const oracles = {
|
|
362
362
|
resourceKey,
|
|
363
|
-
fieldSets: resourceKey !== void 0 ?
|
|
364
|
-
dateSets: resourceKey !== void 0 ?
|
|
363
|
+
fieldSets: resourceKey !== void 0 ? _chunkLVBFLSPLcjs.MODEL_FIELD_SETS[resourceKey] : void 0,
|
|
364
|
+
dateSets: resourceKey !== void 0 ? _chunkLVBFLSPLcjs.MODEL_DATE_FIELDS[resourceKey] : void 0
|
|
365
365
|
};
|
|
366
366
|
const groupBy = parseGroupBy(opts, oracles, problems);
|
|
367
367
|
const sum = checkSumFields("sum", opts.sum, oracles, problems);
|
|
368
368
|
const { top, limit } = parseTopAndLimit(opts, problems);
|
|
369
369
|
if (problems.length > 0) {
|
|
370
|
-
throw new (0,
|
|
370
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
371
371
|
`aggregate: ${problems.length} problem(s) found pre-request (zero wire was issued)
|
|
372
372
|
- ` + problems.join("\n- "),
|
|
373
373
|
{ operation: "operations.aggregate" }
|
|
@@ -401,9 +401,9 @@ function foldGroups(items, v) {
|
|
|
401
401
|
}
|
|
402
402
|
async function aggregate(client, operation, filter, opts = {}) {
|
|
403
403
|
const v = validateAggregate(operation, filter, opts);
|
|
404
|
-
const holder = client[
|
|
404
|
+
const holder = client[_chunkLVBFLSPLcjs.camelKey.call(void 0, v.resourceKey)];
|
|
405
405
|
if (holder === void 0) {
|
|
406
|
-
throw new (0,
|
|
406
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(`aggregate: the client exposes no accessor for resource "${v.resourceKey}"`, {
|
|
407
407
|
operation: "operations.aggregate",
|
|
408
408
|
suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
|
|
409
409
|
});
|
|
@@ -437,20 +437,20 @@ async function aggregate(client, operation, filter, opts = {}) {
|
|
|
437
437
|
async function relationshipMap(client, resourceKey) {
|
|
438
438
|
void client;
|
|
439
439
|
if (typeof resourceKey !== "string" || resourceKey.trim() === "") {
|
|
440
|
-
throw new (0,
|
|
440
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
441
441
|
`relationshipMap: resourceKey must be a non-empty plan resource key string (e.g. 'tickets'; got ${typeof resourceKey === "string" ? "a blank string" : typeof resourceKey})`,
|
|
442
442
|
{ suggestedAction: "Pass the exact plan resource key (snake_case) from autotask_catalog \u2014 e.g. tickets, companies, configuration_items, ticket_notes." }
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
445
|
const key = resourceKey.trim();
|
|
446
|
-
const entry =
|
|
446
|
+
const entry = _chunkLVBFLSPLcjs.RELATIONSHIP_MAP[key];
|
|
447
447
|
if (entry === void 0) {
|
|
448
|
-
throw new (0,
|
|
449
|
-
`relationshipMap: unknown resource "${key}" \u2014 the plan has ${Object.keys(
|
|
448
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskError)(
|
|
449
|
+
`relationshipMap: unknown resource "${key}" \u2014 the plan has ${Object.keys(_chunkLVBFLSPLcjs.RELATIONSHIP_MAP).length} resources`,
|
|
450
450
|
{
|
|
451
451
|
code: "RESOURCE_UNKNOWN",
|
|
452
452
|
category: "validation",
|
|
453
|
-
suggestedAction: `Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items). Zone facts served are ${
|
|
453
|
+
suggestedAction: `Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items). Zone facts served are ${_chunkLVBFLSPLcjs.RELATIONSHIP_ZONE.label} (${_chunkLVBFLSPLcjs.RELATIONSHIP_ZONE.zone})-verified.`
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
456
|
}
|
|
@@ -467,24 +467,24 @@ var BLIND_SURFACE_KINDS = [
|
|
|
467
467
|
async function blindSurfaces(client, opts) {
|
|
468
468
|
void client;
|
|
469
469
|
if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
|
|
470
|
-
throw new (0,
|
|
470
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("blindSurfaces: opts must be an object { resource?: string, kind?: BlindSurfaceKind }");
|
|
471
471
|
}
|
|
472
|
-
const inv =
|
|
472
|
+
const inv = _chunkLVBFLSPLcjs.BLIND_SURFACE_INVENTORY;
|
|
473
473
|
if (inv === null) {
|
|
474
|
-
throw new (0,
|
|
474
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("blindSurfaces: the reachability inventory is absent from the generated artifact \u2014 re-run the build");
|
|
475
475
|
}
|
|
476
476
|
let surfaces = inv.surfaces;
|
|
477
477
|
if (_optionalChain([opts, 'optionalAccess', _ => _.resource]) !== void 0) {
|
|
478
478
|
const key = typeof opts.resource === "string" ? opts.resource.trim() : "";
|
|
479
479
|
if (key === "") {
|
|
480
|
-
throw new (0,
|
|
480
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
481
481
|
"blindSurfaces: opts.resource must be a non-empty plan resource key string (e.g. 'tickets')",
|
|
482
482
|
{ suggestedAction: "Pass the exact plan resource key (snake_case) from autotask_catalog \u2014 e.g. tickets, companies, configuration_items." }
|
|
483
483
|
);
|
|
484
484
|
}
|
|
485
485
|
if (!inv.surfaces.some((row) => row.resource === key)) {
|
|
486
|
-
throw new (0,
|
|
487
|
-
`blindSurfaces: unknown resource "${key}" \u2014 the plan has ${Object.keys(
|
|
486
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskError)(
|
|
487
|
+
`blindSurfaces: unknown resource "${key}" \u2014 the plan has ${Object.keys(_chunkLVBFLSPLcjs.RELATIONSHIP_MAP).length} resources`,
|
|
488
488
|
{
|
|
489
489
|
code: "RESOURCE_UNKNOWN",
|
|
490
490
|
category: "validation",
|
|
@@ -496,7 +496,7 @@ async function blindSurfaces(client, opts) {
|
|
|
496
496
|
}
|
|
497
497
|
if (_optionalChain([opts, 'optionalAccess', _2 => _2.kind]) !== void 0) {
|
|
498
498
|
if (!BLIND_SURFACE_KINDS.includes(opts.kind)) {
|
|
499
|
-
throw new (0,
|
|
499
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
500
500
|
`blindSurfaces: unknown kind "${String(opts.kind)}" \u2014 the valid classes are: ${BLIND_SURFACE_KINDS.join(", ")}`,
|
|
501
501
|
{ suggestedAction: `Filter with one of: ${BLIND_SURFACE_KINDS.join(", ")} (or omit kind for the full 116-surface inventory).` }
|
|
502
502
|
);
|
|
@@ -509,51 +509,51 @@ async function blindSurfaces(client, opts) {
|
|
|
509
509
|
// src/operations/probeReachability.ts
|
|
510
510
|
async function probeReachability(client, opts) {
|
|
511
511
|
if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
|
|
512
|
-
throw new (0,
|
|
512
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("probeReachability: opts must be an object { resources?: string[], limit?: 1|2, maxWireCalls?: number, confirmProbe?: true }");
|
|
513
513
|
}
|
|
514
|
-
const defs =
|
|
514
|
+
const defs = _chunkLVBFLSPLcjs.REACHABILITY_PROBE_DEFAULTS;
|
|
515
515
|
if (_optionalChain([opts, 'optionalAccess', _3 => _3.confirmProbe]) !== true) {
|
|
516
|
-
throw new (0,
|
|
516
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
517
517
|
"probeReachability: confirmProbe: true is required \u2014 the op deliberately fans out read wire across the tenant (one bounded query per surface); pass confirmProbe: true to run it",
|
|
518
518
|
{ suggestedAction: `Re-call with { confirmProbe: true } (plus resources/limit/maxWireCalls as needed). For the ZERO-wire pinned inventory use operations.blindSurfaces.` }
|
|
519
519
|
);
|
|
520
520
|
}
|
|
521
521
|
const limit = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _4 => _4.limit]), () => ( defs.limitDefault));
|
|
522
522
|
if (!Number.isInteger(limit) || limit < 1 || limit > defs.limitMax) {
|
|
523
|
-
throw new (0,
|
|
523
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
524
524
|
`probeReachability: limit must be an integer 1..${defs.limitMax} (got ${String(limit)}) \u2014 the rows-per-surface bound for the discovery read`
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
527
|
const cap = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _5 => _5.maxWireCalls]), () => ( defs.defaultCap));
|
|
528
528
|
if (!Number.isInteger(cap) || cap < 1) {
|
|
529
|
-
throw new (0,
|
|
529
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(`probeReachability: maxWireCalls must be a positive integer (got ${String(cap)})`);
|
|
530
530
|
}
|
|
531
531
|
if (cap > defs.hardCap) {
|
|
532
|
-
throw new (0,
|
|
532
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
533
533
|
`probeReachability: maxWireCalls ${cap} exceeds the hard wire cap of ${defs.hardCap} \u2014 the sweep is refused above it (never capped silently)`,
|
|
534
534
|
{ suggestedAction: `Pass maxWireCalls \u2264 ${defs.hardCap} and a resources set no larger than the cap (the refused set is never truncated).` }
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
|
-
const inv =
|
|
537
|
+
const inv = _chunkLVBFLSPLcjs.BLIND_SURFACE_INVENTORY;
|
|
538
538
|
if (inv === null) {
|
|
539
|
-
throw new (0,
|
|
539
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("probeReachability: the reachability inventory is absent from the generated artifact \u2014 re-run the build");
|
|
540
540
|
}
|
|
541
541
|
let targets;
|
|
542
542
|
if (_optionalChain([opts, 'optionalAccess', _6 => _6.resources]) === void 0) {
|
|
543
543
|
targets = [...defs.defaultTargets];
|
|
544
544
|
} else {
|
|
545
545
|
if (!Array.isArray(opts.resources) || opts.resources.length === 0) {
|
|
546
|
-
throw new (0,
|
|
546
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("probeReachability: opts.resources must be a non-empty string[] of plan resource keys (or omit it for the default non-data-full set)");
|
|
547
547
|
}
|
|
548
548
|
const seen = /* @__PURE__ */ new Set();
|
|
549
549
|
for (const r of opts.resources) {
|
|
550
550
|
if (typeof r !== "string" || r.trim() === "") {
|
|
551
|
-
throw new (0,
|
|
551
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(`probeReachability: opts.resources must contain non-empty plan resource key strings (got ${typeof r === "string" && r.trim() === "" ? "a blank string" : typeof r})`);
|
|
552
552
|
}
|
|
553
553
|
const key = r.trim();
|
|
554
554
|
if (!inv.surfaces.some((row) => row.resource === key)) {
|
|
555
555
|
const surfaceCount = new Set(inv.surfaces.map((s) => s.resource)).size;
|
|
556
|
-
throw new (0,
|
|
556
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskError)(
|
|
557
557
|
`probeReachability: unknown resource "${key}" \u2014 the inventory has ${surfaceCount} surfaces`,
|
|
558
558
|
{
|
|
559
559
|
code: "RESOURCE_UNKNOWN",
|
|
@@ -567,7 +567,7 @@ async function probeReachability(client, opts) {
|
|
|
567
567
|
targets = [...seen];
|
|
568
568
|
}
|
|
569
569
|
if (targets.length > cap) {
|
|
570
|
-
throw new (0,
|
|
570
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
571
571
|
`probeReachability: ${targets.length} requested surface(s) exceed the wire cap of ${cap} \u2014 the sweep is refused above its cap (never truncated)`,
|
|
572
572
|
{ suggestedAction: `Raise maxWireCalls (\u2264 ${defs.hardCap}) to cover the set, or pass a smaller resources list.` }
|
|
573
573
|
);
|
|
@@ -577,7 +577,7 @@ async function probeReachability(client, opts) {
|
|
|
577
577
|
for (const resource of targets.sort()) {
|
|
578
578
|
const row = byResource.get(resource);
|
|
579
579
|
if (row === void 0) continue;
|
|
580
|
-
const holder = client[
|
|
580
|
+
const holder = client[_chunkLVBFLSPLcjs.camelKey.call(void 0, resource)];
|
|
581
581
|
const probeFn = _optionalChain([holder, 'optionalAccess', _7 => _7.queryBounded]);
|
|
582
582
|
if (typeof probeFn !== "function") {
|
|
583
583
|
results.push({
|
|
@@ -596,7 +596,7 @@ async function probeReachability(client, opts) {
|
|
|
596
596
|
probe: { ok: true, wire: 1, error: null }
|
|
597
597
|
});
|
|
598
598
|
} catch (err) {
|
|
599
|
-
const code =
|
|
599
|
+
const code = _chunkLVBFLSPLcjs.isAutotaskError.call(void 0, err) ? err.code : "NETWORK_ERROR";
|
|
600
600
|
const message = err instanceof Error ? err.message : String(err);
|
|
601
601
|
results.push({
|
|
602
602
|
...row,
|
|
@@ -624,24 +624,24 @@ var CREATE_BLOCKER_KINDS = [
|
|
|
624
624
|
async function createGuidance(client, opts) {
|
|
625
625
|
void client;
|
|
626
626
|
if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
|
|
627
|
-
throw new (0,
|
|
627
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
628
628
|
"createGuidance: opts must be an object { resources?: string[], kind?: CreateBlockerKind }"
|
|
629
629
|
);
|
|
630
630
|
}
|
|
631
|
-
let rows =
|
|
631
|
+
let rows = _chunkLVBFLSPLcjs.CREATE_GUIDANCE.rows;
|
|
632
632
|
if (_optionalChain([opts, 'optionalAccess', _9 => _9.resources]) !== void 0) {
|
|
633
633
|
if (!Array.isArray(opts.resources) || opts.resources.length === 0) {
|
|
634
|
-
throw new (0,
|
|
634
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("createGuidance: opts.resources must be a non-empty string[] of plan resource keys");
|
|
635
635
|
}
|
|
636
636
|
const wanted = /* @__PURE__ */ new Set();
|
|
637
637
|
for (const r of opts.resources) {
|
|
638
638
|
if (typeof r !== "string" || r.trim() === "") {
|
|
639
|
-
throw new (0,
|
|
639
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)("createGuidance: opts.resources must contain non-empty plan resource key strings");
|
|
640
640
|
}
|
|
641
641
|
const key = r.trim();
|
|
642
|
-
if (!
|
|
643
|
-
throw new (0,
|
|
644
|
-
`createGuidance: unknown resource "${key}" \u2014 the catalog has ${
|
|
642
|
+
if (!_chunkLVBFLSPLcjs.CREATE_GUIDANCE.rows.some((row) => row.resource === key)) {
|
|
643
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskError)(
|
|
644
|
+
`createGuidance: unknown resource "${key}" \u2014 the catalog has ${_chunkLVBFLSPLcjs.CREATE_GUIDANCE.rows.length} create entities`,
|
|
645
645
|
{
|
|
646
646
|
code: "RESOURCE_UNKNOWN",
|
|
647
647
|
category: "validation",
|
|
@@ -655,18 +655,18 @@ async function createGuidance(client, opts) {
|
|
|
655
655
|
}
|
|
656
656
|
if (_optionalChain([opts, 'optionalAccess', _10 => _10.kind]) !== void 0) {
|
|
657
657
|
if (!CREATE_BLOCKER_KINDS.includes(opts.kind)) {
|
|
658
|
-
throw new (0,
|
|
658
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
659
659
|
`createGuidance: unknown kind "${String(opts.kind)}" \u2014 the valid kinds are: ${CREATE_BLOCKER_KINDS.join(", ")}`
|
|
660
660
|
);
|
|
661
661
|
}
|
|
662
662
|
rows = rows.filter((row) => _optionalChain([row, 'access', _11 => _11.blocker, 'optionalAccess', _12 => _12.kind]) === opts.kind);
|
|
663
663
|
}
|
|
664
664
|
return {
|
|
665
|
-
zone:
|
|
666
|
-
label:
|
|
667
|
-
verifiedAt:
|
|
665
|
+
zone: _chunkLVBFLSPLcjs.CREATE_GUIDANCE.zone,
|
|
666
|
+
label: _chunkLVBFLSPLcjs.CREATE_GUIDANCE.label,
|
|
667
|
+
verifiedAt: _chunkLVBFLSPLcjs.CREATE_GUIDANCE.verifiedAt,
|
|
668
668
|
rows,
|
|
669
|
-
counts:
|
|
669
|
+
counts: _chunkLVBFLSPLcjs.CREATE_GUIDANCE.counts
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
672
|
|
|
@@ -675,7 +675,7 @@ var RECOVERY_CONFIRM = "operations.recovery";
|
|
|
675
675
|
var RECOVERY_DEFAULT_LIMIT = 25;
|
|
676
676
|
var RECOVERY_MAX_LIMIT = 100;
|
|
677
677
|
function configError(message, operation, suggestedAction) {
|
|
678
|
-
throw new (0,
|
|
678
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(message, { operation, suggestedAction });
|
|
679
679
|
}
|
|
680
680
|
function parseMatchId(record) {
|
|
681
681
|
const raw = record.id;
|
|
@@ -691,7 +691,7 @@ function parseMatchId(record) {
|
|
|
691
691
|
return { id: null, unsafe: true };
|
|
692
692
|
}
|
|
693
693
|
function validateRecoveryInput(input, operation) {
|
|
694
|
-
if (!
|
|
694
|
+
if (!_chunkLVBFLSPLcjs.isRecord.call(void 0, input)) {
|
|
695
695
|
configError(
|
|
696
696
|
`recovery: input must be an object { resource, marker, ... } (got ${typeof input})`,
|
|
697
697
|
operation,
|
|
@@ -725,10 +725,10 @@ function validateRecoveryInput(input, operation) {
|
|
|
725
725
|
return { resource, marker, action };
|
|
726
726
|
}
|
|
727
727
|
function resolveRecoveryTarget(client, resource, operation) {
|
|
728
|
-
const entry =
|
|
728
|
+
const entry = _chunkLVBFLSPLcjs.RELATIONSHIP_MAP[resource];
|
|
729
729
|
if (entry === void 0) {
|
|
730
|
-
throw new (0,
|
|
731
|
-
`recovery: unknown resource "${resource}" \u2014 the plan has ${Object.keys(
|
|
730
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskError)(
|
|
731
|
+
`recovery: unknown resource "${resource}" \u2014 the plan has ${Object.keys(_chunkLVBFLSPLcjs.RELATIONSHIP_MAP).length} resources`,
|
|
732
732
|
{
|
|
733
733
|
code: "RESOURCE_UNKNOWN",
|
|
734
734
|
category: "validation",
|
|
@@ -737,7 +737,7 @@ function resolveRecoveryTarget(client, resource, operation) {
|
|
|
737
737
|
}
|
|
738
738
|
);
|
|
739
739
|
}
|
|
740
|
-
const holder = client[
|
|
740
|
+
const holder = client[_chunkLVBFLSPLcjs.camelKey.call(void 0, resource)];
|
|
741
741
|
if (!holder || typeof holder.queryBounded !== "function") {
|
|
742
742
|
configError(
|
|
743
743
|
`recovery: ${resource} exposes no bounded query surface \u2014 the marker search cannot run`,
|
|
@@ -748,7 +748,7 @@ function resolveRecoveryTarget(client, resource, operation) {
|
|
|
748
748
|
return { entry, holder };
|
|
749
749
|
}
|
|
750
750
|
function resolveMarkerField(input, resource, operation) {
|
|
751
|
-
const field = input.field !== void 0 ? String(input.field) :
|
|
751
|
+
const field = input.field !== void 0 ? String(input.field) : _chunkLVBFLSPLcjs.MARKER_FIELDS[resource];
|
|
752
752
|
if (typeof field !== "string" || field.trim() === "") {
|
|
753
753
|
configError(
|
|
754
754
|
`recovery: ${resource} has no plan markerField and no input.field was passed \u2014 the marker search needs a name-like field to filter on`,
|
|
@@ -787,7 +787,7 @@ function resolveExtraFilter(input, operation) {
|
|
|
787
787
|
);
|
|
788
788
|
}
|
|
789
789
|
for (const c of input.filter) {
|
|
790
|
-
if (!
|
|
790
|
+
if (!_chunkLVBFLSPLcjs.isRecord.call(void 0, c) || typeof c.op !== "string" || c.op === "and" || c.op === "or") {
|
|
791
791
|
configError(
|
|
792
792
|
"recovery: input.filter accepts only plain leaf conditions ({ field, op, value }) \u2014 no grouping",
|
|
793
793
|
operation,
|
|
@@ -812,7 +812,7 @@ function resolveLimit(input, operation) {
|
|
|
812
812
|
async function applyRecoveryDeletes(holder, matches, parentId, resource, operation) {
|
|
813
813
|
const deleteMethod = holder.delete;
|
|
814
814
|
if (deleteMethod === void 0) {
|
|
815
|
-
throw new (0,
|
|
815
|
+
throw new (0, _chunkLVBFLSPLcjs.DeleteBoundaryError)(
|
|
816
816
|
`recovery: ${resource} has no delete method on the client \u2014 the boundary is marked available in the plan but the typed delete surface is missing`,
|
|
817
817
|
{
|
|
818
818
|
operation,
|
|
@@ -841,14 +841,14 @@ async function applyRecoveryDeletes(holder, matches, parentId, resource, operati
|
|
|
841
841
|
verify = "still-present";
|
|
842
842
|
}
|
|
843
843
|
} catch (err) {
|
|
844
|
-
if (err instanceof
|
|
844
|
+
if (err instanceof _chunkLVBFLSPLcjs.NotFoundError) verify = "not-found";
|
|
845
845
|
else {
|
|
846
846
|
verify = "error";
|
|
847
|
-
code =
|
|
847
|
+
code = _chunkLVBFLSPLcjs.isAutotaskError.call(void 0, err) ? err.code : "SERVER_ERROR";
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
} catch (err) {
|
|
851
|
-
code =
|
|
851
|
+
code = _chunkLVBFLSPLcjs.isAutotaskError.call(void 0, err) ? err.code : "SERVER_ERROR";
|
|
852
852
|
}
|
|
853
853
|
deleted.push({ id, verified: verify === "not-found", code });
|
|
854
854
|
}
|
|
@@ -876,7 +876,7 @@ async function recovery(client, input, opts = {}) {
|
|
|
876
876
|
const parentId = resolveParentId(input, entry, resource, operation);
|
|
877
877
|
const extra = resolveExtraFilter(input, operation);
|
|
878
878
|
const limit = resolveLimit(input, operation);
|
|
879
|
-
const boundaryNote =
|
|
879
|
+
const boundaryNote = _chunkLVBFLSPLcjs.DELETE_BOUNDARY_NOTES[resource];
|
|
880
880
|
const boundary = {
|
|
881
881
|
available: boundaryNote === void 0,
|
|
882
882
|
reason: _nullishCoalesce(boundaryNote, () => ( null)),
|
|
@@ -888,7 +888,7 @@ async function recovery(client, input, opts = {}) {
|
|
|
888
888
|
};
|
|
889
889
|
const isDelete = action === "delete";
|
|
890
890
|
if (isDelete && boundaryNote !== void 0) {
|
|
891
|
-
throw new (0,
|
|
891
|
+
throw new (0, _chunkLVBFLSPLcjs.DeleteBoundaryError)(
|
|
892
892
|
`recovery: the vendor defines no DELETE for ${resource} \u2014 the delete cannot be issued through the API (zero wire was issued)`,
|
|
893
893
|
{
|
|
894
894
|
operation,
|
|
@@ -900,7 +900,7 @@ async function recovery(client, input, opts = {}) {
|
|
|
900
900
|
const dryRun = _optionalChain([opts, 'optionalAccess', _13 => _13.dryRun]) !== false;
|
|
901
901
|
const confirm = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _14 => _14.confirm]), () => ( input.confirm));
|
|
902
902
|
if (isDelete && !dryRun && confirm !== RECOVERY_CONFIRM) {
|
|
903
|
-
throw new (0,
|
|
903
|
+
throw new (0, _chunkLVBFLSPLcjs.ConfirmationRequiredError)(
|
|
904
904
|
`recovery: action 'delete' apply is destructive and requires its confirmation flag: pass confirm: "${RECOVERY_CONFIRM}"`,
|
|
905
905
|
{
|
|
906
906
|
operation: RECOVERY_CONFIRM,
|
|
@@ -916,7 +916,7 @@ async function recovery(client, input, opts = {}) {
|
|
|
916
916
|
const query = await holder.queryBounded({ filter: conditions, limit });
|
|
917
917
|
if (query.hasMore) {
|
|
918
918
|
const wire = isDelete ? "DELETE wire" : "mutating wire";
|
|
919
|
-
throw new (0,
|
|
919
|
+
throw new (0, _chunkLVBFLSPLcjs.RecoveryTruncatedError)(
|
|
920
920
|
`recovery: the marker search on ${resource} TRIPPED its match cap (${limit}) \u2014 more matches exist than were returned (zero ${wire} was issued)`,
|
|
921
921
|
{
|
|
922
922
|
operation,
|
|
@@ -945,7 +945,7 @@ async function recovery(client, input, opts = {}) {
|
|
|
945
945
|
return { ...base, simulated: true, dryRun: true };
|
|
946
946
|
}
|
|
947
947
|
if (unsafeId) {
|
|
948
|
-
throw new (0,
|
|
948
|
+
throw new (0, _chunkLVBFLSPLcjs.MarkerUnsafeIdError)(
|
|
949
949
|
`recovery: ${unsafeIds.length} of ${matches.length} match(es) on ${resource} have ids beyond Number.MAX_SAFE_INTEGER \u2014 they CANNOT be addressed through the SDK's typed delete surface (zero DELETE wire was issued)`,
|
|
950
950
|
{
|
|
951
951
|
operation,
|
|
@@ -963,7 +963,7 @@ function needsConfirmation(record) {
|
|
|
963
963
|
return record.effect === "destructive" || (_nullishCoalesce(record.flags, () => ( []))).includes("requiresApproval");
|
|
964
964
|
}
|
|
965
965
|
function refuse(message, operation, suggestedAction) {
|
|
966
|
-
throw new (0,
|
|
966
|
+
throw new (0, _chunkLVBFLSPLcjs.ConfirmationRequiredError)(message, { operation, suggestedAction });
|
|
967
967
|
}
|
|
968
968
|
var MODE_BY_EFFECT = {
|
|
969
969
|
read: "read",
|
|
@@ -1009,7 +1009,7 @@ function looseTypeOk(type, value) {
|
|
|
1009
1009
|
case "string[]":
|
|
1010
1010
|
return Array.isArray(value) && value.every((v) => typeof v === "string");
|
|
1011
1011
|
case "object":
|
|
1012
|
-
return
|
|
1012
|
+
return _chunkLVBFLSPLcjs.isRecord.call(void 0, value);
|
|
1013
1013
|
default:
|
|
1014
1014
|
return true;
|
|
1015
1015
|
}
|
|
@@ -1029,7 +1029,7 @@ function validateDispatchArgs(record, argsIn) {
|
|
|
1029
1029
|
const bagName = names.find((n) => schema[n].properties);
|
|
1030
1030
|
const surplus = args[names.length];
|
|
1031
1031
|
const bagHint = bagName && surplus !== null && typeof surplus === "object" && !Array.isArray(surplus) ? ` \u2014 options go inside the single ${bagName} object` : "";
|
|
1032
|
-
throw new (0,
|
|
1032
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1033
1033
|
`invoke: "${operation}" declares ${names.length} positional arg(s) (${declaredArgList(record)}) but ${args.length} were passed \u2014 extra args are refused${bagHint}`,
|
|
1034
1034
|
{
|
|
1035
1035
|
operation,
|
|
@@ -1039,7 +1039,7 @@ function validateDispatchArgs(record, argsIn) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
const required = names.filter((n) => schema[n].required);
|
|
1041
1041
|
if (args.length < required.length) {
|
|
1042
|
-
throw new (0,
|
|
1042
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1043
1043
|
`invoke: "${operation}" requires ${required.length} positional arg(s) (${required.map((n) => `${n}: ${schema[n].type}`).join(", ")}) but only ${args.length} were passed \u2014 declared args: ${declaredArgList(record)}`,
|
|
1044
1044
|
{ operation }
|
|
1045
1045
|
);
|
|
@@ -1050,7 +1050,7 @@ function validateDispatchArgs(record, argsIn) {
|
|
|
1050
1050
|
const name = names[i];
|
|
1051
1051
|
const spec = schema[name];
|
|
1052
1052
|
if (!looseTypeOk(spec.type, value)) {
|
|
1053
|
-
throw new (0,
|
|
1053
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1054
1054
|
`invoke: "${operation}" arg ${i + 1} is declared ${name}: ${spec.type} \u2014 the value has the wrong type (pass a ${spec.type} value)`,
|
|
1055
1055
|
{ operation }
|
|
1056
1056
|
);
|
|
@@ -1112,11 +1112,11 @@ function validateParamsBag(record, args) {
|
|
|
1112
1112
|
const valid = PARAMS_BAG_KEYS[record.operation];
|
|
1113
1113
|
if (valid === void 0) return;
|
|
1114
1114
|
const bag = _optionalChain([args, 'optionalAccess', _15 => _15[0]]);
|
|
1115
|
-
if (bag === void 0 || bag === null || !
|
|
1115
|
+
if (bag === void 0 || bag === null || !_chunkLVBFLSPLcjs.isRecord.call(void 0, bag)) return;
|
|
1116
1116
|
const unknown = Object.keys(bag).filter((k) => !valid.includes(k));
|
|
1117
1117
|
if (unknown.length === 0) return;
|
|
1118
1118
|
const suggestions = unknown.map((k) => [k, suggestForKey(k, valid)]).filter((pair) => pair[1] !== null).map(([k, s]) => `"${k}" \u2192 "${s}"`);
|
|
1119
|
-
throw new (0,
|
|
1119
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1120
1120
|
`invoke: "${record.id}" params bag has unknown key(s) ${unknown.map((k) => `"${k}"`).join(", ")} \u2014 the bag is closed (valid keys: ${valid.join(", ")})`,
|
|
1121
1121
|
{
|
|
1122
1122
|
operation: record.id,
|
|
@@ -1130,7 +1130,7 @@ function validateInvokeOptions(opts, operation) {
|
|
|
1130
1130
|
const unknown = Object.keys(opts).filter((k) => !INVOKE_OPTION_KEYS.includes(k));
|
|
1131
1131
|
if (unknown.length === 0) return;
|
|
1132
1132
|
const suggestions = unknown.map((k) => [k, suggestForKey(k, ["dryRun", "confirm", "lastModifiedDate", "maxRetries"])]).filter((pair) => pair[1] !== null).map(([k, s]) => `"${k}" \u2192 "${s}"`);
|
|
1133
|
-
throw new (0,
|
|
1133
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1134
1134
|
`invoke: "${operation}" has unknown option key(s) ${unknown.map((k) => `"${k}"`).join(", ")} \u2014 the options set is closed (valid: dryRun, confirm, lastModifiedDate, maxRetries; "mode" is internal to the mode wrappers)`,
|
|
1135
1135
|
{
|
|
1136
1136
|
operation,
|
|
@@ -1143,7 +1143,7 @@ function unknownKeysRefusal(raw, validKeys, subject, operation) {
|
|
|
1143
1143
|
const unknown = Object.keys(raw).filter((k) => !validKeys.includes(k));
|
|
1144
1144
|
if (unknown.length === 0) return null;
|
|
1145
1145
|
const suggestions = unknown.map((k) => [k, suggestForKey(k, [...validKeys])]).filter((pair) => pair[1] !== null).map(([k, s]) => `"${k}" \u2192 "${s}"`);
|
|
1146
|
-
return new (0,
|
|
1146
|
+
return new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1147
1147
|
`unknown ${subject} ${unknown.map((k) => `"${k}"`).join(", ")} \u2014 the ${subject} set is closed (valid keys: ${validKeys.join(", ")})`,
|
|
1148
1148
|
{
|
|
1149
1149
|
...operation !== void 0 ? { operation } : {},
|
|
@@ -1153,7 +1153,7 @@ function unknownKeysRefusal(raw, validKeys, subject, operation) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
|
|
1155
1155
|
// src/operations/invoke/registry.ts
|
|
1156
|
-
var RECORDS =
|
|
1156
|
+
var RECORDS = _chunk4VAC2Z55cjs.CAPABILITIES;
|
|
1157
1157
|
var byId = new Map(RECORDS.map((r) => [r.id, r]));
|
|
1158
1158
|
|
|
1159
1159
|
// src/operations/invoke/dispatch.ts
|
|
@@ -1172,7 +1172,7 @@ function bufferResult(buf) {
|
|
|
1172
1172
|
function resolveRecord(operation) {
|
|
1173
1173
|
const record = byId.get(operation);
|
|
1174
1174
|
if (record === void 0) {
|
|
1175
|
-
throw new (0,
|
|
1175
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1176
1176
|
`invoke: unknown operation "${operation}" \u2014 it is not in the capability registry`,
|
|
1177
1177
|
{ operation, suggestedAction: "List the registry (the ./capabilities subpath) for the exact operation key." }
|
|
1178
1178
|
);
|
|
@@ -1183,16 +1183,16 @@ function governPreRequest(record, operation, opts) {
|
|
|
1183
1183
|
validateInvokeOptions(opts, operation);
|
|
1184
1184
|
const mode = opts.mode;
|
|
1185
1185
|
if (mode !== void 0 && MODE_BY_EFFECT[record.effect] !== mode) {
|
|
1186
|
-
throw new (0,
|
|
1186
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(crossModeRefusal(operation, record.effect, mode), { operation });
|
|
1187
1187
|
}
|
|
1188
1188
|
if (opts.dryRun !== void 0 && typeof opts.dryRun !== "boolean") {
|
|
1189
|
-
throw new (0,
|
|
1189
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1190
1190
|
`invoke: dryRun must be a boolean (got ${typeof opts.dryRun}) \u2014 "${operation}" was not issued`,
|
|
1191
1191
|
{ operation, suggestedAction: "Pass dryRun: true (simulate) or dryRun: false (apply) as a real boolean." }
|
|
1192
1192
|
);
|
|
1193
1193
|
}
|
|
1194
1194
|
if (record.effect === "read" && opts.dryRun === true) {
|
|
1195
|
-
throw new (0,
|
|
1195
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1196
1196
|
`invoke: "${operation}" is a read \u2014 dryRun is not applicable (reads issue their request as-is)`,
|
|
1197
1197
|
{ operation }
|
|
1198
1198
|
);
|
|
@@ -1209,7 +1209,7 @@ function operationsHolder(client) {
|
|
|
1209
1209
|
return {
|
|
1210
1210
|
resolveAny: (identifier, opts) => resolveAny(client, identifier, opts),
|
|
1211
1211
|
searchAcrossResources: (query, opts) => searchAcrossResources(client, query, opts),
|
|
1212
|
-
fetchMany: (items, opts) =>
|
|
1212
|
+
fetchMany: (items, opts) => _chunkLVBFLSPLcjs.fetchMany.call(void 0, client, items, opts),
|
|
1213
1213
|
// Issue #62: the generic aggregate + the cheap count — the
|
|
1214
1214
|
// groupBy/sum-absent mode is ONE vendor /query/count (the S12-C blind
|
|
1215
1215
|
// sentinel rides through); the group/sum modes walk the named
|
|
@@ -1219,12 +1219,12 @@ function operationsHolder(client) {
|
|
|
1219
1219
|
// Issue #59 PR-B: the bulk fetch by ids — query-first chunked `id in`
|
|
1220
1220
|
// reads + the per-id `get` fallback (blind-surface-safe; per-item
|
|
1221
1221
|
// typed outcomes reuse the fetchMany shapes).
|
|
1222
|
-
fetchByIds: (items, opts) =>
|
|
1222
|
+
fetchByIds: (items, opts) => _chunkLVBFLSPLcjs.fetchByIds.call(void 0, client, items, opts),
|
|
1223
1223
|
// Issue #65: opt-in resource name expansion — per-id resources.get
|
|
1224
1224
|
// reads ONLY (never an id-in query — the resources table can be blind
|
|
1225
1225
|
// to count/query while per-id reads work); blind-marked rows for ids
|
|
1226
1226
|
// the API user cannot resolve; the name cache (default-on).
|
|
1227
|
-
expandResourceNames: (ids, opts) =>
|
|
1227
|
+
expandResourceNames: (ids, opts) => _chunkLVBFLSPLcjs.expandResourceNames.call(void 0, client, ids, opts),
|
|
1228
1228
|
relationshipMap: (resourceKey) => relationshipMap(client, resourceKey),
|
|
1229
1229
|
// Issue #11: the served blind-surface inventory (zero wire) + the
|
|
1230
1230
|
// bounded caller-opted reachability sweep (read-only, confirmProbe-
|
|
@@ -1234,12 +1234,12 @@ function operationsHolder(client) {
|
|
|
1234
1234
|
// Issue #12: the served zone-fact create-guidance catalog (zero wire).
|
|
1235
1235
|
createGuidance: (opts) => createGuidance(client, opts),
|
|
1236
1236
|
// Issue #202: ExecuteCommand deep links — pure, zero wire.
|
|
1237
|
-
uiLink: (input) =>
|
|
1237
|
+
uiLink: (input) => _chunkLVBFLSPLcjs.uiLink.call(void 0, client, input),
|
|
1238
1238
|
// Issue #31: the opt-in live field-metadata channel — N bounded
|
|
1239
1239
|
// entityInformation GETs (the op's own cap refuses over-cap fan-outs
|
|
1240
1240
|
// pre-request; per-resource failures are recorded on the row and
|
|
1241
1241
|
// never abort the call).
|
|
1242
|
-
fieldCatalog: (opts) =>
|
|
1242
|
+
fieldCatalog: (opts) => _chunkLVBFLSPLcjs.fieldCatalog.call(void 0, client, opts),
|
|
1243
1243
|
// Issue #9: the one-call recovery/cleanup op — effect write in the
|
|
1244
1244
|
// registry (the governor's dry-run-first applies to it); the op's own
|
|
1245
1245
|
// confirm gate makes the destructive action deliberate (the governor
|
|
@@ -1249,15 +1249,15 @@ function operationsHolder(client) {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
function resolveHolder(client, record, operation) {
|
|
1251
1251
|
const clientBag = client;
|
|
1252
|
-
let holder = clientBag[
|
|
1252
|
+
let holder = clientBag[_chunkLVBFLSPLcjs.camelKey.call(void 0, record.resource)];
|
|
1253
1253
|
if (typeof holder === "function") {
|
|
1254
|
-
holder = _nullishCoalesce(clientBag[`${
|
|
1254
|
+
holder = _nullishCoalesce(clientBag[`${_chunkLVBFLSPLcjs.camelKey.call(void 0, record.resource)}Resource`], () => ( holder));
|
|
1255
1255
|
}
|
|
1256
1256
|
if (holder === void 0 && record.resource === "operations") {
|
|
1257
1257
|
holder = operationsHolder(client);
|
|
1258
1258
|
}
|
|
1259
1259
|
if (holder === void 0) {
|
|
1260
|
-
throw new (0,
|
|
1260
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1261
1261
|
`invoke: the client exposes no accessor for resource "${record.resource}"`,
|
|
1262
1262
|
{ operation }
|
|
1263
1263
|
);
|
|
@@ -1310,11 +1310,11 @@ async function invokeMode(client, operation, argsIn = [], opts = {}) {
|
|
|
1310
1310
|
const boundedQuery = record.kind === "primitive" && record.operation === "query";
|
|
1311
1311
|
const countedQuery = record.kind === "primitive" && record.operation === "count";
|
|
1312
1312
|
const holder = resolveHolder(client, record, operation);
|
|
1313
|
-
if (boundedQuery || countedQuery) await
|
|
1313
|
+
if (boundedQuery || countedQuery) await _chunkLVBFLSPLcjs.validateQueryFieldNames.call(void 0, record, holder, args);
|
|
1314
1314
|
const methodName = boundedQuery ? "queryBounded" : record.operation;
|
|
1315
1315
|
const method = holder[methodName];
|
|
1316
1316
|
if (typeof method !== "function") {
|
|
1317
|
-
throw new (0,
|
|
1317
|
+
throw new (0, _chunkLVBFLSPLcjs.AutotaskConfigError)(
|
|
1318
1318
|
`invoke: "${record.resource}.${methodName}" is not a callable method on the client`,
|
|
1319
1319
|
{ operation }
|
|
1320
1320
|
);
|
|
@@ -1386,4 +1386,4 @@ async function invokeDelete(client, operation, args = [], opts = {}) {
|
|
|
1386
1386
|
|
|
1387
1387
|
|
|
1388
1388
|
|
|
1389
|
-
exports.AGGREGATE_DATE_BUCKETS = AGGREGATE_DATE_BUCKETS; exports.AGGREGATE_DEFAULT_LIMIT = AGGREGATE_DEFAULT_LIMIT; exports.AGGREGATE_DEFAULT_TOP = AGGREGATE_DEFAULT_TOP; exports.AGGREGATE_TOP_MAX = AGGREGATE_TOP_MAX; exports.BLIND_SURFACE_KINDS = BLIND_SURFACE_KINDS; exports.CREATE_BLOCKER_KINDS = CREATE_BLOCKER_KINDS; exports.EXPAND_RESOURCE_NAMES_MAX_IDS =
|
|
1389
|
+
exports.AGGREGATE_DATE_BUCKETS = AGGREGATE_DATE_BUCKETS; exports.AGGREGATE_DEFAULT_LIMIT = AGGREGATE_DEFAULT_LIMIT; exports.AGGREGATE_DEFAULT_TOP = AGGREGATE_DEFAULT_TOP; exports.AGGREGATE_TOP_MAX = AGGREGATE_TOP_MAX; exports.BLIND_SURFACE_KINDS = BLIND_SURFACE_KINDS; exports.CREATE_BLOCKER_KINDS = CREATE_BLOCKER_KINDS; exports.EXPAND_RESOURCE_NAMES_MAX_IDS = _chunkLVBFLSPLcjs.EXPAND_RESOURCE_NAMES_MAX_IDS; exports.FETCH_BY_IDS_CHUNK_SIZE = _chunkLVBFLSPLcjs.FETCH_BY_IDS_CHUNK_SIZE; exports.FETCH_BY_IDS_MAX_ITEMS = _chunkLVBFLSPLcjs.FETCH_BY_IDS_MAX_ITEMS; exports.FETCH_MANY_MAX_ITEMS = _chunkLVBFLSPLcjs.FETCH_MANY_MAX_ITEMS; exports.FIELD_CACHE_KINDS = _chunkLVBFLSPLcjs.FIELD_CACHE_KINDS; exports.FIELD_CATALOG_HONESTY_NOTE = _chunkLVBFLSPLcjs.FIELD_CATALOG_HONESTY_NOTE; exports.INVOKE_OPTION_KEYS = INVOKE_OPTION_KEYS; exports.MAX_FIELD_CATALOG_WIRE = _chunkLVBFLSPLcjs.MAX_FIELD_CATALOG_WIRE; exports.PARAMS_BAG_KEYS = PARAMS_BAG_KEYS; exports.PICKLIST_VALUE_NOT_SERVED_NOTE = _chunkLVBFLSPLcjs.PICKLIST_VALUE_NOT_SERVED_NOTE; exports.RECOVERY_CONFIRM = RECOVERY_CONFIRM; exports.RECOVERY_DEFAULT_LIMIT = RECOVERY_DEFAULT_LIMIT; exports.RECOVERY_MAX_LIMIT = RECOVERY_MAX_LIMIT; exports.UI_LINK_ENTITIES = _chunkLVBFLSPLcjs.UI_LINK_ENTITIES; exports.WORKFLOW_RESOURCES = _chunkLVBFLSPLcjs.WORKFLOW_RESOURCES; exports.aggregate = aggregate; exports.blindSurfaces = blindSurfaces; exports.buildUiLink = _chunkLVBFLSPLcjs.buildUiLink; exports.createGuidance = createGuidance; exports.dateBucketLabel = dateBucketLabel; exports.expandResourceNames = _chunkLVBFLSPLcjs.expandResourceNames; exports.fetchByIds = _chunkLVBFLSPLcjs.fetchByIds; exports.fetchMany = _chunkLVBFLSPLcjs.fetchMany; exports.fieldCatalog = _chunkLVBFLSPLcjs.fieldCatalog; exports.invoke = invoke; exports.invokeDelete = invokeDelete; exports.invokeRead = invokeRead; exports.invokeWrite = invokeWrite; exports.needsConfirmation = needsConfirmation; exports.probeReachability = probeReachability; exports.recovery = recovery; exports.relationshipMap = relationshipMap; exports.resolveAny = resolveAny; exports.searchAcrossResources = searchAcrossResources; exports.uiLink = _chunkLVBFLSPLcjs.uiLink; exports.unknownKeysRefusal = unknownKeysRefusal; exports.validateDispatchArgs = validateDispatchArgs; exports.validateFetchManyItems = _chunkLVBFLSPLcjs.validateFetchManyItems; exports.validateInvokeOptions = validateInvokeOptions; exports.validateParamsBag = validateParamsBag;
|