@uipath/packager-tool-case 1.201.0-preview.133 → 1.202.0-preview.134

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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Registry for the `caseplan.json` -> BPMN compiler.
3
+ *
4
+ * The compiler lives in `@uipath/case-schema`, a 2.5 MB CommonJS bundle that
5
+ * `require`s `child_process`, `tls` and `http2`. This package builds for the
6
+ * browser (StudioWeb loads it as a micro-frontend), so it cannot import that
7
+ * dependency directly. Instead it declares the interface and whoever runs on
8
+ * Node registers the real thing — `@uipath/packager-tool-case/node` provides
9
+ * that implementation, and the CLI tools that register the Case factory call
10
+ * it alongside.
11
+ *
12
+ * Nothing registered means no compile: `CaseTool` then requires the project to
13
+ * carry an already-compiled `.bpmn` and fails the build with an actionable
14
+ * message if it does not. It never packs a case silently missing its BPMN.
15
+ */
16
+ /** Compiles the contents of `caseplan.json` into BPMN XML. */
17
+ export type CaseBpmnCompiler = (casePlanJson: string) => Promise<string>;
18
+ /**
19
+ * Register the compiler used by `CaseTool.buildAsync`. Last call wins. Pass
20
+ * `undefined` to clear it — how a test reproduces a host that never
21
+ * registered one.
22
+ */
23
+ export declare function registerCaseBpmnCompiler(caseBpmnCompiler: CaseBpmnCompiler | undefined): void;
24
+ /** The registered compiler, or `undefined` when none was registered. */
25
+ export declare function getCaseBpmnCompiler(): CaseBpmnCompiler | undefined;
@@ -3,9 +3,11 @@ import { type IFileSystem, type IToolLogger, ProjectTool, ToolResult } from "@ui
3
3
  /**
4
4
  * Case Management project tool implementation.
5
5
  *
6
- * Case Management projects use .stage.json source files that are converted
7
- * to .bpmn format. All files are placed in the content/ folder (no separate
8
- * source folder like flow_files/).
6
+ * The authored source is `caseplan.json`; the runtime reads the BPMN compiled
7
+ * from it. `entry-points.json` points at `/content/caseplan.json.bpmn`, so the
8
+ * build compiles that file into content/ — a package without it deploys and
9
+ * activates fine and then faults every job it starts (UV-15809). All files are
10
+ * placed in the content/ folder (no separate source folder like flow_files/).
9
11
  */
10
12
  export declare class CaseTool extends ProjectTool {
11
13
  private readonly _temporaryStorage;
@@ -20,6 +22,47 @@ export declare class CaseTool extends ProjectTool {
20
22
  * Case Management projects keep all files in content/ (no separate folder).
21
23
  */
22
24
  private copyFiles;
25
+ /**
26
+ * Compile `caseplan.json` into `content/caseplan.json.bpmn`.
27
+ *
28
+ * Runs after copyFiles on purpose: a stale `caseplan.json.bpmn` left in the
29
+ * project directory by an earlier `uip maestro case pack` is copied in
30
+ * first and then overwritten here, so an edited case plan can never ship
31
+ * against an old BPMN. Nothing is written back into the project directory —
32
+ * packing a solution does not mutate the user's source tree.
33
+ *
34
+ * The compiler is injected (see `case-bpmn-compiler.ts`). With none
35
+ * registered — a browser host, where `@uipath/case-schema` cannot run — the
36
+ * project has to bring its own compiled `.bpmn`.
37
+ */
38
+ private compileCasePlan;
39
+ /**
40
+ * Verify every `.bpmn` `entry-points.json` names is actually in content/.
41
+ *
42
+ * This is the defect UV-15809 reported, checked mechanically: the entry
43
+ * point resolved to a file the package did not contain, so it deployed and
44
+ * activated cleanly and then faulted every job. Checking the declaration
45
+ * rather than a fixed filename covers both project shapes — a CLI project
46
+ * (`caseplan.json` -> `caseplan.json.bpmn`) and a Studio Web one
47
+ * (`<name>.stage.json` shipped with its compiled `<name>.stage.json.bpmn`)
48
+ * — and a stray `.bpmn` left behind by `uip case debug` cannot stand in for
49
+ * the one that is missing.
50
+ *
51
+ * No `entry-points.json` means nothing declares an entry point, so there is
52
+ * nothing to resolve and nothing to fail on.
53
+ */
54
+ private checkEntryPointBpmnPresent;
55
+ /**
56
+ * The `.bpmn` file names `entry-points.json` refers to. Entries look like
57
+ * `/content/caseplan.json.bpmn#<triggerId>`; `uip case debug` writes them
58
+ * without the `content/` prefix, so both forms are accepted.
59
+ *
60
+ * No file at all means nothing is declared, so the caller has nothing to
61
+ * check. A file that is there but cannot be read as JSON returns `null`:
62
+ * treating that as "nothing declared" would wave through the very package
63
+ * this check exists to stop, since the entry point it names is unknown.
64
+ */
65
+ private readEntryPointBpmnFiles;
23
66
  /**
24
67
  * Create operate.json file if it doesn't already exist
25
68
  */