@uipath/case-tool 1.206.0-preview.306 → 1.207.0-preview.307
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 +164 -9
- 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-56a4wtat.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-r60m9e6a.js → case-debug-solution-projects-b2rsts1n.js} +2 -2
- package/dist/{case-debug-studio-web-service-my6vezsd.js → case-debug-studio-web-service-39gj6045.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-17rj6kqt.js +297 -0
- package/dist/{case-splice-service-8deak994.js → case-splice-service-tpp2syvn.js} +7 -7
- package/dist/{case-validate-service-pesq63n9.js → case-validate-service-m2kk0fme.js} +146 -38
- package/dist/{connector-enrichment-service-e0z27bhh.js → connector-enrichment-service-s5y68svm.js} +26 -25
- package/dist/{connector-library-1yw5r47w.js → connector-library-844myxz2.js} +20 -6
- package/dist/{connector-lookup-service-rpmsy37q.js → connector-lookup-service-g5qw6a1n.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/{embedded-file-reader-pxpwcq3n.js → embedded-file-reader-k94wt612.js} +16 -16
- 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-dm5kvwhy.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/{first-party-service-6b9ajm57.js → first-party-service-qfg2m05s.js} +1 -1
- 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-0m89asqv.js → index-59sh1kv0.js} +129 -76
- package/dist/index-b3n9b1bf.js +36 -0
- package/dist/{index-amqqhge1.js → index-ewg6ygg0.js} +1 -1
- package/dist/{index-j2gw61z0.js → index-r16ndadh.js} +3030 -764
- 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-v8jen5rh.js → index-xy5fcn8e.js} +4 -4
- 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-n6d0dwba.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-zvwk08cj.js → node-sync-service-phye3746.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-388vyja1.js → packager-tool-0gmnk7sb.js} +2 -2
- package/dist/{packager-tool-fcektt1g.js → packager-tool-0nbcqyvp.js} +10 -9
- package/dist/{packager-tool-wg91yz70.js → packager-tool-1jtrz02q.js} +61 -11
- package/dist/packager-tool-1yew22sn.js +9 -0
- package/dist/{packager-tool-1hpd2gmh.js → packager-tool-225b9qhq.js} +1 -1
- 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-cqkbf2fg.js → packager-tool-3hzsw5r7.js} +906 -41
- package/dist/packager-tool-3k5j706w.js +73 -0
- package/dist/{packager-tool-8h6tqbps.js → packager-tool-41j8ppy2.js} +59 -34
- 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-8n13ny0q.js → packager-tool-70a6y6t1.js} +3393 -3092
- 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-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-k9z8yg4f.js → packager-tool-jepvcpj7.js} +22 -8
- 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-5ytjvsfb.js → packager-tool-mbm0kd8w.js} +22 -22
- package/dist/{packager-tool-q26hncjr.js → packager-tool-n3r5apbb.js} +4 -2
- package/dist/packager-tool-n6h4bz4d.js +22 -0
- package/dist/{packager-tool-4t71ya0d.js → packager-tool-nqz24dxf.js} +254 -69
- 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/{packager-tool-jjkypwge.js → packager-tool-s8jxyjgj.js} +15 -4
- 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-f93rmjxx.js → packager-tool-z3k461re.js} +191 -154
- 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-jaj95t3d.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-7j2m0tv0.js → resourcesSyncService-5gcxp8r5.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-jc2788nm.js → sdd-resolve-siblings-bg4qmawq.js} +4 -4
- package/dist/solution-auth-yb1twb9d.js +11 -0
- package/dist/{solution-definition-helper-6zwd9hjs.js → solution-definition-helper-qjj01xh0.js} +1 -1
- 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-8nfz9p7h.js → trigger-enrichment-service-zn229s6b.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-9fxd19z9.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
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFileSystem2
|
|
3
|
+
} from "./packager-tool-p64w2wrt.js";
|
|
4
|
+
import {
|
|
5
|
+
catchError2,
|
|
6
|
+
classifyThrownError,
|
|
7
|
+
logger,
|
|
8
|
+
mapPackageMetadataOptions
|
|
9
|
+
} from "./packager-tool-j8mnpsv8.js";
|
|
10
|
+
import"./packager-tool-wvf6b31h.js";
|
|
11
|
+
import {
|
|
12
|
+
resolveOperateMain,
|
|
13
|
+
applyDefaultEntryPoint,
|
|
14
|
+
ensureContentOperateFile,
|
|
15
|
+
NugetPackager
|
|
16
|
+
} from "./packager-tool-j1etnthk.js";
|
|
17
|
+
import"./packager-tool-1wgav5ma.js";
|
|
18
|
+
import {
|
|
19
|
+
CasePlanFileNames2,
|
|
20
|
+
casePlanSidecarName2,
|
|
21
|
+
findCasePlanFileName2,
|
|
22
|
+
resolveDeclaredFileName2,
|
|
23
|
+
entryPointBpmnNames2,
|
|
24
|
+
misnamedEntryPointBpmn2,
|
|
25
|
+
stagedMainEntryPoint2,
|
|
26
|
+
stagedMainProblem2,
|
|
27
|
+
buildCasePackageDescriptor2,
|
|
28
|
+
casePlanDefaults2
|
|
29
|
+
} from "./packager-tool-57970zfm.js";
|
|
30
|
+
import {
|
|
31
|
+
entryPointsDocument2,
|
|
32
|
+
initEntryPoints2
|
|
33
|
+
} from "./packager-tool-t6xwkhht.js";
|
|
34
|
+
import {
|
|
35
|
+
slaErrors,
|
|
36
|
+
issueLine
|
|
37
|
+
} from "./packager-tool-n6h4bz4d.js";
|
|
38
|
+
import {
|
|
39
|
+
VALID_PACKAGE_NAME_REGEX
|
|
40
|
+
} from "./packager-tool-zte9svtn.js";
|
|
41
|
+
import {
|
|
42
|
+
loadCaseSchemaAsync
|
|
43
|
+
} from "./packager-tool-zrbnms9b.js";
|
|
44
|
+
|
|
45
|
+
// src/services/case-pack-service.ts
|
|
46
|
+
var ENTRY_POINTS_FILE = "entry-points.json";
|
|
47
|
+
var OPERATE_FILE = "operate.json";
|
|
48
|
+
var REGENERATE_FIX = `Delete ${ENTRY_POINTS_FILE} to generate one from the plan's trigger (the entry point gets a new uniqueId)`;
|
|
49
|
+
var entryPointsProblem = (parseError, declared) => {
|
|
50
|
+
if (parseError) {
|
|
51
|
+
return {
|
|
52
|
+
problem: `is not valid JSON (${parseError.message})`,
|
|
53
|
+
fix: `Fix the JSON in ${ENTRY_POINTS_FILE}; its entries and uniqueIds stay as they are`
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (!Array.isArray(declared)) {
|
|
57
|
+
return {
|
|
58
|
+
problem: "has no entryPoints array",
|
|
59
|
+
fix: `Add an entryPoints array with an entry that has a filePath, or ${REGENERATE_FIX.replace("Delete", "delete")}`
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
if (declared.length === 0) {
|
|
63
|
+
return {
|
|
64
|
+
problem: "has an empty entryPoints array",
|
|
65
|
+
fix: REGENERATE_FIX
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
problem: "has no entry with a filePath",
|
|
70
|
+
fix: `Add a filePath to its entries, e.g. "/content/caseplan.case.bpmn#<trigger id>"`
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
class CasePackService {
|
|
75
|
+
fs;
|
|
76
|
+
constructor() {
|
|
77
|
+
this.fs = getFileSystem2();
|
|
78
|
+
}
|
|
79
|
+
async execute(projectPath, options) {
|
|
80
|
+
const absoluteProjectPath = this.fs.path.resolve(projectPath);
|
|
81
|
+
const absoluteOutputPath = this.fs.path.resolve(options.output);
|
|
82
|
+
const packageName = options.name || this.fs.path.basename(absoluteProjectPath);
|
|
83
|
+
if (!VALID_PACKAGE_NAME_REGEX.test(packageName)) {
|
|
84
|
+
const fix = options.name ? "" : ` The name comes from the project folder; pass --name ${packageName.replaceAll(/[^a-zA-Z0-9._-]/g, "_")} or rename the folder.`;
|
|
85
|
+
throw new Error(`Invalid package name "${packageName}". Package name can only contain letters, numbers, dots (.), underscores (_), and hyphens (-).${fix}`);
|
|
86
|
+
}
|
|
87
|
+
logger.info(`
|
|
88
|
+
Packing Case project...
|
|
89
|
+
`);
|
|
90
|
+
logger.info("Details:");
|
|
91
|
+
logger.info(` Project: ${absoluteProjectPath}`);
|
|
92
|
+
logger.info(` Package: ${packageName}@${options.version}`);
|
|
93
|
+
logger.info(` Output: ${absoluteOutputPath}`);
|
|
94
|
+
logger.info("");
|
|
95
|
+
await this.validate(absoluteProjectPath);
|
|
96
|
+
const casePlanFileName = await this.findCasePlan(absoluteProjectPath);
|
|
97
|
+
await this.refuseInvalidSla(absoluteProjectPath, casePlanFileName);
|
|
98
|
+
const writtenToProject = [
|
|
99
|
+
...await this.ensureEntryPoints(absoluteProjectPath, casePlanFileName)
|
|
100
|
+
];
|
|
101
|
+
await this.convertCaseToBpmn(absoluteProjectPath, casePlanFileName);
|
|
102
|
+
writtenToProject.push(...await this.ensureOperate(absoluteProjectPath));
|
|
103
|
+
if (writtenToProject.length > 0) {
|
|
104
|
+
logger.warn(`Pack wrote into the project: ${writtenToProject.join(", ")}`);
|
|
105
|
+
}
|
|
106
|
+
await this.fs.mkdir(absoluteOutputPath);
|
|
107
|
+
let tempDir;
|
|
108
|
+
try {
|
|
109
|
+
tempDir = await this.fs.getTempDir();
|
|
110
|
+
const stagingDir = this.fs.path.join(tempDir, "case-pack-staging");
|
|
111
|
+
await this.fs.mkdir(stagingDir);
|
|
112
|
+
const contentDir = this.fs.path.join(stagingDir, "content");
|
|
113
|
+
await this.fs.copyDirectory(absoluteProjectPath, contentDir);
|
|
114
|
+
await applyDefaultEntryPoint(this.fs, {
|
|
115
|
+
contentFolder: contentDir,
|
|
116
|
+
withDefaults: await casePlanDefaults2(this.fs, contentDir)
|
|
117
|
+
});
|
|
118
|
+
await this.checkEntryPointBpmn(contentDir, casePlanFileName);
|
|
119
|
+
await this.regeneratePackageDescriptor(contentDir);
|
|
120
|
+
const packageId = `${packageName}.case.Case`;
|
|
121
|
+
const version = options.version || "1.0.0";
|
|
122
|
+
const nupkgPath = this.fs.path.join(absoluteOutputPath, `${packageId}.${version}.nupkg`);
|
|
123
|
+
const packager = new NugetPackager(this.fs);
|
|
124
|
+
const result = await packager.packAsync(stagingDir, {
|
|
125
|
+
id: packageId,
|
|
126
|
+
version,
|
|
127
|
+
tags: "Case",
|
|
128
|
+
...mapPackageMetadataOptions(options)
|
|
129
|
+
}, nupkgPath);
|
|
130
|
+
return {
|
|
131
|
+
packageName: `${packageName}@${options.version}`,
|
|
132
|
+
outputPath: result.outputPath,
|
|
133
|
+
writtenToProject
|
|
134
|
+
};
|
|
135
|
+
} finally {
|
|
136
|
+
if (tempDir) {
|
|
137
|
+
await catchError2((async () => {
|
|
138
|
+
if (await this.fs.exists(tempDir)) {
|
|
139
|
+
await this.fs.rm(tempDir);
|
|
140
|
+
}
|
|
141
|
+
})());
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async convertCaseToBpmn(projectPath, casePlanFileName) {
|
|
146
|
+
logger.info("Converting case plan to BPMN...");
|
|
147
|
+
const caseContent = String(await this.fs.readFile(this.fs.path.join(projectPath, casePlanFileName), "utf-8"));
|
|
148
|
+
const { serializeCaseDiskJsonToBpmnAndRulesJson } = await loadCaseSchemaAsync();
|
|
149
|
+
const { bpmnXml: bpmn } = await serializeCaseDiskJsonToBpmnAndRulesJson(caseContent);
|
|
150
|
+
const bpmnFilePath = this.fs.path.join(projectPath, casePlanSidecarName2(casePlanFileName));
|
|
151
|
+
await this.fs.writeFile(bpmnFilePath, bpmn);
|
|
152
|
+
logger.info(`BPMN file written to ${bpmnFilePath}`);
|
|
153
|
+
}
|
|
154
|
+
async refuseInvalidSla(projectPath, casePlanFileName) {
|
|
155
|
+
const { CaseValidateService } = await import("./case-validate-service-m2kk0fme.js");
|
|
156
|
+
const result = await new CaseValidateService().validateFileUsingSDK(this.fs.path.join(projectPath, casePlanFileName));
|
|
157
|
+
const found = slaErrors(result.issues);
|
|
158
|
+
if (found.length === 0)
|
|
159
|
+
return;
|
|
160
|
+
throw Object.assign(new Error(`${casePlanFileName} has ${found.length} SLA or escalation error(s) that \`case validate\` also reports:
|
|
161
|
+
${found.map(issueLine).join(`
|
|
162
|
+
`)}`), { errorCode: "invalid_argument" });
|
|
163
|
+
}
|
|
164
|
+
async findCasePlan(projectPath) {
|
|
165
|
+
const casePlanFileName = findCasePlanFileName2(await this.fs.readdir(projectPath));
|
|
166
|
+
if (!casePlanFileName) {
|
|
167
|
+
throw new Error(`No case plan in ${projectPath}. Expected one of ${CasePlanFileNames2.join(", ")}.`);
|
|
168
|
+
}
|
|
169
|
+
return casePlanFileName;
|
|
170
|
+
}
|
|
171
|
+
async ensureEntryPoints(projectPath, casePlanFileName) {
|
|
172
|
+
const entryPointsPath = this.fs.path.join(projectPath, ENTRY_POINTS_FILE);
|
|
173
|
+
if (await this.fs.exists(entryPointsPath)) {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
const planPath = this.fs.path.join(projectPath, casePlanFileName);
|
|
177
|
+
const plan = String(await this.fs.readFile(planPath, "utf-8"));
|
|
178
|
+
const entryPoints = initEntryPoints2({
|
|
179
|
+
sidecarFileName: casePlanSidecarName2(casePlanFileName),
|
|
180
|
+
keptPlan: plan,
|
|
181
|
+
newId: () => crypto.randomUUID()
|
|
182
|
+
});
|
|
183
|
+
if (!("write" in entryPoints) || entryPoints.write.length === 0) {
|
|
184
|
+
throw Object.assign(new Error(`${projectPath} has no entry-points.json and ${casePlanFileName} has no trigger node to point one at, so the package would fault every job. Add a trigger to the plan, then pack again.`), { errorCode: "invalid_argument" });
|
|
185
|
+
}
|
|
186
|
+
const planStamped = await this.stampTriggers(projectPath, planPath, plan, entryPoints.write);
|
|
187
|
+
await this.writeMissing(() => this.fs.writeFile(entryPointsPath, `${JSON.stringify(entryPointsDocument2(entryPoints.write), null, 2)}
|
|
188
|
+
`), `Pack writes the missing ${ENTRY_POINTS_FILE} into ${projectPath}`, `Make the folder writable, or add ${ENTRY_POINTS_FILE} to it.`);
|
|
189
|
+
logger.info(`entry-points.json written to ${entryPointsPath}`);
|
|
190
|
+
return planStamped ? [ENTRY_POINTS_FILE, casePlanFileName] : [ENTRY_POINTS_FILE];
|
|
191
|
+
}
|
|
192
|
+
async stampTriggers(projectPath, planPath, plan, entries) {
|
|
193
|
+
const [
|
|
194
|
+
{ entryPointIdsByNode },
|
|
195
|
+
{ currentTriggers, entryPointIdOf, stampEntryPointIds }
|
|
196
|
+
] = await Promise.all([
|
|
197
|
+
import("./case-event-trigger-bindings-8nd78j4e.js"),
|
|
198
|
+
import("./trigger-entry-point-id-hre2ewts.js")
|
|
199
|
+
]);
|
|
200
|
+
const document = JSON.parse(plan);
|
|
201
|
+
const ids = entryPointIdsByNode({ entryPoints: entries });
|
|
202
|
+
const unpaired = currentTriggers(document).some((node) => ids.has(node.id) && entryPointIdOf(node) !== ids.get(node.id));
|
|
203
|
+
if (!unpaired) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
stampEntryPointIds(document, ids);
|
|
207
|
+
const planName = this.fs.path.basename(planPath);
|
|
208
|
+
await this.writeMissing(() => this.fs.writeFile(planPath, `${JSON.stringify(document, null, 4)}
|
|
209
|
+
`), `Pack writes each trigger's entry point id onto ${planName} in ${projectPath}`, `Make ${planName} writable, then pack again.`);
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
async ensureOperate(projectPath) {
|
|
213
|
+
const operatePath = this.fs.path.join(projectPath, OPERATE_FILE);
|
|
214
|
+
if (await this.fs.exists(operatePath)) {
|
|
215
|
+
await ensureContentOperateFile(this.fs, {
|
|
216
|
+
contentFolder: projectPath,
|
|
217
|
+
projectPath,
|
|
218
|
+
contentType: "CaseManagement" /* CaseManagement */
|
|
219
|
+
});
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
const raw = await this.fs.readFile(this.fs.path.join(projectPath, ENTRY_POINTS_FILE), "utf-8");
|
|
223
|
+
const [parseError, parsed] = catchError2(() => JSON.parse(String(raw)));
|
|
224
|
+
const declared = parseError ? undefined : parsed?.entryPoints;
|
|
225
|
+
if (!Array.isArray(declared) || resolveOperateMain(declared) === "") {
|
|
226
|
+
const { problem, fix } = entryPointsProblem(parseError, declared);
|
|
227
|
+
throw Object.assign(new Error(`${ENTRY_POINTS_FILE} in ${projectPath} ${problem}, so the operate.json pack would write has no main and the package would fault every job. ${fix}, then pack again.`), { errorCode: "invalid_argument" });
|
|
228
|
+
}
|
|
229
|
+
await this.writeMissing(() => ensureContentOperateFile(this.fs, {
|
|
230
|
+
contentFolder: projectPath,
|
|
231
|
+
projectPath,
|
|
232
|
+
contentType: "CaseManagement" /* CaseManagement */
|
|
233
|
+
}), `Pack writes the missing ${OPERATE_FILE} into ${projectPath}`, `Make the folder writable, or add ${OPERATE_FILE} to it.`);
|
|
234
|
+
return [OPERATE_FILE];
|
|
235
|
+
}
|
|
236
|
+
async writeMissing(write, action, fix) {
|
|
237
|
+
const [error] = await catchError2(write());
|
|
238
|
+
if (!error) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (classifyThrownError(error).errorCode !== "local_permission_denied") {
|
|
242
|
+
throw error;
|
|
243
|
+
}
|
|
244
|
+
throw Object.assign(new Error(`${action} and could not (${error.message}). ${fix}`, {
|
|
245
|
+
cause: error
|
|
246
|
+
}), { code: error.code });
|
|
247
|
+
}
|
|
248
|
+
async checkEntryPointBpmn(contentPath, casePlanFileName) {
|
|
249
|
+
const entryPointsPath = this.fs.path.join(contentPath, "entry-points.json");
|
|
250
|
+
if (!await this.fs.exists(entryPointsPath)) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const raw = await this.fs.readFile(entryPointsPath, "utf-8");
|
|
254
|
+
const declared = raw ? entryPointBpmnNames2(String(raw)) : null;
|
|
255
|
+
if (declared === null) {
|
|
256
|
+
throw new Error(`entry-points.json in ${contentPath} could not be read as JSON, so pack cannot check that the BPMN it declares is in the package.`);
|
|
257
|
+
}
|
|
258
|
+
const operate = await this.fs.readFile(this.fs.path.join(contentPath, "operate.json"), "utf-8");
|
|
259
|
+
const staged = stagedMainEntryPoint2(operate === null ? null : String(operate), String(raw));
|
|
260
|
+
const mainEntry = resolveDeclaredFileName2(staged.filePath);
|
|
261
|
+
if (staged.filePath && !declared.includes(mainEntry)) {
|
|
262
|
+
const own = casePlanSidecarName2(casePlanFileName);
|
|
263
|
+
const wording = stagedMainProblem2(staged, mainEntry, own);
|
|
264
|
+
throw new Error(`${wording.problem}, which is not a declared .bpmn file this project ships, so it would deploy and activate and then fault every job. ${wording.fix}.`);
|
|
265
|
+
}
|
|
266
|
+
const present = new Set(await this.fs.readdir(contentPath));
|
|
267
|
+
const missing = declared.filter((file) => !present.has(file));
|
|
268
|
+
if (missing.length > 0) {
|
|
269
|
+
throw new Error(`entry-points.json points at ${missing.join(", ")}, which the package does not contain, so it would deploy and activate and then fault every job.`);
|
|
270
|
+
}
|
|
271
|
+
const misnamed = misnamedEntryPointBpmn2(declared, casePlanFileName);
|
|
272
|
+
if (misnamed) {
|
|
273
|
+
const own = casePlanSidecarName2(casePlanFileName);
|
|
274
|
+
throw new Error(`entry-points.json points at '${misnamed}', the sidecar of a case plan this project does not carry. '${casePlanFileName}' compiles to '${own}', so the entry point would resolve to a BPMN pack did not produce. Point it at '${own}'.`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
async regeneratePackageDescriptor(contentDir) {
|
|
278
|
+
const contentFiles = await this.fs.readdir(contentDir);
|
|
279
|
+
const descriptor = buildCasePackageDescriptor2(contentFiles);
|
|
280
|
+
await this.fs.writeFile(this.fs.path.join(contentDir, "package-descriptor.json"), `${JSON.stringify(descriptor, null, 2)}
|
|
281
|
+
`);
|
|
282
|
+
}
|
|
283
|
+
async validate(projectPath) {
|
|
284
|
+
if (!await this.fs.exists(projectPath)) {
|
|
285
|
+
throw new Error(`Project path does not exist: ${projectPath}`);
|
|
286
|
+
}
|
|
287
|
+
const stats = await this.fs.stat(projectPath);
|
|
288
|
+
if (!stats?.isDirectory()) {
|
|
289
|
+
throw new Error(`Project path must be a directory: ${projectPath}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
export {
|
|
294
|
+
CasePackService
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
//# debugId=F1D5BEF98031136B64756E2164756E21
|
|
@@ -4,25 +4,25 @@ import {
|
|
|
4
4
|
FOLDER_BINDING_ID_PLACEHOLDER,
|
|
5
5
|
RESOURCE_BINDING_ID_PREFIX,
|
|
6
6
|
upsertResourceBinding
|
|
7
|
-
} from "./packager-tool-
|
|
7
|
+
} from "./packager-tool-00ck60cc.js";
|
|
8
8
|
import {
|
|
9
9
|
EXTERNAL_TASK_TYPES,
|
|
10
10
|
CONNECTOR_CALL_TASK_TYPES,
|
|
11
11
|
isMappedExecution,
|
|
12
12
|
serviceTypeFor
|
|
13
|
-
} from "./packager-tool-
|
|
13
|
+
} from "./packager-tool-jydreskq.js";
|
|
14
14
|
import {
|
|
15
15
|
BINDING_REFERENCE_PREFIX
|
|
16
16
|
} from "./packager-tool-nfhtwa72.js";
|
|
17
17
|
import {
|
|
18
18
|
camelizeDisplayName
|
|
19
|
-
} from "./packager-tool-
|
|
20
|
-
import"./packager-tool-
|
|
21
|
-
import"./packager-tool-
|
|
22
|
-
import"./packager-tool-
|
|
19
|
+
} from "./packager-tool-bw4fsdq4.js";
|
|
20
|
+
import"./packager-tool-p64w2wrt.js";
|
|
21
|
+
import"./packager-tool-j8mnpsv8.js";
|
|
22
|
+
import"./packager-tool-0nbcqyvp.js";
|
|
23
23
|
import {
|
|
24
24
|
dedupedId
|
|
25
|
-
} from "./packager-tool-
|
|
25
|
+
} from "./packager-tool-engs9gvj.js";
|
|
26
26
|
import {
|
|
27
27
|
createConnectorBindings
|
|
28
28
|
} from "./packager-tool-e1tx5mqg.js";
|