@uipath/maestro-tool 1.202.2 → 1.203.0-preview.180
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 +8 -0
- package/dist/THIRD-PARTY-NOTICES.md +83 -290
- package/dist/{authoring-818595dq.js → authoring-at68vr5g.js} +7 -5
- package/dist/{authoring-6r3wx3fa.js → authoring-sh284a0x.js} +3 -3
- package/dist/{authoring-61hqf5em.js → authoring-szfy0rh1.js} +5 -5
- package/dist/{binding-service-643e69bb.js → binding-service-8a05gy4k.js} +37 -29
- package/dist/{bpmn-action-type-validator-kx36sqhe.js → bpmn-action-type-validator-8kvyvvcf.js} +2 -2
- package/dist/bpmn-binding-resolver-5scq28mc.js +145 -0
- package/dist/{bpmn-branch-y1m9f10n.js → bpmn-branch-t12a7jvf.js} +50 -44
- package/dist/bpmn-format-service-ay6jd9he.js +69 -0
- package/dist/{bpmn-refresh-service-ew545y06.js → bpmn-refresh-service-ak1ctkwg.js} +4 -4
- package/dist/{bpmn-update-metadata-service-jhahhjab.js → bpmn-update-metadata-service-hqe4edze.js} +6 -5
- package/dist/{bpmn-validate-service-6z2dj8ac.js → bpmn-validate-service-48sfy3a2.js} +3 -3
- package/dist/{case-api-4mstfkzf.js → case-api-e3fmq685.js} +6 -6
- package/dist/case-bindings-service-nswc6v0v.js +240 -0
- package/dist/case-debug-studio-web-service-58gtqznh.js +135 -0
- package/dist/case-format-service-6s5e1ckk.js +84 -0
- package/dist/{case-pack-service-v7wtb0qt.js → case-pack-service-sg435he1.js} +62 -11
- package/dist/{case-validate-service-bnpaf0zt.js → case-validate-service-7s69shsa.js} +1424 -42
- package/dist/{connector-enrichment-service-scrqnke3.js → connector-enrichment-service-9rqr3esj.js} +27 -26
- package/dist/{connector-lookup-service-hnk08t3m.js → connector-lookup-service-pencasp9.js} +5 -5
- package/dist/{connector-service-581bhxaj.js → connector-service-k4cgcv2b.js} +224 -56
- package/dist/{connector-task-spec-y2tcthz5.js → connector-task-spec-13ex0x0m.js} +27 -26
- package/dist/{conversion-FQTRFHRX-03xh3xbp.js → conversion-FQTRFHRX-0y9br7gw.js} +6 -5
- package/dist/de-FGHEJRCI-gn4cf5gh.js +2697 -0
- package/dist/de-MUJPA4EB-dpg7t2rw.js +173 -0
- package/dist/{debug-conversation-trigger-nj04k7s2.js → debug-conversation-trigger-wgzjaasj.js} +17 -14
- package/dist/{debug-http-client-c4teyma3.js → debug-http-client-7dvbwp96.js} +2 -2
- package/dist/{debug-service-m5jdyz3q.js → debug-service-8cwxhgww.js} +3 -3
- package/dist/{edge-service-vv2yfsn4.js → edge-service-szpsaezp.js} +17 -14
- package/dist/{index-yqfqxh2r.js → embedded-file-reader-0sjt4nkj.js} +96 -16641
- package/dist/{en-TBNO2WUV-rfe87pgh.js → en-BWGKA5OE-1qkvb9rn.js} +2 -2
- package/dist/en-FBPVNKFN-dqt573xn.js +138 -0
- package/dist/en-TBNO2WUV-9nan43e5.js +1936 -0
- package/dist/{enrichment-service-a65qt7y1.js → enrichment-service-7n1tf75p.js} +4 -4
- package/dist/es-7SE7HX2X-8yh1aj2y.js +173 -0
- package/dist/es-KR3ZSNMP-0cszm2n3.js +2697 -0
- package/dist/es-MX-2MYFZU7X-3rek4r73.js +173 -0
- package/dist/es-MX-XXZJGC4R-b4fbwe9d.js +2697 -0
- package/dist/first-party-service-srxaftkn.js +27 -0
- package/dist/{flow-api-vqvvs0q2.js → flow-api-4vkpbmt3.js} +7 -7
- package/dist/{flow-debug-service-vd7bdyhg.js → flow-debug-service-9tad5ckh.js} +66 -41
- package/dist/{flow-eval-node-target-mve3v55h.js → flow-eval-node-target-g222rh2e.js} +22 -15
- package/dist/flow-eval-run-api-hashjgq1.js +13 -0
- package/dist/{flow-eval-run-service-rt9kg4wx.js → flow-eval-run-service-btghb02r.js} +109 -224
- package/dist/{flow-eval-service-ededh59n.js → flow-eval-service-ma5psrsd.js} +346 -302
- package/dist/{flow-init-service-4ve9tr0t.js → flow-init-service-662zhfd3.js} +22 -18
- package/dist/{flow-io-2dd3sx38.js → flow-io-3cqz0svg.js} +16 -13
- package/dist/{flow-migrate-service-nbe6et60.js → flow-migrate-service-ehx7nmsr.js} +18 -14
- package/dist/{flow-pack-service-b2n877d8.js → flow-pack-service-a3w3489r.js} +43 -35
- package/dist/flow-validate-service-02e21w4d.js +3555 -0
- package/dist/fr-MDFKNZ4C-h4a122k9.js +173 -0
- package/dist/fr-Y6NPVODW-q5ef3htr.js +2697 -0
- package/dist/{governance-fetcher-at165287.js → governance-fetcher-7vxmap1e.js} +5 -4
- package/dist/{headless-85f2cys0.js → headless-627q5my5.js} +42909 -1756
- package/dist/{hitl-service-xn1bt80z.js → hitl-service-fn94tk6z.js} +16 -13
- package/dist/{index-hfsfzg4k.js → index-3arytfxn.js} +6 -4
- package/dist/{index-d1yqqk6q.js → index-55cym5j7.js} +6 -4
- package/dist/{index-0j6xww0f.js → index-9f94yk28.js} +3 -3
- package/dist/{index-1kgxzh8x.js → index-fz4ttsde.js} +14 -2
- package/dist/index-gvwc29bb.js +16742 -0
- package/dist/{index-mkgrn150.js → index-j1azsfr5.js} +36 -33
- package/dist/index-kmp9fmhb.js +25 -0
- package/dist/{index-938ee96p.js → index-rtg24r4x.js} +1 -1
- package/dist/index-tzccx5ym.js +2961 -0
- package/dist/{index-acd6bpqc.js → index-ymsd3pyx.js} +12 -15
- package/dist/index.js +3 -3
- package/dist/{input-reader-1wda1a2v.js → input-reader-7pzkcw6t.js} +1 -1
- package/dist/{input-reader-svafwk7x.js → input-reader-j8rvde4z.js} +1 -1
- package/dist/ja-Q5PXKJ2V-tzf2rvz2.js +2697 -0
- package/dist/ja-UTQEAP34-8e0q6swp.js +173 -0
- package/dist/known-types-8dhhqk35.js +19 -0
- package/dist/ko-AXCHW2OK-askct7f6.js +173 -0
- package/dist/ko-AYBDSRZG-am0h0m2r.js +2697 -0
- package/dist/{maestro-automate-entry-gwntzkvj.js → maestro-automate-entry-jehpbg37.js} +2 -2
- package/dist/{maestro-debug-service-dvh7qbx8.js → maestro-debug-service-xhtszkrc.js} +10 -10
- package/dist/{maestro-pack-service-fam5zdm3.js → maestro-pack-service-fkkc5g3v.js} +12 -6
- package/dist/{node-ks3095fb.js → node-p4bde6qy.js} +2344 -376
- package/dist/node-service-frvz67y3.js +83 -0
- package/dist/{node-sync-service-zwvm30qg.js → node-sync-service-wa2t7c65.js} +14 -14
- package/dist/{packager-tool-me5q0naa.js → packager-tool-095jzn8v.js} +16 -6
- package/dist/{packager-tool-y5f2qhfe.js → packager-tool-19030vpg.js} +32 -2
- package/dist/{packager-tool-gtqkcj4x.js → packager-tool-2c1rbj85.js} +310 -13
- package/dist/packager-tool-2q1mffef.js +261 -0
- package/dist/{flow-validate-service-0hxf5080.js → packager-tool-2xrng5ff.js} +1956 -3065
- package/dist/{packager-tool-8dgxmjzx.js → packager-tool-30ky51ca.js} +6 -3
- package/dist/{packager-tool-d5mjdpbf.js → packager-tool-4r35ye9r.js} +5 -4
- package/dist/packager-tool-53w8skv5.js +262 -0
- package/dist/{packager-tool-db4jm1rz.js → packager-tool-56gcg9de.js} +1 -1
- package/dist/{packager-tool-29eg86w6.js → packager-tool-6rsegsby.js} +6 -7
- package/dist/packager-tool-7msx23gd.js +13 -0
- package/dist/packager-tool-7q6z6npd.js +1937 -0
- package/dist/packager-tool-8qp60s20.js +12 -0
- package/dist/{packager-tool-s1r7krkp.js → packager-tool-9pccpz3r.js} +1 -1
- package/dist/{packager-tool-m351tkkr.js → packager-tool-c95fhhys.js} +30 -8
- package/dist/{packager-tool-kg5sxneg.js → packager-tool-cmzzh4f8.js} +72 -73
- package/dist/{packager-tool-ffvmys2r.js → packager-tool-cr0z8cbj.js} +5 -5
- package/dist/{packager-tool-8fkt71n4.js → packager-tool-cs1ec1da.js} +4 -3
- package/dist/{packager-tool-xatnrtwp.js → packager-tool-d2813z49.js} +9 -9
- package/dist/packager-tool-d88rqwk8.js +135 -0
- package/dist/{packager-tool-pm3qh1hy.js → packager-tool-dh5nppv4.js} +1 -1
- package/dist/packager-tool-dqxz5v18.js +486 -0
- package/dist/{packager-tool-r87gxwqa.js → packager-tool-e87tzg4y.js} +2 -2
- package/dist/{packager-tool-w9fd7vzs.js → packager-tool-f33sg3vr.js} +9 -9
- package/dist/{packager-tool-cj2ka9jr.js → packager-tool-fer9mdsq.js} +2 -2
- package/dist/{packager-tool-70eh7rpg.js → packager-tool-fm67whdy.js} +23 -5
- package/dist/packager-tool-fq7wtkd3.js +21012 -0
- package/dist/packager-tool-fvm2dddf.js +6297 -0
- package/dist/packager-tool-gdtpsdn7.js +342 -0
- package/dist/{packager-tool-ejyeka5x.js → packager-tool-gpwec9sp.js} +2 -2
- package/dist/{packager-tool-pap09zfh.js → packager-tool-h8x54cvx.js} +1 -1
- package/dist/{packager-tool-9vh3df76.js → packager-tool-hdmhxdch.js} +7 -7
- package/dist/packager-tool-hnyecbk6.js +88 -0
- package/dist/{packager-tool-mtbak8t4.js → packager-tool-j00gcgbs.js} +2 -2
- package/dist/packager-tool-j78fwwhq.js +16 -0
- package/dist/packager-tool-jysvpt8p.js +11 -0
- package/dist/{packager-tool-jfv7t0c8.js → packager-tool-kb554twx.js} +94 -94
- package/dist/{packager-tool-k4x5yn3p.js → packager-tool-khm7zsm8.js} +4 -1
- package/dist/packager-tool-kj0qc4f4.js +269 -0
- package/dist/{packager-tool-12636p2y.js → packager-tool-mcjjj1hk.js} +4 -4
- package/dist/{packager-tool-bftjhmqz.js → packager-tool-mfrdmqmt.js} +124 -2
- package/dist/{packager-tool-qgh5yaeh.js → packager-tool-mj89jhvb.js} +1 -1
- package/dist/{packager-tool-ve35117x.js → packager-tool-mjz4hma1.js} +5791 -176
- package/dist/packager-tool-paq9c70w.js +1332 -0
- package/dist/{packager-tool-d8v984ah.js → packager-tool-q2gwvnf5.js} +15 -56
- package/dist/{packager-tool-nmznynbj.js → packager-tool-qff6ang6.js} +1 -1
- package/dist/{packager-tool-j79gbsee.js → packager-tool-rg5pkkf0.js} +6 -6
- package/dist/{packager-tool-7309ymg1.js → packager-tool-s1466723.js} +10 -13
- package/dist/{packager-tool-54b4v7wp.js → packager-tool-te6rrpsz.js} +205 -195
- package/dist/packager-tool-vcjq9xkc.js +1895 -0
- package/dist/{packager-tool-w20r6n9v.js → packager-tool-vck7ct1e.js} +2877 -2221
- package/dist/{packager-tool-e8td7b01.js → packager-tool-vdc8r21p.js} +10328 -16610
- package/dist/{packager-tool-nxw5yzs7.js → packager-tool-vqcnvaae.js} +1 -1
- package/dist/{packager-tool-7rz102fw.js → packager-tool-wd01egnx.js} +1 -1
- package/dist/{packager-tool-gxqd24n0.js → packager-tool-wger1vt9.js} +7 -7
- package/dist/{packager-tool-a6yfnjgx.js → packager-tool-wynrdnqj.js} +1 -1
- package/dist/packager-tool-x0eamrk4.js +104577 -0
- package/dist/packager-tool-x92czn5x.js +208 -0
- package/dist/{packager-tool-am67sn1c.js → packager-tool-xtkgeccn.js} +1 -1
- package/dist/packager-tool-y59jhapb.js +10369 -0
- package/dist/{packager-tool-317z6dc1.js → packager-tool-ydg78w9z.js} +23 -23
- package/dist/{packager-tool-rr8hveb9.js → packager-tool-ygrrb1zh.js} +1 -1
- package/dist/{packager-tool-f0kd5kq4.js → packager-tool-yrsrzz1a.js} +127 -12
- package/dist/{packager-tool-d9dpx9wn.js → packager-tool-z185rq2a.js} +1 -1
- package/dist/{packager-tool-79gws1zn.js → packager-tool-z6nkdv48.js} +270 -24
- package/dist/{packager-tool-802qm7jy.js → packager-tool-zzxt99e4.js} +3 -3
- package/dist/packager-tool.js +75 -218
- package/dist/{project-artifacts-9z7atbk7.js → project-artifacts-h5cydk2n.js} +1 -1
- package/dist/{project-validator-0rkrfmj0.js → project-validator-ek97s27p.js} +1 -1
- package/dist/pt-3DIO5QWG-59b3f4bc.js +173 -0
- package/dist/pt-BR-TKHNHMET-dn6zxk1d.js +2697 -0
- package/dist/pt-BR-Y6K6XHXK-mp3hwhw1.js +173 -0
- package/dist/pt-ROXU257Y-yd80gx6s.js +2697 -0
- package/dist/{resourcesSyncService-3pajvveg.js → resourcesSyncService-7s92g1hm.js} +28 -27
- package/dist/ro-AVAWPKOO-42m6am1w.js +2697 -0
- package/dist/ro-BWR3ONRR-vzx3hy8a.js +173 -0
- package/dist/ru-GSCT4ARZ-jrxwev63.js +10 -0
- package/dist/ru-WBLQ5B2U-s4em88p0.js +10 -0
- package/dist/sdd-lookup-7h7j2h6v.js +48 -0
- package/dist/{serialization-BXU6AKAN-dk0sqx89.js → serialization-BXU6AKAN-0ghhrsja.js} +6 -5
- package/dist/{shared-utils-twgpb9ax.js → shared-utils-6z7gnnc8.js} +1 -1
- package/dist/{strict-case-rules-zxnq80zm.js → strict-case-rules-byym8cvc.js} +141 -109
- package/dist/strict-sdd-audit-v156c9e3.js +2520 -0
- package/dist/tidy-service-zyy7wxc0.js +39 -0
- package/dist/{tool-pxfafj3m.js → tool-dejjyv8m.js} +213 -51
- package/dist/{tool-td30zmyt.js → tool-v0r5qzcc.js} +106 -146
- package/dist/tool.js +3 -3
- package/dist/tr-5IIHSFW5-hw4cewew.js +173 -0
- package/dist/tr-JMIP7ZSL-fb67ft9w.js +2696 -0
- package/dist/{trigger-enrichment-service-t3wcd12r.js → trigger-enrichment-service-ak1nrz5t.js} +30 -29
- package/dist/{variable-service-2q705dsx.js → variable-service-t9gsp8xs.js} +16 -13
- package/dist/{wait-for-flow-job-sx0ht8sb.js → wait-for-flow-job-1s8ka07s.js} +7 -7
- package/dist/{xml-949787yf.js → xml-3rzcgm9z.js} +1359 -659
- package/dist/zh-CN-IFFXSEJS-tke4mzty.js +2697 -0
- package/dist/zh-CN-R2KU4U5L-tc1hat59.js +173 -0
- package/dist/zh-TW-GNKMELBF-j674515r.js +173 -0
- package/dist/zh-TW-IYBNYAMG-wcan0qpb.js +2697 -0
- package/package.json +3 -2
- package/dist/bpmn-format-service-r67afbny.js +0 -477
- package/dist/case-debug-studio-web-service-kj1797m8.js +0 -336
- package/dist/known-types-eq32py2n.js +0 -20
- package/dist/node-service-teagjd9n.js +0 -75
- package/dist/packager-tool-15bstxb6.js +0 -4192
- package/dist/packager-tool-1zpm7wts.js +0 -7217
- package/dist/packager-tool-7tjxtpfp.js +0 -106
- package/dist/packager-tool-ckhyvcn5.js +0 -58
- package/dist/packager-tool-dz506qqq.js +0 -2120
- package/dist/packager-tool-hpc2j0zw.js +0 -27
- package/dist/packager-tool-jjpc0yka.js +0 -304
- package/dist/packager-tool-xtv236p7.js +0 -73
- package/dist/strict-sdd-audit-zc0n5vj6.js +0 -1024
- package/dist/tidy-service-hc9gex0v.js +0 -36
- /package/dist/{localization-xecwjpe2.js → localization-y790z9vm.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-tool",
|
|
3
|
+
"author": "UiPath",
|
|
3
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
4
|
-
"version": "1.
|
|
5
|
+
"version": "1.203.0-preview.180",
|
|
5
6
|
"description": "Create, debug, and run Maestro projects and jobs.",
|
|
6
7
|
"private": false,
|
|
7
8
|
"repository": {
|
|
@@ -27,5 +28,5 @@
|
|
|
27
28
|
"files": [
|
|
28
29
|
"dist"
|
|
29
30
|
],
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "4e0a51e3ab2c9d89afd3d35a7b087a7fa58133a0"
|
|
31
32
|
}
|
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseBpmnFile
|
|
3
|
-
} from "./packager-tool-xtv236p7.js";
|
|
4
|
-
import {
|
|
5
|
-
OutputFormatter,
|
|
6
|
-
RESULTS,
|
|
7
|
-
catchError
|
|
8
|
-
} from "./packager-tool-79gws1zn.js";
|
|
9
|
-
import {
|
|
10
|
-
getFileSystem
|
|
11
|
-
} from "./packager-tool-0v3s8r01.js";
|
|
12
|
-
import"./packager-tool-1yh8g550.js";
|
|
13
|
-
|
|
14
|
-
// src/services/bpmn-layout.ts
|
|
15
|
-
var BPMN_DI_NAMESPACES = {
|
|
16
|
-
"xmlns:bpmndi": "http://www.omg.org/spec/BPMN/20100524/DI",
|
|
17
|
-
"xmlns:dc": "http://www.omg.org/spec/DD/20100524/DC",
|
|
18
|
-
"xmlns:di": "http://www.omg.org/spec/DD/20100524/DI"
|
|
19
|
-
};
|
|
20
|
-
var X_START = 160;
|
|
21
|
-
var Y_START = 100;
|
|
22
|
-
var H_GAP = 60;
|
|
23
|
-
var V_GAP = 30;
|
|
24
|
-
var SUB_PROCESS_PADDING_X = 40;
|
|
25
|
-
var SUB_PROCESS_PADDING_Y = 40;
|
|
26
|
-
var SUB_PROCESS_PADDING_TOP = 60;
|
|
27
|
-
var SUB_PROCESS_MIN_WIDTH = 350;
|
|
28
|
-
var SUB_PROCESS_MIN_HEIGHT = 200;
|
|
29
|
-
var SUB_PROCESS_COLLAPSED_WIDTH = 100;
|
|
30
|
-
var SUB_PROCESS_COLLAPSED_HEIGHT = 80;
|
|
31
|
-
var DIAGRAM_CLOSE_TAG = "</bpmndi:BPMNDiagram>";
|
|
32
|
-
var EVENT_TYPES = new Set([
|
|
33
|
-
"bpmn:StartEvent",
|
|
34
|
-
"bpmn:EndEvent",
|
|
35
|
-
"bpmn:IntermediateThrowEvent",
|
|
36
|
-
"bpmn:IntermediateCatchEvent",
|
|
37
|
-
"bpmn:BoundaryEvent"
|
|
38
|
-
]);
|
|
39
|
-
var GATEWAY_TYPES = new Set([
|
|
40
|
-
"bpmn:ExclusiveGateway",
|
|
41
|
-
"bpmn:ParallelGateway",
|
|
42
|
-
"bpmn:InclusiveGateway",
|
|
43
|
-
"bpmn:EventBasedGateway",
|
|
44
|
-
"bpmn:ComplexGateway"
|
|
45
|
-
]);
|
|
46
|
-
var SKIP_TYPES = new Set([
|
|
47
|
-
"bpmn:SequenceFlow",
|
|
48
|
-
"bpmn:DataObject",
|
|
49
|
-
"bpmn:Association"
|
|
50
|
-
]);
|
|
51
|
-
var ARTIFACT_TYPES = new Set([
|
|
52
|
-
"bpmn:DataObjectReference",
|
|
53
|
-
"bpmn:DataStoreReference",
|
|
54
|
-
"bpmn:TextAnnotation",
|
|
55
|
-
"bpmn:Group"
|
|
56
|
-
]);
|
|
57
|
-
var SUB_PROCESS_TYPES = new Set([
|
|
58
|
-
"bpmn:SubProcess",
|
|
59
|
-
"bpmn:Transaction",
|
|
60
|
-
"bpmn:AdHocSubProcess"
|
|
61
|
-
]);
|
|
62
|
-
function escapeXmlAttr(value) {
|
|
63
|
-
return value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">");
|
|
64
|
-
}
|
|
65
|
-
function ensureDiNamespaces(xml) {
|
|
66
|
-
let result = xml;
|
|
67
|
-
for (const [attr, uri] of Object.entries(BPMN_DI_NAMESPACES)) {
|
|
68
|
-
if (!result.includes(`${attr}=`)) {
|
|
69
|
-
result = result.replace(/(<bpmn:definitions\b[^>]*)(\/?>)/, (_, p1, p2) => `${p1} ${attr}="${uri}"${p2}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
function tryConsumeComment(xml, start, state) {
|
|
75
|
-
if (state.noMoreCommentClose)
|
|
76
|
-
return { handled: false, end: start };
|
|
77
|
-
const closeIdx = xml.indexOf("-->", start + 4);
|
|
78
|
-
if (closeIdx === -1) {
|
|
79
|
-
state.noMoreCommentClose = true;
|
|
80
|
-
return { handled: false, end: start };
|
|
81
|
-
}
|
|
82
|
-
return { handled: true, end: closeIdx + 3 };
|
|
83
|
-
}
|
|
84
|
-
function tryConsumeDiagramBlock(xml, start, state) {
|
|
85
|
-
const tagEnd = state.noMoreAngleBracket ? -1 : xml.indexOf(">", start);
|
|
86
|
-
if (tagEnd === -1) {
|
|
87
|
-
state.noMoreAngleBracket = true;
|
|
88
|
-
return { handled: false, end: start };
|
|
89
|
-
}
|
|
90
|
-
if (xml[tagEnd - 1] === "/")
|
|
91
|
-
return { handled: true, end: tagEnd + 1 };
|
|
92
|
-
if (state.noMoreDiagramClose)
|
|
93
|
-
return { handled: false, end: start };
|
|
94
|
-
const closeIdx = xml.indexOf(DIAGRAM_CLOSE_TAG, tagEnd + 1);
|
|
95
|
-
if (closeIdx === -1) {
|
|
96
|
-
state.noMoreDiagramClose = true;
|
|
97
|
-
return { handled: false, end: start };
|
|
98
|
-
}
|
|
99
|
-
return { handled: true, end: closeIdx + DIAGRAM_CLOSE_TAG.length };
|
|
100
|
-
}
|
|
101
|
-
function removeExistingDiagram(xml) {
|
|
102
|
-
const marker = /<!--|<bpmndi:BPMNDiagram\b/g;
|
|
103
|
-
let result = "";
|
|
104
|
-
let cursor = 0;
|
|
105
|
-
let match = marker.exec(xml);
|
|
106
|
-
const state = {
|
|
107
|
-
noMoreCommentClose: false,
|
|
108
|
-
noMoreAngleBracket: false,
|
|
109
|
-
noMoreDiagramClose: false
|
|
110
|
-
};
|
|
111
|
-
while (match !== null) {
|
|
112
|
-
const start = match.index;
|
|
113
|
-
const isComment = match[0] === "<!--";
|
|
114
|
-
const outcome = isComment ? tryConsumeComment(xml, start, state) : tryConsumeDiagramBlock(xml, start, state);
|
|
115
|
-
if (!outcome.handled) {
|
|
116
|
-
marker.lastIndex = start + 1;
|
|
117
|
-
match = marker.exec(xml);
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (isComment) {
|
|
121
|
-
result += xml.slice(cursor, outcome.end);
|
|
122
|
-
} else {
|
|
123
|
-
let wsStart = start;
|
|
124
|
-
while (wsStart > cursor && /\s/.test(xml[wsStart - 1]))
|
|
125
|
-
wsStart--;
|
|
126
|
-
result += xml.slice(cursor, wsStart);
|
|
127
|
-
}
|
|
128
|
-
cursor = outcome.end;
|
|
129
|
-
marker.lastIndex = cursor;
|
|
130
|
-
match = marker.exec(xml);
|
|
131
|
-
}
|
|
132
|
-
return result + xml.slice(cursor);
|
|
133
|
-
}
|
|
134
|
-
var NODE_DIMS = new Map([
|
|
135
|
-
["bpmn:DataObjectReference", { w: 36, h: 50 }],
|
|
136
|
-
["bpmn:DataStoreReference", { w: 50, h: 50 }],
|
|
137
|
-
["bpmn:TextAnnotation", { w: 100, h: 80 }],
|
|
138
|
-
["bpmn:Group", { w: 300, h: 300 }]
|
|
139
|
-
]);
|
|
140
|
-
function nodeDims(type) {
|
|
141
|
-
if (EVENT_TYPES.has(type))
|
|
142
|
-
return { w: 36, h: 36 };
|
|
143
|
-
if (GATEWAY_TYPES.has(type))
|
|
144
|
-
return { w: 50, h: 50 };
|
|
145
|
-
return NODE_DIMS.get(type) ?? { w: 100, h: 80 };
|
|
146
|
-
}
|
|
147
|
-
function isSubProcess(element) {
|
|
148
|
-
return element.$instanceOf?.("bpmn:SubProcess") === true || SUB_PROCESS_TYPES.has(element.$type ?? "");
|
|
149
|
-
}
|
|
150
|
-
function buildAdjacencyList(nodes, flows) {
|
|
151
|
-
const adj = new Map;
|
|
152
|
-
for (const [, { src, tgt }] of flows) {
|
|
153
|
-
if (nodes.has(src) && nodes.has(tgt)) {
|
|
154
|
-
if (!adj.has(src))
|
|
155
|
-
adj.set(src, []);
|
|
156
|
-
adj.get(src)?.push(tgt);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return adj;
|
|
160
|
-
}
|
|
161
|
-
function computeBfsLevels(nodes, adj) {
|
|
162
|
-
const levels = new Map;
|
|
163
|
-
const queue = [];
|
|
164
|
-
const startIds = [...nodes.keys()].filter((id) => nodes.get(id)?.type === "bpmn:StartEvent").sort((a, b) => a.localeCompare(b));
|
|
165
|
-
if (startIds.length === 0) {
|
|
166
|
-
const fallback = [...nodes.keys()].sort((a, b) => a.localeCompare(b))[0];
|
|
167
|
-
if (fallback)
|
|
168
|
-
startIds.push(fallback);
|
|
169
|
-
}
|
|
170
|
-
for (const startId of startIds) {
|
|
171
|
-
levels.set(startId, 0);
|
|
172
|
-
queue.push(startId);
|
|
173
|
-
}
|
|
174
|
-
let queueIndex = 0;
|
|
175
|
-
while (queueIndex < queue.length) {
|
|
176
|
-
const current = queue[queueIndex++];
|
|
177
|
-
const children = (adj.get(current) ?? []).slice().sort((a, b) => a.localeCompare(b));
|
|
178
|
-
for (const next of children) {
|
|
179
|
-
if (!levels.has(next)) {
|
|
180
|
-
levels.set(next, (levels.get(current) ?? 0) + 1);
|
|
181
|
-
queue.push(next);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
let maxLevel = Math.max(0, ...levels.values());
|
|
186
|
-
for (const id of [...nodes.keys()].sort((a, b) => a.localeCompare(b))) {
|
|
187
|
-
if (!levels.has(id))
|
|
188
|
-
levels.set(id, ++maxLevel);
|
|
189
|
-
}
|
|
190
|
-
return levels;
|
|
191
|
-
}
|
|
192
|
-
function groupByLevel(levels) {
|
|
193
|
-
const byLevel = new Map;
|
|
194
|
-
for (const [id, level] of levels) {
|
|
195
|
-
if (!byLevel.has(level))
|
|
196
|
-
byLevel.set(level, []);
|
|
197
|
-
byLevel.get(level)?.push(id);
|
|
198
|
-
}
|
|
199
|
-
for (const ids of byLevel.values())
|
|
200
|
-
ids.sort((a, b) => a.localeCompare(b));
|
|
201
|
-
return byLevel;
|
|
202
|
-
}
|
|
203
|
-
function computeXByLevel(byLevel, dimsFor) {
|
|
204
|
-
const xByLevel = new Map;
|
|
205
|
-
let x = X_START;
|
|
206
|
-
for (const level of [...byLevel.keys()].sort((a, b) => a - b)) {
|
|
207
|
-
xByLevel.set(level, x);
|
|
208
|
-
const ids = byLevel.get(level) ?? [];
|
|
209
|
-
const maxWidth = Math.max(...ids.map((id) => dimsFor(id).w));
|
|
210
|
-
x += maxWidth + H_GAP;
|
|
211
|
-
}
|
|
212
|
-
return xByLevel;
|
|
213
|
-
}
|
|
214
|
-
function computeLayout(nodes, flows, artifacts, sizeOverrides) {
|
|
215
|
-
const dimsFor = (id) => sizeOverrides.get(id) ?? nodeDims(nodes.get(id)?.type ?? "");
|
|
216
|
-
const levels = computeBfsLevels(nodes, buildAdjacencyList(nodes, flows));
|
|
217
|
-
const byLevel = groupByLevel(levels);
|
|
218
|
-
const xByLevel = computeXByLevel(byLevel, dimsFor);
|
|
219
|
-
const positions = new Map;
|
|
220
|
-
for (const level of [...byLevel.keys()].sort((a, b) => a - b)) {
|
|
221
|
-
const ids = byLevel.get(level) ?? [];
|
|
222
|
-
const maxHeight = Math.max(...ids.map((id) => dimsFor(id).h));
|
|
223
|
-
const levelX = xByLevel.get(level) ?? X_START;
|
|
224
|
-
let y = Y_START;
|
|
225
|
-
for (const id of ids) {
|
|
226
|
-
const { w, h } = dimsFor(id);
|
|
227
|
-
positions.set(id, { x: levelX, y, w, h });
|
|
228
|
-
y += maxHeight + V_GAP;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (artifacts.size > 0) {
|
|
232
|
-
const bottom = [...positions.values()].reduce((maxY, position) => Math.max(maxY, position.y + position.h), Y_START);
|
|
233
|
-
let artifactX = X_START;
|
|
234
|
-
const artifactY = bottom + V_GAP * 2;
|
|
235
|
-
for (const [id, artifact] of [...artifacts.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
236
|
-
const { w, h } = nodeDims(artifact.type);
|
|
237
|
-
positions.set(id, { x: artifactX, y: artifactY, w, h });
|
|
238
|
-
artifactX += w + H_GAP;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return positions;
|
|
242
|
-
}
|
|
243
|
-
function dockPoint(box, peer) {
|
|
244
|
-
const cx = box.x + Math.floor(box.w / 2);
|
|
245
|
-
const cy = box.y + Math.floor(box.h / 2);
|
|
246
|
-
if (peer.x >= box.x + box.w)
|
|
247
|
-
return { x: box.x + box.w, y: cy };
|
|
248
|
-
if (peer.x + peer.w <= box.x)
|
|
249
|
-
return { x: box.x, y: cy };
|
|
250
|
-
const dy = peer.y + Math.floor(peer.h / 2) - cy;
|
|
251
|
-
return { x: cx, y: dy > 0 ? box.y + box.h : box.y };
|
|
252
|
-
}
|
|
253
|
-
function buildPlaneXml(diagramIndex, positions, nodes, flows, scopeId, expanded) {
|
|
254
|
-
const lines = [
|
|
255
|
-
` <bpmndi:BPMNDiagram id="Diagram_${diagramIndex}">`,
|
|
256
|
-
` <bpmndi:BPMNPlane id="Plane_${diagramIndex}" bpmnElement="${escapeXmlAttr(scopeId)}">`
|
|
257
|
-
];
|
|
258
|
-
for (const [id, { x, y, w, h }] of [...positions.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
259
|
-
const safeId = escapeXmlAttr(id);
|
|
260
|
-
const expandedAttr = expanded.has(id) ? ' isExpanded="true"' : "";
|
|
261
|
-
lines.push(` <bpmndi:BPMNShape id="S_${safeId}" bpmnElement="${safeId}"${expandedAttr}>` + `<dc:Bounds x="${x}" y="${y}" width="${w}" height="${h}" />` + `</bpmndi:BPMNShape>`);
|
|
262
|
-
}
|
|
263
|
-
for (const [flowId, { src, tgt }] of [...flows.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
264
|
-
if (!nodes.has(src) || !nodes.has(tgt))
|
|
265
|
-
continue;
|
|
266
|
-
const source = positions.get(src);
|
|
267
|
-
const target = positions.get(tgt);
|
|
268
|
-
if (!source || !target)
|
|
269
|
-
continue;
|
|
270
|
-
const { x: sourceX, y: sourceY } = dockPoint(source, target);
|
|
271
|
-
const { x: targetX, y: targetY } = dockPoint(target, source);
|
|
272
|
-
const safeFlowId = escapeXmlAttr(flowId);
|
|
273
|
-
lines.push(` <bpmndi:BPMNEdge id="E_${safeFlowId}" bpmnElement="${safeFlowId}">` + `<di:waypoint x="${sourceX}" y="${sourceY}" />` + `<di:waypoint x="${targetX}" y="${targetY}" />` + `</bpmndi:BPMNEdge>`);
|
|
274
|
-
}
|
|
275
|
-
lines.push(" </bpmndi:BPMNPlane>", " </bpmndi:BPMNDiagram>");
|
|
276
|
-
return lines.join(`
|
|
277
|
-
`);
|
|
278
|
-
}
|
|
279
|
-
function collectNodesAndFlows(scope) {
|
|
280
|
-
const nodes = new Map;
|
|
281
|
-
const artifacts = new Map;
|
|
282
|
-
const flows = new Map;
|
|
283
|
-
const addArtifact = (element) => {
|
|
284
|
-
if (!element.id || !element.$type)
|
|
285
|
-
return false;
|
|
286
|
-
if (!ARTIFACT_TYPES.has(element.$type))
|
|
287
|
-
return false;
|
|
288
|
-
artifacts.set(element.id, { type: element.$type });
|
|
289
|
-
return true;
|
|
290
|
-
};
|
|
291
|
-
for (const element of scope.flowElements ?? []) {
|
|
292
|
-
if (!element.id || !element.$type)
|
|
293
|
-
continue;
|
|
294
|
-
if (element.$type === "bpmn:SequenceFlow") {
|
|
295
|
-
const src = element.sourceRef?.id;
|
|
296
|
-
const tgt = element.targetRef?.id;
|
|
297
|
-
if (src && tgt)
|
|
298
|
-
flows.set(element.id, { src, tgt });
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
if (addArtifact(element))
|
|
302
|
-
continue;
|
|
303
|
-
if (SKIP_TYPES.has(element.$type))
|
|
304
|
-
continue;
|
|
305
|
-
nodes.set(element.id, { type: element.$type });
|
|
306
|
-
}
|
|
307
|
-
for (const element of scope.artifacts ?? []) {
|
|
308
|
-
addArtifact(element);
|
|
309
|
-
}
|
|
310
|
-
return { nodes, artifacts, flows };
|
|
311
|
-
}
|
|
312
|
-
function collectScopeTree(scope, scopeId) {
|
|
313
|
-
const children = new Map;
|
|
314
|
-
for (const element of scope.flowElements ?? []) {
|
|
315
|
-
if (isSubProcess(element) && element.id) {
|
|
316
|
-
children.set(element.id, collectScopeTree(element, element.id));
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return { scopeId, ...collectNodesAndFlows(scope), children };
|
|
320
|
-
}
|
|
321
|
-
function layoutScopeTree(tree) {
|
|
322
|
-
const childLayouts = new Map;
|
|
323
|
-
const sizeOverrides = new Map;
|
|
324
|
-
const expanded = new Set;
|
|
325
|
-
for (const [subId, subTree] of tree.children) {
|
|
326
|
-
const laid = layoutScopeTree(subTree);
|
|
327
|
-
childLayouts.set(subId, laid);
|
|
328
|
-
sizeOverrides.set(subId, laid.size);
|
|
329
|
-
for (const id of laid.expanded)
|
|
330
|
-
expanded.add(id);
|
|
331
|
-
}
|
|
332
|
-
const positions = computeLayout(tree.nodes, tree.flows, tree.artifacts, sizeOverrides);
|
|
333
|
-
const flows = new Map(tree.flows);
|
|
334
|
-
for (const [subId, laid] of childLayouts) {
|
|
335
|
-
if (laid.positions.size === 0)
|
|
336
|
-
continue;
|
|
337
|
-
const box = positions.get(subId);
|
|
338
|
-
if (!box) {
|
|
339
|
-
throw new Error(`sub-process ${subId} was not positioned`);
|
|
340
|
-
}
|
|
341
|
-
expanded.add(subId);
|
|
342
|
-
const minX = Math.min(...[...laid.positions.values()].map((p) => p.x));
|
|
343
|
-
const minY = Math.min(...[...laid.positions.values()].map((p) => p.y));
|
|
344
|
-
for (const [id, p] of laid.positions) {
|
|
345
|
-
positions.set(id, {
|
|
346
|
-
...p,
|
|
347
|
-
x: box.x + SUB_PROCESS_PADDING_X + (p.x - minX),
|
|
348
|
-
y: box.y + SUB_PROCESS_PADDING_TOP + (p.y - minY)
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
for (const [flowId, flow] of laid.flows)
|
|
352
|
-
flows.set(flowId, flow);
|
|
353
|
-
}
|
|
354
|
-
return { positions, flows, size: subProcessSize(positions), expanded };
|
|
355
|
-
}
|
|
356
|
-
function subProcessSize(positions) {
|
|
357
|
-
const all = [...positions.values()];
|
|
358
|
-
if (all.length === 0) {
|
|
359
|
-
return {
|
|
360
|
-
w: SUB_PROCESS_COLLAPSED_WIDTH,
|
|
361
|
-
h: SUB_PROCESS_COLLAPSED_HEIGHT
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
const fitted = {
|
|
365
|
-
w: Math.max(...all.map((p) => p.x + p.w)) - Math.min(...all.map((p) => p.x)) + SUB_PROCESS_PADDING_X * 2,
|
|
366
|
-
h: Math.max(...all.map((p) => p.y + p.h)) - Math.min(...all.map((p) => p.y)) + SUB_PROCESS_PADDING_TOP + SUB_PROCESS_PADDING_Y
|
|
367
|
-
};
|
|
368
|
-
return {
|
|
369
|
-
w: Math.max(fitted.w, SUB_PROCESS_MIN_WIDTH),
|
|
370
|
-
h: Math.max(fitted.h, SUB_PROCESS_MIN_HEIGHT)
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
function generateBpmnLayout(xml, processes) {
|
|
374
|
-
const trees = processes.map((process, index) => collectScopeTree(process, process.id ?? `Process_${index + 1}`));
|
|
375
|
-
const flatten = (tree) => {
|
|
376
|
-
const nodes = new Map(tree.nodes);
|
|
377
|
-
const artifacts = new Map(tree.artifacts);
|
|
378
|
-
for (const child of tree.children.values()) {
|
|
379
|
-
const flat = flatten(child);
|
|
380
|
-
for (const [id, value] of flat.nodes)
|
|
381
|
-
nodes.set(id, value);
|
|
382
|
-
for (const [id, value] of flat.artifacts)
|
|
383
|
-
artifacts.set(id, value);
|
|
384
|
-
}
|
|
385
|
-
return { nodes, artifacts };
|
|
386
|
-
};
|
|
387
|
-
const flattened = trees.map(flatten);
|
|
388
|
-
if (flattened.reduce((sum, flat) => sum + flat.nodes.size, 0) === 0) {
|
|
389
|
-
return {
|
|
390
|
-
success: false,
|
|
391
|
-
message: "No flow nodes found in bpmn:process",
|
|
392
|
-
instructions: "The BPMN process must contain at least one flow node."
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
let shapeCount = 0;
|
|
396
|
-
let edgeCount = 0;
|
|
397
|
-
const diagrams = [];
|
|
398
|
-
for (const [index, tree] of trees.entries()) {
|
|
399
|
-
const { nodes: allNodes, artifacts } = flattened[index];
|
|
400
|
-
if (allNodes.size === 0 && artifacts.size === 0)
|
|
401
|
-
continue;
|
|
402
|
-
const { positions, flows, expanded } = layoutScopeTree(tree);
|
|
403
|
-
diagrams.push(buildPlaneXml(diagrams.length + 1, positions, allNodes, flows, tree.scopeId, expanded));
|
|
404
|
-
shapeCount += positions.size;
|
|
405
|
-
edgeCount += [...flows.values()].filter(({ src, tgt }) => allNodes.has(src) && allNodes.has(tgt)).length;
|
|
406
|
-
}
|
|
407
|
-
let content = ensureDiNamespaces(removeExistingDiagram(xml));
|
|
408
|
-
const closeTag = "</bpmn:definitions>";
|
|
409
|
-
if (!content.includes(closeTag)) {
|
|
410
|
-
return {
|
|
411
|
-
success: false,
|
|
412
|
-
message: `Missing ${closeTag} in file`,
|
|
413
|
-
instructions: "The BPMN file must end with </bpmn:definitions>."
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
content = content.replace(closeTag, `
|
|
417
|
-
${diagrams.join(`
|
|
418
|
-
`)}
|
|
419
|
-
${closeTag}`);
|
|
420
|
-
return { success: true, content, shapeCount, edgeCount };
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
// src/services/bpmn-format-service.ts
|
|
424
|
-
class BpmnFormatService {
|
|
425
|
-
fs;
|
|
426
|
-
constructor(fs = getFileSystem()) {
|
|
427
|
-
this.fs = fs;
|
|
428
|
-
}
|
|
429
|
-
async execute(bpmnPath, outPath) {
|
|
430
|
-
const [error, exitCode] = await catchError(this.formatDiagram(bpmnPath, outPath));
|
|
431
|
-
if (error) {
|
|
432
|
-
OutputFormatter.error({
|
|
433
|
-
Result: RESULTS.Failure,
|
|
434
|
-
Message: "format failed",
|
|
435
|
-
Instructions: error.message
|
|
436
|
-
});
|
|
437
|
-
return 1;
|
|
438
|
-
}
|
|
439
|
-
return exitCode ?? 0;
|
|
440
|
-
}
|
|
441
|
-
async formatDiagram(bpmnPath, outPath) {
|
|
442
|
-
const bpmn = await parseBpmnFile(this.fs, bpmnPath);
|
|
443
|
-
if (!bpmn)
|
|
444
|
-
return 1;
|
|
445
|
-
const layout = generateBpmnLayout(bpmn.xml, bpmn.processes);
|
|
446
|
-
if (!layout.success) {
|
|
447
|
-
OutputFormatter.error({
|
|
448
|
-
Result: RESULTS.Failure,
|
|
449
|
-
Message: layout.message,
|
|
450
|
-
Instructions: layout.instructions
|
|
451
|
-
});
|
|
452
|
-
return 1;
|
|
453
|
-
}
|
|
454
|
-
const resolvedOut = outPath ? this.fs.path.resolve(outPath) : bpmn.absolutePath;
|
|
455
|
-
if (outPath) {
|
|
456
|
-
await this.fs.mkdir(this.fs.path.dirname(resolvedOut), {
|
|
457
|
-
recursive: true
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
await this.fs.writeFile(resolvedOut, layout.content, "utf-8");
|
|
461
|
-
OutputFormatter.success({
|
|
462
|
-
Result: RESULTS.Success,
|
|
463
|
-
Code: "MaestroBpmnFormat",
|
|
464
|
-
Data: {
|
|
465
|
-
File: resolvedOut,
|
|
466
|
-
ShapeCount: layout.shapeCount,
|
|
467
|
-
EdgeCount: layout.edgeCount
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
return 0;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
export {
|
|
474
|
-
BpmnFormatService
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
//# debugId=B0B019AB2AC750FE64756E2164756E21
|