@uipath/rules-tool 1.206.0-preview.303 → 1.207.0-preview.305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/DmnFactory-2Z66XPBB-dcse77vg.js +10 -0
  2. package/dist/DmnModelTypes-QISEK3CY-vth5tgqd.js +8 -0
  3. package/dist/KieDmnMarshaller-KLYKOHUQ-jae862c0.js +8 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +6 -6
  5. package/dist/{business-rules-zfzwr08c.js → business-rules-4b4d9pw6.js} +4 -4
  6. package/dist/{constants-1sdwfz26.js → constants-yt6m7vkn.js} +12 -12
  7. package/dist/{first-party-service-ej32b6j2.js → first-party-service-r63v6skt.js} +1 -1
  8. package/dist/hitPolicyResult-2NPUZW2E-rddfkhb2.js +14 -0
  9. package/dist/{index-y5yffb2s.js → index-189nh3zq.js} +642 -513
  10. package/dist/{index-88sps467.js → index-g955264n.js} +7 -5
  11. package/dist/index-jm0j1yn2.js +212 -0
  12. package/dist/{index-s9wmt93c.js → index-thn9n1n9.js} +1 -1
  13. package/dist/index-xvy3d6qz.js +8 -0
  14. package/dist/index.js +2 -2
  15. package/dist/{rule-catalog-780050xk.js → rule-catalog-0zntgf3s.js} +34 -10
  16. package/dist/rules-command-error-5jq3z0ny.js +15 -0
  17. package/dist/{rules-debug-service-gjmn59w4.js → rules-debug-service-cfaqvnep.js} +16 -9
  18. package/dist/{rules-init-service-najk4r7p.js → rules-init-service-vhd0gzmd.js} +7 -7
  19. package/dist/{rules-refresh-service-x3gfnfqt.js → rules-refresh-service-r7fpbbfv.js} +3 -3
  20. package/dist/{rules-validate-service-e47hgykv.js → rules-validate-service-jrw7c1q9.js} +8 -10
  21. package/dist/{solution-definition-helper-trxp0zbj.js → solution-definition-helper-s5v427j0.js} +1 -1
  22. package/dist/{tool-zs98h1p2.js → tool-0r1ykkjf.js} +12 -5
  23. package/dist/{tool-yfaf9b8c.js → tool-19fj7ema.js} +36 -9
  24. package/dist/{tool-sjp6fvze.js → tool-2cxm18e8.js} +2 -2
  25. package/dist/tool-2grmcreg.js +117 -0
  26. package/dist/{tool-b475et36.js → tool-46g75ed0.js} +3 -3
  27. package/dist/{tool-syavphgt.js → tool-5sgkktdb.js} +287 -139
  28. package/dist/{tool-7ekab7v3.js → tool-a1wk2tqc.js} +28 -26
  29. package/dist/{tool-jzdt6z77.js → tool-c0peefw8.js} +7 -6
  30. package/dist/tool-e83bfqmj.js +192 -0
  31. package/dist/{tool-3755q59j.js → tool-fsmgxvqa.js} +189 -15
  32. package/dist/tool-fv5xtqv5.js +736 -0
  33. package/dist/{tool-vqm4apm6.js → tool-jykscmfk.js} +206 -203
  34. package/dist/{tool-0tbve332.js → tool-kmzhfjw8.js} +64 -10
  35. package/dist/tool-q02dmnzm.js +74 -0
  36. package/dist/{tool-93hqhaj3.js → tool-q3jw2emw.js} +100 -96
  37. package/dist/tool.js +2 -2
  38. package/package.json +2 -2
  39. package/dist/DmnFactory-L7MABUC6-q2sr3grz.js +0 -10
  40. package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +0 -8
  41. package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +0 -8
  42. package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +0 -12
  43. package/dist/index-egzwtc07.js +0 -19
  44. package/dist/index-z4kt2kt6.js +0 -8
  45. package/dist/index-zeszs1ra.js +0 -184
  46. package/dist/rules-command-error-2x1vm0wt.js +0 -13
  47. package/dist/tool-2nmqvfmt.js +0 -26
  48. package/dist/tool-89e90qrm.js +0 -777
  49. package/dist/tool-m59a481n.js +0 -49
  50. package/dist/tool-sbtf80ft.js +0 -218
@@ -3,7 +3,7 @@ import {
3
3
  logger,
4
4
  quoteForShell,
5
5
  unsupportedSolutionProjectType
6
- } from "./tool-syavphgt.js";
6
+ } from "./tool-5sgkktdb.js";
7
7
 
8
8
  // ../solution-sdk/src/solution-file.ts
9
9
  var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
@@ -84,6 +84,29 @@ async function warnIfCandidateDirShadowed(fs, candidateDir, projectDir) {
84
84
  }
85
85
  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.");
86
86
  }
