@uipath/rules-tool 1.205.0-preview.277 → 1.206.0-preview.279
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/dist/DmnFactory-L7MABUC6-q2sr3grz.js +10 -0
- package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +8 -0
- package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +8 -0
- package/dist/THIRD-PARTY-NOTICES.md +4 -4
- package/dist/business-rules-z2zw35qd.js +25 -0
- package/dist/{constants-cnn0jfw6.js → constants-1sdwfz26.js} +7 -15
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/first-party-service-hegqxm82.js +8 -0
- package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +12 -0
- package/dist/index-4a4x1ygg.js +24 -0
- package/dist/{index-52h8rpew.js → index-egzwtc07.js} +2 -4
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-xaxgkfez.js +23 -0
- package/dist/{tool-tjcg2xje.js → index-y5yffb2s.js} +3525 -236
- package/dist/index-z4kt2kt6.js +8 -0
- package/dist/{index-bhjt1h5c.js → index-zeszs1ra.js} +23 -66
- package/dist/index.js +8 -9
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/rule-catalog-5qnmp0xp.js +71 -0
- package/dist/rules-command-error-30c8a3n9.js +13 -0
- package/dist/{rules-debug-service-830zfzcy.js → rules-debug-service-xc1cmwwh.js} +37 -38
- package/dist/{rules-init-service-qphmbh3k.js → rules-init-service-frjbgfcs.js} +12 -16
- package/dist/{rules-refresh-service-jn6my893.js → rules-refresh-service-18hrs394.js} +13 -14
- package/dist/{rules-validate-service-hfw8m3dm.js → rules-validate-service-s787ehrr.js} +10 -13
- package/dist/{tool-fk8rznma.js → tool-89e90qrm.js} +173 -223
- package/dist/{tool-fbxe48wd.js → tool-8cnhz30a.js} +13991 -15184
- package/dist/{tool-ey5djkhz.js → tool-8sjyv0xg.js} +659 -14
- package/dist/{tool-h7gn1rar.js → tool-93hqhaj3.js} +402 -417
- package/dist/{tool-c2xarvad.js → tool-cf9810hm.js} +32 -34
- package/dist/{tool-wf2qkrye.js → tool-cs8nyk0r.js} +990 -514
- package/dist/{tool-txp5th7j.js → tool-e23cj2jx.js} +127 -42
- package/dist/{tool-1de529jm.js → tool-epsr41wx.js} +12 -3
- package/dist/{tool-gkbr01gc.js → tool-fkppxa9f.js} +14 -17
- package/dist/{tool-86f1xpxn.js → tool-m59a481n.js} +18 -20
- package/dist/tool-mst6a4dr.js +73 -0
- package/dist/{tool-t4k013ex.js → tool-njnhj05q.js} +8 -8
- package/dist/tool-p7hqn93n.js +455 -0
- package/dist/{tool-z1ay3csx.js → tool-sbtf80ft.js} +66 -24
- package/dist/{tool-yq5jph4h.js → tool-vqm4apm6.js} +207 -216
- package/dist/tool.js +7 -8
- package/package.json +2 -2
- package/dist/DmnFactory-L7MABUC6-98k17dkr.js +0 -46
- package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +0 -18
- package/dist/KieDmnMarshaller-LGE63WDG-3vemswef.js +0 -20
- package/dist/business-rules-pm96sefm.js +0 -26
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/hitPolicyResult-CGCR73CW-9bmc4nsr.js +0 -36
- package/dist/index-cpm94vee.js +0 -132
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-x9msn1dj.js +0 -85
- package/dist/index-ybrgtfsg.js +0 -3326
- package/dist/rule-catalog-10fhgevc.js +0 -74
- package/dist/rules-command-error-k6kxwfn7.js +0 -14
- package/dist/tool-1pccj6q3.js +0 -1116
- package/dist/tool-53w8skv5.js +0 -262
- package/dist/tool-7haj67tr.js +0 -19
- package/dist/tool-fbmxx07c.js +0 -73
- package/dist/tool-gdtpsdn7.js +0 -342
- package/dist/tool-jd313s2x.js +0 -10
- package/dist/tool-qgqscsjc.js +0 -46
- /package/dist/{tool-cfrcyxgm.js → tool-2nmqvfmt.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
OutputFormatter,
|
|
3
2
|
RESULTS,
|
|
4
3
|
classifiedFailure,
|
|
4
|
+
OutputFormatter,
|
|
5
5
|
processContext
|
|
6
|
-
} from "./tool-
|
|
6
|
+
} from "./tool-cs8nyk0r.js";
|
|
7
7
|
|
|
8
8
|
// src/services/rules-command-error.ts
|
|
9
|
-
class
|
|
9
|
+
class RulesCommandError2 extends Error {
|
|
10
10
|
errorCode;
|
|
11
11
|
instructions;
|
|
12
12
|
retry;
|
|
@@ -19,11 +19,11 @@ class RulesCommandError extends Error {
|
|
|
19
19
|
this.context = context;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function isJsonObject2(value) {
|
|
23
23
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
26
|
-
if (error instanceof
|
|
25
|
+
async function reportRulesFailure2(message, error) {
|
|
26
|
+
if (error instanceof RulesCommandError2) {
|
|
27
27
|
OutputFormatter.error({
|
|
28
28
|
Result: error.errorCode === "configuration_error" ? RESULTS.ConfigError : RESULTS.Failure,
|
|
29
29
|
ErrorCode: error.errorCode,
|
|
@@ -38,6 +38,6 @@ async function reportRulesFailure(message, error) {
|
|
|
38
38
|
processContext.exit(1);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export {
|
|
41
|
+
export { RulesCommandError2, isJsonObject2, reportRulesFailure2 };
|
|
42
42
|
|
|
43
|
-
//# debugId=
|
|
43
|
+
//# debugId=5F74FF1A10A8429C64756E2164756E21
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError,
|
|
3
|
+
logger,
|
|
4
|
+
quoteForShell,
|
|
5
|
+
unsupportedSolutionProjectType
|
|
6
|
+
} from "./tool-cs8nyk0r.js";
|
|
7
|
+
|
|
8
|
+
// ../solution-sdk/src/solution-file.ts
|
|
9
|
+
var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
|
|
10
|
+
ProcessOrchestration: "processOrchestration"
|
|
11
|
+
};
|
|
12
|
+
function normalizeProjectType(projectType) {
|
|
13
|
+
return STUDIO_WEB_PROJECT_TYPE_OVERRIDES[projectType] ?? projectType;
|
|
14
|
+
}
|
|
15
|
+
function toPortableRelativePath(relativePath) {
|
|
16
|
+
return relativePath.replace(/\\/g, "/");
|
|
17
|
+
}
|
|
18
|
+
function isRecord(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20
|
+
}
|
|
21
|
+
async function createSolutionManifest(fs, solutionDir, solutionName, options = {}) {
|
|
22
|
+
const resolvedDir = fs.path.resolve(solutionDir);
|
|
23
|
+
if (!(options.allowExistingDir && await fs.exists(resolvedDir))) {
|
|
24
|
+
await fs.mkdir(resolvedDir);
|
|
25
|
+
}
|
|
26
|
+
const solutionId = crypto.randomUUID();
|
|
27
|
+
const manifest = {
|
|
28
|
+
DocVersion: "1.0.0",
|
|
29
|
+
StudioMinVersion: "2025.10.0",
|
|
30
|
+
SolutionId: solutionId,
|
|
31
|
+
Projects: []
|
|
32
|
+
};
|
|
33
|
+
const solutionFile = fs.path.join(resolvedDir, `${solutionName}.uipx`);
|
|
34
|
+
await fs.writeFile(solutionFile, `${JSON.stringify(manifest, null, 2)}
|
|
35
|
+
`);
|
|
36
|
+
return {
|
|
37
|
+
solutionDir: resolvedDir,
|
|
38
|
+
solutionFile,
|
|
39
|
+
solutionId
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
var AUTO_SOLUTION_SUFFIX = "Solution";
|
|
43
|
+
async function autoScaffoldSolution(fs, baseDir, projectName) {
|
|
44
|
+
const solutionName = `${projectName}${AUTO_SOLUTION_SUFFIX}`;
|
|
45
|
+
const solutionDir = fs.path.resolve(baseDir, solutionName);
|
|
46
|
+
const expectedSolutionFile = fs.path.join(solutionDir, `${solutionName}.uipx`);
|
|
47
|
+
if (await fs.exists(expectedSolutionFile)) {
|
|
48
|
+
return {
|
|
49
|
+
Name: solutionName,
|
|
50
|
+
Path: solutionDir,
|
|
51
|
+
SolutionFile: expectedSolutionFile
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const { solutionFile } = await createSolutionManifest(fs, solutionDir, solutionName, { allowExistingDir: true });
|
|
55
|
+
return {
|
|
56
|
+
Name: solutionName,
|
|
57
|
+
Path: solutionDir,
|
|
58
|
+
SolutionFile: solutionFile
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function prepareProjectLocation(fs, candidateProjectDir, projectName, options = {}) {
|
|
62
|
+
const resolved = fs.path.resolve(candidateProjectDir);
|
|
63
|
+
if (options.skipRegistration) {
|
|
64
|
+
return { projectDir: resolved };
|
|
65
|
+
}
|
|
66
|
+
const discovery = await findNearestParentUipxFile(fs, resolved);
|
|
67
|
+
if (discovery.status !== "notFound") {
|
|
68
|
+
return { projectDir: resolved };
|
|
69
|
+
}
|
|
70
|
+
const baseDir = fs.path.dirname(resolved);
|
|
71
|
+
const autoCreatedSolution = await autoScaffoldSolution(fs, baseDir, projectName);
|
|
72
|
+
const projectDir = fs.path.join(autoCreatedSolution.Path, projectName);
|
|
73
|
+
await warnIfCandidateDirShadowed(fs, resolved, projectDir);
|
|
74
|
+
return { projectDir, autoCreatedSolution };
|
|
75
|
+
}
|
|
76
|
+
async function warnIfCandidateDirShadowed(fs, candidateDir, projectDir) {
|
|
77
|
+
const [, exists] = await catchError(fs.exists(candidateDir));
|
|
78
|
+
if (!exists) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const [, entries] = await catchError(fs.readdir(candidateDir));
|
|
82
|
+
if (!entries || entries.length === 0) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
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
|
+
}
|
|
87
|
+
async function updateUipxSolutionId(fs, uipxPath, newSolutionId) {
|
|
88
|
+
const [readError, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
89
|
+
if (readError || !content) {
|
|
90
|
+
logger.error(`Could not read .uipx file for update: ${readError?.message ?? "empty file"}`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const [parseError, parsed] = catchError(() => JSON.parse(content));
|
|
94
|
+
if (parseError) {
|
|
95
|
+
logger.error(`Could not parse .uipx file for update: ${parseError.message}`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
parsed.SolutionId = newSolutionId;
|
|
99
|
+
const [writeError] = await catchError(fs.writeFile(uipxPath, JSON.stringify(parsed, null, 4)));
|
|
100
|
+
if (writeError) {
|
|
101
|
+
logger.error(`Could not update .uipx with new SolutionId: ${writeError.message}`);
|
|
102
|
+
} else {
|
|
103
|
+
logger.info(`Updated .uipx with Studio Web SolutionId: ${newSolutionId}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function findSolutionFile(fs, projectPath) {
|
|
107
|
+
const parentDir = fs.path.resolve(projectPath, "..");
|
|
108
|
+
const [dirError, entries] = await catchError(fs.readdir(parentDir));
|
|
109
|
+
if (dirError) {
|
|
110
|
+
logger.error(`Could not read parent directory for .uipx file: ${dirError.message}`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const uipxFile = entries.find((entry) => entry.endsWith(".uipx"));
|
|
114
|
+
if (!uipxFile) {
|
|
115
|
+
logger.info("No .uipx solution file found in parent directory.");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const uipxPath = fs.path.join(parentDir, uipxFile);
|
|
119
|
+
const [readError, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
120
|
+
if (readError || content === null) {
|
|
121
|
+
logger.error(`Could not read .uipx file: ${readError?.message ?? "file returned null"}`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const [parseError, parsed] = catchError(() => JSON.parse(content));
|
|
125
|
+
if (parseError) {
|
|
126
|
+
logger.error(`Could not parse .uipx file: ${parseError.message}`);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const solutionId = parsed.SolutionId;
|
|
130
|
+
const projectId = parsed.Projects?.[0]?.Id;
|
|
131
|
+
if (!solutionId) {
|
|
132
|
+
logger.info("No SolutionId found in .uipx file.");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
logger.info(`Found solution file: ${uipxFile} (SolutionId: ${solutionId})`);
|
|
136
|
+
return {
|
|
137
|
+
solutionId,
|
|
138
|
+
projectId: projectId ?? crypto.randomUUID()
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
async function updateSolutionFile(fs, projectPath, newSolutionId) {
|
|
142
|
+
const parentDir = fs.path.resolve(projectPath, "..");
|
|
143
|
+
const [dirError, entries] = await catchError(fs.readdir(parentDir));
|
|
144
|
+
if (dirError)
|
|
145
|
+
return;
|
|
146
|
+
const uipxFile = entries.find((entry) => entry.endsWith(".uipx"));
|
|
147
|
+
if (!uipxFile)
|
|
148
|
+
return;
|
|
149
|
+
const uipxPath = fs.path.join(parentDir, uipxFile);
|
|
150
|
+
await updateUipxSolutionId(fs, uipxPath, newSolutionId);
|
|
151
|
+
}
|
|
152
|
+
async function tryRegisterProjectInParentSolution(fs, projectDir, options) {
|
|
153
|
+
if (options?.skipRegistration) {
|
|
154
|
+
return {
|
|
155
|
+
Status: "OptedOut",
|
|
156
|
+
Message: "Solution auto-registration skipped (--skip-solution-registration).",
|
|
157
|
+
Instructions: buildOptedOutInstructions(fs.path.resolve(projectDir))
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const [registrationError, registration] = await catchError(registerProjectInParentSolution(fs, projectDir));
|
|
161
|
+
if (registrationError) {
|
|
162
|
+
return {
|
|
163
|
+
Status: "Failed",
|
|
164
|
+
Message: "Project registration failed.",
|
|
165
|
+
Instructions: buildRegistrationFailureInstructions(projectDir, registrationError.message)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return registration;
|
|
169
|
+
}
|
|
170
|
+
async function registerProjectInParentSolution(fs, projectDir) {
|
|
171
|
+
const resolvedProjectDir = fs.path.resolve(projectDir);
|
|
172
|
+
const discovery = await findNearestParentUipxFile(fs, resolvedProjectDir);
|
|
173
|
+
if (discovery.status === "notFound") {
|
|
174
|
+
return {
|
|
175
|
+
Status: "NotInSolution",
|
|
176
|
+
Message: "Project created in standalone mode; no parent .uipx solution found.",
|
|
177
|
+
Instructions: buildStandaloneInstructions(resolvedProjectDir)
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (discovery.status === "skipped") {
|
|
181
|
+
return discovery.registration;
|
|
182
|
+
}
|
|
183
|
+
const solutionFile = discovery.solutionFile;
|
|
184
|
+
const solutionDir = fs.path.dirname(solutionFile);
|
|
185
|
+
const relativeProjectDir = fs.path.relative(solutionDir, resolvedProjectDir);
|
|
186
|
+
if (relativeProjectDir === "" || relativeProjectDir.startsWith("..") || fs.path.isAbsolute(relativeProjectDir)) {
|
|
187
|
+
return {
|
|
188
|
+
Status: "Skipped",
|
|
189
|
+
Message: "Project registration skipped.",
|
|
190
|
+
Solution: solutionFile,
|
|
191
|
+
Instructions: `Project must reside within the solution folder.
|
|
192
|
+
Solution: ${solutionDir}
|
|
193
|
+
Project: ${resolvedProjectDir}`
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const [projectFileError, projectFile] = await findProjectFile(fs, resolvedProjectDir);
|
|
197
|
+
if (projectFileError) {
|
|
198
|
+
return {
|
|
199
|
+
Status: "Failed",
|
|
200
|
+
Message: "Project registration failed.",
|
|
201
|
+
Solution: solutionFile,
|
|
202
|
+
Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, projectFileError.message)
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const [projectManifestError, projectManifest] = await readProjectManifest(fs, projectFile.filePath, projectFile.useProjectJson);
|
|
206
|
+
if (projectManifestError) {
|
|
207
|
+
return {
|
|
208
|
+
Status: "Failed",
|
|
209
|
+
Message: "Project registration failed.",
|
|
210
|
+
Solution: solutionFile,
|
|
211
|
+
Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, projectManifestError.message)
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
const unsupportedReason = unsupportedSolutionProjectType(projectManifest.projectType);
|
|
215
|
+
if (unsupportedReason) {
|
|
216
|
+
return {
|
|
217
|
+
Status: "Skipped",
|
|
218
|
+
Message: "Project registration skipped.",
|
|
219
|
+
Solution: solutionFile,
|
|
220
|
+
Instructions: unsupportedReason
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const projectRelativePath = toPortableRelativePath(fs.path.join(relativeProjectDir, projectFile.fileName));
|
|
224
|
+
const [solutionError, solution] = await readSolutionManifest(fs, solutionFile);
|
|
225
|
+
if (solutionError) {
|
|
226
|
+
return {
|
|
227
|
+
Status: "Failed",
|
|
228
|
+
Message: "Project registration failed.",
|
|
229
|
+
Solution: solutionFile,
|
|
230
|
+
Project: projectRelativePath,
|
|
231
|
+
Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, solutionError.message)
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const existingProject = solution.projects.find((project) => toPortableRelativePath(project.ProjectRelativePath) === projectRelativePath);
|
|
235
|
+
if (existingProject) {
|
|
236
|
+
return {
|
|
237
|
+
Status: "AlreadyRegistered",
|
|
238
|
+
Message: "Project already registered in solution.",
|
|
239
|
+
Solution: solutionFile,
|
|
240
|
+
Project: projectRelativePath,
|
|
241
|
+
ProjectId: typeof existingProject.Id === "string" ? existingProject.Id : undefined,
|
|
242
|
+
Instructions: buildRegistrationSuccessInstructions(solutionDir)
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const projectId = crypto.randomUUID();
|
|
246
|
+
solution.projects.push({
|
|
247
|
+
Type: normalizeProjectType(projectManifest.projectType),
|
|
248
|
+
ProjectRelativePath: projectRelativePath,
|
|
249
|
+
Id: projectId
|
|
250
|
+
});
|
|
251
|
+
solution.content.Projects = solution.projects;
|
|
252
|
+
const [writeError] = await catchError(fs.writeFile(solutionFile, `${JSON.stringify(solution.content, null, 2)}
|
|
253
|
+
`));
|
|
254
|
+
if (writeError) {
|
|
255
|
+
return {
|
|
256
|
+
Status: "Failed",
|
|
257
|
+
Message: "Project registration failed.",
|
|
258
|
+
Solution: solutionFile,
|
|
259
|
+
Project: projectRelativePath,
|
|
260
|
+
Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, writeError.message)
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
Status: "Registered",
|
|
265
|
+
Message: "Project registered in parent solution.",
|
|
266
|
+
Solution: solutionFile,
|
|
267
|
+
Project: projectRelativePath,
|
|
268
|
+
ProjectId: projectId,
|
|
269
|
+
Instructions: buildRegistrationSuccessInstructions(solutionDir)
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
async function findNearestParentUipxFile(fs, projectDir) {
|
|
273
|
+
let currentDir = fs.path.dirname(fs.path.resolve(projectDir));
|
|
274
|
+
while (true) {
|
|
275
|
+
const [readDirError, entries] = await catchError(fs.readdir(currentDir));
|
|
276
|
+
if (readDirError) {
|
|
277
|
+
return {
|
|
278
|
+
status: "skipped",
|
|
279
|
+
registration: {
|
|
280
|
+
Status: "Failed",
|
|
281
|
+
Message: "Project registration failed.",
|
|
282
|
+
Instructions: buildRegistrationFailureInstructions(projectDir, `Could not inspect parent directory for a solution: ${currentDir}
|
|
283
|
+
${readDirError.message}`)
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const solutionFiles = entries.filter((entry) => entry.endsWith(".uipx"));
|
|
288
|
+
if (solutionFiles.length > 1) {
|
|
289
|
+
return {
|
|
290
|
+
status: "skipped",
|
|
291
|
+
registration: {
|
|
292
|
+
Status: "Skipped",
|
|
293
|
+
Message: "Project registration skipped.",
|
|
294
|
+
Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution projects add "${projectDir}" <solution.uipx>' to choose one.`
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
if (solutionFiles.length === 1) {
|
|
299
|
+
return {
|
|
300
|
+
status: "found",
|
|
301
|
+
solutionFile: fs.path.join(currentDir, solutionFiles[0])
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
const parentDir = fs.path.dirname(currentDir);
|
|
305
|
+
if (parentDir === currentDir) {
|
|
306
|
+
return { status: "notFound" };
|
|
307
|
+
}
|
|
308
|
+
currentDir = parentDir;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
async function findProjectFile(fs, projectDir) {
|
|
312
|
+
const uiprojPath = fs.path.join(projectDir, "project.uiproj");
|
|
313
|
+
if (await fs.exists(uiprojPath)) {
|
|
314
|
+
return [
|
|
315
|
+
null,
|
|
316
|
+
{
|
|
317
|
+
filePath: uiprojPath,
|
|
318
|
+
fileName: "project.uiproj",
|
|
319
|
+
useProjectJson: false
|
|
320
|
+
}
|
|
321
|
+
];
|
|
322
|
+
}
|
|
323
|
+
const jsonProjectPath = fs.path.join(projectDir, "project.json");
|
|
324
|
+
if (await fs.exists(jsonProjectPath)) {
|
|
325
|
+
return [
|
|
326
|
+
null,
|
|
327
|
+
{
|
|
328
|
+
filePath: jsonProjectPath,
|
|
329
|
+
fileName: "project.json",
|
|
330
|
+
useProjectJson: true
|
|
331
|
+
}
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
return [
|
|
335
|
+
new Error(`No project file found in ${projectDir}. Expected project.uiproj or project.json.`),
|
|
336
|
+
null
|
|
337
|
+
];
|
|
338
|
+
}
|
|
339
|
+
async function readProjectManifest(fs, filePath, useProjectJson) {
|
|
340
|
+
const [readError, rawContent] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
341
|
+
if (readError || !rawContent) {
|
|
342
|
+
return [readError ?? new Error(`Unable to read ${filePath}.`), null];
|
|
343
|
+
}
|
|
344
|
+
const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
|
|
345
|
+
if (parseError) {
|
|
346
|
+
return [
|
|
347
|
+
new Error(`Invalid JSON in project file: ${parseError.message}`),
|
|
348
|
+
null
|
|
349
|
+
];
|
|
350
|
+
}
|
|
351
|
+
if (!isRecord(parsed)) {
|
|
352
|
+
return [new Error(`Invalid project file: ${filePath}`), null];
|
|
353
|
+
}
|
|
354
|
+
const designOptions = parsed.designOptions;
|
|
355
|
+
const outputType = useProjectJson && isRecord(designOptions) ? readString(designOptions.outputType) : undefined;
|
|
356
|
+
const projectType = outputType ?? readString(parsed.ProjectType);
|
|
357
|
+
if (!projectType) {
|
|
358
|
+
return [new Error(`ProjectType not found in ${filePath}`), null];
|
|
359
|
+
}
|
|
360
|
+
return [
|
|
361
|
+
null,
|
|
362
|
+
{
|
|
363
|
+
projectType
|
|
364
|
+
}
|
|
365
|
+
];
|
|
366
|
+
}
|
|
367
|
+
async function readSolutionManifest(fs, solutionFile) {
|
|
368
|
+
const [readError, rawContent] = await catchError(fs.readFile(solutionFile, "utf-8"));
|
|
369
|
+
if (readError || !rawContent) {
|
|
370
|
+
return [
|
|
371
|
+
readError ?? new Error(`Unable to read solution file: ${solutionFile}`),
|
|
372
|
+
null
|
|
373
|
+
];
|
|
374
|
+
}
|
|
375
|
+
const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
|
|
376
|
+
if (parseError) {
|
|
377
|
+
return [
|
|
378
|
+
new Error(`Invalid JSON in solution file: ${parseError.message}`),
|
|
379
|
+
null
|
|
380
|
+
];
|
|
381
|
+
}
|
|
382
|
+
if (!isRecord(parsed)) {
|
|
383
|
+
return [
|
|
384
|
+
new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
|
|
385
|
+
null
|
|
386
|
+
];
|
|
387
|
+
}
|
|
388
|
+
if (!Array.isArray(parsed.Projects)) {
|
|
389
|
+
return [
|
|
390
|
+
new Error(`Invalid solution file: ${solutionFile} must contain a Projects array.`),
|
|
391
|
+
null
|
|
392
|
+
];
|
|
393
|
+
}
|
|
394
|
+
const projects = [];
|
|
395
|
+
for (const [index, project] of parsed.Projects.entries()) {
|
|
396
|
+
if (!isRecord(project)) {
|
|
397
|
+
return [
|
|
398
|
+
new Error(`Invalid solution file: Projects[${index}] must be an object.`),
|
|
399
|
+
null
|
|
400
|
+
];
|
|
401
|
+
}
|
|
402
|
+
const projectRelativePath = readString(project.ProjectRelativePath);
|
|
403
|
+
if (!projectRelativePath) {
|
|
404
|
+
return [
|
|
405
|
+
new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution projects add' to repair the manifest.`),
|
|
406
|
+
null
|
|
407
|
+
];
|
|
408
|
+
}
|
|
409
|
+
projects.push({
|
|
410
|
+
...project,
|
|
411
|
+
Type: readString(project.Type) ?? "",
|
|
412
|
+
ProjectRelativePath: projectRelativePath,
|
|
413
|
+
Id: readString(project.Id) ?? ""
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
return [null, { content: parsed, projects }];
|
|
417
|
+
}
|
|
418
|
+
function readString(value) {
|
|
419
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
420
|
+
}
|
|
421
|
+
function buildRegistrationSuccessInstructions(solutionDir) {
|
|
422
|
+
return [
|
|
423
|
+
"The project is listed in the parent solution manifest.",
|
|
424
|
+
"Packing or uploading the solution will sync solution resources automatically.",
|
|
425
|
+
`To sync resources before packaging, run: uip solution resources refresh --solution-folder ${quoteForShell(solutionDir)}`
|
|
426
|
+
].join(`
|
|
427
|
+
`);
|
|
428
|
+
}
|
|
429
|
+
function buildRegistrationFailureInstructions(projectDir, details) {
|
|
430
|
+
return [
|
|
431
|
+
"Automatic solution registration could not complete.",
|
|
432
|
+
`Run 'uip solution projects add "${projectDir}" <solution.uipx>' after checking the project and solution files.`,
|
|
433
|
+
`Details: ${details}`
|
|
434
|
+
].join(`
|
|
435
|
+
`);
|
|
436
|
+
}
|
|
437
|
+
function buildStandaloneInstructions(projectDir) {
|
|
438
|
+
return [
|
|
439
|
+
"No parent solution was found by walking ancestor directories.",
|
|
440
|
+
"Studio Web upload, `flow debug`, and packaging require an enclosing solution.",
|
|
441
|
+
`To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution projects add "${projectDir}" <SolutionName>.uipx'.`
|
|
442
|
+
].join(`
|
|
443
|
+
`);
|
|
444
|
+
}
|
|
445
|
+
function buildOptedOutInstructions(projectDir) {
|
|
446
|
+
return [
|
|
447
|
+
"Automatic solution registration was skipped because --skip-solution-registration was passed.",
|
|
448
|
+
`To register this project later, run 'uip solution projects add "${projectDir}" <SolutionName>.uipx' from within the solution.`
|
|
449
|
+
].join(`
|
|
450
|
+
`);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export { normalizeProjectType, toPortableRelativePath, prepareProjectLocation, findSolutionFile, updateSolutionFile, tryRegisterProjectInParentSolution };
|
|
454
|
+
|
|
455
|
+
//# debugId=493FBF7C33D5BE6D64756E2164756E21
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// ../../node_modules/@uipath/dmn-editor-utils/dist/chunks/chunk-H6JHU73X.js
|
|
2
|
+
var e = { First: "FIRST", Unique: "UNIQUE", Priority: "PRIORITY", Any: "ANY", Collect: "COLLECT", RuleOrder: "RULE ORDER", OutputOrder: "OUTPUT ORDER" };
|
|
3
|
+
var t = Object.values(e);
|
|
4
|
+
var n = { Sum: "SUM", Min: "MIN", Max: "MAX", Count: "COUNT" };
|
|
5
|
+
var i = Object.values(n);
|
|
6
|
+
var r = ["string", "number", "boolean", "Any", "date", "time", "date and time", "dayTimeDuration", "yearMonthDuration"];
|
|
4
7
|
|
|
5
8
|
// ../../node_modules/@uipath/dmn-editor-utils/dist/chunks/chunk-HIWFLOJ4.js
|
|
6
|
-
var
|
|
9
|
+
var x2 = (e) => e.includes(":") ? e.split(":").pop() ?? e : e;
|
|
7
10
|
var w = new Set(["number", "integer", "long", "double", "decimal"]);
|
|
8
|
-
var $ = (e) => w.has(
|
|
9
|
-
var
|
|
11
|
+
var $ = (e) => w.has(x2(e));
|
|
12
|
+
var R2 = (e) => $(e) ? "number" : x2(e);
|
|
10
13
|
var z = (e) => {
|
|
11
14
|
let n = e.chain[e.chain.length - 1];
|
|
12
15
|
return !e.components && !e.recursive && !!n && !n.allowedValues && !e.baseTypeRef && !e.foreign;
|
|
@@ -32,7 +35,7 @@ var K = (e, n) => {
|
|
|
32
35
|
}
|
|
33
36
|
return t ? { type: t } : {};
|
|
34
37
|
};
|
|
35
|
-
var
|
|
38
|
+
var m4 = (e) => {
|
|
36
39
|
let n = Object.entries(e ?? {}).flatMap(([t, o]) => t.startsWith("@_xmlns:") && typeof o == "string" ? [[t.slice(8), o]] : []);
|
|
37
40
|
return n.length ? Object.fromEntries(n) : undefined;
|
|
38
41
|
};
|
|
@@ -44,12 +47,12 @@ var f = (e, n, t = [], o) => {
|
|
|
44
47
|
}
|
|
45
48
|
if (!e || typeof e != "object" || o?.(e))
|
|
46
49
|
return;
|
|
47
|
-
let s =
|
|
50
|
+
let s = m4(e), r2 = s ? [s, ...t] : t;
|
|
48
51
|
for (let [i, a] of Object.entries(e))
|
|
49
52
|
if (i === "@_typeRef" && typeof a == "string")
|
|
50
53
|
n(a, r2);
|
|
51
54
|
else if (i === "typeRef" && typeof a?.__$$text == "string") {
|
|
52
|
-
let p =
|
|
55
|
+
let p = m4(a);
|
|
53
56
|
n(a.__$$text, p ? [p, ...r2] : r2);
|
|
54
57
|
} else
|
|
55
58
|
i !== "dmndi:DMNDI" && f(a, n, r2, o);
|
|
@@ -68,34 +71,34 @@ var k = (e) => {
|
|
|
68
71
|
}, o = I([e]);
|
|
69
72
|
return f([e.itemDefinition, e.drgElement], t, o), n.size ? Object.fromEntries(n) : undefined;
|
|
70
73
|
};
|
|
71
|
-
var
|
|
74
|
+
var A2 = (e) => {
|
|
72
75
|
let n = new Set, t = (s) => {
|
|
73
76
|
let r2 = s;
|
|
74
77
|
for (let i = 2;n.has(r2); i++)
|
|
75
78
|
r2 = `${s}#${i}`;
|
|
76
79
|
return n.add(r2), r2;
|
|
77
80
|
}, o = (s, r2) => {
|
|
78
|
-
let i = s["@_id"] || t(r2), a = s.itemComponent?.map((l) => o(l, `${i}/${l["@_name"]}`)), p =
|
|
81
|
+
let i = s["@_id"] || t(r2), a = s.itemComponent?.map((l) => o(l, `${i}/${l["@_name"]}`)), p = m4(s), c = m4(s.typeRef);
|
|
79
82
|
return { id: i, name: s["@_name"] ?? "", isCollection: s["@_isCollection"] === true, typeRef: s.typeRef?.__$$text, allowedValues: s.allowedValues?.text?.__$$text, ...a?.length ? { components: a } : {}, ...p ? { namespaces: p } : {}, ...c ? { typeRefNamespaces: c } : {} };
|
|
80
83
|
};
|
|
81
84
|
return e.itemDefinition?.map((s) => o(s, `itemDefinition/${s["@_name"]}`));
|
|
82
85
|
};
|
|
83
|
-
var Q = (e) => ({ itemDefinitions:
|
|
84
|
-
var
|
|
86
|
+
var Q = (e) => ({ itemDefinitions: A2(e), namespace: e["@_namespace"], namespaces: k(e) });
|
|
87
|
+
var j2 = (e) => ("inputExpression" in e) ? e.inputExpression?.text?.__$$text?.trim() : undefined;
|
|
85
88
|
var q = (e, n) => {
|
|
86
89
|
let t = e.drgElement ?? [], o = new Set(t.flatMap((r2) => {
|
|
87
90
|
if (r2.__$$element !== "inputData")
|
|
88
91
|
return [];
|
|
89
92
|
let i = (r2.variable?.["@_name"]?.trim() || r2["@_name"]?.trim()) ?? "";
|
|
90
93
|
return i ? [i] : [];
|
|
91
|
-
})), s = (r2) => o.has(
|
|
94
|
+
})), s = (r2) => o.has(j2(r2) ?? "");
|
|
92
95
|
return M(e, t.filter((r2) => r2 !== n && r2.__$$element !== "inputData"), s);
|
|
93
96
|
};
|
|
94
97
|
var C = /^([\p{L}_][\p{L}\p{N}_.-]*):(.+)$/u;
|
|
95
98
|
var L = /^https?:\/\/www\.omg\.org\/spec\/(?:FEEL\/\d{8}|DMN\/\d{8}\/FEEL)\/?$/;
|
|
96
99
|
var y = (e, n) => n.find((t) => Object.prototype.hasOwnProperty.call(t, e))?.[e];
|
|
97
100
|
var I = (e) => e.flatMap((n) => {
|
|
98
|
-
let t =
|
|
101
|
+
let t = m4(n);
|
|
99
102
|
return t ? [t] : [];
|
|
100
103
|
});
|
|
101
104
|
var F = new Map;
|
|
@@ -130,10 +133,6 @@ var G = (e, n) => {
|
|
|
130
133
|
let { name: t, space: o } = d(n.typeRef, g(n, u(e)).typeRefScope, e);
|
|
131
134
|
return o === "local" ? N(e.itemDefinitions).get(t) : undefined;
|
|
132
135
|
};
|
|
133
|
-
var H = (e, n) => {
|
|
134
|
-
let { name: t, space: o } = d(n, u(e), e);
|
|
135
|
-
return o === "local" ? t : undefined;
|
|
136
|
-
};
|
|
137
136
|
var E = (e, n, t, o = [], s = t) => {
|
|
138
137
|
let r2 = N(e.itemDefinitions);
|
|
139
138
|
for (;; ) {
|
|
@@ -147,7 +146,7 @@ var E = (e, n, t, o = [], s = t) => {
|
|
|
147
146
|
if (l >= 0 && o.slice(l).some((D) => D.isCollection))
|
|
148
147
|
return { chain: o, scope: s, isCollection: i, recursive: true };
|
|
149
148
|
if (!c || l >= 0)
|
|
150
|
-
return { chain: o, scope: s, isCollection: i, baseTypeRef:
|
|
149
|
+
return { chain: o, scope: s, isCollection: i, baseTypeRef: R2(a) };
|
|
151
150
|
o.push(c), { scope: s, typeRefScope: t } = g(c, u(e)), n = c.typeRef;
|
|
152
151
|
}
|
|
153
152
|
};
|
|
@@ -165,12 +164,55 @@ var h = ({ scope: e, ...n }, t, o) => {
|
|
|
165
164
|
return { ...n, components: i };
|
|
166
165
|
};
|
|
167
166
|
var v = (e, n, t) => E(e, n, [...t, ...u(e)]);
|
|
168
|
-
var
|
|
169
|
-
var
|
|
167
|
+
var J2 = (e, n, t = []) => h(v(e, n, t), e, new Set);
|
|
168
|
+
var X2 = (e, n, t = []) => {
|
|
170
169
|
let { scope: o, ...s } = v(e, n, t);
|
|
171
170
|
return s;
|
|
172
171
|
};
|
|
173
172
|
|
|
174
|
-
|
|
173
|
+
// ../../node_modules/uuid/dist-node/rng.js
|
|
174
|
+
var rnds8 = new Uint8Array(16);
|
|
175
|
+
function rng() {
|
|
176
|
+
return crypto.getRandomValues(rnds8);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ../../node_modules/uuid/dist-node/stringify.js
|
|
180
|
+
var byteToHex = [];
|
|
181
|
+
for (let i = 0;i < 256; ++i) {
|
|
182
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
183
|
+
}
|
|
184
|
+
function unsafeStringify(arr, offset = 0) {
|
|
185
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ../../node_modules/uuid/dist-node/v4.js
|
|
189
|
+
function v4(options, buf, offset) {
|
|
190
|
+
if (!buf && !options && crypto.randomUUID) {
|
|
191
|
+
return crypto.randomUUID();
|
|
192
|
+
}
|
|
193
|
+
return _v4(options, buf, offset);
|
|
194
|
+
}
|
|
195
|
+
function _v4(options, buf, offset) {
|
|
196
|
+
options = options || {};
|
|
197
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
198
|
+
if (rnds.length < 16) {
|
|
199
|
+
throw new Error("Random bytes length must be >= 16");
|
|
200
|
+
}
|
|
201
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
202
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
203
|
+
if (buf) {
|
|
204
|
+
offset = offset || 0;
|
|
205
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
206
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
207
|
+
}
|
|
208
|
+
for (let i = 0;i < 16; ++i) {
|
|
209
|
+
buf[offset + i] = rnds[i];
|
|
210
|
+
}
|
|
211
|
+
return buf;
|
|
212
|
+
}
|
|
213
|
+
return unsafeStringify(rnds);
|
|
214
|
+
}
|
|
215
|
+
var v4_default = v4;
|
|
216
|
+
export { e, t, n, i, r, x2, R2, z, B, U, K, m4, A2, Q, j2, q, y, I, G, J2, X2, v4_default };
|
|
175
217
|
|
|
176
|
-
//# debugId=
|
|
218
|
+
//# debugId=518457718687AF1264756E2164756E21
|