node-autotask 0.38.0 → 0.39.1
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 +24 -0
- package/MCP_TOOL_CATALOG.json +2 -2
- package/MCP_TOOL_MANIFEST.md +7 -7
- package/N8N_MCP_MANIFEST.json +2 -2
- package/N8N_MCP_MANIFEST.md +3 -3
- package/capabilities.json +1460 -1429
- package/capabilities.schema.json +2 -1
- package/dist/capabilities.cjs +2 -2
- package/dist/capabilities.d.cts +4 -4
- package/dist/capabilities.d.ts +4 -4
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-DCTUBUIZ.cjs → chunk-73QNAEAF.cjs} +143 -143
- package/dist/{chunk-IY3WCPCK.js → chunk-CQXB7KAO.js} +2 -2
- package/dist/{chunk-U3K6IDKB.js → chunk-GDSCYY2G.js} +1459 -1428
- package/dist/{chunk-7FNKFNIJ.cjs → chunk-GIVYTQ6R.cjs} +285 -285
- package/dist/{chunk-IY5QZZVF.cjs → chunk-LB34VFQY.cjs} +254 -143
- package/dist/{chunk-KPYXO7F5.js → chunk-LDTJNLX7.js} +2 -2
- package/dist/{chunk-4QHGCYEI.js → chunk-LN3HQQBR.js} +136 -25
- package/dist/{chunk-73JMTV4O.cjs → chunk-VR6RYXTD.cjs} +1459 -1428
- package/dist/{index-Q-4HQEEb.d.ts → index-C-Oqef4y.d.cts} +7170 -52
- package/dist/{index-BFbUB5YD.d.cts → index-C-Oqef4y.d.ts} +7170 -52
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +4 -4
- package/dist/operations/index.cjs +181 -177
- package/dist/operations/index.d.cts +3 -172
- package/dist/operations/index.d.ts +3 -172
- package/dist/operations/index.js +6 -2
- package/dist/pool.cjs +9 -9
- package/dist/pool.d.cts +1 -2
- package/dist/pool.d.ts +1 -2
- package/dist/pool.js +4 -4
- package/dist/resources/index.cjs +4 -4
- package/dist/resources/index.d.cts +1 -2
- package/dist/resources/index.d.ts +1 -2
- 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 +63 -8
- package/package.json +1 -1
- package/dist/index-BQVStxwi.d.cts +0 -6893
- package/dist/index-BQVStxwi.d.ts +0 -6893
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
unwrapItems,
|
|
31
31
|
unwrapOperation,
|
|
32
32
|
vendorId
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LN3HQQBR.js";
|
|
34
34
|
import {
|
|
35
35
|
CAPABILITIES
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-GDSCYY2G.js";
|
|
37
37
|
|
|
38
38
|
// src/resources/appointments.ts
|
|
39
39
|
var AppointmentsResource = class extends BaseResource {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAPABILITIES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GDSCYY2G.js";
|
|
4
4
|
import {
|
|
5
5
|
wrapUntrusted
|
|
6
6
|
} from "./chunk-5VHSLJMR.js";
|
|
@@ -17878,7 +17878,8 @@ var WORKFLOW_RESOURCES = [
|
|
|
17878
17878
|
// src/operations/fieldCatalog.ts
|
|
17879
17879
|
var MAX_FIELD_CATALOG_WIRE = 60;
|
|
17880
17880
|
var FIELD_CATALOG_HONESTY_NOTE = "Live field metadata reports the SHAPE of a field (existence, requiredness, type, maxLength, read-only, queryable, picklist-ness) as FLAGS and NAMES: picklist-ness as a flag (isPickList) and picklist field names (picklistFields). With the opt-in `labels: true`, picklist rows carry the vendor's exposed picklist VALUES (labels next to each value); without it the op serves no VALUES. It cannot resolve a picklist VALUE the vendor does not expose to this API user (the W-A4 wall \u2014 e.g. the attachments Type picklist): retrying the catalog will not surface a withheld value; that gap is vendor-side, not a client defect.";
|
|
17881
|
-
var
|
|
17881
|
+
var MIN_FIELD_CATALOG_MAX_BYTES = 4096;
|
|
17882
|
+
var FIELD_CATALOG_OPT_KEYS = ["resources", "include", "fresh", "fields", "labels", "compact", "maxBytes"];
|
|
17882
17883
|
function projectFieldRow(raw, labels = false, udf = false) {
|
|
17883
17884
|
const r = typeof raw === "object" && raw !== null ? raw : {};
|
|
17884
17885
|
const name = typeof r.name === "string" ? r.name : "";
|
|
@@ -17905,6 +17906,16 @@ function projectFieldRow(raw, labels = false, udf = false) {
|
|
|
17905
17906
|
...values !== void 0 ? { picklistValues: values } : {}
|
|
17906
17907
|
};
|
|
17907
17908
|
}
|
|
17909
|
+
function compactFieldRow(f, udf, keepValues) {
|
|
17910
|
+
return {
|
|
17911
|
+
name: f.name,
|
|
17912
|
+
type: f.type,
|
|
17913
|
+
isPickList: f.isPickList,
|
|
17914
|
+
isReference: f.referenceEntityType !== "",
|
|
17915
|
+
udf,
|
|
17916
|
+
...keepValues && f.picklistValues !== void 0 ? { picklistValues: f.picklistValues } : {}
|
|
17917
|
+
};
|
|
17918
|
+
}
|
|
17908
17919
|
function isObjectOrArrayType(type) {
|
|
17909
17920
|
const t = type.trim().toLowerCase();
|
|
17910
17921
|
return t === "object" || t === "array" || t === "collection" || t.endsWith("[]");
|
|
@@ -17972,7 +17983,7 @@ function apiEntityFor(rec) {
|
|
|
17972
17983
|
function validateCatalogOptsShape(opts) {
|
|
17973
17984
|
if (opts !== void 0 && (typeof opts !== "object" || opts === null || Array.isArray(opts))) {
|
|
17974
17985
|
throw new AutotaskConfigError(
|
|
17975
|
-
"fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean, fields?: string[], labels?: boolean }"
|
|
17986
|
+
"fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean, fields?: string[], labels?: boolean, compact?: boolean, maxBytes?: number }"
|
|
17976
17987
|
);
|
|
17977
17988
|
}
|
|
17978
17989
|
for (const key of Object.keys(opts ?? {})) {
|
|
@@ -18061,6 +18072,61 @@ function resolveLabels(opts) {
|
|
|
18061
18072
|
}
|
|
18062
18073
|
return opts?.labels === true;
|
|
18063
18074
|
}
|
|
18075
|
+
function resolveSizeOpts(opts) {
|
|
18076
|
+
if (opts?.compact !== void 0 && typeof opts.compact !== "boolean") {
|
|
18077
|
+
throw new AutotaskConfigError(`fieldCatalog: opts.compact must be a boolean (got ${typeof opts.compact})`);
|
|
18078
|
+
}
|
|
18079
|
+
const maxBytes = opts?.maxBytes;
|
|
18080
|
+
if (maxBytes !== void 0 && (typeof maxBytes !== "number" || !Number.isInteger(maxBytes) || maxBytes < MIN_FIELD_CATALOG_MAX_BYTES)) {
|
|
18081
|
+
throw new AutotaskConfigError(
|
|
18082
|
+
`fieldCatalog: opts.maxBytes must be an integer >= ${MIN_FIELD_CATALOG_MAX_BYTES} (got ${String(maxBytes)})`
|
|
18083
|
+
);
|
|
18084
|
+
}
|
|
18085
|
+
return { compact: opts?.compact === true, maxBytes };
|
|
18086
|
+
}
|
|
18087
|
+
var jsonBytes = (v) => Buffer.byteLength(JSON.stringify(v), "utf8");
|
|
18088
|
+
var TRIM_KINDS = ["udf", "fields", "picklistFields", "queryable", "readOnly", "required"];
|
|
18089
|
+
function applyMaxBytes(result, maxBytes) {
|
|
18090
|
+
const fullBytes = jsonBytes(result);
|
|
18091
|
+
if (fullBytes <= maxBytes) return;
|
|
18092
|
+
result.truncated = true;
|
|
18093
|
+
const omitted = /* @__PURE__ */ new Map();
|
|
18094
|
+
const truncation = { reason: "maxBytes", maxBytes, fullBytes, omitted: [], note: "" };
|
|
18095
|
+
result.truncation = truncation;
|
|
18096
|
+
const lists = [];
|
|
18097
|
+
for (const kind of TRIM_KINDS.slice(0, 2)) {
|
|
18098
|
+
for (let i = result.rows.length - 1; i >= 0; i--) {
|
|
18099
|
+
const row = result.rows[i];
|
|
18100
|
+
if (Array.isArray(row[kind])) lists.push({ resource: row.resource, kind, list: row[kind] });
|
|
18101
|
+
}
|
|
18102
|
+
}
|
|
18103
|
+
for (const kind of TRIM_KINDS.slice(2)) {
|
|
18104
|
+
for (let i = result.rows.length - 1; i >= 0; i--) lists.push({ resource: result.rows[i].resource, kind, list: result.rows[i][kind] });
|
|
18105
|
+
}
|
|
18106
|
+
for (; ; ) {
|
|
18107
|
+
truncation.omitted = [...omitted.values()];
|
|
18108
|
+
const rowsDropped = truncation.omitted.filter((o) => o.kind === "fields" || o.kind === "udf").reduce((a, o) => a + o.count, 0);
|
|
18109
|
+
const namesDropped = truncation.omitted.length > 0 && truncation.omitted.some((o) => o.kind !== "fields" && o.kind !== "udf");
|
|
18110
|
+
truncation.note = `${rowsDropped} field row(s) omitted to fit maxBytes ${maxBytes} (the full result is ${fullBytes} bytes); ` + (namesDropped ? "the row name lists were trimmed as well (see omitted). " : "the row name lists (required, readOnly, queryable, picklistFields) still name every field. ") + `Narrow with fields: [...], ${result.compact ? "" : "use compact: true, "}or raise maxBytes.`;
|
|
18111
|
+
let bytes = jsonBytes(result);
|
|
18112
|
+
if (bytes <= maxBytes) return;
|
|
18113
|
+
if (lists.every((l) => l.list.length === 0)) {
|
|
18114
|
+
throw new AutotaskConfigError(
|
|
18115
|
+
`fieldCatalog: maxBytes ${maxBytes} cannot hold this result: with every field row and name list dropped it is still ${bytes} bytes for ${result.rows.length} resource row(s); request fewer resources or raise maxBytes`
|
|
18116
|
+
);
|
|
18117
|
+
}
|
|
18118
|
+
for (const { resource, kind, list } of lists) {
|
|
18119
|
+
while (list.length > 0 && bytes > maxBytes) {
|
|
18120
|
+
bytes -= jsonBytes(list.pop()) + 1;
|
|
18121
|
+
const key = `${resource}:${kind}`;
|
|
18122
|
+
const entry = omitted.get(key) ?? { resource, kind, count: 0 };
|
|
18123
|
+
entry.count += 1;
|
|
18124
|
+
omitted.set(key, entry);
|
|
18125
|
+
}
|
|
18126
|
+
if (bytes <= maxBytes) break;
|
|
18127
|
+
}
|
|
18128
|
+
}
|
|
18129
|
+
}
|
|
18064
18130
|
function assertWithinWireCap(targetCount, kindCount) {
|
|
18065
18131
|
const cost = targetCount * kindCount;
|
|
18066
18132
|
if (cost > MAX_FIELD_CATALOG_WIRE) {
|
|
@@ -18142,11 +18208,16 @@ async function sweepResource(ctx, resource, tally) {
|
|
|
18142
18208
|
}
|
|
18143
18209
|
}
|
|
18144
18210
|
row.cache = allCached ? { hit: true, age: ages.length > 0 ? Math.max(...ages) : 0 } : { hit: false, age: null };
|
|
18211
|
+
if (ctx.compact) {
|
|
18212
|
+
const keepValues = labels && fieldsFilter !== void 0;
|
|
18213
|
+
if (row.fields !== void 0) row.fields = row.fields.map((f) => compactFieldRow(f, false, keepValues));
|
|
18214
|
+
if (Array.isArray(row.udf)) row.udf = row.udf.map((f) => compactFieldRow(f, true, keepValues));
|
|
18215
|
+
}
|
|
18145
18216
|
const declared = derivedFieldsFor(resource);
|
|
18146
18217
|
if (declared.length > 0) {
|
|
18147
18218
|
const byField = new Map(declared.map((d) => [d.field, d]));
|
|
18148
18219
|
row.derivedFields = declared;
|
|
18149
|
-
for (const field of row.fields ?? []) {
|
|
18220
|
+
for (const field of ctx.compact ? [] : row.fields ?? []) {
|
|
18150
18221
|
const derivation = byField.get(field.name);
|
|
18151
18222
|
if (derivation === void 0) continue;
|
|
18152
18223
|
field.derived = {
|
|
@@ -18164,21 +18235,23 @@ async function fieldCatalog(client, opts) {
|
|
|
18164
18235
|
const targets = resolveTargets(opts, fieldOps, allResources);
|
|
18165
18236
|
const fieldsFilter = resolveFieldsFilter(opts);
|
|
18166
18237
|
const labels = resolveLabels(opts);
|
|
18238
|
+
const { compact, maxBytes } = resolveSizeOpts(opts);
|
|
18167
18239
|
assertWithinWireCap(targets.length, include.length);
|
|
18168
18240
|
const cache = client.http.fieldCache;
|
|
18169
18241
|
const zone = client.config.zone ?? "unknown";
|
|
18170
18242
|
const rows = [];
|
|
18171
18243
|
const tally = { wireUsed: 0, anyPicklistValues: false };
|
|
18172
|
-
const ctx = { client, include, fieldsFilter, labels, fresh: opts?.fresh === true, fieldOps, udfCapable };
|
|
18244
|
+
const ctx = { client, include, fieldsFilter, labels, compact, fresh: opts?.fresh === true, fieldOps, udfCapable };
|
|
18173
18245
|
for (const resource of targets) {
|
|
18174
18246
|
const row = await sweepResource(ctx, resource, tally);
|
|
18175
18247
|
if (row !== void 0) rows.push(row);
|
|
18176
18248
|
}
|
|
18177
|
-
|
|
18249
|
+
const result = {
|
|
18178
18250
|
zone,
|
|
18179
18251
|
label: zone,
|
|
18180
18252
|
cached: cache !== void 0,
|
|
18181
18253
|
labels,
|
|
18254
|
+
compact,
|
|
18182
18255
|
ttlMs: cache?.ttlMs ?? null,
|
|
18183
18256
|
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18184
18257
|
rows,
|
|
@@ -18196,6 +18269,8 @@ async function fieldCatalog(client, opts) {
|
|
|
18196
18269
|
note: FIELD_CATALOG_HONESTY_NOTE
|
|
18197
18270
|
}
|
|
18198
18271
|
};
|
|
18272
|
+
if (maxBytes !== void 0) applyMaxBytes(result, maxBytes);
|
|
18273
|
+
return result;
|
|
18199
18274
|
}
|
|
18200
18275
|
|
|
18201
18276
|
// src/field-sets.ts
|
|
@@ -20455,6 +20530,7 @@ var BaseResource = class extends MutationBase {
|
|
|
20455
20530
|
|
|
20456
20531
|
// src/operations/compositeNames.ts
|
|
20457
20532
|
var PICKLIST_VALUE_NOT_SERVED_NOTE = "The picklist is served to this API user, but this record's value is not in it (an inactive or unexposed value) \u2014 the label cannot be resolved and is null; refreshing the field catalog will not surface it. (A picklist the vendor does not expose at all is reported with the field-catalog honesty note instead.)";
|
|
20533
|
+
var PICKLIST_CATALOG_UNAVAILABLE_NOTE = "The field-catalog read that serves picklist labels failed for this call, so this label is unavailable (null), not absent: the value may well have one. Retry the call once the catalog read succeeds (see names.catalogError).";
|
|
20458
20534
|
var DEFAULT_MAX_NAME_READS = 20;
|
|
20459
20535
|
var TICKET_LABEL_FIELDS = ["status", "priority", "ticketType", "issueType", "subIssueType", "source", "queueID"];
|
|
20460
20536
|
function isVendorId(value) {
|
|
@@ -20765,7 +20841,7 @@ async function resolveCompositeNames(http, plan, opts = {}) {
|
|
|
20765
20841
|
}
|
|
20766
20842
|
const hit = values.find((v) => String(v.value) === String(value));
|
|
20767
20843
|
if (hit === void 0) {
|
|
20768
|
-
section.reasons[field] = PICKLIST_VALUE_NOT_SERVED_NOTE;
|
|
20844
|
+
if (String(value) !== "0") section.reasons[field] = PICKLIST_VALUE_NOT_SERVED_NOTE;
|
|
20769
20845
|
return null;
|
|
20770
20846
|
}
|
|
20771
20847
|
return typeof hit.label === "string" ? hit.label : null;
|
|
@@ -20786,6 +20862,7 @@ function untrustedName(name) {
|
|
|
20786
20862
|
const [[capped]] = truncateNoteChars([{ v: name }], LABEL_NAME_MAX_CHARS, ["v"]);
|
|
20787
20863
|
return wrapUntrusted(capped.v) ?? capped.v;
|
|
20788
20864
|
}
|
|
20865
|
+
var lastPicklists = /* @__PURE__ */ new WeakMap();
|
|
20789
20866
|
function readNamesOpt(value, where) {
|
|
20790
20867
|
if (value === void 0) return true;
|
|
20791
20868
|
if (typeof value !== "boolean") {
|
|
@@ -20794,19 +20871,35 @@ function readNamesOpt(value, where) {
|
|
|
20794
20871
|
return value;
|
|
20795
20872
|
}
|
|
20796
20873
|
async function labelRows(client, resourceKey, rows) {
|
|
20797
|
-
const
|
|
20798
|
-
for (const row of rows) for (const
|
|
20799
|
-
if (
|
|
20874
|
+
const keys = /* @__PURE__ */ new Set();
|
|
20875
|
+
for (const row of rows) for (const k of Object.keys(row)) keys.add(k);
|
|
20876
|
+
if (keys.size === 0) return { rows: [...rows] };
|
|
20800
20877
|
let picklistFields = [];
|
|
20878
|
+
let unavailable = [];
|
|
20879
|
+
let catalogError;
|
|
20801
20880
|
const modelFields = MODEL_FIELD_SETS[resourceKey] ?? [];
|
|
20802
|
-
const candidates = [...
|
|
20881
|
+
const candidates = [...keys].filter((f) => f !== "id" && modelFields.includes(f) && ROW_FK_TABLES[f] === void 0 && !isResourceFkField(f));
|
|
20803
20882
|
if (candidates.length > 0) try {
|
|
20804
20883
|
const catalog = await fieldCatalog(client, { resources: [resourceKey], labels: true });
|
|
20805
|
-
const
|
|
20806
|
-
|
|
20884
|
+
const row = catalog.rows.find((r) => r.resource === resourceKey);
|
|
20885
|
+
const known = lastPicklists.get(client) ?? /* @__PURE__ */ new Map();
|
|
20886
|
+
lastPicklists.set(client, known);
|
|
20887
|
+
if (row?.fields === void 0) {
|
|
20888
|
+
const last = known.get(resourceKey);
|
|
20889
|
+
unavailable = (last ?? []).filter((f) => candidates.includes(f));
|
|
20890
|
+
if (last === void 0 || unavailable.length > 0) {
|
|
20891
|
+
catalogError = row?.error ?? { code: "INVALID_RESPONSE", message: `fieldCatalog: no ${resourceKey} row` };
|
|
20892
|
+
}
|
|
20893
|
+
} else {
|
|
20894
|
+
const all = row.fields.filter((f) => f.isPickList).map((f) => f.name);
|
|
20895
|
+
known.set(resourceKey, all);
|
|
20896
|
+
picklistFields = all.filter((f) => candidates.includes(f));
|
|
20897
|
+
}
|
|
20807
20898
|
} catch (err) {
|
|
20808
20899
|
if (!isAutotaskError(err) || err.code === "ABORTED") throw err;
|
|
20809
20900
|
}
|
|
20901
|
+
const labelled = (field) => picklistFields.includes(field) || unavailable.includes(field) || ROW_FK_TABLES[field] !== void 0 || isResourceFkField(field);
|
|
20902
|
+
if (catalogError === void 0 && ![...keys].some(labelled)) return { rows: [...rows] };
|
|
20810
20903
|
const builder = createNamePlan(picklistFields, resourceKey);
|
|
20811
20904
|
for (const row of rows) {
|
|
20812
20905
|
for (const [field, value] of Object.entries(row)) {
|
|
@@ -20817,29 +20910,43 @@ async function labelRows(client, resourceKey, rows) {
|
|
|
20817
20910
|
}
|
|
20818
20911
|
}
|
|
20819
20912
|
const plan = builder.plan();
|
|
20820
|
-
|
|
20821
|
-
const names = await resolveCompositeNames(client.http, plan);
|
|
20913
|
+
const names = plan.resourceIds.length === 0 && plan.recordFks.length === 0 && picklistFields.length === 0 ? void 0 : await resolveCompositeNames(client.http, plan);
|
|
20822
20914
|
const out = rows.map((row) => {
|
|
20823
20915
|
const r = { ...row };
|
|
20824
20916
|
for (const [field, value] of Object.entries(row)) {
|
|
20825
|
-
|
|
20826
|
-
if (picklistFields.includes(field)) r[`${field}Label`] = names.labelFor(field, value);
|
|
20917
|
+
const has2 = value !== null && value !== void 0 && names !== void 0;
|
|
20918
|
+
if (picklistFields.includes(field)) r[`${field}Label`] = has2 ? names.labelFor(field, value) : null;
|
|
20919
|
+
else if (unavailable.includes(field)) r[`${field}Label`] = null;
|
|
20920
|
+
const set = has2 && value !== 0 && value !== "0";
|
|
20827
20921
|
const table = ROW_FK_TABLES[field];
|
|
20828
|
-
if (table !== void 0
|
|
20829
|
-
else if (isResourceFkField(field)
|
|
20922
|
+
if (table !== void 0) r[`${field}Name`] = set && isVendorId(value) ? untrustedName(names.recordName(table, value)) : null;
|
|
20923
|
+
else if (isResourceFkField(field)) r[`${field}Name`] = set && isVendorId(value) ? untrustedName(names.resourceName(value)) : null;
|
|
20830
20924
|
}
|
|
20831
20925
|
if (r["assignedResourceIDName"] !== void 0) r["assignedResourceName"] = r["assignedResourceIDName"];
|
|
20832
20926
|
return r;
|
|
20833
20927
|
});
|
|
20834
|
-
const capped = Object.values(names.section.rows).filter((row) => row.capped).length;
|
|
20835
|
-
const
|
|
20836
|
-
|
|
20928
|
+
const capped = names === void 0 ? 0 : Object.values(names.section.rows).filter((row) => row.capped).length;
|
|
20929
|
+
const unresolved = Object.keys(names?.section.reasons ?? {});
|
|
20930
|
+
const reasons = { ...names?.section.reasons };
|
|
20931
|
+
for (const f of unavailable) reasons[f] = PICKLIST_CATALOG_UNAVAILABLE_NOTE;
|
|
20932
|
+
if (capped === 0 && unresolved.length === 0 && catalogError === void 0) return { rows: out };
|
|
20837
20933
|
const parts = [];
|
|
20838
20934
|
if (capped > 0) parts.push(`${capped} id(s) left unlabelled (their *Name is null): the per-call cap of ${DEFAULT_MAX_NAME_READS} uncached name reads was hit \u2014 names already read are cached, so repeating or narrowing the call labels more`);
|
|
20839
|
-
if (
|
|
20935
|
+
if (unresolved.length > 0) parts.push(`picklist label(s) unavailable for ${unresolved.join(", ")} (see reasons)`);
|
|
20936
|
+
if (catalogError !== void 0) {
|
|
20937
|
+
parts.push(
|
|
20938
|
+
`the ${resourceKey} field catalog read failed (${catalogError.code}), so picklist labels are unavailable for this call, not absent: ` + (unavailable.length > 0 ? `the *Label is null for ${unavailable.join(", ")}` : "no *Label sibling was added (the picklist fields are unknown until a catalog read succeeds)") + " \u2014 retry the call to label them"
|
|
20939
|
+
);
|
|
20940
|
+
}
|
|
20840
20941
|
return {
|
|
20841
20942
|
rows: out,
|
|
20842
|
-
names: {
|
|
20943
|
+
names: {
|
|
20944
|
+
truncated: capped > 0,
|
|
20945
|
+
capped,
|
|
20946
|
+
note: parts.join("; "),
|
|
20947
|
+
...Object.keys(reasons).length > 0 ? { reasons } : {},
|
|
20948
|
+
...catalogError !== void 0 ? { catalogError } : {}
|
|
20949
|
+
}
|
|
20843
20950
|
};
|
|
20844
20951
|
}
|
|
20845
20952
|
async function labelFetchResults(client, result) {
|
|
@@ -20858,11 +20965,13 @@ async function labelFetchResults(client, result) {
|
|
|
20858
20965
|
}
|
|
20859
20966
|
if (summaries.length === 0) return { ...result, results };
|
|
20860
20967
|
const reasons = Object.assign({}, ...summaries.map((s) => s.reasons ?? {}));
|
|
20968
|
+
const catalogError = summaries.find((s) => s.catalogError !== void 0)?.catalogError;
|
|
20861
20969
|
const names = {
|
|
20862
20970
|
truncated: summaries.some((s) => s.truncated),
|
|
20863
20971
|
capped: summaries.reduce((n, s) => n + s.capped, 0),
|
|
20864
20972
|
note: summaries.map((s) => s.note).join("; "),
|
|
20865
|
-
...Object.keys(reasons).length > 0 ? { reasons } : {}
|
|
20973
|
+
...Object.keys(reasons).length > 0 ? { reasons } : {},
|
|
20974
|
+
...catalogError !== void 0 ? { catalogError } : {}
|
|
20866
20975
|
};
|
|
20867
20976
|
return { ...result, results, names };
|
|
20868
20977
|
}
|
|
@@ -26528,8 +26637,10 @@ export {
|
|
|
26528
26637
|
WORKFLOW_RESOURCES,
|
|
26529
26638
|
MAX_FIELD_CATALOG_WIRE,
|
|
26530
26639
|
FIELD_CATALOG_HONESTY_NOTE,
|
|
26640
|
+
MIN_FIELD_CATALOG_MAX_BYTES,
|
|
26531
26641
|
fieldCatalog,
|
|
26532
26642
|
PICKLIST_VALUE_NOT_SERVED_NOTE,
|
|
26643
|
+
PICKLIST_CATALOG_UNAVAILABLE_NOTE,
|
|
26533
26644
|
TICKET_LABEL_FIELDS,
|
|
26534
26645
|
createNamePlan,
|
|
26535
26646
|
addNameSibling,
|