87
+ var DEFAULT_UIPX_INDENT = " ";
88
+ function escapeRegExp(text) {
89
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
90
+ }
91
+ function withSolutionId(content, parsed, newSolutionId) {
92
+ const previous = parsed.SolutionId;
93
+ if (typeof previous === "string") {
94
+ const pattern = new RegExp(`("SolutionId"\\s*:\\s*")${escapeRegExp(previous)}(")`, "g");
95
+ const matches = content.match(pattern) ?? [];
96
+ if (matches.length === 1) {
97
+ return content.replace(pattern, (_match, open, close) => `${open}${newSolutionId}${close}`);
98
+ }
99
+ }
100
+ const indent = content.match(/^([ \t]+)"/m)?.[1] ?? DEFAULT_UIPX_INDENT;
101
+ const text = JSON.stringify({ ...parsed, SolutionId: newSolutionId }, null, indent);
102
+ const eol = content.includes(`\r
103
+ `) ? `\r
104
+ ` : `
105
+ `;
106
+ const body = text.replace(/\n/g, eol);
107
+ return content.endsWith(`
108
+ `) ? `${body}${eol}` : body;
109
+ }
87
110
  async function updateUipxSolutionId(fs, uipxPath, newSolutionId) {
88
111
  const [readError, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
89
112
  if (readError || !content) {
@@ -95,13 +118,21 @@ async function updateUipxSolutionId(fs, uipxPath, newSolutionId) {
95
118
  logger.error(`Could not parse .uipx file for update: ${parseError.message}`);
96
119
  return;
97
120
  }
98
- parsed.SolutionId = newSolutionId;
99
- const [writeError] = await catchError(fs.writeFile(uipxPath, JSON.stringify(parsed, null, 4)));
121
+ if (parsed.SolutionId === newSolutionId) {
122
+ return;
123
+ }
124
+ const [writeError] = await catchError(fs.writeFile(uipxPath, withSolutionId(content, parsed, newSolutionId)));
100
125
  if (writeError) {
101
126
  logger.error(`Could not update .uipx with new SolutionId: ${writeError.message}`);
102
- } else {
103
- logger.info(`Updated .uipx with Studio Web SolutionId: ${newSolutionId}`);
127
+ return;
104
128
  }
129
+ const from = typeof parsed.SolutionId === "string" ? parsed.SolutionId : undefined;
130
+ logger.warn(from ? `Rewrote SolutionId in ${uipxPath}: ${from} -> ${newSolutionId} (Studio Web's id for this solution).` : `Wrote SolutionId ${newSolutionId} into ${uipxPath} (Studio Web's id for this solution).`);
131
+ return {
132
+ Path: uipxPath,
133
+ ...from ? { From: from } : {},
134
+ To: newSolutionId
135
+ };
105
136
  }
106
137
  async function findSolutionFile(fs, projectPath) {
107
138
  const parentDir = fs.path.resolve(projectPath, "..");
@@ -147,7 +178,7 @@ async function updateSolutionFile(fs, projectPath, newSolutionId) {
147
178
  if (!uipxFile)
148
179
  return;
149
180
  const uipxPath = fs.path.join(parentDir, uipxFile);
150
- await updateUipxSolutionId(fs, uipxPath, newSolutionId);
181
+ return updateUipxSolutionId(fs, uipxPath, newSolutionId);
151
182
  }
152
183
  async function tryRegisterProjectInParentSolution(fs, projectDir, options) {
153
184
  if (options?.skipRegistration) {
@@ -249,8 +280,7 @@ async function registerProjectInParentSolution(fs, projectDir) {
249
280
  Id: projectId
250
281
  });
251
282
  solution.content.Projects = solution.projects;
252
- const [writeError] = await catchError(fs.writeFile(solutionFile, `${JSON.stringify(solution.content, null, 2)}
253
- `));
283
+ const [writeError] = await catchError(writeSolutionManifest(fs, solutionFile, solution.content));
254
284
  if (writeError) {
255
285
  return {
256
286
  Status: "Failed",
@@ -269,6 +299,30 @@ async function registerProjectInParentSolution(fs, projectDir) {
269
299
  Instructions: buildRegistrationSuccessInstructions(solutionDir)
270
300
  };
271
301
  }
302
+ async function writeSolutionManifest(fs, solutionFile, content) {
303
+ const [, previous] = await catchError(fs.readFile(solutionFile, "utf-8"));
304
+ const before = typeof previous === "string" ? previous : "";
305
+ const bom = before.startsWith("\uFEFF");
306
+ const crlf = before.includes(`\r
307
+ `);
308
+ const indent = /\n([ \t]+)\S/.exec(before.replace(/\r\n/g, `
309
+ `))?.[1] ?? " ";
310
+ const finalNewline = before === "" || /\n$/.test(before);
311
+ let text = JSON.stringify(content, null, indent) + (finalNewline ? `
312
+ ` : "");
313
+ if (crlf)
314
+ text = text.replace(/\n/g, `\r
315
+ `);
316
+ if (bom)
317
+ text = `\uFEFF${text}`;
318
+ const temp = `${solutionFile}.${crypto.randomUUID()}.tmp`;
319
+ await fs.writeFile(temp, text);
320
+ const [renameError] = await catchError(fs.rename(temp, solutionFile));
321
+ if (renameError) {
322
+ await catchError(fs.rm(temp));
323
+ throw renameError;
324
+ }
325
+ }
272
326
  async function findNearestParentUipxFile(fs, projectDir) {
273
327
  let currentDir = fs.path.dirname(fs.path.resolve(projectDir));
274
328
  while (true) {
@@ -372,7 +426,7 @@ async function readSolutionManifest(fs, solutionFile) {
372
426
  null
373
427
  ];
374
428
  }
375
- const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
429
+ const [parseError, parsed] = catchError(() => JSON.parse(rawContent.replace(/^\uFEFF/, "")));
376
430
  if (parseError) {
377
431
  return [
378
432
  new Error(`Invalid JSON in solution file: ${parseError.message}`),
@@ -452,4 +506,4 @@ function buildOptedOutInstructions(projectDir) {
452
506
 
453
507
  export { normalizeProjectType, toPortableRelativePath, prepareProjectLocation, findSolutionFile, updateSolutionFile, tryRegisterProjectInParentSolution };
454
508
 
455
- //# debugId=493FBF7C33D5BE6D64756E2164756E21
509
+ //# debugId=912DB46FE7F1A71664756E2164756E21
@@ -0,0 +1,74 @@
1
+ import {
2
+ t,
3
+ i,
4
+ s,
5
+ r,
6
+ x,
7
+ z2,
8
+ N3,
9
+ oe
10
+ } from "./tool-e83bfqmj.js";
11
+
12
+ // ../../node_modules/@uipath/dmn-editor-utils/dist/chunks/chunk-76IYREZB.js
13
+ var S = new Set([t.Collect, t.RuleOrder, t.OutputOrder]);
14
+ var v = new Set([t.Priority, t.OutputOrder]);
15
+ var b2 = (e) => e.hitPolicy === t.Collect && e.aggregation ? e.aggregation : S.has(e.hitPolicy) ? "list" : "value";
16
+ var N = (e) => {
17
+ let n = e["@_aggregation"];
18
+ return b2({ hitPolicy: e["@_hitPolicy"] ?? t.Unique, aggregation: P(n) ? n : undefined }) === "list";
19
+ };
20
+ var P = (e) => !!e && s.includes(e);
21
+ var w = (e, n) => e === i.Sum || e === i.Count ? "number" : n?.typeRef;
22
+ var x2 = (e, n, t2, i2, o = []) => {
23
+ if (!i2 || n !== 1)
24
+ return;
25
+ if (!t2 || _(e, i2, o))
26
+ return i2;
27
+ let r2 = C(e, i2, o), a = r2?.components?.length ? undefined : r2?.typeRef;
28
+ return z2(a) ? undefined : a;
29
+ };
30
+ var C = (e, n, t2 = []) => oe(e, n, t2).chain.find((i2) => i2.isCollection);
31
+ var H = (e, n, t2, i2, o) => {
32
+ let r2 = t2.variable?.["@_typeRef"], a = N3([t2.variable, t2]), p = x2(e, i2, o, r2, a);
33
+ if (p === undefined)
34
+ return;
35
+ let g = p === r2 ? undefined : C(e, r2, a)?.name, d = g === undefined ? undefined : n.itemDefinition?.find((h) => h["@_name"] === g);
36
+ return { typeRef: p, enclosing: d ? [d.typeRef, d, n] : [t2.variable, t2] };
37
+ };
38
+ var R = (e, n) => {
39
+ let t2 = e.decision.decisionTable;
40
+ return n.typeRef ?? x2(e, t2.outputs.length, b2(t2) === "list", e.decision.variableTypeRef);
41
+ };
42
+ var L = (e, n) => oe(e, n).isCollection;
43
+ var O = (e) => r.includes(x(e));
44
+ var _ = (e, n, t2 = []) => {
45
+ let i2 = oe(e, n, t2);
46
+ if (i2.isCollection || i2.foreign)
47
+ return false;
48
+ let o = i2.baseTypeRef;
49
+ return o === undefined || O(o) && o !== "Any";
50
+ };
51
+ var f = (e, n) => {
52
+ let t2 = oe(e, n);
53
+ if (t2.foreign)
54
+ return "Any";
55
+ if (t2.baseTypeRef !== undefined)
56
+ return t2.baseTypeRef;
57
+ let i2 = t2.chain[t2.chain.length - 1];
58
+ return i2 ? x(i2.name) : undefined;
59
+ };
60
+ var M = (e, n) => n && O(n) ? n : f(e, n);
61
+ var V = (e, n) => {
62
+ let t2 = R(e, n), i2 = n.allowedValues?.text.trim() || oe(e, t2).chain.find((o) => o.allowedValues?.trim())?.allowedValues;
63
+ return i2 ? { text: i2, typeRef: f(e, t2) } : undefined;
64
+ };
65
+ var k = (e, n, t2) => {
66
+ if (n === i.Count)
67
+ return true;
68
+ let i2 = R(e, t2), o = oe(e, i2), r2 = f(e, i2);
69
+ return !o.isCollection && (!r2 || o.foreign || x(r2) === "number");
70
+ };
71
+
72
+ export { S, v, b2, N, P, w, H, R, L, O, _, f, M, V, k };
73
+
74
+ //# debugId=291A03F6D0E7AE0964756E2164756E21