@uipath/rules-tool 1.204.0-preview.249 → 1.204.0-preview.254

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.
Files changed (154) hide show
  1. package/dist/DmnFactory-VWZOSZHH-jkpbxz3n.js +42 -0
  2. package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +18 -0
  3. package/dist/KieDmnMarshaller-6TTUU5B4-47q50gk4.js +20 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +1085 -0
  5. package/dist/business-rules-bnr581tz.js +26 -0
  6. package/dist/{constants-za5vbzp8.js → constants-9pa118cj.js} +17 -10
  7. package/dist/{embedded-file-reader-wmsg31a8.js → embedded-file-reader-rf2g1kfj.js} +4 -1
  8. package/dist/first-party-service-sd8yaf73.js +27 -0
  9. package/dist/hitPolicyResult-4WDHTX4A-gk103w84.js +33 -0
  10. package/dist/index-2hzp9b97.js +116 -0
  11. package/dist/index-34pj9f36.js +48 -0
  12. package/dist/{index-zdwhfpt1.js → index-4c4exdzw.js} +370 -406
  13. package/dist/index-dqa169gp.js +25 -0
  14. package/dist/{index-we6zjs66.js → index-fs1nd5ap.js} +40 -4
  15. package/dist/{index-nzr4mx5p.js → index-sby22td6.js} +22 -2
  16. package/dist/{index-7wc0g78k.js → index-t4mx1a5e.js} +5 -2
  17. package/dist/index.js +9 -8
  18. package/dist/{jmespath-ab6tdc42.js → jmespath-231m3hyn.js} +1 -1
  19. package/dist/{js-yaml-a2bk27p6.js → js-yaml-88tdqrtd.js} +3 -1
  20. package/dist/rule-catalog-5gzpe93c.js +46 -0
  21. package/dist/rules-command-error-20gp2dv9.js +14 -0
  22. package/dist/{rules-debug-service-h1ahd6p3.js → rules-debug-service-yvh448xp.js} +36 -35
  23. package/dist/{rules-init-service-y678kjje.js → rules-init-service-ewahc0vh.js} +16 -12
  24. package/dist/{rules-refresh-service-btn64j8j.js → rules-refresh-service-jgk2kq9d.js} +14 -13
  25. package/dist/{rules-validate-service-sppr4x13.js → rules-validate-service-mr2fk58k.js} +13 -10
  26. package/dist/{tool-97x3zjcm.js → tool-19b4ect0.js} +158 -113
  27. package/dist/{tool-epsr41wx.js → tool-1de529jm.js} +3 -12
  28. package/dist/{tool-7xmarr97.js → tool-2cky8jwp.js} +2578 -1777
  29. package/dist/{tool-x67kek1m.js → tool-2qj74g14.js} +12 -652
  30. package/dist/{tool-0bthsb3x.js → tool-4dfpdepw.js} +15 -15
  31. package/dist/tool-53w8skv5.js +262 -0
  32. package/dist/tool-7haj67tr.js +19 -0
  33. package/dist/{tool-e1mmqsjr.js → tool-8h4er38s.js} +411 -396
  34. package/dist/{tool-2trg1fpx.js → tool-8qy8pkp4.js} +8 -8
  35. package/dist/tool-av4mmsef.js +73 -0
  36. package/dist/{tool-6sqt4zrx.js → tool-cgmy94zt.js} +32 -29
  37. package/dist/{tool-8j9f6ns5.js → tool-eymjx05p.js} +11 -11
  38. package/dist/{tool-mm1x18d6.js → tool-gdtpsdn7.js} +28 -223
  39. package/dist/tool-m41px07w.js +49 -0
  40. package/dist/{tool-k2s349kn.js → tool-mkn83w88.js} +17 -14
  41. package/dist/tool-pm3ewdxc.js +1115 -0
  42. package/dist/{tool-6rp0gx98.js → tool-tkcx6png.js} +107 -127
  43. package/dist/{tool-1dycs173.js → tool-wmh645tm.js} +202 -194
  44. package/dist/tool.js +8 -7
  45. package/package.json +2 -15
  46. package/dist/DmnFactory-SG3RP3T3-cr8e7mxz.js +0 -8
  47. package/dist/DmnFactory-VWZOSZHH-azx0zqcn.js +0 -8
  48. package/dist/DmnModelTypes-ATR7FVKZ-vkv7n0jn.js +0 -8
  49. package/dist/KieDmnMarshaller-6TTUU5B4-rsxhvw7a.js +0 -8
  50. package/dist/business-rules-d51977r1.js +0 -25
  51. package/dist/business-rules-dekge24t.js +0 -23
  52. package/dist/business-rules-ew76mbwg.js +0 -25
  53. package/dist/business-rules-jmwx05k2.js +0 -25
  54. package/dist/business-rules-zpzqxyce.js +0 -26
  55. package/dist/constants-4r8pfr16.js +0 -22
  56. package/dist/embedded-file-reader-0228j82a.js +0 -111
  57. package/dist/first-party-service-1qa6cp4d.js +0 -8
  58. package/dist/first-party-service-28dkctkz.js +0 -8
  59. package/dist/first-party-service-4fsz3cnj.js +0 -8
  60. package/dist/first-party-service-ahcc6xc6.js +0 -8
  61. package/dist/first-party-service-y1ccmsvp.js +0 -8
  62. package/dist/first-party-service-zpr1q3nd.js +0 -8
  63. package/dist/hitPolicyResult-4WDHTX4A-dbtkgpqp.js +0 -12
  64. package/dist/index-2zxy6zgp.js +0 -23
  65. package/dist/index-3nx77wfh.js +0 -23
  66. package/dist/index-43zg1wqe.js +0 -19621
  67. package/dist/index-47jera73.js +0 -23
  68. package/dist/index-70jn7cz1.js +0 -19631
  69. package/dist/index-8kb5kc5y.js +0 -24
  70. package/dist/index-97yad7ms.js +0 -8
  71. package/dist/index-dfn83hxf.js +0 -14
  72. package/dist/index-e301h23h.js +0 -24
  73. package/dist/index-frd259yv.js +0 -24
  74. package/dist/index-gc7cw2jh.js +0 -23
  75. package/dist/index-gya2v502.js +0 -8
  76. package/dist/index-hb3gk1wf.js +0 -24
  77. package/dist/index-nsnfdqd5.js +0 -24
  78. package/dist/index-vffktc0w.js +0 -166
  79. package/dist/index-xymrydfw.js +0 -3095
  80. package/dist/index-z2qk2qn6.js +0 -24
  81. package/dist/index-zecwgvg7.js +0 -23
  82. package/dist/rule-catalog-a5w86qns.js +0 -43
  83. package/dist/rule-catalog-etpf962f.js +0 -69
  84. package/dist/rule-catalog-q5cr17hf.js +0 -58
  85. package/dist/rule-catalog-vc98yg4n.js +0 -43
  86. package/dist/rule-catalog-z3h66kh5.js +0 -56
  87. package/dist/rules-command-error-10qmb5w7.js +0 -13
  88. package/dist/rules-command-error-5bdv4bcx.js +0 -13
  89. package/dist/rules-command-error-cmssf0w4.js +0 -13
  90. package/dist/rules-command-error-fsm3b1mv.js +0 -13
  91. package/dist/rules-debug-service-5rcdh3pj.js +0 -192
  92. package/dist/rules-debug-service-8q7mkd0r.js +0 -199
  93. package/dist/rules-debug-service-b9j29ejz.js +0 -192
  94. package/dist/rules-debug-service-v3jr3r1n.js +0 -192
  95. package/dist/rules-init-service-3c2yfa7p.js +0 -687
  96. package/dist/rules-init-service-3wgd9cqp.js +0 -100
  97. package/dist/rules-init-service-8fqytxq0.js +0 -685
  98. package/dist/rules-init-service-pspt7sje.js +0 -100
  99. package/dist/rules-init-service-sbtzw93j.js +0 -102
  100. package/dist/rules-init-service-x7paqa63.js +0 -687
  101. package/dist/rules-init-service-y7qzmxx0.js +0 -102
  102. package/dist/rules-refresh-service-4xxj6ex6.js +0 -65
  103. package/dist/rules-refresh-service-ba5jk1y9.js +0 -65
  104. package/dist/rules-refresh-service-qkmphj53.js +0 -65
  105. package/dist/rules-validate-service-dmgnfne7.js +0 -60
  106. package/dist/rules-validate-service-hk2d006t.js +0 -60
  107. package/dist/rules-validate-service-xp05n2d9.js +0 -60
  108. package/dist/tool-1pkqxwwd.js +0 -17472
  109. package/dist/tool-24mr6g8c.js +0 -1556
  110. package/dist/tool-39fmkx2d.js +0 -611
  111. package/dist/tool-3e2q1x2y.js +0 -6578
  112. package/dist/tool-3j0747gg.js +0 -17077
  113. package/dist/tool-4z7zcq4z.js +0 -6058
  114. package/dist/tool-56smnjrh.js +0 -73
  115. package/dist/tool-5qygptrc.js +0 -6171
  116. package/dist/tool-5xx6x8pe.js +0 -6596
  117. package/dist/tool-7fkrd618.js +0 -1556
  118. package/dist/tool-89xzeteg.js +0 -361
  119. package/dist/tool-911s9czz.js +0 -570
  120. package/dist/tool-9bz2x04j.js +0 -40
  121. package/dist/tool-akh7nnqs.js +0 -704
  122. package/dist/tool-axfzew45.js +0 -1555
  123. package/dist/tool-b71jq9pt.js +0 -389
  124. package/dist/tool-bfj846v8.js +0 -141
  125. package/dist/tool-bvmc017m.js +0 -96
  126. package/dist/tool-bykz5ryf.js +0 -454
  127. package/dist/tool-c76qb8ap.js +0 -17052
  128. package/dist/tool-ca15515v.js +0 -570
  129. package/dist/tool-f9qs255w.js +0 -70
  130. package/dist/tool-ga79rety.js +0 -389
  131. package/dist/tool-gb547mcn.js +0 -141
  132. package/dist/tool-gta9rr4h.js +0 -68
  133. package/dist/tool-h2dfnxdq.js +0 -6486
  134. package/dist/tool-hg6vr5y9.js +0 -3769
  135. package/dist/tool-hgvnm4vh.js +0 -1843
  136. package/dist/tool-hjbf9aay.js +0 -571
  137. package/dist/tool-k5jm64n3.js +0 -5650
  138. package/dist/tool-ketztpgf.js +0 -73
  139. package/dist/tool-n1d88ryb.js +0 -6396
  140. package/dist/tool-nmqpwh9m.js +0 -6166
  141. package/dist/tool-pb80pswx.js +0 -73
  142. package/dist/tool-pcsgwpfw.js +0 -40
  143. package/dist/tool-q3c1bjyb.js +0 -454
  144. package/dist/tool-rwp1skmf.js +0 -40
  145. package/dist/tool-s3fbt22r.js +0 -454
  146. package/dist/tool-tmbst1r8.js +0 -68
  147. package/dist/tool-v6w109p0.js +0 -455
  148. package/dist/tool-w2js05qv.js +0 -389
  149. package/dist/tool-x89947ah.js +0 -17052
  150. package/dist/tool-xhksjdka.js +0 -4005
  151. package/dist/tool-yv3t4gg5.js +0 -108
  152. package/dist/tool-zbyb1ttx.js +0 -5650
  153. /package/dist/{tool-fbqnqf9k.js → tool-jd313s2x.js} +0 -0
  154. /package/dist/{tool-vyx8fpft.js → tool-qgqscsjc.js} +0 -0
