@uipath/case-tool 1.206.0-preview.303 → 1.207.0-preview.305
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/README.md +7 -90
- package/dist/THIRD-PARTY-NOTICES.md +162 -7
- package/dist/{authoring-wt5ngnjb.js → authoring-qqev46bh.js} +233 -63
- package/dist/{bindings-v2-x100hvcy.js → bindings-v2-wjgg92tj.js} +4 -4
- package/dist/{browser-strategy-627rrg7z.js → browser-strategy-qc6htsnf.js} +1 -1
- package/dist/{business-rule-export-pggs7x01.js → business-rule-export-0pbc3ysq.js} +2 -2
- package/dist/{carry-forward-gxsadrqb.js → carry-forward-tj5yrqf6.js} +6 -6
- package/dist/{case-api-a6v5beat.js → case-api-bfwmvkb8.js} +24 -28
- package/dist/{case-bindings-service-9zemt0r2.js → case-bindings-service-5r7c70kz.js} +5 -5
- package/dist/case-catalog-h4fjn6q3.js +304 -0
- package/dist/{case-debug-solution-projects-c300019s.js → case-debug-solution-projects-5tr4pwbs.js} +2 -2
- package/dist/{case-debug-studio-web-service-b6xe8es1.js → case-debug-studio-web-service-7smzvq4c.js} +10 -9
- package/dist/{case-described-io-service-8dw21x2y.js → case-described-io-service-ddsvkz8w.js} +5 -5
- package/dist/{case-event-trigger-bindings-pmad4dev.js → case-event-trigger-bindings-8nd78j4e.js} +5 -5
- package/dist/{case-format-service-xjvnx3jd.js → case-format-service-4mzszgfb.js} +2 -2
- package/dist/case-pack-service-bp7sh20v.js +297 -0
- package/dist/{case-splice-service-8deak994.js → case-splice-service-tpp2syvn.js} +7 -7
- package/dist/{case-validate-service-p324kcry.js → case-validate-service-fxvq4qx7.js} +146 -38
- package/dist/{connector-enrichment-service-9wnew5a0.js → connector-enrichment-service-x0w721wj.js} +26 -25
- package/dist/{connector-library-1yw5r47w.js → connector-library-844myxz2.js} +20 -6
- package/dist/{connector-lookup-service-v8r2htmg.js → connector-lookup-service-51pca3bf.js} +8 -8
- package/dist/{connector-task-shape-bgywpbqc.js → connector-task-shape-s2zny4gf.js} +3 -3
- package/dist/{de-AI7ML6JM-km47f8k4.js → de-B6IFKV43-9sk50xx0.js} +164 -2
- package/dist/{de-2BEKRUMY-x4dx0nn9.js → de-HF4GJ4EK-xrrajtht.js} +1277 -10
- package/dist/{debug-service-tm92ws5e.js → debug-service-hf2wb4tw.js} +9 -4
- package/dist/{en-LAVDF7IQ-yzy20n6d.js → en-5JIPZTS5-c68n8taw.js} +4 -2
- package/dist/{en-X6T4SP2Y-xm47mf18.js → en-ETY46SDS-far9tmsf.js} +66 -2
- package/dist/{enrichment-service-hzsn1aqp.js → enrichment-service-7f4sdff5.js} +17 -17
- package/dist/{es-SPNKTD5Y-vw5cbgv5.js → es-AQW6PFIU-q2mz247f.js} +164 -2
- package/dist/{es-7ZTQTGKN-11sj0yjx.js → es-IYP2OLUY-98xsbyd5.js} +1271 -10
- package/dist/{es-MX-IHGRIEWH-g63p0gb4.js → es-MX-D2MN3U37-0y5q0nbe.js} +1276 -10
- package/dist/{es-MX-7KJZPEQN-1fq0a9jr.js → es-MX-KWITVBWE-w49gknha.js} +164 -2
- package/dist/{fr-7ZDL4MVO-pd27vwh6.js → fr-NISALSPL-vzfmygd7.js} +1277 -10
- package/dist/{fr-AXJGUT53-hdg3pmd4.js → fr-RNWK2TMC-dpyzj366.js} +164 -2
- package/dist/{index-n1ndwwsz.js → index-2j5tfjwv.js} +129 -76
- package/dist/{index-kc1h1yf6.js → index-ezxmyhan.js} +4 -4
- package/dist/{index-j2gw61z0.js → index-gb75pv5a.js} +111 -65
- package/dist/index-prn518fr.js +36 -0
- package/dist/{index-nj3axvya.js → index-rk82650j.js} +7 -5
- package/dist/{index-pg9wmyrf.js → index-t6fnts8a.js} +2 -2
- package/dist/index-wkmh1h6w.js +26 -0
- package/dist/{index-21kns9qg.js → index-y7v9rkq9.js} +1 -1
- package/dist/index.js +13 -11
- package/dist/init-entry-points-52kvvbg9.js +15 -0
- package/dist/input-reader-zr71xcm9.js +13 -0
- package/dist/integration-service-fetcher-bpbz1gcx.js +68 -0
- package/dist/{ja-C7GZV6YP-hvtbngr5.js → ja-DH4I3GEF-ywyhhppa.js} +164 -2
- package/dist/{ja-LGAM5HKR-sgrtjqjh.js → ja-HTS2Q4YG-4ahnq47y.js} +1277 -10
- package/dist/{known-types-gak9by1w.js → known-types-a5d0evdm.js} +2 -2
- package/dist/{ko-7B4SUZB7-c8wr20sc.js → ko-3JFGTMNY-qnf1bnef.js} +1271 -10
- package/dist/{ko-Q24HSSL4-5vn55pte.js → ko-R5BCWVO7-whzgmh6q.js} +164 -2
- package/dist/library-option-pbvkt66g.js +13 -0
- package/dist/{localSolutionDiscovery-9pj8mzye.js → localSolutionDiscovery-5sqz9dkr.js} +5 -5
- package/dist/manifest-rhee8kem.js +32 -0
- package/dist/{node-strategy-2mqzg36t.js → node-strategy-aaf2qe6c.js} +2 -2
- package/dist/{node-sync-service-7n5960qy.js → node-sync-service-q1a37d6n.js} +21 -15
- package/dist/{out-target-gtg3we44.js → out-target-02x6x6nk.js} +5 -5
- package/dist/{packager-tool-h2ar8xf8.js → packager-tool-00ck60cc.js} +25 -24
- package/dist/{packager-tool-rfdkx9c9.js → packager-tool-00qmds4s.js} +254 -69
- package/dist/{packager-tool-388vyja1.js → packager-tool-0gmnk7sb.js} +2 -2
- package/dist/{packager-tool-fcektt1g.js → packager-tool-0nbcqyvp.js} +10 -9
- package/dist/{packager-tool-anvg0etj.js → packager-tool-178xtejt.js} +191 -154
- package/dist/{packager-tool-j69tzg52.js → packager-tool-1dsedy7x.js} +59 -34
- package/dist/packager-tool-1yew22sn.js +9 -0
- package/dist/{packager-tool-1hpd2gmh.js → packager-tool-225b9qhq.js} +1 -1
- package/dist/{packager-tool-z4phaas7.js → packager-tool-2x40ye7a.js} +21 -7
- package/dist/{packager-tool-p0rdmmvk.js → packager-tool-2xemp3b1.js} +2 -2
- package/dist/packager-tool-34ttsx9q.js +18 -0
- package/dist/{packager-tool-3zy717ga.js → packager-tool-36vkdb3h.js} +2 -2
- package/dist/{packager-tool-7hcpmn4g.js → packager-tool-380ac64s.js} +61 -11
- package/dist/{packager-tool-cqkbf2fg.js → packager-tool-3hzsw5r7.js} +906 -41
- package/dist/packager-tool-3k5j706w.js +73 -0
- package/dist/{packager-tool-scy94jyb.js → packager-tool-4seehsme.js} +2 -72
- package/dist/{packager-tool-es77jvky.js → packager-tool-4w7nzx18.js} +360 -44
- package/dist/{packager-tool-4avchhz8.js → packager-tool-57970zfm.js} +12 -7
- package/dist/{packager-tool-bjt8b2nz.js → packager-tool-5s476jdt.js} +13 -13
- package/dist/{packager-tool-0xj79bbd.js → packager-tool-8kcwawyg.js} +13 -4
- package/dist/{packager-tool-wy3a65rx.js → packager-tool-bw4fsdq4.js} +27 -13
- package/dist/{packager-tool-dn9d4ywm.js → packager-tool-c0pavv0s.js} +66 -10
- package/dist/packager-tool-c9h0rwgv.js +31 -0
- package/dist/{packager-tool-t8qx6hvn.js → packager-tool-dv2vtyg0.js} +4 -4
- package/dist/{packager-tool-3r23qsca.js → packager-tool-ef43cy32.js} +213 -231
- package/dist/{packager-tool-m4kp6a7j.js → packager-tool-ej14cxen.js} +22 -22
- package/dist/{packager-tool-5w0gjcck.js → packager-tool-engs9gvj.js} +1 -1
- package/dist/{packager-tool-stdwmgvd.js → packager-tool-exrjwmew.js} +202 -83
- package/dist/{task-type-declaration-yhczvj05.js → packager-tool-f9n5mk1c.js} +8 -12
- package/dist/{packager-tool-b2q8m9pq.js → packager-tool-fspmvh6g.js} +5 -4
- package/dist/packager-tool-geh2qybm.js +179 -0
- package/dist/{packager-tool-17b466mr.js → packager-tool-hrd44w8g.js} +7561 -6408
- package/dist/{packager-tool-snesn0bt.js → packager-tool-j1etnthk.js} +19 -14
- package/dist/{packager-tool-k871wgpe.js → packager-tool-j53d4vv1.js} +18 -4
- package/dist/{packager-tool-6ewsbrnb.js → packager-tool-j8mnpsv8.js} +329 -149
- package/dist/{packager-tool-7x1tmb8a.js → packager-tool-jydreskq.js} +1 -1
- package/dist/{packager-tool-r5pha7xq.js → packager-tool-k08k9g2y.js} +9 -9
- package/dist/{packager-tool-bg3tdpva.js → packager-tool-kh9gs4d5.js} +4 -2
- package/dist/{packager-tool-8467kcz9.js → packager-tool-m7s4n455.js} +120 -13
- package/dist/{packager-tool-q26hncjr.js → packager-tool-n3r5apbb.js} +4 -2
- package/dist/packager-tool-n6h4bz4d.js +22 -0
- package/dist/{packager-tool-ad8v11jd.js → packager-tool-p4c1g2sj.js} +1032 -819
- package/dist/{packager-tool-z070caqq.js → packager-tool-p64w2wrt.js} +30 -8
- package/dist/{packager-tool-xd1wbvay.js → packager-tool-pq61r2f1.js} +1 -1
- package/dist/{packager-tool-65vr263d.js → packager-tool-qzyb1eac.js} +1 -1
- package/dist/{packager-tool-5dptce1y.js → packager-tool-rzxnm9yj.js} +2 -2
- package/dist/{init-entry-points-5xzn81bb.js → packager-tool-t6xwkhht.js} +12 -10
- package/dist/packager-tool-vmfd007q.js +27 -0
- package/dist/packager-tool-wvf6b31h.js +50 -0
- package/dist/{packager-tool-cdvrca04.js → packager-tool-x9z4krtr.js} +1036 -259
- package/dist/{packager-tool-z1fw9a8v.js → packager-tool-y69796fy.js} +19 -11
- package/dist/{packager-tool-jkwpw95j.js → packager-tool-z13dp55w.js} +3393 -3092
- package/dist/{packager-tool-9m7jbv7t.js → packager-tool-zbfwp75m.js} +4 -4
- package/dist/{packager-tool-pq9xv4vq.js → packager-tool-zte9svtn.js} +11 -4
- package/dist/packager-tool.js +2 -2
- package/dist/{prepare-uip-ad7mfs8t.js → prepare-uip-2hcb65bn.js} +39 -6
- package/dist/{project-artifacts-pfcn65cg.js → project-artifacts-77yctm8b.js} +1 -1
- package/dist/{pt-BR-BIUJXIPU-2sqzhr8y.js → pt-BR-6TBBEDQS-y3f2vg5d.js} +164 -2
- package/dist/{pt-BR-PHLFHMXZ-n6de4s7z.js → pt-BR-7H7BP5DT-z2e5aaj1.js} +1276 -10
- package/dist/{pt-N7ZTJT4W-d6c67xcn.js → pt-QWGSZKMD-m50nrkx8.js} +1271 -10
- package/dist/{pt-MHX6JGAX-xfgvdqwg.js → pt-ZSQC5RZ3-8kp3g1z5.js} +164 -2
- package/dist/{resolved-check-dz8eqrf6.js → resolved-check-kwgy875v.js} +1 -1
- package/dist/{resourcesSyncService-y5r4k43w.js → resourcesSyncService-gegbd8b8.js} +49 -26
- package/dist/{ro-FLNXVYJI-ytrwabg2.js → ro-B7G474JK-9k2jjk88.js} +1271 -10
- package/dist/{ro-3RKJNGJZ-xqj14e3d.js → ro-P33AQ6ZL-s92z1mgg.js} +164 -2
- package/dist/{rule-type-declaration-ze0saj5r.js → rule-type-declaration-a0fk7fe7.js} +12 -11
- package/dist/{sdd-convert-service-m8e615a1.js → sdd-convert-service-2ag3xjpj.js} +120 -621
- package/dist/{sdd-lookup-fwj6x364.js → sdd-lookup-wgm5ctnd.js} +2 -2
- package/dist/{sdd-resolve-service-dvg387wx.js → sdd-resolve-service-epygyb0n.js} +34 -6
- package/dist/{sdd-resolve-siblings-xsm2ktkq.js → sdd-resolve-siblings-qz7gwws5.js} +4 -4
- package/dist/solution-auth-yb1twb9d.js +11 -0
- package/dist/{solution-discovery-gfdqhgt2.js → solution-discovery-t0nkzpm3.js} +4 -4
- package/dist/{strict-case-rules-045kbjvv.js → strict-case-rules-x1sytx3e.js} +91 -46
- package/dist/{strict-entry-points-wd85a81g.js → strict-entry-points-anxeg692.js} +6 -6
- package/dist/strict-sdd-audit-z1bg2zr0.js +28 -0
- package/dist/taggable-variables-gc58xb0s.js +6094 -0
- package/dist/task-type-declaration-b0ejzhc6.js +15 -0
- package/dist/tool.js +13 -11
- package/dist/{tr-7AIZZWZ6-pdzp9n0p.js → tr-FX7WCKK2-x3rx9fjt.js} +1271 -10
- package/dist/{tr-PQLUUHPC-qsb7btxn.js → tr-XD73CQAA-tb2nrpyp.js} +164 -2
- package/dist/{trigger-enrichment-service-dzkht78s.js → trigger-enrichment-service-bsj58ppa.js} +33 -32
- package/dist/{trigger-entry-point-id-4j9rk3kp.js → trigger-entry-point-id-hre2ewts.js} +1 -1
- package/dist/{zh-CN-OHNTHZRI-b0hjkfqn.js → zh-CN-GWP3B2EM-c07fm17a.js} +164 -2
- package/dist/{zh-CN-CN2ARPFS-e0p2qrxf.js → zh-CN-NCMB6YM5-drw9bnxg.js} +1271 -10
- package/dist/{zh-TW-E4D3Y6ZR-tn3bmzz5.js → zh-TW-2DLUOA7C-9khqnr4r.js} +164 -2
- package/dist/{zh-TW-7RUFEVFK-qd7myw31.js → zh-TW-UNIEJPLE-4vxzbphe.js} +1272 -11
- package/package.json +2 -2
- package/dist/case-pack-service-adhg30nq.js +0 -167
- package/dist/index-garh9kcd.js +0 -35
- package/dist/input-reader-pjt4a914.js +0 -10
- package/dist/packager-tool-v11fx4dk.js +0 -25
- package/dist/solution-auth-a1p22hq1.js +0 -11
- package/dist/strict-sdd-audit-6es2j6fs.js +0 -26
|
@@ -2,11 +2,148 @@ import {
|
|
|
2
2
|
catchError2,
|
|
3
3
|
RESULTS,
|
|
4
4
|
logger
|
|
5
|
-
} from "./packager-tool-
|
|
5
|
+
} from "./packager-tool-j8mnpsv8.js";
|
|
6
|
+
import {
|
|
7
|
+
normalizeTimestamps
|
|
8
|
+
} from "./packager-tool-wvf6b31h.js";
|
|
6
9
|
|
|
7
10
|
// ../maestro-sdk/src/debug-service.ts
|
|
8
11
|
import { randomUUID } from "node:crypto";
|
|
9
12
|
|
|
13
|
+
// ../executor/jit-debug-contract/src/index.ts
|
|
14
|
+
var FPS_DEBUG_MASTER = "debug.master";
|
|
15
|
+
var FPS_DEBUG_SOURCE = "debug.source";
|
|
16
|
+
var DEBUG_SOURCE_STUDIO_WEB = "studioweb";
|
|
17
|
+
var MAX_JIT_PROCESSES = 64;
|
|
18
|
+
var ORCHESTRATOR_PROJECT_TYPES = [
|
|
19
|
+
"Undefined",
|
|
20
|
+
"Process",
|
|
21
|
+
"ProcessLibrary",
|
|
22
|
+
"BusinessProcess",
|
|
23
|
+
"BusinessProcessLibrary",
|
|
24
|
+
"TestAutomationProcess",
|
|
25
|
+
"ProcessOrchestration",
|
|
26
|
+
"BusinessProcessOrchestration",
|
|
27
|
+
"WebApp",
|
|
28
|
+
"BusinessWebApp",
|
|
29
|
+
"Agent",
|
|
30
|
+
"BusinessAgent",
|
|
31
|
+
"Api",
|
|
32
|
+
"MCPServer",
|
|
33
|
+
"BusinessRules",
|
|
34
|
+
"CaseManagement",
|
|
35
|
+
"Flow",
|
|
36
|
+
"Function",
|
|
37
|
+
"FlowAutomate"
|
|
38
|
+
];
|
|
39
|
+
var READABLE_PROJECT_TYPES = new Set(ORCHESTRATOR_PROJECT_TYPES.map((type) => type.toLowerCase()));
|
|
40
|
+
|
|
41
|
+
class JitAssemblyError extends Error {
|
|
42
|
+
code;
|
|
43
|
+
projectName;
|
|
44
|
+
constructor(code, message, projectName) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.code = code;
|
|
47
|
+
this.projectName = projectName;
|
|
48
|
+
this.name = "JitAssemblyError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function mergeJitProcessEntries(fpsProperties, entries) {
|
|
52
|
+
if (entries.length === 0) {
|
|
53
|
+
return fpsProperties ?? "{}";
|
|
54
|
+
}
|
|
55
|
+
const described = `Cannot add ${entries.length} process entr${entries.length === 1 ? "y" : "ies"}`;
|
|
56
|
+
const {
|
|
57
|
+
outer,
|
|
58
|
+
master,
|
|
59
|
+
processes: existing
|
|
60
|
+
} = parseFpsEnvelope(fpsProperties, described);
|
|
61
|
+
const total = existing.length + entries.length;
|
|
62
|
+
if (total > MAX_JIT_PROCESSES) {
|
|
63
|
+
throw new JitAssemblyError("TooManyProcesses", `${described}: the bag would hold ${total} processes; the limit is ${MAX_JIT_PROCESSES}.`);
|
|
64
|
+
}
|
|
65
|
+
master.processes = [...existing, ...entries.map(toWireEntry)];
|
|
66
|
+
outer[FPS_DEBUG_MASTER] = JSON.stringify(master);
|
|
67
|
+
if (!(FPS_DEBUG_SOURCE in outer)) {
|
|
68
|
+
outer[FPS_DEBUG_SOURCE] = DEBUG_SOURCE_STUDIO_WEB;
|
|
69
|
+
}
|
|
70
|
+
return JSON.stringify(outer);
|
|
71
|
+
}
|
|
72
|
+
function jitProcessNames(fpsProperties) {
|
|
73
|
+
const names = new Set;
|
|
74
|
+
let processes;
|
|
75
|
+
try {
|
|
76
|
+
({ processes } = parseFpsEnvelope(fpsProperties, "Cannot read process names"));
|
|
77
|
+
} catch {
|
|
78
|
+
return names;
|
|
79
|
+
}
|
|
80
|
+
for (const process2 of processes) {
|
|
81
|
+
if (isJsonObject(process2) && typeof process2.name === "string") {
|
|
82
|
+
names.add(process2.name.toLowerCase());
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return names;
|
|
86
|
+
}
|
|
87
|
+
function parseFpsEnvelope(fpsProperties, described) {
|
|
88
|
+
const envelopeLength = (fpsProperties ?? "").length;
|
|
89
|
+
let outer;
|
|
90
|
+
let master;
|
|
91
|
+
try {
|
|
92
|
+
outer = fpsProperties ? JSON.parse(fpsProperties) : {};
|
|
93
|
+
const masterRaw = isJsonObject(outer) ? outer[FPS_DEBUG_MASTER] : undefined;
|
|
94
|
+
master = typeof masterRaw === "string" ? JSON.parse(masterRaw) : masterRaw === undefined ? {} : masterRaw;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
throw new JitAssemblyError("MalformedFpsProperties", `${described}: the FpsProperties envelope (${envelopeLength} chars) is not valid JSON. ` + `Parse error: ${error instanceof Error ? error.name : "unknown"}.`);
|
|
97
|
+
}
|
|
98
|
+
if (!isJsonObject(outer) || !isJsonObject(master)) {
|
|
99
|
+
throw new JitAssemblyError("MalformedFpsProperties", `${described}: the FpsProperties envelope (${envelopeLength} chars) must be a JSON ` + `object whose ${FPS_DEBUG_MASTER} is also an object.`);
|
|
100
|
+
}
|
|
101
|
+
if (!(master.processes === undefined || Array.isArray(master.processes))) {
|
|
102
|
+
throw new JitAssemblyError("MalformedFpsProperties", `${described}: the ${FPS_DEBUG_MASTER} processes in the FpsProperties envelope ` + `(${envelopeLength} chars) must be an array.`);
|
|
103
|
+
}
|
|
104
|
+
return { outer, master, processes: master.processes ?? [] };
|
|
105
|
+
}
|
|
106
|
+
function toWireEntry(entry) {
|
|
107
|
+
if (!READABLE_PROJECT_TYPES.has(entry.projectType.toLowerCase())) {
|
|
108
|
+
throw new JitAssemblyError("UnknownProjectType", `Project '${entry.name}' has project type '${entry.projectType}', which Orchestrator ` + "cannot read, so a Run Job that targets it would start an ordinary job instead of " + "this project. Translate it to one of: " + `${ORCHESTRATOR_PROJECT_TYPES.join(", ")}.`, entry.name);
|
|
109
|
+
}
|
|
110
|
+
const wire = {
|
|
111
|
+
name: entry.name,
|
|
112
|
+
projectType: entry.projectType
|
|
113
|
+
};
|
|
114
|
+
assignDefined(wire, "executorInfo", entry.executorInfo);
|
|
115
|
+
assignDefined(wire, "folderKey", entry.folderKey);
|
|
116
|
+
assignDefined(wire, "entryPointPath", entry.entryPointPath);
|
|
117
|
+
assignDefined(wire, "requiresUserInteraction", entry.requiresUserInteraction);
|
|
118
|
+
assignDefined(wire, "targetFramework", entry.targetFramework);
|
|
119
|
+
assignDefined(wire, "remoteControlAccess", entry.remoteControlAccess);
|
|
120
|
+
assignDefined(wire, "targetRuntime", entry.targetRuntime);
|
|
121
|
+
assignDefined(wire, "isConversational", entry.isConversational);
|
|
122
|
+
const settings = toWireExecutionSettings(entry.executionSettings);
|
|
123
|
+
assignDefined(wire, "executionSettings", settings);
|
|
124
|
+
return wire;
|
|
125
|
+
}
|
|
126
|
+
function toWireExecutionSettings(settings) {
|
|
127
|
+
if (!settings) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const wire = {};
|
|
131
|
+
assignDefined(wire, "runtimeType", settings.runtimeType);
|
|
132
|
+
assignDefined(wire, "machineTemplateName", settings.machineTemplateName);
|
|
133
|
+
assignDefined(wire, "hostMachineName", settings.hostMachineName);
|
|
134
|
+
assignDefined(wire, "serviceUserName", settings.serviceUserName);
|
|
135
|
+
assignDefined(wire, "runAsMe", settings.runAsMe);
|
|
136
|
+
return Object.keys(wire).length > 0 ? wire : undefined;
|
|
137
|
+
}
|
|
138
|
+
function isJsonObject(value) {
|
|
139
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
140
|
+
}
|
|
141
|
+
function assignDefined(target, key, value) {
|
|
142
|
+
if (value !== undefined) {
|
|
143
|
+
target[key] = value;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
10
147
|
// ../maestro-sdk/src/debug-http-client.ts
|
|
11
148
|
function parseBackendErrorBody(body) {
|
|
12
149
|
if (!body)
|
|
@@ -146,13 +283,17 @@ async function automationSolutionsGet(config, path, stage, signal) {
|
|
|
146
283
|
}
|
|
147
284
|
return response.json();
|
|
148
285
|
}
|
|
149
|
-
async function orchestratorGet(config, path, stage) {
|
|
286
|
+
async function orchestratorGet(config, path, stage, options) {
|
|
150
287
|
const url = buildOrchestratorUrl(config, path);
|
|
151
288
|
const headers = buildCommonHeaders(config);
|
|
152
289
|
if (typeof process !== "undefined" && process.env?.DEBUG) {
|
|
153
290
|
logger.info(`DEBUG GET: ${url}`);
|
|
154
291
|
}
|
|
155
|
-
const response = await fetch(url, {
|
|
292
|
+
const response = await fetch(url, {
|
|
293
|
+
method: "GET",
|
|
294
|
+
headers,
|
|
295
|
+
...options?.signal ? { signal: options.signal } : {}
|
|
296
|
+
});
|
|
156
297
|
if (!response.ok) {
|
|
157
298
|
throw new MaestroHttpError(await buildHttpErrorDetails(response, {
|
|
158
299
|
service: "orchestrator",
|
|
@@ -206,11 +347,11 @@ async function debugPimsGet(config, path, stage, options) {
|
|
|
206
347
|
stage
|
|
207
348
|
}));
|
|
208
349
|
}
|
|
209
|
-
return response.json();
|
|
350
|
+
return normalizeTimestamps(await response.json());
|
|
210
351
|
}
|
|
211
352
|
async function readOptionalJsonResponse(response) {
|
|
212
353
|
const text = await response.text();
|
|
213
|
-
return text ? JSON.parse(text) : {};
|
|
354
|
+
return text ? normalizeTimestamps(JSON.parse(text)) : {};
|
|
214
355
|
}
|
|
215
356
|
async function debugPimsWrite(config, path, body, method, stage) {
|
|
216
357
|
const url = buildPimsUrl(config, path);
|
|
@@ -267,15 +408,29 @@ async function studioWebPost(config, organizationName, path, body, extraHeaders,
|
|
|
267
408
|
// ../maestro-sdk/src/debug-poll-retry.ts
|
|
268
409
|
var POLL_RETRY_DELAYS_MS = [5000, 1e4];
|
|
269
410
|
var isRetryablePollStatus = (httpStatus) => httpStatus === 403 || httpStatus >= 500;
|
|
270
|
-
|
|
271
|
-
|
|
411
|
+
function waitOrAbort(ms, signal) {
|
|
412
|
+
if (signal?.aborted)
|
|
413
|
+
return Promise.resolve();
|
|
414
|
+
return new Promise((resolve) => {
|
|
415
|
+
const onAbort = () => {
|
|
416
|
+
clearTimeout(timer);
|
|
417
|
+
resolve();
|
|
418
|
+
};
|
|
419
|
+
const timer = setTimeout(() => {
|
|
420
|
+
signal?.removeEventListener("abort", onAbort);
|
|
421
|
+
resolve();
|
|
422
|
+
}, ms);
|
|
423
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
async function withPollRetry(stage, poll, delays = POLL_RETRY_DELAYS_MS, signal) {
|
|
272
427
|
const totalAttempts = delays.length + 1;
|
|
273
428
|
const traceIds = [];
|
|
274
429
|
for (let attempt = 1;; attempt++) {
|
|
275
430
|
const [error, result] = await catchError2(poll());
|
|
276
431
|
if (!error)
|
|
277
432
|
return result;
|
|
278
|
-
if (!(error instanceof MaestroHttpError) || !isRetryablePollStatus(error.httpStatus)) {
|
|
433
|
+
if (signal?.aborted || !(error instanceof MaestroHttpError) || !isRetryablePollStatus(error.httpStatus)) {
|
|
279
434
|
throw error;
|
|
280
435
|
}
|
|
281
436
|
if (error.parsedTraceId)
|
|
@@ -287,7 +442,7 @@ async function withPollRetry(stage, poll, delays = POLL_RETRY_DELAYS_MS) {
|
|
|
287
442
|
throw error;
|
|
288
443
|
}
|
|
289
444
|
logger.warn(`${stage} returned HTTP ${error.httpStatus} (attempt ${attempt}/${totalAttempts}); retrying in ${retryDelay / 1000}s.`);
|
|
290
|
-
await
|
|
445
|
+
await waitOrAbort(retryDelay, signal);
|
|
291
446
|
}
|
|
292
447
|
}
|
|
293
448
|
|
|
@@ -295,12 +450,12 @@ async function withPollRetry(stage, poll, delays = POLL_RETRY_DELAYS_MS) {
|
|
|
295
450
|
var AGENT_TARGET_RUNTIME = "pythonAgent";
|
|
296
451
|
|
|
297
452
|
class FpsPropertiesInjectionError2 extends Error {
|
|
298
|
-
|
|
453
|
+
envelopeLength;
|
|
299
454
|
agentCount;
|
|
300
455
|
cause;
|
|
301
|
-
constructor(
|
|
302
|
-
super(`Cannot inject ${agentCount} inline agent(s): FpsProperties is not valid JSON.`);
|
|
303
|
-
this.
|
|
456
|
+
constructor(envelopeLength, agentCount, cause) {
|
|
457
|
+
super(cause instanceof Error ? cause.message : `Cannot inject ${agentCount} inline agent(s): FpsProperties is not valid JSON.`);
|
|
458
|
+
this.envelopeLength = envelopeLength;
|
|
304
459
|
this.agentCount = agentCount;
|
|
305
460
|
this.name = "FpsPropertiesInjectionError";
|
|
306
461
|
this.cause = cause;
|
|
@@ -326,11 +481,15 @@ function injectInlineAgentProcessEntries2(fpsProperties, inlineAgents, flowProje
|
|
|
326
481
|
}));
|
|
327
482
|
return appendProcessEntries(fpsProperties, entries, inlineAgents.length);
|
|
328
483
|
}
|
|
329
|
-
function injectSolutionProjectProcessEntries2(fpsProperties, solutionProjects) {
|
|
484
|
+
function injectSolutionProjectProcessEntries2(fpsProperties, solutionProjects, describedNames = jitProcessNames(fpsProperties)) {
|
|
330
485
|
if (!solutionProjects || solutionProjects.length === 0) {
|
|
331
486
|
return fpsProperties;
|
|
332
487
|
}
|
|
333
|
-
const
|
|
488
|
+
const undescribed = solutionProjects.filter((project) => !describedNames.has(project.name.toLowerCase()));
|
|
489
|
+
if (undescribed.length === 0) {
|
|
490
|
+
return fpsProperties;
|
|
491
|
+
}
|
|
492
|
+
const entries = undescribed.map((project) => ({
|
|
334
493
|
name: project.name,
|
|
335
494
|
projectType: project.projectType,
|
|
336
495
|
executorInfo: JSON.stringify(project.projectType === "BusinessRules" ? {
|
|
@@ -352,22 +511,16 @@ function injectSolutionProjectProcessEntries2(fpsProperties, solutionProjects) {
|
|
|
352
511
|
}
|
|
353
512
|
})
|
|
354
513
|
}));
|
|
355
|
-
return appendProcessEntries(fpsProperties, entries,
|
|
514
|
+
return appendProcessEntries(fpsProperties, entries, undescribed.length);
|
|
356
515
|
}
|
|
357
516
|
function appendProcessEntries(fpsProperties, entries, entryCount) {
|
|
358
517
|
try {
|
|
359
|
-
|
|
360
|
-
const masterRaw = outer["debug.master"];
|
|
361
|
-
const master = typeof masterRaw === "string" ? JSON.parse(masterRaw) : masterRaw ?? {};
|
|
362
|
-
const existing = Array.isArray(master.processes) ? master.processes : [];
|
|
363
|
-
master.processes = [...existing, ...entries];
|
|
364
|
-
outer["debug.master"] = JSON.stringify(master);
|
|
365
|
-
if (!("debug.source" in outer)) {
|
|
366
|
-
outer["debug.source"] = "studioweb";
|
|
367
|
-
}
|
|
368
|
-
return JSON.stringify(outer);
|
|
518
|
+
return mergeJitProcessEntries(fpsProperties, entries);
|
|
369
519
|
} catch (err) {
|
|
370
|
-
|
|
520
|
+
if (err instanceof JitAssemblyError && err.code === "MalformedFpsProperties") {
|
|
521
|
+
throw new FpsPropertiesInjectionError2((fpsProperties ?? "").length, entryCount, err);
|
|
522
|
+
}
|
|
523
|
+
throw err;
|
|
371
524
|
}
|
|
372
525
|
}
|
|
373
526
|
function extractStartEventId2(bpmnXml) {
|
|
@@ -414,7 +567,7 @@ class DebugProvisioningFailedError2 extends Error {
|
|
|
414
567
|
this.errors = errors;
|
|
415
568
|
}
|
|
416
569
|
}
|
|
417
|
-
var
|
|
570
|
+
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
418
571
|
async function waitForProjectProvisioning(config, solutionId, sessionId, timeoutMs, pollIntervalMs) {
|
|
419
572
|
const deadline = Date.now() + timeoutMs;
|
|
420
573
|
const path = `/api/v1/solutions/${encodeURIComponent(solutionId)}/projects/debug/status` + `?debugSessionId=${encodeURIComponent(sessionId)}`;
|
|
@@ -440,7 +593,7 @@ async function waitForProjectProvisioning(config, solutionId, sessionId, timeout
|
|
|
440
593
|
const remainingAfterPollMs = deadline - Date.now();
|
|
441
594
|
if (remainingAfterPollMs <= 0)
|
|
442
595
|
break;
|
|
443
|
-
await
|
|
596
|
+
await delay(Math.min(pollIntervalMs, remainingAfterPollMs));
|
|
444
597
|
}
|
|
445
598
|
throw new Error(`Timed out waiting for Studio Web resource provisioning after ${timeoutMs}ms.`);
|
|
446
599
|
}
|
|
@@ -471,7 +624,10 @@ async function prepareForCustomDebug2(params) {
|
|
|
471
624
|
};
|
|
472
625
|
}
|
|
473
626
|
async function getFolderInfoById2(config, folderId) {
|
|
474
|
-
const result = await orchestratorGet(config, `/odata/Folders(${folderId})`, "get-folder-by-id");
|
|
627
|
+
const [error, result] = await catchError2(orchestratorGet(config, `/odata/Folders(${folderId})`, "get-folder-by-id"));
|
|
628
|
+
if (error) {
|
|
629
|
+
return personalFolderById(config, folderId, error);
|
|
630
|
+
}
|
|
475
631
|
return {
|
|
476
632
|
key: result.Key,
|
|
477
633
|
id: result.Id,
|
|
@@ -480,8 +636,38 @@ async function getFolderInfoById2(config, folderId) {
|
|
|
480
636
|
parentKey: result.ParentKey
|
|
481
637
|
};
|
|
482
638
|
}
|
|
639
|
+
async function personalFolderById(config, folderId, notFound) {
|
|
640
|
+
if (!(notFound instanceof MaestroHttpError) || notFound.httpStatus !== 404) {
|
|
641
|
+
throw notFound;
|
|
642
|
+
}
|
|
643
|
+
const [error, personal] = await catchError2(getPersonalFolderInfo2(config));
|
|
644
|
+
if (error || personal.id !== folderId) {
|
|
645
|
+
throw notFound;
|
|
646
|
+
}
|
|
647
|
+
return personal;
|
|
648
|
+
}
|
|
649
|
+
var NO_PERSONAL_ROBOT_STATUS = 409;
|
|
650
|
+
var NO_PERSONAL_ROBOT_ERROR_CODE = "1230";
|
|
651
|
+
var BEGIN_SESSION_RETRY_DELAYS_MS = [2000, 5000];
|
|
652
|
+
var isNoPersonalRobot = (error) => error instanceof MaestroHttpError && error.httpStatus === NO_PERSONAL_ROBOT_STATUS && error.parsedErrorCode === NO_PERSONAL_ROBOT_ERROR_CODE;
|
|
653
|
+
async function postBeginSession(config, body) {
|
|
654
|
+
const totalAttempts = BEGIN_SESSION_RETRY_DELAYS_MS.length + 1;
|
|
655
|
+
for (let attempt = 1;; attempt++) {
|
|
656
|
+
const [error, result] = await catchError2(orchestratorPost(config, "/api/robotdebug/BeginSession", body, "begin-debug-session"));
|
|
657
|
+
if (!error)
|
|
658
|
+
return result;
|
|
659
|
+
if (!isNoPersonalRobot(error))
|
|
660
|
+
throw error;
|
|
661
|
+
const retryDelay = BEGIN_SESSION_RETRY_DELAYS_MS[attempt - 1];
|
|
662
|
+
if (retryDelay === undefined) {
|
|
663
|
+
throw error.recordAttempts(attempt, []);
|
|
664
|
+
}
|
|
665
|
+
logger.warn(`begin-debug-session returned HTTP 409 #1230 (attempt ${attempt}/${totalAttempts}); retrying in ${retryDelay / 1000}s.`);
|
|
666
|
+
await delay(retryDelay);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
483
669
|
async function beginDebugSession2(config, inputArguments = "{}", options) {
|
|
484
|
-
const fpsProperties = injectSolutionProjectProcessEntries2(injectInlineAgentProcessEntries2(options?.fpsProperties, options?.inlineAgents, options?.flowProjectId), options?.solutionProjects);
|
|
670
|
+
const fpsProperties = injectSolutionProjectProcessEntries2(injectInlineAgentProcessEntries2(options?.fpsProperties, options?.inlineAgents, options?.flowProjectId), options?.solutionProjects, jitProcessNames(options?.fpsProperties));
|
|
485
671
|
const body = {
|
|
486
672
|
JobsCount: 1,
|
|
487
673
|
JobPriority: null,
|
|
@@ -495,7 +681,7 @@ async function beginDebugSession2(config, inputArguments = "{}", options) {
|
|
|
495
681
|
InputArguments: inputArguments,
|
|
496
682
|
...fpsProperties ? { FpsProperties: fpsProperties } : {}
|
|
497
683
|
};
|
|
498
|
-
const result = await
|
|
684
|
+
const result = await postBeginSession(config, body);
|
|
499
685
|
if (!result.jobKey) {
|
|
500
686
|
throw new Error("BeginSession returned success but no jobKey was provided");
|
|
501
687
|
}
|
|
@@ -557,7 +743,7 @@ async function createDebugInstance2(config, jobKey, solutionId, studioWebProject
|
|
|
557
743
|
break;
|
|
558
744
|
}
|
|
559
745
|
logger.warn(`create-debug-instance returned HTTP ${error.httpStatus} (attempt ${attempt}/${totalAttempts}); retrying in ${retryDelay / 1000}s.`);
|
|
560
|
-
await
|
|
746
|
+
await delay(retryDelay);
|
|
561
747
|
}
|
|
562
748
|
if (!lastError) {
|
|
563
749
|
throw new Error("create-debug-instance failed without an error.");
|
|
@@ -588,13 +774,15 @@ class DebugPollTimeoutError2 extends Error {
|
|
|
588
774
|
jobKey;
|
|
589
775
|
lastStatus;
|
|
590
776
|
timeoutSeconds;
|
|
777
|
+
lastReadError;
|
|
591
778
|
constructor(details) {
|
|
592
|
-
super(`Debug polling timed out after ${details.timeoutSeconds}s — instance ${details.instanceId} was still "${details.lastStatus}" (not a terminal status)`);
|
|
779
|
+
super(`Debug polling timed out after ${details.timeoutSeconds}s — instance ${details.instanceId} was still "${details.lastStatus}" (not a terminal status)` + (details.lastReadError ? `. The last status read failed: ${details.lastReadError}` : ""));
|
|
593
780
|
this.name = "DebugPollTimeoutError";
|
|
594
781
|
this.instanceId = details.instanceId;
|
|
595
782
|
this.jobKey = details.jobKey;
|
|
596
783
|
this.lastStatus = details.lastStatus;
|
|
597
784
|
this.timeoutSeconds = details.timeoutSeconds;
|
|
785
|
+
this.lastReadError = details.lastReadError;
|
|
598
786
|
}
|
|
599
787
|
}
|
|
600
788
|
function buildPollTimeoutFailureOutput2(err, inspectCommand) {
|
|
@@ -614,15 +802,97 @@ function buildPollTimeoutFailureOutput2(err, inspectCommand) {
|
|
|
614
802
|
}
|
|
615
803
|
};
|
|
616
804
|
}
|
|
617
|
-
|
|
805
|
+
|
|
806
|
+
class DebugCancelledError2 extends Error {
|
|
807
|
+
jobKey;
|
|
808
|
+
instanceId;
|
|
809
|
+
constructor(details = {}) {
|
|
810
|
+
super(details.jobKey ? `The run was cancelled. Orchestrator job ${details.jobKey} may still be running.` : "The run was cancelled before the debug session started.");
|
|
811
|
+
this.name = "DebugCancelledError";
|
|
812
|
+
this.jobKey = details.jobKey;
|
|
813
|
+
this.instanceId = details.instanceId;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
function throwIfCancelled(signal, details) {
|
|
817
|
+
if (signal?.aborted) {
|
|
818
|
+
throw new DebugCancelledError2(details);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
var JOB_READ_TIMEOUT_MS = 30000;
|
|
822
|
+
function jobReadSignal(signal, deadline) {
|
|
823
|
+
const timeoutMs = deadline === undefined ? JOB_READ_TIMEOUT_MS : Math.max(0, Math.min(JOB_READ_TIMEOUT_MS, deadline - Date.now()));
|
|
824
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
825
|
+
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
826
|
+
}
|
|
827
|
+
function summarizeDebugIncidents(incidents) {
|
|
828
|
+
return incidents.map((inc) => {
|
|
829
|
+
const code = inc.errorCode ? `[${inc.errorCode}] ` : "";
|
|
830
|
+
const element = inc.elementId ? ` (element ${inc.elementId})` : "";
|
|
831
|
+
return `${code}${inc.errorMessage}${element}`;
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
function buildFaultedDebugFailureOutput2(run, options) {
|
|
835
|
+
const incidents = run.incidents ?? [];
|
|
836
|
+
const lines = summarizeDebugIncidents(incidents);
|
|
837
|
+
const inspect = options.inspectCommand ? `${options.inspectCommand} ${run.instanceId}` : undefined;
|
|
838
|
+
let Instructions;
|
|
839
|
+
if (incidents.length > 0) {
|
|
840
|
+
const detailHint = inspect ? `
|
|
841
|
+
Run '${inspect}' for the full backend payload (incidentId, errorDetails, AI summary).` : "";
|
|
842
|
+
const traceHint = incidents[0].traceId ? ` traceId=${incidents[0].traceId}.` : "";
|
|
843
|
+
Instructions = `Incident(s):
|
|
844
|
+
- ${lines.join(`
|
|
845
|
+
- `)}${detailHint}${traceHint}`;
|
|
846
|
+
} else if (inspect) {
|
|
847
|
+
const summaryHint = options.summaryCommand ? `, then '${options.summaryCommand}' to confirm whether the process recorded a tenant-level incident` : "";
|
|
848
|
+
Instructions = `Run '${inspect}' to inspect the backend payload${summaryHint}.`;
|
|
849
|
+
} else {
|
|
850
|
+
Instructions = "Open the run in Studio Web (Data.studioWebUrl) to see which element stopped it and why.";
|
|
851
|
+
}
|
|
852
|
+
const Context = {};
|
|
853
|
+
if (incidents[0]?.errorCode) {
|
|
854
|
+
Context.errorCode = incidents[0].errorCode;
|
|
855
|
+
}
|
|
856
|
+
if (incidents[0]?.traceId) {
|
|
857
|
+
Context.traceId = incidents[0].traceId;
|
|
858
|
+
}
|
|
859
|
+
return {
|
|
860
|
+
Result: RESULTS.Failure,
|
|
861
|
+
Code: options.code,
|
|
862
|
+
ErrorCode: "execution_failed",
|
|
863
|
+
Message: incidents.length ? `Debug session ${run.finalStatus}. ${lines[0]}` : `Debug session ${run.finalStatus}. No incident details returned by PIMS.`,
|
|
864
|
+
Instructions,
|
|
865
|
+
...Object.keys(Context).length > 0 ? { Context } : {},
|
|
866
|
+
Data: options.data
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
async function pollDebugInstanceStatus2(config, instanceId, callbacks, pollInterval = 2000, maxPolls = 300, jobKey, options) {
|
|
618
870
|
let pollCount = 0;
|
|
619
871
|
let lastStatus = "";
|
|
620
872
|
const canCheckOrchestratorJob = jobKey !== undefined && ORCHESTRATOR_JOB_KEY.test(jobKey);
|
|
621
873
|
if (jobKey !== undefined && !canCheckOrchestratorJob) {
|
|
622
874
|
logger.warn(`Skipping the Orchestrator job status fallback: "${jobKey}" is not a job key.`);
|
|
623
875
|
}
|
|
876
|
+
const signal = options?.signal;
|
|
624
877
|
while (pollCount < maxPolls) {
|
|
625
|
-
|
|
878
|
+
throwIfCancelled(signal, { jobKey, instanceId });
|
|
879
|
+
const [pollError, status] = await catchError2(withPollRetry("poll-instance-status", () => debugPimsGet(config, `/api/v1/debug-instances/${instanceId}/element-executions`, "poll-instance-status", signal ? { signal } : undefined), undefined, signal));
|
|
880
|
+
throwIfCancelled(signal, { jobKey, instanceId });
|
|
881
|
+
if (pollError) {
|
|
882
|
+
if (options?.followJobWhenForbidden && canCheckOrchestratorJob && jobKey !== undefined && pollError instanceof MaestroHttpError && pollError.httpStatus === 403) {
|
|
883
|
+
logger.warn("PIMS refused the element status of this run (403), so element progress is not " + `available. Following Orchestrator job ${jobKey} until it ends.`);
|
|
884
|
+
return followOrchestratorJob(config, {
|
|
885
|
+
instanceId,
|
|
886
|
+
jobKey,
|
|
887
|
+
callbacks,
|
|
888
|
+
pollInterval,
|
|
889
|
+
remainingPolls: maxPolls - pollCount,
|
|
890
|
+
timeoutSeconds: maxPolls * pollInterval / 1000,
|
|
891
|
+
signal
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
throw pollError;
|
|
895
|
+
}
|
|
626
896
|
if (status.status !== lastStatus) {
|
|
627
897
|
lastStatus = status.status;
|
|
628
898
|
const elementExecutions = status.elementExecutions.map((e) => ({
|
|
@@ -642,7 +912,8 @@ async function pollDebugInstanceStatus2(config, instanceId, callbacks, pollInter
|
|
|
642
912
|
return status;
|
|
643
913
|
}
|
|
644
914
|
if (canCheckOrchestratorJob && pollCount > 0 && pollCount % 5 === 0) {
|
|
645
|
-
const [, jobResponse] = await catchError2(orchestratorGet(config, `/odata/Jobs?$filter=Key eq ${jobKey}&$top=1`, "check-orchestrator-job-status"));
|
|
915
|
+
const [, jobResponse] = await catchError2(orchestratorGet(config, `/odata/Jobs?$filter=Key eq ${jobKey}&$top=1`, "check-orchestrator-job-status", { signal: jobReadSignal(signal) }));
|
|
916
|
+
throwIfCancelled(signal, { jobKey, instanceId });
|
|
646
917
|
const jobState = jobResponse?.value?.[0]?.State;
|
|
647
918
|
if (jobState && ORCHESTRATOR_TERMINAL_STATUSES.includes(jobState)) {
|
|
648
919
|
const jobInfo = jobResponse?.value?.[0]?.Info ?? "";
|
|
@@ -650,7 +921,7 @@ async function pollDebugInstanceStatus2(config, instanceId, callbacks, pollInter
|
|
|
650
921
|
return { ...status, status: jobState };
|
|
651
922
|
}
|
|
652
923
|
}
|
|
653
|
-
await
|
|
924
|
+
await waitOrAbort(pollInterval, signal);
|
|
654
925
|
pollCount++;
|
|
655
926
|
}
|
|
656
927
|
throw new DebugPollTimeoutError2({
|
|
@@ -660,6 +931,46 @@ async function pollDebugInstanceStatus2(config, instanceId, callbacks, pollInter
|
|
|
660
931
|
timeoutSeconds: maxPolls * pollInterval / 1000
|
|
661
932
|
});
|
|
662
933
|
}
|
|
934
|
+
var JOB_READ_FINAL_STATUSES = new Set([401, 403, 404]);
|
|
935
|
+
async function followOrchestratorJob(config, run) {
|
|
936
|
+
let lastState = "";
|
|
937
|
+
let lastReadError;
|
|
938
|
+
const deadline = Date.now() + run.remainingPolls * run.pollInterval;
|
|
939
|
+
for (let poll = 0;poll < run.remainingPolls && Date.now() < deadline; poll++) {
|
|
940
|
+
throwIfCancelled(run.signal, run);
|
|
941
|
+
const [readError, jobResponse] = await catchError2(orchestratorGet(config, `/odata/Jobs?$filter=Key eq ${run.jobKey}&$top=1`, "check-orchestrator-job-status", { signal: jobReadSignal(run.signal, deadline) }));
|
|
942
|
+
throwIfCancelled(run.signal, run);
|
|
943
|
+
if (readError instanceof MaestroHttpError && JOB_READ_FINAL_STATUSES.has(readError.httpStatus)) {
|
|
944
|
+
throw readError;
|
|
945
|
+
}
|
|
946
|
+
lastReadError = readError ? readError.message : undefined;
|
|
947
|
+
const state = jobResponse?.value?.[0]?.State;
|
|
948
|
+
if (state && state !== lastState) {
|
|
949
|
+
lastState = state;
|
|
950
|
+
run.callbacks?.onStatusChange?.(state, []);
|
|
951
|
+
}
|
|
952
|
+
if (state && ORCHESTRATOR_TERMINAL_STATUSES.includes(state)) {
|
|
953
|
+
const info = jobResponse?.value?.[0]?.Info ?? "";
|
|
954
|
+
logger.info(`Orchestrator job reached terminal status: ${state}${info ? ` — ${info}` : ""}`);
|
|
955
|
+
return {
|
|
956
|
+
instanceId: run.instanceId,
|
|
957
|
+
status: state,
|
|
958
|
+
startedTimeUtc: "",
|
|
959
|
+
completedTimeUtc: null,
|
|
960
|
+
traceId: null,
|
|
961
|
+
elementExecutions: []
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
await waitOrAbort(run.pollInterval, run.signal);
|
|
965
|
+
}
|
|
966
|
+
throw new DebugPollTimeoutError2({
|
|
967
|
+
instanceId: run.instanceId,
|
|
968
|
+
jobKey: run.jobKey,
|
|
969
|
+
lastStatus: lastState || "unknown",
|
|
970
|
+
timeoutSeconds: run.timeoutSeconds,
|
|
971
|
+
...lastReadError ? { lastReadError } : {}
|
|
972
|
+
});
|
|
973
|
+
}
|
|
663
974
|
async function fetchDebugInstanceIncidents2(config, instanceId) {
|
|
664
975
|
const result = await debugPimsGet(config, `/api/v1/debug-instances/${instanceId}/incidents`, "get-debug-instance-incidents");
|
|
665
976
|
return result ?? [];
|
|
@@ -741,7 +1052,7 @@ async function fetchDebugInstanceVariables2(config, instanceId, options) {
|
|
|
741
1052
|
break;
|
|
742
1053
|
}
|
|
743
1054
|
logger.warn(`fetch-output-variables failed (attempt ${attempt}/${totalAttempts}): ${lastMessage}; retrying in ${retryDelay / 1000}s.`);
|
|
744
|
-
await
|
|
1055
|
+
await delay(retryDelay);
|
|
745
1056
|
}
|
|
746
1057
|
throw new DebugVariablesFetchFailedError({
|
|
747
1058
|
message: lastMessage,
|
|
@@ -783,7 +1094,8 @@ function buildStudioWebDesignerUrl2(params) {
|
|
|
783
1094
|
return `${params.baseUrl}/${encodeURIComponent(params.organizationName)}` + `/studio_/designer/${encodeURIComponent(params.projectId)}` + `?solutionId=${encodeURIComponent(params.solutionId)}`;
|
|
784
1095
|
}
|
|
785
1096
|
async function uploadAndDebugSolution2(params) {
|
|
786
|
-
const { apiConfig } = params;
|
|
1097
|
+
const { apiConfig, signal } = params;
|
|
1098
|
+
throwIfCancelled(signal);
|
|
787
1099
|
logger.info("Uploading solution to Studio Web...");
|
|
788
1100
|
const importResult = await params.upload();
|
|
789
1101
|
const solutionId = importResult.id;
|
|
@@ -801,6 +1113,7 @@ async function uploadAndDebugSolution2(params) {
|
|
|
801
1113
|
logger.info(`Solution uploaded — solutionId: ${solutionId}, projectId: ${studioWebProjectId}`);
|
|
802
1114
|
logger.info(`Studio Web URL: ${studioWebUrl}`);
|
|
803
1115
|
params.callbacks?.onStudioWebUrl?.(studioWebUrl);
|
|
1116
|
+
throwIfCancelled(signal);
|
|
804
1117
|
const folder = params.folder ?? await getPersonalFolderKey2(apiConfig);
|
|
805
1118
|
apiConfig.folderKey = folder.key;
|
|
806
1119
|
apiConfig.organizationUnitId = folder.id;
|
|
@@ -852,18 +1165,21 @@ async function uploadAndDebugSolution2(params) {
|
|
|
852
1165
|
}
|
|
853
1166
|
logger.warn("Skipping prepareForCustomDebug — apiConfig.tenantId is not set. " + "Sub-jobs (api-workflow / agent / process orchestration) may fault with a missing debugSessionId.");
|
|
854
1167
|
}
|
|
1168
|
+
throwIfCancelled(signal);
|
|
855
1169
|
logger.info("Beginning debug session in Orchestrator...");
|
|
856
1170
|
const session = await beginDebugSession2(apiConfig, params.beginSessionPayload, {
|
|
857
1171
|
inlineAgents,
|
|
858
1172
|
flowProjectId: studioWebProjectId,
|
|
859
|
-
...solutionProjects ? { solutionProjects } : {}
|
|
1173
|
+
...solutionProjects ? { solutionProjects } : {},
|
|
1174
|
+
...params.fpsProperties ? { fpsProperties: params.fpsProperties } : {}
|
|
860
1175
|
});
|
|
861
1176
|
logger.info(`Debug session started — jobKey: ${session.jobKey}`);
|
|
1177
|
+
throwIfCancelled(signal, { jobKey: session.jobKey });
|
|
862
1178
|
logger.info("Creating debug instance in PIMS...");
|
|
863
1179
|
const debugInstance = await createDebugInstance2(apiConfig, session.jobKey, debugSolutionId, debugProjectId, params.entryPoint, params.projectType);
|
|
864
1180
|
logger.info(`Debug instance created — instanceId: ${debugInstance.instanceId}`);
|
|
865
1181
|
logger.info("Polling for completion...");
|
|
866
|
-
const finalResponse = await pollDebugInstanceStatus2(apiConfig, debugInstance.instanceId, params.callbacks, params.pollInterval, params.maxPolls, session.jobKey);
|
|
1182
|
+
const finalResponse = await pollDebugInstanceStatus2(apiConfig, debugInstance.instanceId, params.callbacks, params.pollInterval, params.maxPolls, session.jobKey, { followJobWhenForbidden: params.followJobWhenForbidden, signal });
|
|
867
1183
|
const terminalStatusAt = Date.now();
|
|
868
1184
|
const incidents = await resolveFaultIncidents2(apiConfig, debugInstance.instanceId, finalResponse.status);
|
|
869
1185
|
return {
|
|
@@ -938,6 +1254,6 @@ async function patchConnectionOverwrites2(config, organizationName, solutionId,
|
|
|
938
1254
|
return successCount;
|
|
939
1255
|
}
|
|
940
1256
|
|
|
941
|
-
export { FpsPropertiesInjectionError2, injectInlineAgentProcessEntries2, injectSolutionProjectProcessEntries2, extractStartEventId2, getPersonalFolderKey2, getPersonalFolderInfo2, DebugProvisioningFailedError2, prepareForCustomDebug2, getFolderInfoById2, beginDebugSession2, DEBUG_MODE_MAP2, SIMULATION_MODE_MAP2, createDebugInstance2, DebugPollTimeoutError2, buildPollTimeoutFailureOutput2, pollDebugInstanceStatus2, fetchDebugInstanceIncidents2, fetchDebugInstanceVariables2, isFaultedDebugStatus2, isSuccessfulDebugStatus2, resolveFaultIncidents2, buildStudioWebDesignerUrl2, uploadAndDebugSolution2, patchConnectionOverwrites2 };
|
|
1257
|
+
export { FpsPropertiesInjectionError2, injectInlineAgentProcessEntries2, injectSolutionProjectProcessEntries2, extractStartEventId2, getPersonalFolderKey2, getPersonalFolderInfo2, DebugProvisioningFailedError2, prepareForCustomDebug2, getFolderInfoById2, beginDebugSession2, DEBUG_MODE_MAP2, SIMULATION_MODE_MAP2, createDebugInstance2, DebugPollTimeoutError2, buildPollTimeoutFailureOutput2, DebugCancelledError2, buildFaultedDebugFailureOutput2, pollDebugInstanceStatus2, fetchDebugInstanceIncidents2, fetchDebugInstanceVariables2, isFaultedDebugStatus2, isSuccessfulDebugStatus2, resolveFaultIncidents2, buildStudioWebDesignerUrl2, uploadAndDebugSolution2, patchConnectionOverwrites2 };
|
|
942
1258
|
|
|
943
|
-
//# debugId=
|
|
1259
|
+
//# debugId=DC9ABFFE9F7D0D9964756E2164756E21
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
NugetPackager,
|
|
12
12
|
ProjectTool,
|
|
13
13
|
toolsFactoryRepository
|
|
14
|
-
} from "./packager-tool-
|
|
14
|
+
} from "./packager-tool-j1etnthk.js";
|
|
15
15
|
import {
|
|
16
16
|
roleDescriptionOf,
|
|
17
17
|
caseStageLabels,
|
|
@@ -138,7 +138,7 @@ var reconcileRoleBindings = (resources, roles) => {
|
|
|
138
138
|
var BINDINGS_FILE_NAME = "bindings_v2.json";
|
|
139
139
|
var ROLE_RESOURCE_KIND = "role";
|
|
140
140
|
var CASE_ROLE_RESOURCE_TYPE = "case-role";
|
|
141
|
-
async function describeCaseRoles(projectDir, fs) {
|
|
141
|
+
async function describeCaseRoles(projectDir, fs, options) {
|
|
142
142
|
const entries = await fs.readdir(projectDir);
|
|
143
143
|
const planName = findCasePlanFileName2(entries);
|
|
144
144
|
if (planName === undefined)
|
|
@@ -166,7 +166,7 @@ async function describeCaseRoles(projectDir, fs) {
|
|
|
166
166
|
const reconciled = reconcileRoleBindings(sidecar, roles);
|
|
167
167
|
const bound = roleBindingNames(reconciled.resources);
|
|
168
168
|
const unbound = roles.filter((role) => !bound.has(role.name));
|
|
169
|
-
if (unbound.length > 0) {
|
|
169
|
+
if (unbound.length > 0 && !options?.skipUnbound) {
|
|
170
170
|
const names = unbound.map((role) => `"${role.name}"`).join(", ");
|
|
171
171
|
return {
|
|
172
172
|
errors: [
|
|
@@ -178,8 +178,11 @@ async function describeCaseRoles(projectDir, fs) {
|
|
|
178
178
|
]
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
+
const deployed = roles.filter((role) => bound.has(role.name));
|
|
182
|
+
if (deployed.length === 0)
|
|
183
|
+
return {};
|
|
181
184
|
return {
|
|
182
|
-
specPatch:
|
|
185
|
+
specPatch: deployed.map(rolePatch),
|
|
183
186
|
...reconciled.changed && {
|
|
184
187
|
bindings: reconciled.resources
|
|
185
188
|
}
|
|
@@ -527,8 +530,10 @@ class CaseToolFactory2 {
|
|
|
527
530
|
async createAsync(logger, fileSystem) {
|
|
528
531
|
return new CaseTool(fileSystem, logger);
|
|
529
532
|
}
|
|
530
|
-
async describeResourcesAsync(projectDir, fileSystem) {
|
|
531
|
-
return describeCaseRoles(projectDir, fileSystem
|
|
533
|
+
async describeResourcesAsync(projectDir, fileSystem, context) {
|
|
534
|
+
return describeCaseRoles(projectDir, fileSystem, {
|
|
535
|
+
skipUnbound: context?.forDebug === true
|
|
536
|
+
});
|
|
532
537
|
}
|
|
533
538
|
}
|
|
534
539
|
|
|
@@ -536,4 +541,4 @@ class CaseToolFactory2 {
|
|
|
536
541
|
toolsFactoryRepository.registerProjectToolFactory(new CaseToolFactory2);
|
|
537
542
|
export { CasePlanFileNames2, casePlanSidecarName2, findCasePlanFileName2, resolveDeclaredFileName2, normalizeEntryPointPath2, entryPointBpmnNames2, misnamedEntryPointBpmn2, stagedMainEntryPoint2, stagedMainProblem2, buildCasePackageDescriptor2, registerCaseBpmnCompiler, readCasePlanTriggers2, withCasePlanDefaults2, casePlanDefaults2, CaseToolFactory2 };
|
|
538
543
|
|
|
539
|
-
//# debugId=
|
|
544
|
+
//# debugId=F51F3B5AF708742E64756E2164756E21
|