@uipath/case-tool 1.202.0 → 1.203.0-preview.160
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/dist/THIRD-PARTY-NOTICES.md +172 -3
- package/dist/{authoring-e757p9dq.js → authoring-kngaggwm.js} +42 -4
- package/dist/{case-api-42s4mbpn.js → case-api-v6cjyrfw.js} +8 -8
- package/dist/case-bindings-service-1wxfghzd.js +240 -0
- package/dist/case-debug-studio-web-service-0624c07c.js +133 -0
- package/dist/case-format-service-q345a2fd.js +84 -0
- package/dist/{case-pack-service-8exkecnd.js → case-pack-service-29rza2q2.js} +61 -11
- package/dist/{case-validate-service-xvxkr026.js → case-validate-service-e06varbt.js} +1422 -40
- package/dist/{connector-enrichment-service-xq9xtz95.js → connector-enrichment-service-2pes4b1b.js} +20 -20
- package/dist/{connector-lookup-service-bk1wscyr.js → connector-lookup-service-2bkybhkf.js} +7 -7
- package/dist/{connector-task-spec-0g34na74.js → connector-task-spec-q59xmzm0.js} +24 -24
- package/dist/{de-7XQXX2DK-tqdy5n2b.js → de-FGHEJRCI-rv513mfh.js} +153 -9
- package/dist/{de-5KVP66U6-1bnf4zt5.js → de-MUJPA4EB-dpg7t2rw.js} +15 -3
- package/dist/{debug-service-f6t4ntmg.js → debug-service-8x087xxt.js} +2 -2
- package/dist/{index-j3xb87ag.js → embedded-file-reader-0sjt4nkj.js} +96 -16641
- package/dist/{en-5ZGC5VQ3-h581y30k.js → en-BWGKA5OE-1qkvb9rn.js} +140 -2
- package/dist/{en-X3S6IZ5J-nhkg6pwn.js → en-FBPVNKFN-dqt573xn.js} +29 -3
- package/dist/{enrichment-service-k1zhkzgr.js → enrichment-service-7vbxcwge.js} +7 -7
- package/dist/{es-VFPNVMP5-bx2c337j.js → es-7SE7HX2X-8yh1aj2y.js} +15 -3
- package/dist/{es-ZGCPPOME-8gazspjj.js → es-KR3ZSNMP-84zphx0x.js} +153 -9
- package/dist/{es-MX-XAVLOQW3-q00km2y7.js → es-MX-2MYFZU7X-3rek4r73.js} +15 -3
- package/dist/{es-MX-U2VN3SZW-anynsmd8.js → es-MX-XXZJGC4R-2mr8jtgm.js} +153 -9
- package/dist/first-party-service-srxaftkn.js +27 -0
- package/dist/{fr-E5MDO4EG-c3mkty2t.js → fr-MDFKNZ4C-h4a122k9.js} +15 -3
- package/dist/{fr-T3G5GZCT-y3f7xb1q.js → fr-Y6NPVODW-8vr1ja4b.js} +153 -9
- package/dist/{index-f0rf4m8p.js → index-8yv94z7r.js} +6 -4
- package/dist/{index-kwxe1vep.js → index-fz4ttsde.js} +16 -4
- package/dist/index-jxj2jz45.js +16742 -0
- package/dist/index-kmp9fmhb.js +25 -0
- package/dist/index.js +10 -10
- package/dist/{input-reader-vgsdjgst.js → input-reader-pnh948bq.js} +1 -1
- package/dist/{ja-BI5K3JDZ-77zat4z2.js → ja-Q5PXKJ2V-p4msxzjd.js} +153 -9
- package/dist/{ja-DPO5PPLO-mysfmznx.js → ja-UTQEAP34-8e0q6swp.js} +15 -3
- package/dist/{known-types-qryebm95.js → known-types-mn8xn36b.js} +4 -4
- package/dist/{ko-ITOPNIYI-hmxd2asd.js → ko-AXCHW2OK-askct7f6.js} +15 -3
- package/dist/{ko-JOBF5V7N-4bv0mjje.js → ko-AYBDSRZG-41mdmsg1.js} +153 -9
- package/dist/{node-strategy-0267x5e5.js → node-strategy-gc4sg6a2.js} +4 -4
- package/dist/{node-sync-service-ac8rzgnj.js → node-sync-service-9d0dqz4z.js} +12 -14
- package/dist/{packager-tool-5yw9xatr.js → packager-tool-052kvydg.js} +1 -1
- package/dist/{packager-tool-3tfbb641.js → packager-tool-32jxda3r.js} +213 -51
- package/dist/packager-tool-53w8skv5.js +262 -0
- package/dist/{packager-tool-w0209wf4.js → packager-tool-61hxhgeg.js} +1 -1
- package/dist/{packager-tool-58q3tvh7.js → packager-tool-7q6z6npd.js} +166 -28
- package/dist/packager-tool-83qnybab.js +1564 -0
- package/dist/{packager-tool-eh50gcdk.js → packager-tool-8q7vzh65.js} +5 -4
- package/dist/{packager-tool-8rf8qda5.js → packager-tool-adcaxdhs.js} +15 -5
- package/dist/{packager-tool-933n6t8x.js → packager-tool-af2s79jb.js} +6 -6
- package/dist/{packager-tool-sk2b33km.js → packager-tool-b6368khs.js} +10 -9
- package/dist/{packager-tool-d73376xs.js → packager-tool-cg2j4rma.js} +8 -8
- package/dist/packager-tool-d4sjk46c.js +88 -0
- package/dist/{packager-tool-a42jnpy5.js → packager-tool-d88rqwk8.js} +29 -3
- package/dist/packager-tool-dd8bq6az.js +8462 -0
- package/dist/packager-tool-gdtpsdn7.js +342 -0
- package/dist/{packager-tool-v60h8pvv.js → packager-tool-hrdan5ms.js} +1 -1
- package/dist/{packager-tool-bmn50g7v.js → packager-tool-hz1mz8fs.js} +1 -1
- package/dist/{packager-tool-v0vdet53.js → packager-tool-jf4hmztd.js} +10 -13
- package/dist/{packager-tool-c23zrhj8.js → packager-tool-jysvpt8p.js} +2 -2
- package/dist/{packager-tool-jhdf8gt1.js → packager-tool-kkxhc0fp.js} +13554 -8844
- package/dist/{packager-tool-4knkebkr.js → packager-tool-kpcjnxd1.js} +269 -23
- package/dist/{packager-tool-nx0j1294.js → packager-tool-rhkk0pta.js} +31 -30
- package/dist/{packager-tool-d128hs55.js → packager-tool-wefb1zw3.js} +1 -1
- package/dist/{packager-tool-3kbkkv2a.js → packager-tool-x4vxexvk.js} +11 -11
- package/dist/{packager-tool-dqs5qy9s.js → packager-tool-yrsrzz1a.js} +134 -19
- package/dist/packager-tool.js +5 -1501
- package/dist/{project-artifacts-43c2ynd9.js → project-artifacts-8snev67g.js} +1 -1
- package/dist/{pt-YI4VE4YQ-wdkn2dcf.js → pt-3DIO5QWG-59b3f4bc.js} +15 -3
- package/dist/{pt-BR-7DYX2YPT-fqxqzqtf.js → pt-BR-TKHNHMET-sn91xyq0.js} +153 -9
- package/dist/{pt-BR-BXURWX4W-bwfcwhk1.js → pt-BR-Y6K6XHXK-mp3hwhw1.js} +15 -3
- package/dist/{pt-HTXGGX6Y-97t21dty.js → pt-ROXU257Y-2f6bxev4.js} +153 -9
- package/dist/{resourcesSyncService-7ampdrez.js → resourcesSyncService-5bq0j9wf.js} +20 -20
- package/dist/{ro-KTNQ3MNU-y08n1x5g.js → ro-AVAWPKOO-b89pw79r.js} +153 -9
- package/dist/{ro-RKXZUG7Z-nndrrsq7.js → ro-BWR3ONRR-vzx3hy8a.js} +15 -3
- package/dist/ru-WBLQ5B2U-s4em88p0.js +10 -0
- package/dist/sdd-lookup-x08j9g9m.js +48 -0
- package/dist/{strict-case-rules-303vjvas.js → strict-case-rules-x6t0vb40.js} +141 -109
- package/dist/strict-sdd-audit-8e2fh9jg.js +2520 -0
- package/dist/tool.js +9 -9
- package/dist/{tr-AA6O2WSR-86ba4bdf.js → tr-5IIHSFW5-hw4cewew.js} +15 -3
- package/dist/{tr-XHSSPNK7-cmqyc4wd.js → tr-JMIP7ZSL-c39b6pe4.js} +153 -9
- package/dist/{trigger-enrichment-service-cg99dk1f.js → trigger-enrichment-service-kkh3197w.js} +24 -24
- package/dist/{zh-CN-2EHQT23P-mr63c4xz.js → zh-CN-IFFXSEJS-9wm9gmrv.js} +153 -9
- package/dist/{zh-CN-R2KLHXQV-agqr45ds.js → zh-CN-R2KU4U5L-tc1hat59.js} +15 -3
- package/dist/{zh-TW-RJGCQANM-w0x3qc1p.js → zh-TW-GNKMELBF-j674515r.js} +15 -3
- package/dist/{zh-TW-MGZCE5BT-c4ekmrz9.js → zh-TW-IYBNYAMG-8727c7v2.js} +153 -9
- package/package.json +3 -2
- package/dist/case-debug-studio-web-service-npcw81ay.js +0 -335
- package/dist/packager-tool-134mvmcm.js +0 -3040
- package/dist/packager-tool-ty1t2byf.js +0 -27
- package/dist/ru-WBLQ5B2U-8r3c7v6d.js +0 -10
- package/dist/strict-sdd-audit-qdmc9e1y.js +0 -1024
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ACTIVITY_TYPE_ID_PATH,
|
|
3
|
+
BINDING_REFERENCE_PREFIX,
|
|
4
|
+
NAME_BOUND_TASK_TYPES,
|
|
5
|
+
RESOLVED_IDENTITY_KEYS,
|
|
6
|
+
activityTypeIdMessage,
|
|
2
7
|
contextEntry,
|
|
3
8
|
missingContextKeys,
|
|
4
9
|
readActivityTypeId
|
|
5
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-d4sjk46c.js";
|
|
6
11
|
import"./packager-tool-1yh8g550.js";
|
|
7
12
|
|
|
8
13
|
// src/services/strict-case-rules.ts
|
|
@@ -32,31 +37,6 @@ var checkStagesHaveTasks = (nodes) => {
|
|
|
32
37
|
}
|
|
33
38
|
return issues;
|
|
34
39
|
};
|
|
35
|
-
var checkNoUnresolvedXrefs = (value, path, issues) => {
|
|
36
|
-
if (typeof value === "string") {
|
|
37
|
-
if (value.includes("$xref(")) {
|
|
38
|
-
issues.push({
|
|
39
|
-
code: "STRICT_XREF_UNRESOLVED",
|
|
40
|
-
path,
|
|
41
|
-
severity: "error",
|
|
42
|
-
message: `Unresolved authoring marker in "${value}". "$xref(...)" ` + "is a placeholder the converter does not expand — resolve " + "it to the real id before packing."
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (Array.isArray(value)) {
|
|
48
|
-
value.forEach((entry, index) => {
|
|
49
|
-
checkNoUnresolvedXrefs(entry, `${path}[${index}]`, issues);
|
|
50
|
-
});
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const record = asRecord(value);
|
|
54
|
-
if (!record)
|
|
55
|
-
return;
|
|
56
|
-
for (const [key, entry] of Object.entries(record)) {
|
|
57
|
-
checkNoUnresolvedXrefs(entry, `${path}.${key}`, issues);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
40
|
var jsSyntaxError = (source) => {
|
|
61
41
|
try {
|
|
62
42
|
new Script(source);
|
|
@@ -96,42 +76,6 @@ var checkJsExpressionsParse = (value, path, issues) => {
|
|
|
96
76
|
checkJsExpressionsParse(entry, `${path}.${key}`, issues);
|
|
97
77
|
}
|
|
98
78
|
};
|
|
99
|
-
var checkConditionExpressionPlacement = (conditions, path) => {
|
|
100
|
-
const issues = [];
|
|
101
|
-
asArray(conditions).forEach((condition, index) => {
|
|
102
|
-
const record = asRecord(condition);
|
|
103
|
-
if (!record)
|
|
104
|
-
return;
|
|
105
|
-
if (typeof record.conditionExpression !== "string")
|
|
106
|
-
return;
|
|
107
|
-
issues.push({
|
|
108
|
-
code: "STRICT_CONDITION_EXPR_HOISTED",
|
|
109
|
-
path: `${path}[${index}].conditionExpression`,
|
|
110
|
-
severity: "error",
|
|
111
|
-
message: '"conditionExpression" sits on the condition object. The ' + "scheduler reads it from a rule inside rules[][], so here it " + "is ignored and the condition fires ungated — move it onto " + "the rule it is meant to guard."
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
return issues;
|
|
115
|
-
};
|
|
116
|
-
var collectConditionIssues = (nodes, metadata) => {
|
|
117
|
-
const issues = [];
|
|
118
|
-
for (const node of nodes) {
|
|
119
|
-
const id = typeof node.id === "string" ? node.id : "?";
|
|
120
|
-
const data = asRecord(node.data);
|
|
121
|
-
issues.push(...checkConditionExpressionPlacement(data?.entryConditions, `nodes[${id}].data.entryConditions`), ...checkConditionExpressionPlacement(data?.exitConditions, `nodes[${id}].data.exitConditions`));
|
|
122
|
-
for (const lane of asArray(data?.tasks)) {
|
|
123
|
-
for (const task of asArray(lane)) {
|
|
124
|
-
const taskRecord = asRecord(task);
|
|
125
|
-
if (!taskRecord)
|
|
126
|
-
continue;
|
|
127
|
-
const taskId = typeof taskRecord.id === "string" ? taskRecord.id : "?";
|
|
128
|
-
issues.push(...checkConditionExpressionPlacement(taskRecord.entryConditions, `nodes[${id}].data.tasks[${taskId}].entryConditions`));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
issues.push(...checkConditionExpressionPlacement(metadata?.caseExitRules, "metadata.caseExitRules"));
|
|
133
|
-
return issues;
|
|
134
|
-
};
|
|
135
79
|
var checkVariableContract = (variables) => {
|
|
136
80
|
const issues = [];
|
|
137
81
|
for (const slot of ["inputs", "outputs", "inputOutputs"]) {
|
|
@@ -210,50 +154,13 @@ var checkInputOutputCompanions = (variables, nodes) => {
|
|
|
210
154
|
}
|
|
211
155
|
return issues;
|
|
212
156
|
};
|
|
213
|
-
var checkOutputIdUniqueness = (nodes) => {
|
|
214
|
-
const issues = [];
|
|
215
|
-
const seen = new Map;
|
|
216
|
-
const reported = new Set;
|
|
217
|
-
for (const node of nodes) {
|
|
218
|
-
const nodeId = typeof node.id === "string" ? node.id : "?";
|
|
219
|
-
const data = asRecord(node.data);
|
|
220
|
-
for (const lane of asArray(data?.tasks)) {
|
|
221
|
-
for (const task of asArray(lane)) {
|
|
222
|
-
const taskRecord = asRecord(task);
|
|
223
|
-
if (!taskRecord)
|
|
224
|
-
continue;
|
|
225
|
-
const taskId = typeof taskRecord.id === "string" ? taskRecord.id : "?";
|
|
226
|
-
const taskData = asRecord(taskRecord.data);
|
|
227
|
-
for (const output of asArray(taskData?.outputs)) {
|
|
228
|
-
const id = asRecord(output)?.id;
|
|
229
|
-
if (typeof id !== "string" || id === "")
|
|
230
|
-
continue;
|
|
231
|
-
const owner = `${nodeId}/${taskId}`;
|
|
232
|
-
const previous = seen.get(id);
|
|
233
|
-
if (previous !== undefined && !reported.has(id)) {
|
|
234
|
-
reported.add(id);
|
|
235
|
-
issues.push({
|
|
236
|
-
code: "STRICT_OUTPUT_ID_DUPLICATE",
|
|
237
|
-
path: `nodes[${nodeId}].data.tasks[${taskId}].data.outputs[${id}]`,
|
|
238
|
-
severity: "error",
|
|
239
|
-
message: `Output id "${id}" is used by two tasks ` + `(${previous} and ${owner}). Output ids are ` + "the write target, so the second write lands " + "on the first task's variable."
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
if (previous === undefined)
|
|
243
|
-
seen.set(id, owner);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return issues;
|
|
249
|
-
};
|
|
250
157
|
var checkConnectorRuleContext = (nodes) => {
|
|
251
158
|
const issues = [];
|
|
252
159
|
const visitRule = (rule, path) => {
|
|
253
160
|
if (rule.rule !== "wait-for-connector")
|
|
254
161
|
return;
|
|
255
162
|
const context = asRecord(rule.uipath)?.context;
|
|
256
|
-
const missing = missingContextKeys(context);
|
|
163
|
+
const missing = missingContextKeys(context, true);
|
|
257
164
|
if (missing.length > 0) {
|
|
258
165
|
issues.push({
|
|
259
166
|
code: "STRICT_CONNECTOR_CONTEXT_INCOMPLETE",
|
|
@@ -267,9 +174,9 @@ var checkConnectorRuleContext = (nodes) => {
|
|
|
267
174
|
if (readActivityTypeId(context) === undefined) {
|
|
268
175
|
issues.push({
|
|
269
176
|
code: "STRICT_CONNECTOR_ACTIVITY_TYPE_ID",
|
|
270
|
-
path: `${path}.uipath.context[metadata]
|
|
177
|
+
path: `${path}.uipath.context[metadata].${ACTIVITY_TYPE_ID_PATH}`,
|
|
271
178
|
severity: "error",
|
|
272
|
-
message: `
|
|
179
|
+
message: activityTypeIdMessage(`rule "${typeof rule.id === "string" ? rule.id : "?"}"`, context, "The connection id alone does not identify the event to " + "wait for.")
|
|
273
180
|
});
|
|
274
181
|
}
|
|
275
182
|
};
|
|
@@ -350,28 +257,153 @@ var checkActionRecipientShape = (nodes) => nodes.flatMap((node) => {
|
|
|
350
257
|
return recipientIssues(recipient, `nodes[${nodeId}].data.tasks[${taskId}].data.recipient`);
|
|
351
258
|
}));
|
|
352
259
|
});
|
|
260
|
+
var RESOURCE_TASK_TYPES = new Set([
|
|
261
|
+
"action",
|
|
262
|
+
"agent",
|
|
263
|
+
"api-workflow",
|
|
264
|
+
"case-management",
|
|
265
|
+
"execute-connector-activity",
|
|
266
|
+
"process",
|
|
267
|
+
"rpa",
|
|
268
|
+
"wait-for-connector"
|
|
269
|
+
]);
|
|
270
|
+
var collectBindingReferences = (value, path, found) => {
|
|
271
|
+
if (typeof value === "string") {
|
|
272
|
+
if (value.startsWith(BINDING_REFERENCE_PREFIX)) {
|
|
273
|
+
const id = value.slice(BINDING_REFERENCE_PREFIX.length);
|
|
274
|
+
if (id !== "" && !found.has(id))
|
|
275
|
+
found.set(id, path);
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (Array.isArray(value)) {
|
|
280
|
+
value.forEach((entry, index) => {
|
|
281
|
+
collectBindingReferences(entry, `${path}[${index}]`, found);
|
|
282
|
+
});
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const record = asRecord(value);
|
|
286
|
+
if (record === undefined)
|
|
287
|
+
return;
|
|
288
|
+
for (const [key, entry] of Object.entries(record)) {
|
|
289
|
+
collectBindingReferences(entry, `${path}.${key}`, found);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
var isBindingReference = (value) => typeof value === "string" && value.startsWith(BINDING_REFERENCE_PREFIX);
|
|
293
|
+
var checkTaskBindings = (nodes) => {
|
|
294
|
+
const issues = [];
|
|
295
|
+
for (const node of nodes) {
|
|
296
|
+
const stage = asRecord(node.data);
|
|
297
|
+
const stageName = typeof stage?.label === "string" ? stage.label : "";
|
|
298
|
+
for (const lane of asArray(stage?.tasks)) {
|
|
299
|
+
for (const task of asArray(lane)) {
|
|
300
|
+
const taskRecord = asRecord(task);
|
|
301
|
+
const type = taskRecord?.type;
|
|
302
|
+
const data = asRecord(taskRecord?.data);
|
|
303
|
+
if (typeof type !== "string" || !NAME_BOUND_TASK_TYPES.has(type) || data === undefined) {
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
const identity = RESOLVED_IDENTITY_KEYS.filter((key) => data[key] !== undefined);
|
|
307
|
+
if (identity.length === 0)
|
|
308
|
+
continue;
|
|
309
|
+
const unbound = ["name", "folderPath"].filter((field) => !isBindingReference(data[field]));
|
|
310
|
+
if (unbound.length === 0)
|
|
311
|
+
continue;
|
|
312
|
+
const taskName = typeof taskRecord?.displayName === "string" ? taskRecord.displayName : type;
|
|
313
|
+
issues.push({
|
|
314
|
+
code: "STRICT_BINDINGS_TASK_UNBOUND",
|
|
315
|
+
path: `nodes[${stageName}].data.tasks[${taskName}].data`,
|
|
316
|
+
severity: "error",
|
|
317
|
+
message: `Task "${taskName}" (${type}) pins its resource with ` + `${identity.join(", ")}, but ${unbound.join(" and ")} ` + `${unbound.length === 1 ? `is not a ${BINDING_REFERENCE_PREFIX} reference` : `are not ${BINDING_REFERENCE_PREFIX} references`}. A resolved ` + "resource task binds both: `name` and `folderPath` " + "each point at a root bindings entry, and " + "bindings_v2.json is derived from those. A raw id " + "binds nothing, so the solution ships resolving this " + "task to nothing, and the id itself does not survive " + "a move to another tenant. Bind the pair and drop the " + "raw id."
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return issues;
|
|
323
|
+
};
|
|
324
|
+
var resourceTaskCount = (nodes) => {
|
|
325
|
+
let count = 0;
|
|
326
|
+
for (const node of nodes) {
|
|
327
|
+
for (const lane of asArray(asRecord(node.data)?.tasks)) {
|
|
328
|
+
for (const task of asArray(lane)) {
|
|
329
|
+
const taskRecord = asRecord(task);
|
|
330
|
+
const type = taskRecord?.type;
|
|
331
|
+
if (typeof type === "string" && RESOURCE_TASK_TYPES.has(type) && Object.keys(asRecord(taskRecord?.data) ?? {}).length > 0) {
|
|
332
|
+
count += 1;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return count;
|
|
338
|
+
};
|
|
339
|
+
var checkResourceBindings = (parsed, nodes) => {
|
|
340
|
+
const issues = [];
|
|
341
|
+
const bindings = asArray(parsed.bindings).map((entry) => asRecord(entry)).filter((entry) => entry !== undefined);
|
|
342
|
+
const bindingIds = new Set(bindings.map((entry) => entry.id).filter((id) => typeof id === "string"));
|
|
343
|
+
const seenIds = new Set;
|
|
344
|
+
const reportedIds = new Set;
|
|
345
|
+
for (const entry of bindings) {
|
|
346
|
+
const id = entry.id;
|
|
347
|
+
if (typeof id !== "string" || id === "")
|
|
348
|
+
continue;
|
|
349
|
+
if (!seenIds.has(id)) {
|
|
350
|
+
seenIds.add(id);
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (reportedIds.has(id))
|
|
354
|
+
continue;
|
|
355
|
+
reportedIds.add(id);
|
|
356
|
+
issues.push({
|
|
357
|
+
code: "STRICT_BINDINGS_ID_DUPLICATE",
|
|
358
|
+
path: `bindings[${id}]`,
|
|
359
|
+
severity: "error",
|
|
360
|
+
message: `Two or more bindings share the id "${id}". A ` + `${BINDING_REFERENCE_PREFIX}${id} reference resolves to ` + "whichever entry a consumer scans first, so the one that " + "wins depends on array order — and the losing entry still " + "reads as though it applies. Give each entry its own id."
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
const references = new Map;
|
|
364
|
+
collectBindingReferences(parsed.nodes, "nodes", references);
|
|
365
|
+
collectBindingReferences(parsed.metadata, "metadata", references);
|
|
366
|
+
for (const [id, path] of references) {
|
|
367
|
+
if (bindingIds.has(id))
|
|
368
|
+
continue;
|
|
369
|
+
issues.push({
|
|
370
|
+
code: "STRICT_BINDINGS_REFERENCE_UNRESOLVED",
|
|
371
|
+
path,
|
|
372
|
+
severity: "error",
|
|
373
|
+
message: `"${BINDING_REFERENCE_PREFIX}${id}" points at no entry in the ` + "root bindings array, so nothing resolves it at run time. Add " + `a binding with id "${id}", or correct the reference.`
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
const resourceTasks = resourceTaskCount(nodes);
|
|
377
|
+
if (bindings.length > 0) {
|
|
378
|
+
issues.push(...checkTaskBindings(nodes));
|
|
379
|
+
} else if (resourceTasks > 0) {
|
|
380
|
+
issues.push({
|
|
381
|
+
code: "STRICT_BINDINGS_ABSENT",
|
|
382
|
+
path: "bindings",
|
|
383
|
+
severity: "warning",
|
|
384
|
+
message: `The root bindings array is empty, but ${resourceTasks} task(s) ` + "name a platform resource (process, agent, rpa, action, " + "api-workflow, child case or connector). Every such task needs " + "a name/folderPath binding pair — or, for a connector, a " + "connection and folder key — and bindings_v2.json is derived " + "from that array, so an empty one publishes a solution that " + "resolves none of them."
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
return issues;
|
|
388
|
+
};
|
|
353
389
|
var runStrictCaseRules = (parsed) => {
|
|
354
390
|
const nodes = Array.isArray(parsed.nodes) ? parsed.nodes : [];
|
|
355
391
|
const variables = asRecord(parsed.variables);
|
|
356
392
|
const metadata = asRecord(parsed.metadata);
|
|
357
|
-
const xrefIssues = [];
|
|
358
|
-
checkNoUnresolvedXrefs(parsed, "(root)", xrefIssues);
|
|
359
393
|
const jsSyntaxIssues = [];
|
|
360
394
|
checkJsExpressionsParse(parsed, "(root)", jsSyntaxIssues);
|
|
361
395
|
return [
|
|
362
396
|
...checkStagesHaveTasks(nodes),
|
|
363
|
-
...xrefIssues,
|
|
364
397
|
...jsSyntaxIssues,
|
|
365
|
-
...collectConditionIssues(nodes, metadata),
|
|
366
398
|
...checkVariableContract(variables),
|
|
367
399
|
...checkInputOutputCompanions(variables, nodes),
|
|
368
|
-
...checkOutputIdUniqueness(nodes),
|
|
369
400
|
...checkConnectorRuleContext(nodes),
|
|
370
|
-
...checkActionRecipientShape(nodes)
|
|
401
|
+
...checkActionRecipientShape(nodes),
|
|
402
|
+
...checkResourceBindings(parsed, nodes)
|
|
371
403
|
];
|
|
372
404
|
};
|
|
373
405
|
export {
|
|
374
406
|
runStrictCaseRules
|
|
375
407
|
};
|
|
376
408
|
|
|
377
|
-
//# debugId=
|
|
409
|
+
//# debugId=C4B6D297A9F4627964756E2164756E21
|