@@ -1,389 +0,0 @@
1
- import {
2
- catchError,
3
- logger,
4
- unsupportedSolutionProjectType
5
- } from "./tool-nmqpwh9m.js";
6
-
7
- // ../solution-sdk/src/solution-file.ts
8
- var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
9
- ProcessOrchestration: "processOrchestration"
10
- };
11
- function normalizeProjectType(projectType) {
12
- return STUDIO_WEB_PROJECT_TYPE_OVERRIDES[projectType] ?? projectType;
13
- }
14
- function toPortableRelativePath(relativePath) {
15
- return relativePath.replace(/\\/g, "/");
16
- }
17
- function isRecord(value) {
18
- return typeof value === "object" && value !== null && !Array.isArray(value);
19
- }
20
- async function createSolutionManifest(fs, solutionDir, solutionName, options = {}) {
21
- const resolvedDir = fs.path.resolve(solutionDir);
22
- if (!(options.allowExistingDir && await fs.exists(resolvedDir))) {
23
- await fs.mkdir(resolvedDir);
24
- }
25
- const solutionId = crypto.randomUUID();
26
- const manifest = {
27
- DocVersion: "1.0.0",
28
- StudioMinVersion: "2025.10.0",
29
- SolutionId: solutionId,
30
- Projects: []
31
- };
32
- const solutionFile = fs.path.join(resolvedDir, `${solutionName}.uipx`);
33
- await fs.writeFile(solutionFile, `${JSON.stringify(manifest, null, 2)}
34
- `);
35
- return {
36
- solutionDir: resolvedDir,
37
- solutionFile,
38
- solutionId
39
- };
40
- }
41
- var AUTO_SOLUTION_SUFFIX = "Solution";
42
- async function autoScaffoldSolution(fs, baseDir, projectName) {
43
- const solutionName = `${projectName}${AUTO_SOLUTION_SUFFIX}`;
44
- const solutionDir = fs.path.resolve(baseDir, solutionName);
45
- const expectedSolutionFile = fs.path.join(solutionDir, `${solutionName}.uipx`);
46
- if (await fs.exists(expectedSolutionFile)) {
47
- return {
48
- Name: solutionName,
49
- Path: solutionDir,
50
- SolutionFile: expectedSolutionFile
51
- };
52
- }
53
- const { solutionFile } = await createSolutionManifest(fs, solutionDir, solutionName, { allowExistingDir: true });
54
- return {
55
- Name: solutionName,
56
- Path: solutionDir,
57
- SolutionFile: solutionFile
58
- };
59
- }
60
- async function prepareProjectLocation(fs, candidateProjectDir, projectName, options = {}) {
61
- const resolved = fs.path.resolve(candidateProjectDir);
62
- if (options.skipRegistration) {
63
- return { projectDir: resolved };
64
- }
65
- const discovery = await findNearestParentUipxFile(fs, resolved);
66
- if (discovery.status !== "notFound") {
67
- return { projectDir: resolved };
68
- }
69
- const baseDir = fs.path.dirname(resolved);
70
- const autoCreatedSolution = await autoScaffoldSolution(fs, baseDir, projectName);
71
- const projectDir = fs.path.join(autoCreatedSolution.Path, projectName);
72
- await warnIfCandidateDirShadowed(fs, resolved, projectDir);
73
- return { projectDir, autoCreatedSolution };
74
- }
75
- async function warnIfCandidateDirShadowed(fs, candidateDir, projectDir) {
76
- const [, exists] = await catchError(fs.exists(candidateDir));
77
- if (!exists) {
78
- return;
79
- }
80
- const [, entries] = await catchError(fs.readdir(candidateDir));
81
- if (!entries || entries.length === 0) {
82
- return;
83
- }
84
- logger.warn(`An existing directory "${candidateDir}" was left untouched. ` + `The project was created inside the auto-created solution at "${projectDir}". ` + "Run init from inside an existing solution, or pass --skip-solution-registration, if you meant to use the existing directory.");
85
- }
86
- async function tryRegisterProjectInParentSolution(fs, projectDir, options) {
87
- if (options?.skipRegistration) {
88
- return {
89
- Status: "OptedOut",
90
- Message: "Solution auto-registration skipped (--skip-solution-registration).",
91
- Instructions: buildOptedOutInstructions(fs.path.resolve(projectDir))
92
- };
93
- }
94
- const [registrationError, registration] = await catchError(registerProjectInParentSolution(fs, projectDir));
95
- if (registrationError) {
96
- return {
97
- Status: "Failed",
98
- Message: "Project registration failed.",
99
- Instructions: buildRegistrationFailureInstructions(projectDir, registrationError.message)
100
- };
101
- }
102
- return registration;
103
- }
104
- async function registerProjectInParentSolution(fs, projectDir) {
105
- const resolvedProjectDir = fs.path.resolve(projectDir);
106
- const discovery = await findNearestParentUipxFile(fs, resolvedProjectDir);
107
- if (discovery.status === "notFound") {
108
- return {
109
- Status: "NotInSolution",
110
- Message: "Project created in standalone mode; no parent .uipx solution found.",
111
- Instructions: buildStandaloneInstructions(resolvedProjectDir)
112
- };
113
- }
114
- if (discovery.status === "skipped") {
115
- return discovery.registration;
116
- }
117
- const solutionFile = discovery.solutionFile;
118
- const solutionDir = fs.path.dirname(solutionFile);
119
- const relativeProjectDir = fs.path.relative(solutionDir, resolvedProjectDir);
120
- if (relativeProjectDir === "" || relativeProjectDir.startsWith("..") || fs.path.isAbsolute(relativeProjectDir)) {
121
- return {
122
- Status: "Skipped",
123
- Message: "Project registration skipped.",
124
- Solution: solutionFile,
125
- Instructions: `Project must reside within the solution folder.
126
- Solution: ${solutionDir}
127
- Project: ${resolvedProjectDir}`
128
- };
129
- }
130
- const [projectFileError, projectFile] = await findProjectFile(fs, resolvedProjectDir);
131
- if (projectFileError) {
132
- return {
133
- Status: "Failed",
134
- Message: "Project registration failed.",
135
- Solution: solutionFile,
136
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, projectFileError.message)
137
- };
138
- }
139
- const [projectManifestError, projectManifest] = await readProjectManifest(fs, projectFile.filePath, projectFile.useProjectJson);
140
- if (projectManifestError) {
141
- return {
142
- Status: "Failed",
143
- Message: "Project registration failed.",
144
- Solution: solutionFile,
145
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, projectManifestError.message)
146
- };
147
- }
148
- const unsupportedReason = unsupportedSolutionProjectType(projectManifest.projectType);
149
- if (unsupportedReason) {
150
- return {
151
- Status: "Skipped",
152
- Message: "Project registration skipped.",
153
- Solution: solutionFile,
154
- Instructions: unsupportedReason
155
- };
156
- }
157
- const projectRelativePath = toPortableRelativePath(fs.path.join(relativeProjectDir, projectFile.fileName));
158
- const [solutionError, solution] = await readSolutionManifest(fs, solutionFile);
159
- if (solutionError) {
160
- return {
161
- Status: "Failed",
162
- Message: "Project registration failed.",
163
- Solution: solutionFile,
164
- Project: projectRelativePath,
165
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, solutionError.message)
166
- };
167
- }
168
- const existingProject = solution.projects.find((project) => toPortableRelativePath(project.ProjectRelativePath) === projectRelativePath);
169
- if (existingProject) {
170
- return {
171
- Status: "AlreadyRegistered",
172
- Message: "Project already registered in solution.",
173
- Solution: solutionFile,
174
- Project: projectRelativePath,
175
- ProjectId: typeof existingProject.Id === "string" ? existingProject.Id : undefined,
176
- Instructions: buildRegistrationSuccessInstructions(solutionDir)
177
- };
178
- }
179
- const projectId = crypto.randomUUID();
180
- solution.projects.push({
181
- Type: normalizeProjectType(projectManifest.projectType),
182
- ProjectRelativePath: projectRelativePath,
183
- Id: projectId
184
- });
185
- solution.content.Projects = solution.projects;
186
- const [writeError] = await catchError(fs.writeFile(solutionFile, `${JSON.stringify(solution.content, null, 2)}
187
- `));
188
- if (writeError) {
189
- return {
190
- Status: "Failed",
191
- Message: "Project registration failed.",
192
- Solution: solutionFile,
193
- Project: projectRelativePath,
194
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, writeError.message)
195
- };
196
- }
197
- return {
198
- Status: "Registered",
199
- Message: "Project registered in parent solution.",
200
- Solution: solutionFile,
201
- Project: projectRelativePath,
202
- ProjectId: projectId,
203
- Instructions: buildRegistrationSuccessInstructions(solutionDir)
204
- };
205
- }
206
- async function findNearestParentUipxFile(fs, projectDir) {
207
- let currentDir = fs.path.dirname(fs.path.resolve(projectDir));
208
- while (true) {
209
- const [readDirError, entries] = await catchError(fs.readdir(currentDir));
210
- if (readDirError) {
211
- return {
212
- status: "skipped",
213
- registration: {
214
- Status: "Failed",
215
- Message: "Project registration failed.",
216
- Instructions: buildRegistrationFailureInstructions(projectDir, `Could not inspect parent directory for a solution: ${currentDir}
217
- ${readDirError.message}`)
218
- }
219
- };
220
- }
221
- const solutionFiles = entries.filter((entry) => entry.endsWith(".uipx"));
222
- if (solutionFiles.length > 1) {
223
- return {
224
- status: "skipped",
225
- registration: {
226
- Status: "Skipped",
227
- Message: "Project registration skipped.",
228
- Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution projects add "${projectDir}" <solution.uipx>' to choose one.`
229
- }
230
- };
231
- }
232
- if (solutionFiles.length === 1) {
233
- return {
234
- status: "found",
235
- solutionFile: fs.path.join(currentDir, solutionFiles[0])
236
- };
237
- }
238
- const parentDir = fs.path.dirname(currentDir);
239
- if (parentDir === currentDir) {
240
- return { status: "notFound" };
241
- }
242
- currentDir = parentDir;
243
- }
244
- }
245
- async function findProjectFile(fs, projectDir) {
246
- const uiprojPath = fs.path.join(projectDir, "project.uiproj");
247
- if (await fs.exists(uiprojPath)) {
248
- return [
249
- null,
250
- {
251
- filePath: uiprojPath,
252
- fileName: "project.uiproj",
253
- useProjectJson: false
254
- }
255
- ];
256
- }
257
- const jsonProjectPath = fs.path.join(projectDir, "project.json");
258
- if (await fs.exists(jsonProjectPath)) {
259
- return [
260
- null,
261
- {
262
- filePath: jsonProjectPath,
263
- fileName: "project.json",
264
- useProjectJson: true
265
- }
266
- ];
267
- }
268
- return [
269
- new Error(`No project file found in ${projectDir}. Expected project.uiproj or project.json.`),
270
- null
271
- ];
272
- }
273
- async function readProjectManifest(fs, filePath, useProjectJson) {
274
- const [readError, rawContent] = await catchError(fs.readFile(filePath, "utf-8"));
275
- if (readError || !rawContent) {
276
- return [readError ?? new Error(`Unable to read ${filePath}.`), null];
277
- }
278
- const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
279
- if (parseError) {
280
- return [
281
- new Error(`Invalid JSON in project file: ${parseError.message}`),
282
- null
283
- ];
284
- }
285
- if (!isRecord(parsed)) {
286
- return [new Error(`Invalid project file: ${filePath}`), null];
287
- }
288
- const designOptions = parsed.designOptions;
289
- const outputType = useProjectJson && isRecord(designOptions) ? readString(designOptions.outputType) : undefined;
290
- const projectType = outputType ?? readString(parsed.ProjectType);
291
- if (!projectType) {
292
- return [new Error(`ProjectType not found in ${filePath}`), null];
293
- }
294
- return [
295
- null,
296
- {
297
- projectType
298
- }
299
- ];
300
- }
301
- async function readSolutionManifest(fs, solutionFile) {
302
- const [readError, rawContent] = await catchError(fs.readFile(solutionFile, "utf-8"));
303
- if (readError || !rawContent) {
304
- return [
305
- readError ?? new Error(`Unable to read solution file: ${solutionFile}`),
306
- null
307
- ];
308
- }
309
- const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
310
- if (parseError) {
311
- return [
312
- new Error(`Invalid JSON in solution file: ${parseError.message}`),
313
- null
314
- ];
315
- }
316
- if (!isRecord(parsed)) {
317
- return [
318
- new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
319
- null
320
- ];
321
- }
322
- if (!Array.isArray(parsed.Projects)) {
323
- return [
324
- new Error(`Invalid solution file: ${solutionFile} must contain a Projects array.`),
325
- null
326
- ];
327
- }
328
- const projects = [];
329
- for (const [index, project] of parsed.Projects.entries()) {
330
- if (!isRecord(project)) {
331
- return [
332
- new Error(`Invalid solution file: Projects[${index}] must be an object.`),
333
- null
334
- ];
335
- }
336
- const projectRelativePath = readString(project.ProjectRelativePath);
337
- if (!projectRelativePath) {
338
- return [
339
- new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution projects add' to repair the manifest.`),
340
- null
341
- ];
342
- }
343
- projects.push({
344
- ...project,
345
- Type: readString(project.Type) ?? "",
346
- ProjectRelativePath: projectRelativePath,
347
- Id: readString(project.Id) ?? ""
348
- });
349
- }
350
- return [null, { content: parsed, projects }];
351
- }
352
- function readString(value) {
353
- return typeof value === "string" && value.length > 0 ? value : undefined;
354
- }
355
- function buildRegistrationSuccessInstructions(solutionDir) {
356
- return [
357
- "The project is listed in the parent solution manifest.",
358
- "Packing or uploading the solution will sync solution resources automatically.",
359
- `To sync resources before packaging, run 'uip solution resources refresh --solution-folder "${solutionDir}"'.`
360
- ].join(`
361
- `);
362
- }
363
- function buildRegistrationFailureInstructions(projectDir, details) {
364
- return [
365
- "Automatic solution registration could not complete.",
366
- `Run 'uip solution projects add "${projectDir}" <solution.uipx>' after checking the project and solution files.`,
367
- `Details: ${details}`
368
- ].join(`
369
- `);
370
- }
371
- function buildStandaloneInstructions(projectDir) {
372
- return [
373
- "No parent solution was found by walking ancestor directories.",
374
- "Studio Web upload, `flow debug`, and packaging require an enclosing solution.",
375
- `To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution projects add "${projectDir}" <SolutionName>.uipx'.`
376
- ].join(`
377
- `);
378
- }
379
- function buildOptedOutInstructions(projectDir) {
380
- return [
381
- "Automatic solution registration was skipped because --skip-solution-registration was passed.",
382
- `To register this project later, run 'uip solution projects add "${projectDir}" <SolutionName>.uipx' from within the solution.`
383
- ].join(`
384
- `);
385
- }
386
-
387
- export { normalizeProjectType, toPortableRelativePath, prepareProjectLocation, tryRegisterProjectInParentSolution };
388
-
389
- //# debugId=9F94850867E6D86464756E2164756E21
@@ -1,141 +0,0 @@
1
- import {
2
- catchError,
3
- RESULTS,
4
- OutputFormatter,
5
- processContext
6
- } from "./tool-k5jm64n3.js";
7
- // package.json
8
- var package_default = {
9
- name: "@uipath/rules-tool",
10
- author: "UiPath",
11
- license: "SEE LICENSE IN LICENSE.txt",
12
- version: "1.204.0",
13
- description: "Create and manage UiPath Business Rules (DMN) projects.",
14
- private: false,
15
- repository: {
16
- type: "git",
17
- url: "https://github.com/UiPath/cli.git",
18
- directory: "packages/rules-tool"
19
- },
20
- publishConfig: {
21
- registry: "https://npm.pkg.github.com/@uipath"
22
- },
23
- keywords: [
24
- "cli-tool"
25
- ],
26
- type: "module",
27
- main: "./dist/tool.js",
28
- exports: {
29
- ".": "./dist/tool.js"
30
- },
31
- bin: {
32
- "rules-tool": "./dist/index.js"
33
- },
34
- files: [
35
- "dist"
36
- ],
37
- scripts: {
38
- build: "bun ../../tools/build-tool.ts",
39
- package: "bun run build && bun pm pack",
40
- lint: "biome check .",
41
- "lint:fix": "biome check --write .",
42
- test: "vitest run",
43
- "test:coverage": "vitest run --coverage"
44
- },
45
- devDependencies: {
46
- "@types/node": "^25.5.2",
47
- "@uipath/common": "workspace:*",
48
- "@uipath/filesystem": "workspace:*",
49
- "@uipath/maestro-sdk": "workspace:*",
50
- "@uipath/solution-sdk": "workspace:*",
51
- commander: "^14.0.3",
52
- fflate: "^0.8.2",
53
- typescript: "^7.0.2"
54
- }
55
- };
56
-
57
- // src/commands/init.ts
58
- var RULES_INIT_EXAMPLES = [
59
- {
60
- Description: "Create a new business rules project. If the current directory is not already inside a solution, a parent solution named '<project>Solution' is created automatically and the rules project is nested inside it.",
61
- Command: "uip maestro rules init my-rules-project",
62
- Output: {
63
- Code: "RulesInit",
64
- Data: {
65
- Status: "Created successfully",
66
- Path: "/workspace/my-rules-projectSolution/my-rules-project",
67
- RuleStatus: "Created",
68
- SolutionRegistration: {
69
- Status: "Registered",
70
- Message: "Project registered in parent solution.",
71
- Solution: "/workspace/my-rules-projectSolution/my-rules-projectSolution.uipx",
72
- Project: "my-rules-project/project.uiproj",
73
- ProjectId: "00000000-0000-0000-0000-000000000000",
74
- Instructions: `The project is listed in the parent solution manifest.
75
- Packing or uploading the solution will sync solution resources automatically.`
76
- },
77
- AutoCreatedSolution: {
78
- Name: "my-rules-projectSolution",
79
- Path: "/workspace/my-rules-projectSolution",
80
- SolutionFile: "/workspace/my-rules-projectSolution/my-rules-projectSolution.uipx"
81
- },
82
- ProjectArtifacts: { Created: true },
83
- NextSteps: `The project is listed in the parent solution manifest.
84
- Packing or uploading the solution will sync solution resources automatically.`
85
- }
86
- }
87
- }
88
- ];
89
- var registerInitCommand = (program) => {
90
- program.command("init").description("Create a new business rules project seeded with one decision table. If run outside an existing solution, a parent '<name>Solution' is scaffolded automatically and the rules project is created inside it. If run inside an existing solution, the project is added to that solution.").argument("<name>", "Business rules project name").option("--force", "Force initialization even if target directory exists and is not empty").option("--skip-solution-registration", "Do not auto-register this project in the surrounding solution").examples(RULES_INIT_EXAMPLES).trackedAction(processContext, async (name, options) => {
91
- const { rulesInitAsync } = await import("./rules-init-service-3c2yfa7p.js");
92
- const [error, result] = await catchError(rulesInitAsync(name, {
93
- force: options.force,
94
- skipRegistration: options.skipSolutionRegistration === true
95
- }));
96
- if (error) {
97
- OutputFormatter.error({
98
- Result: RESULTS.Failure,
99
- Message: "Failed to create business rules project",
100
- Instructions: error.message
101
- });
102
- processContext.exit(1);
103
- return;
104
- }
105
- const data = {
106
- Status: "Created successfully",
107
- Path: result.projectDir,
108
- RuleStatus: result.ruleStatus,
109
- SolutionRegistration: result.registration
110
- };
111
- if (result.autoCreatedSolution) {
112
- data.AutoCreatedSolution = result.autoCreatedSolution;
113
- }
114
- if (result.projectArtifacts) {
115
- data.ProjectArtifacts = result.projectArtifacts;
116
- }
117
- if (result.registration.Instructions) {
118
- data.NextSteps = result.registration.Instructions;
119
- }
120
- OutputFormatter.success({
121
- Result: RESULTS.Success,
122
- Code: "RulesInit",
123
- Data: data
124
- });
125
- });
126
- };
127
-
128
- // src/tool.ts
129
- var metadata2 = {
130
- name: "rules-tool",
131
- version: package_default.version,
132
- description: "Create and manage UiPath Business Rules (DMN) projects.",
133
- commandPrefix: "rules"
134
- };
135
- var registerCommands2 = async (program) => {
136
- registerInitCommand(program);
137
- };
138
-
139
- export { metadata2, registerCommands2 };
140
-
141
- //# debugId=04D170B1D4E9D59064756E2164756E21
@@ -1,96 +0,0 @@
1
- import {
2
- RESULTS,
3
- OutputFormatter,
4
- classifiedFailure,
5
- processContext
6
- } from "./tool-nmqpwh9m.js";
7
- import {
8
- BusinessRulesApi,
9
- createApiClient,
10
- resolveFolder,
11
- quoteODataStringLiteral
12
- } from "./tool-4z7zcq4z.js";
13
-
14
- // src/services/business-rules.ts
15
- class RulesCommandError2 extends Error {
16
- errorCode;
17
- instructions;
18
- constructor(message, errorCode, instructions) {
19
- super(message);
20
- this.errorCode = errorCode;
21
- this.instructions = instructions;
22
- }
23
- }
24
- async function resolveRequiredFolder2(options) {
25
- if (options.folderPath !== undefined && options.folderKey !== undefined) {
26
- throw new RulesCommandError2("Options --folder-path and --folder-key cannot be used together.", "invalid_argument", "Provide either --folder-path <path> or --folder-key <key>, not both.");
27
- }
28
- const folder = await resolveFolder({ folderPath: options.folderPath, folderKey: options.folderKey }, { tenant: options.tenant });
29
- if (!folder) {
30
- throw new RulesCommandError2("Missing required option --folder-path or --folder-key.", "invalid_argument", "Provide --folder-path <path> or --folder-key <key>. Run 'uip or folders list' to find folder paths.");
31
- }
32
- return folder;
33
- }
34
- function createRulesApi2(tenant, folder) {
35
- return createApiClient(BusinessRulesApi, {
36
- tenant,
37
- folderId: folder.id.toString()
38
- });
39
- }
40
- function ruleNotFound2(name, folder) {
41
- return new RulesCommandError2(`Business rule '${name}' was not found in folder '${folder.path}'.`, "not_found", `Run 'uip rules list --folder-path "${folder.path}"' to see the rules in this folder.`);
42
- }
43
- async function findRuleByName2(api, name, folder) {
44
- const result = await api.businessRulesGet({
45
- $filter: `Name eq ${quoteODataStringLiteral(name)}`,
46
- $top: 1
47
- });
48
- const rule = result.value?.[0];
49
- if (!rule) {
50
- throw ruleNotFound2(name, folder);
51
- }
52
- return rule;
53
- }
54
- function formatRule2(rule, folder) {
55
- return {
56
- Key: rule.id ?? "",
57
- Name: rule.name,
58
- FolderPath: folder.path,
59
- FolderKey: folder.key,
60
- Description: rule.description ?? "",
61
- CurrentVersion: rule.currentVersion?.versionNumber ?? ""
62
- };
63
- }
64
- function formatRuleDetail2(rule, folder) {
65
- return {
66
- ...formatRule2(rule, folder),
67
- Tags: (rule.tags ?? []).map((tag) => tag.name),
68
- CreationTime: rule.creationTime,
69
- LastModificationTime: rule.lastModificationTime
70
- };
71
- }
72
- function formatVersion2(version) {
73
- return {
74
- Version: version.versionNumber ?? "",
75
- IsActive: version.isActive === true,
76
- CreationTime: version.creationTime
77
- };
78
- }
79
- async function reportRulesFailure2(message, error) {
80
- if (error instanceof RulesCommandError2) {
81
- OutputFormatter.error({
82
- Result: RESULTS.Failure,
83
- ErrorCode: error.errorCode,
84
- Message: error.message,
85
- Instructions: error.instructions,
86
- Retry: "RetryWillNotFix"
87
- });
88
- } else {
89
- OutputFormatter.error(await classifiedFailure(message, error));
90
- }
91
- processContext.exit(1);
92
- }
93
-
94
- export { RulesCommandError2, resolveRequiredFolder2, createRulesApi2, ruleNotFound2, findRuleByName2, formatRule2, formatRuleDetail2, formatVersion2, reportRulesFailure2 };
95
-
96
- //# debugId=919A71FE7AE48EAF64756E2164756E21