@uipath/solution-tool 1.202.0 → 1.203.0-preview.160
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/THIRD-PARTY-NOTICES.md +23 -1
- package/dist/deploy.js +7 -6
- package/dist/{packager-tool-bt0z25tw.js → embedded-file-reader-xxqe8vs8.js} +98 -16584
- package/dist/first-party-service-sd8yaf73.js +27 -0
- package/dist/index-dqa169gp.js +25 -0
- package/dist/index.js +19 -13
- package/dist/init.js +8 -5
- package/dist/{list-8hvfmge6.js → list-dadxggxt.js} +5 -4
- package/dist/models/pack-command-types.d.ts +33 -5
- package/dist/pack.js +12 -6
- package/dist/{packager-tool-fjjh5veg.js → packager-tool-0f0wt9vh.js} +353 -1519
- package/dist/{packager-tool-pbmpgz04.js → packager-tool-1haahq17.js} +5 -3
- package/dist/{packager-tool-rbrcxjch.js → packager-tool-2syrt51a.js} +7 -4
- package/dist/packager-tool-3jrq7smt.js +1459 -0
- package/dist/packager-tool-53w8skv5.js +262 -0
- package/dist/packager-tool-7znqtw3f.js +244 -0
- package/dist/packager-tool-bkwnetqn.js +16678 -0
- package/dist/{packager-tool-5518wy6n.js → packager-tool-cp07fhx3.js} +9 -6
- package/dist/{packager-tool-w1dzcj31.js → packager-tool-cvfbzs9p.js} +359 -95
- package/dist/packager-tool-gdtpsdn7.js +342 -0
- package/dist/{packager-tool-pyygbnp2.js → packager-tool-htag6yh5.js} +4 -4
- package/dist/{packager-tool-3bewrpq4.js → packager-tool-jz2wbfjz.js} +4 -1
- package/dist/packager-tool-k4mskzww.js +125 -0
- package/dist/{packager-tool-vfcht7hq.js → packager-tool-mj5p341c.js} +11 -12
- package/dist/{packager-tool-bme8epz8.js → packager-tool-n4nfqj99.js} +15381 -2421
- package/dist/{packager-tool-mcpzmn0v.js → packager-tool-rc5pcf2n.js} +45 -21
- package/dist/packager-tool-resolver-fmjr60x8.js +19 -0
- package/dist/{packager-tool-pw7v82j2.js → packager-tool-vas0xg5h.js} +1 -1
- package/dist/packager-tool-znakt6yw.js +188 -0
- package/dist/packager-tool.d.ts +1 -1
- package/dist/packager-tool.js +1 -1
- package/dist/prepare-solution-resources-wds3r8bq.js +22 -0
- package/dist/project-contributions-cvttys34.js +27 -0
- package/dist/publish.js +7 -6
- package/dist/resource.js +7 -4
- package/dist/services/deployment-validation.d.ts +33 -0
- package/dist/services/governance-options.d.ts +61 -1
- package/dist/services/pack-command-service.d.ts +33 -2
- package/dist/services/packager-tool-resolver.d.ts +3 -0
- package/dist/services/prepare-solution-resources.d.ts +40 -0
- package/dist/services/project-contributions.d.ts +58 -0
- package/dist/services/project-type-tools.d.ts +6 -0
- package/dist/templates/AGENTS.md +78 -8
- package/dist/tool.js +19 -13
- package/package.json +3 -2
- package/dist/services/validate-appv2-action-schemas.d.ts +0 -10
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
listSelectablePublishLocations,
|
|
8
8
|
resolveFeedScope,
|
|
9
9
|
resolvePersonalWorkspace
|
|
10
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-cp07fhx3.js";
|
|
11
11
|
import {
|
|
12
12
|
Configuration as Configuration2,
|
|
13
13
|
DeploymentOperationStatus,
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
SolutionDeploymentAction,
|
|
17
17
|
deploymentsAutoInstall,
|
|
18
18
|
searchPackageVersions
|
|
19
|
-
} from "./packager-tool-
|
|
19
|
+
} from "./packager-tool-mj5p341c.js";
|
|
20
20
|
import {
|
|
21
21
|
getSolutionAuthContext,
|
|
22
22
|
resolveFolder
|
|
23
|
-
} from "./packager-tool-
|
|
23
|
+
} from "./packager-tool-2syrt51a.js";
|
|
24
24
|
import {
|
|
25
25
|
DEFAULT_PAGE_SIZE,
|
|
26
26
|
PollOutcome,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
mapPollFailure,
|
|
32
32
|
pollUntil,
|
|
33
33
|
processContext
|
|
34
|
-
} from "./packager-tool-
|
|
34
|
+
} from "./packager-tool-0f0wt9vh.js";
|
|
35
35
|
import {
|
|
36
36
|
__commonJS,
|
|
37
37
|
__require
|
|
@@ -7697,6 +7697,43 @@ var $stringify = publicApi.stringify;
|
|
|
7697
7697
|
var $visit = visit.visit;
|
|
7698
7698
|
var $visitAsync = visit.visitAsync;
|
|
7699
7699
|
|
|
7700
|
+
// src/services/deployment-validation.ts
|
|
7701
|
+
var NO_SERVER_REASON = "the server reported no reason.";
|
|
7702
|
+
var LOOKUP_TIMEOUT_MS = 15000;
|
|
7703
|
+
function boundedScope(scope, signal) {
|
|
7704
|
+
const deadline = AbortSignal.timeout(LOOKUP_TIMEOUT_MS);
|
|
7705
|
+
const abort = signal ? AbortSignal.any([signal, deadline]) : deadline;
|
|
7706
|
+
return async (requestContext) => ({
|
|
7707
|
+
...await scope?.(requestContext),
|
|
7708
|
+
signal: abort
|
|
7709
|
+
});
|
|
7710
|
+
}
|
|
7711
|
+
async function describeValidationFailureAsync(deploymentsApi, deploymentKey, deploymentAction, scope, signal) {
|
|
7712
|
+
const [error, validation] = await catchError(deploymentsApi.deploymentsGetValidationResult({ deploymentKey, deploymentAction }, boundedScope(scope, signal)));
|
|
7713
|
+
if (error || !validation) {
|
|
7714
|
+
return NO_SERVER_REASON;
|
|
7715
|
+
}
|
|
7716
|
+
const messages = [
|
|
7717
|
+
...validation.validationErrors.map((item) => item.text || item.resource),
|
|
7718
|
+
...validation.resourceValidationErrors.flatMap((resource) => resource.errors.map((item) => item.text || item.resource))
|
|
7719
|
+
].filter(Boolean);
|
|
7720
|
+
return messages.length > 0 ? messages.join("; ") : NO_SERVER_REASON;
|
|
7721
|
+
}
|
|
7722
|
+
async function describeDeploymentFailureAsync(auth, deployment, deploymentAction, scope, signal) {
|
|
7723
|
+
const deploymentsApi = new DeploymentsApi(new Configuration2({
|
|
7724
|
+
basePath: auth.basePath,
|
|
7725
|
+
accessToken: auth.accessToken
|
|
7726
|
+
}));
|
|
7727
|
+
const keys = [deployment.key, deployment.installDeploymentKey].filter((key, index, all) => Boolean(key) && all.indexOf(key) === index);
|
|
7728
|
+
for (const key of keys) {
|
|
7729
|
+
const reason = await describeValidationFailureAsync(deploymentsApi, key, deploymentAction, scope, signal);
|
|
7730
|
+
if (reason !== NO_SERVER_REASON) {
|
|
7731
|
+
return reason;
|
|
7732
|
+
}
|
|
7733
|
+
}
|
|
7734
|
+
return NO_SERVER_REASON;
|
|
7735
|
+
}
|
|
7736
|
+
|
|
7700
7737
|
// src/services/personal-workspace-deploy.ts
|
|
7701
7738
|
async function deployToFeed(auth, target, params) {
|
|
7702
7739
|
const config = new Configuration2({
|
|
@@ -8162,7 +8199,8 @@ async function awaitFeedDeployAsync(auth, scope, options, started, deploymentNam
|
|
|
8162
8199
|
}
|
|
8163
8200
|
const deployment = pollResult.data;
|
|
8164
8201
|
if (deployment.operationStatus !== "Successful") {
|
|
8165
|
-
|
|
8202
|
+
const reason = await describeDeploymentFailureAsync(auth, deployment, SolutionDeploymentAction.Install, scopeOverride, options.signal);
|
|
8203
|
+
return fail3("deploy_failed", `Deployment '${deploymentName}' failed (OperationStatus: ${deployment.operationStatus}): ${reason}`, `Inspect the deployment with: uip solution deploy list, fix the underlying issue, then deploy again.`);
|
|
8166
8204
|
}
|
|
8167
8205
|
return {
|
|
8168
8206
|
...started,
|
|
@@ -8512,7 +8550,7 @@ async function upgradeDeploymentAsync(deploymentKey, options = {}) {
|
|
|
8512
8550
|
}
|
|
8513
8551
|
const status = poll.status;
|
|
8514
8552
|
if (FAILURE_STATUSES.has(status)) {
|
|
8515
|
-
return fail5("install_failed", `The upgrade of '${deployment.name}' to ${pkg.latestVersion} ended in ${status}: ${await describeValidationFailureAsync(deploymentsApi, draft.key, upgradeScope)}`, "Fix the reported problem, then retry the upgrade.");
|
|
8553
|
+
return fail5("install_failed", `The upgrade of '${deployment.name}' to ${pkg.latestVersion} ended in ${status}: ${await describeValidationFailureAsync(deploymentsApi, draft.key, SolutionDeploymentAction.Upgrade, upgradeScope)}`, "Fix the reported problem, then retry the upgrade.");
|
|
8516
8554
|
}
|
|
8517
8555
|
return { ok: true, ...base, status };
|
|
8518
8556
|
}
|
|
@@ -8544,20 +8582,6 @@ async function pollInstallAsync(deploymentsApi, versionChangeKey, scope, timing)
|
|
|
8544
8582
|
failure: mapPollFailure(result, `Upgrade ${versionChangeKey}`)
|
|
8545
8583
|
};
|
|
8546
8584
|
}
|
|
8547
|
-
async function describeValidationFailureAsync(deploymentsApi, versionChangeKey, scope) {
|
|
8548
|
-
const [error, validation] = await catchError(deploymentsApi.deploymentsGetValidationResult({
|
|
8549
|
-
deploymentKey: versionChangeKey,
|
|
8550
|
-
deploymentAction: SolutionDeploymentAction.Upgrade
|
|
8551
|
-
}, scope));
|
|
8552
|
-
if (error || !validation) {
|
|
8553
|
-
return "the server reported no reason.";
|
|
8554
|
-
}
|
|
8555
|
-
const messages = [
|
|
8556
|
-
...validation.validationErrors.map((item) => item.text || item.resource),
|
|
8557
|
-
...validation.resourceValidationErrors.flatMap((resource) => resource.errors.map((item) => item.text || item.resource))
|
|
8558
|
-
].filter(Boolean);
|
|
8559
|
-
return messages.length > 0 ? messages.join("; ") : "the server reported no reason.";
|
|
8560
|
-
}
|
|
8561
8585
|
|
|
8562
8586
|
// src/services/packages-list-service.ts
|
|
8563
8587
|
var fail6 = (reason, message, instructions, exitCode = 1) => ({
|
|
@@ -8617,4 +8641,4 @@ async function listPackagesAsync(options = {}) {
|
|
|
8617
8641
|
|
|
8618
8642
|
export { extractDeploymentErrors, formatDeploymentErrorsAsText, activateDeploymentAsync, listDeploymentsAsync, deployRunAsync, uninstallDeploymentAsync, upgradeDeploymentAsync, listPackagesAsync };
|
|
8619
8643
|
|
|
8620
|
-
//# debugId=
|
|
8644
|
+
//# debugId=C7F5318965ACD96664756E2164756E21
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UnpackableProjectTypeError,
|
|
3
|
+
ensurePackagerTools,
|
|
4
|
+
isUnpackableProjectTypeError,
|
|
5
|
+
toolVerbForProjectType
|
|
6
|
+
} from "./packager-tool-k4mskzww.js";
|
|
7
|
+
import"./packager-tool-jz2wbfjz.js";
|
|
8
|
+
import"./packager-tool-nzghfa48.js";
|
|
9
|
+
import"./packager-tool-0f0wt9vh.js";
|
|
10
|
+
import"./packager-tool-dfrk01gn.js";
|
|
11
|
+
import"./packager-tool-1de529jm.js";
|
|
12
|
+
export {
|
|
13
|
+
UnpackableProjectTypeError,
|
|
14
|
+
ensurePackagerTools,
|
|
15
|
+
isUnpackableProjectTypeError,
|
|
16
|
+
toolVerbForProjectType
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# debugId=E7AC0B5156657E9564756E2164756E21
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toolVerbForProjectType
|
|
3
|
+
} from "./packager-tool-k4mskzww.js";
|
|
4
|
+
import {
|
|
5
|
+
computeEntryPointSpec,
|
|
6
|
+
createResourceBuilderServices,
|
|
7
|
+
hasAnyTemplateRow,
|
|
8
|
+
hasBareTemplateRow,
|
|
9
|
+
readUipxProjects
|
|
10
|
+
} from "./packager-tool-bkwnetqn.js";
|
|
11
|
+
import {
|
|
12
|
+
toolsFactoryRepository
|
|
13
|
+
} from "./packager-tool-nzghfa48.js";
|
|
14
|
+
import {
|
|
15
|
+
catchError,
|
|
16
|
+
getFileSystem,
|
|
17
|
+
logger
|
|
18
|
+
} from "./packager-tool-0f0wt9vh.js";
|
|
19
|
+
|
|
20
|
+
// src/services/project-contributions.ts
|
|
21
|
+
var ENTRY_POINT_RESOURCE_KIND = "process";
|
|
22
|
+
|
|
23
|
+
class ProjectContributionsError extends Error {
|
|
24
|
+
contributionErrors;
|
|
25
|
+
instructions;
|
|
26
|
+
errorCode = "invalid_argument";
|
|
27
|
+
contributionCode;
|
|
28
|
+
constructor(errors) {
|
|
29
|
+
super(errors.map((e) => e.message).join(`
|
|
30
|
+
`));
|
|
31
|
+
this.name = "ProjectContributionsError";
|
|
32
|
+
this.contributionErrors = errors;
|
|
33
|
+
const instructions = errors.map((e) => e.instructions).filter((i) => typeof i === "string" && i.length > 0);
|
|
34
|
+
this.instructions = instructions.length > 0 ? [...new Set(instructions)].join(" ") : undefined;
|
|
35
|
+
const codes = errors.map((e) => e.code);
|
|
36
|
+
const everyCoded = codes.every((c) => typeof c === "string" && c.length > 0);
|
|
37
|
+
this.contributionCode = everyCoded && new Set(codes).size === 1 ? codes[0] : undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function collectProjectContributions(solutionDir, fs = getFileSystem()) {
|
|
41
|
+
const byProject = new Map;
|
|
42
|
+
const skipped = [];
|
|
43
|
+
const projects = await readUipxProjects(solutionDir);
|
|
44
|
+
for (const project of projects) {
|
|
45
|
+
if (!toolsFactoryRepository.canHandleProject(project.type))
|
|
46
|
+
continue;
|
|
47
|
+
const factory = toolsFactoryRepository.getProjectToolFactory(project.type);
|
|
48
|
+
if (typeof factory.describeResourcesAsync !== "function") {
|
|
49
|
+
const verb = toolVerbForProjectType(project.type);
|
|
50
|
+
const update = verb ? `update the tool that provides it ('uip tools install ${verb}')` : "update the tool that provides it";
|
|
51
|
+
if (!hasBareTemplateRow(project.type) && hasAnyTemplateRow(project.type)) {
|
|
52
|
+
byProject.set(project.id, {
|
|
53
|
+
errors: [
|
|
54
|
+
{
|
|
55
|
+
code: "contribution_unavailable",
|
|
56
|
+
message: `Project '${project.name}' (${project.type}) has no resource contribution: the installed tool for its type predates the contract, and ${project.type} artefact resources are generated only from that contribution.`,
|
|
57
|
+
instructions: `To generate them, ${update}, then re-run the command.`
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const notice = `Project '${project.name}' (${project.type}) was not checked for resource contributions; ${update}.`;
|
|
64
|
+
skipped.push(notice);
|
|
65
|
+
logger.warn(notice);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const [describeError, contribution] = await catchError(factory.describeResourcesAsync(project.path, fs));
|
|
69
|
+
if (describeError) {
|
|
70
|
+
byProject.set(project.id, {
|
|
71
|
+
errors: [
|
|
72
|
+
{
|
|
73
|
+
code: "contribution_failed",
|
|
74
|
+
message: `Project '${project.name}' (${project.type}) failed to describe its resource contribution: ${describeError.message}`,
|
|
75
|
+
instructions: `Fix the reported problem in ${project.path}, then re-run the command.`
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (contribution)
|
|
82
|
+
byProject.set(project.id, contribution);
|
|
83
|
+
}
|
|
84
|
+
return { byProject, skipped };
|
|
85
|
+
}
|
|
86
|
+
function assertNoContributionErrors(contributions) {
|
|
87
|
+
const errors = [...contributions.byProject.values()].flatMap((c) => c.errors ?? []);
|
|
88
|
+
if (errors.length === 0)
|
|
89
|
+
return;
|
|
90
|
+
throw new ProjectContributionsError(errors);
|
|
91
|
+
}
|
|
92
|
+
function contributionErrorMessages(contributions) {
|
|
93
|
+
return [...contributions.byProject.values()].flatMap((c) => c.errors ?? []).map((e) => e.instructions ? `${e.message} ${e.instructions}` : e.message);
|
|
94
|
+
}
|
|
95
|
+
async function applyProjectContributions(solutionDir, contributions, options, fs = getFileSystem()) {
|
|
96
|
+
const result = {
|
|
97
|
+
updated: 0,
|
|
98
|
+
warnings: [...contributions.skipped]
|
|
99
|
+
};
|
|
100
|
+
const services = await createResourceBuilderServices();
|
|
101
|
+
const builder = await services.getSolutionBuilder(solutionDir);
|
|
102
|
+
try {
|
|
103
|
+
const solution = await builder.context.loadAsync();
|
|
104
|
+
const resources = solution?.resources ?? [];
|
|
105
|
+
const touched = new Set;
|
|
106
|
+
for (const [projectKey, contribution] of contributions.byProject) {
|
|
107
|
+
for (const patch of contribution.specPatch ?? []) {
|
|
108
|
+
const matches = resources.filter((r) => r.projectKey === projectKey && r.kind?.toLowerCase() === patch.kind.toLowerCase());
|
|
109
|
+
if (matches.length === 0) {
|
|
110
|
+
const message = `No '${patch.kind}' resource found for project '${projectKey}' — nothing to apply the contributed spec to.`;
|
|
111
|
+
if (options?.failOnUnmatchedPatch) {
|
|
112
|
+
throw new Error(message);
|
|
113
|
+
}
|
|
114
|
+
result.warnings.push(message);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
for (const resource of matches) {
|
|
118
|
+
if (applySpecValues(resource, patch.values)) {
|
|
119
|
+
touched.add(resource);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
for (const resource of resources) {
|
|
125
|
+
if (!resource.projectKey)
|
|
126
|
+
continue;
|
|
127
|
+
if (resource.kind?.toLowerCase() !== ENTRY_POINT_RESOURCE_KIND) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const [computeError, computed] = await catchError(computeEntryPointSpec(fs, solutionDir, resource.projectKey));
|
|
131
|
+
if (computeError) {
|
|
132
|
+
result.warnings.push(`Failed to read entry points for project '${resource.projectKey}': ${computeError.message}`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (!computed)
|
|
136
|
+
continue;
|
|
137
|
+
if (applySpecValues(resource, computed))
|
|
138
|
+
touched.add(resource);
|
|
139
|
+
}
|
|
140
|
+
result.updated = touched.size;
|
|
141
|
+
if (touched.size > 0 && solution) {
|
|
142
|
+
await builder.context.saveAsync(solution);
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
} finally {
|
|
146
|
+
const dispose = builder.disposeAsync;
|
|
147
|
+
if (typeof dispose === "function") {
|
|
148
|
+
const [disposeError] = await catchError(dispose.call(builder));
|
|
149
|
+
if (disposeError) {
|
|
150
|
+
logger.warn(`Failed to dispose solution builder after applying project contributions: ${disposeError.message}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function applySpecValues(resource, values) {
|
|
156
|
+
const spec = { ...resource.spec ?? {} };
|
|
157
|
+
let changed = false;
|
|
158
|
+
for (const [key, value] of Object.entries(values)) {
|
|
159
|
+
const existingKey = Object.keys(spec).find((k) => k.toLowerCase() === key.toLowerCase()) ?? key;
|
|
160
|
+
if (value === null) {
|
|
161
|
+
if (existingKey in spec) {
|
|
162
|
+
delete spec[existingKey];
|
|
163
|
+
changed = true;
|
|
164
|
+
}
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (isSameSpecValue(spec[existingKey], value))
|
|
168
|
+
continue;
|
|
169
|
+
spec[existingKey] = value;
|
|
170
|
+
changed = true;
|
|
171
|
+
}
|
|
172
|
+
if (changed) {
|
|
173
|
+
resource.spec = spec;
|
|
174
|
+
}
|
|
175
|
+
return changed;
|
|
176
|
+
}
|
|
177
|
+
function isSameSpecValue(a, b) {
|
|
178
|
+
if (a === b)
|
|
179
|
+
return true;
|
|
180
|
+
if (typeof a !== "object" || typeof b !== "object" || !a || !b) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { ProjectContributionsError, collectProjectContributions, assertNoContributionErrors, contributionErrorMessages, applyProjectContributions };
|
|
187
|
+
|
|
188
|
+
//# debugId=F82FA56EE24E69EE64756E2164756E21
|
package/dist/packager-tool.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* factory for Connector, the one project type no CLI tool owns — there is no
|
|
5
5
|
* `connector` verb. Every other project type is registered by the tool that
|
|
6
6
|
* owns it, through that tool's own `packager-tool` entry point, loaded on
|
|
7
|
-
* demand by `ensurePackagerTools` (AGENTS.md Hard Rule #
|
|
7
|
+
* demand by `ensurePackagerTools` (AGENTS.md Hard Rule #19).
|
|
8
8
|
*
|
|
9
9
|
* Explicit, not a module-load side effect: `ensurePackagerTools` calls this at
|
|
10
10
|
* the start of every pack / restore / cleanup, which is the only code that
|
package/dist/packager-tool.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
prepareSolutionResources,
|
|
3
|
+
projectSubTypesFrom
|
|
4
|
+
} from "./packager-tool-7znqtw3f.js";
|
|
5
|
+
import"./packager-tool-znakt6yw.js";
|
|
6
|
+
import"./packager-tool-k4mskzww.js";
|
|
7
|
+
import"./packager-tool-jz2wbfjz.js";
|
|
8
|
+
import"./packager-tool-bkwnetqn.js";
|
|
9
|
+
import"./packager-tool-gdtpsdn7.js";
|
|
10
|
+
import"./packager-tool-53w8skv5.js";
|
|
11
|
+
import"./packager-tool-nzghfa48.js";
|
|
12
|
+
import"./packager-tool-2syrt51a.js";
|
|
13
|
+
import"./packager-tool-3jrq7smt.js";
|
|
14
|
+
import"./packager-tool-0f0wt9vh.js";
|
|
15
|
+
import"./packager-tool-dfrk01gn.js";
|
|
16
|
+
import"./packager-tool-1de529jm.js";
|
|
17
|
+
export {
|
|
18
|
+
prepareSolutionResources,
|
|
19
|
+
projectSubTypesFrom
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//# debugId=9F446E87789120A364756E2164756E21
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProjectContributionsError,
|
|
3
|
+
applyProjectContributions,
|
|
4
|
+
assertNoContributionErrors,
|
|
5
|
+
collectProjectContributions,
|
|
6
|
+
contributionErrorMessages
|
|
7
|
+
} from "./packager-tool-znakt6yw.js";
|
|
8
|
+
import"./packager-tool-k4mskzww.js";
|
|
9
|
+
import"./packager-tool-jz2wbfjz.js";
|
|
10
|
+
import"./packager-tool-bkwnetqn.js";
|
|
11
|
+
import"./packager-tool-gdtpsdn7.js";
|
|
12
|
+
import"./packager-tool-53w8skv5.js";
|
|
13
|
+
import"./packager-tool-nzghfa48.js";
|
|
14
|
+
import"./packager-tool-2syrt51a.js";
|
|
15
|
+
import"./packager-tool-3jrq7smt.js";
|
|
16
|
+
import"./packager-tool-0f0wt9vh.js";
|
|
17
|
+
import"./packager-tool-dfrk01gn.js";
|
|
18
|
+
import"./packager-tool-1de529jm.js";
|
|
19
|
+
export {
|
|
20
|
+
ProjectContributionsError,
|
|
21
|
+
applyProjectContributions,
|
|
22
|
+
assertNoContributionErrors,
|
|
23
|
+
collectProjectContributions,
|
|
24
|
+
contributionErrorMessages
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//# debugId=5BEB743E097B870464756E2164756E21
|
package/dist/publish.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
publishSolutionAsync
|
|
3
|
-
} from "./packager-tool-
|
|
4
|
-
import"./packager-tool-
|
|
5
|
-
import"./packager-tool-
|
|
6
|
-
import"./packager-tool-
|
|
7
|
-
import"./packager-tool-
|
|
3
|
+
} from "./packager-tool-htag6yh5.js";
|
|
4
|
+
import"./packager-tool-cp07fhx3.js";
|
|
5
|
+
import"./packager-tool-mj5p341c.js";
|
|
6
|
+
import"./packager-tool-2syrt51a.js";
|
|
7
|
+
import"./packager-tool-3jrq7smt.js";
|
|
8
|
+
import"./packager-tool-0f0wt9vh.js";
|
|
8
9
|
import"./packager-tool-dfrk01gn.js";
|
|
9
10
|
import"./packager-tool-1de529jm.js";
|
|
10
11
|
export {
|
|
11
12
|
publishSolutionAsync
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
//# debugId=
|
|
15
|
+
//# debugId=C6A6B2A4D9E3236B64756E2164756E21
|
package/dist/resource.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resourceRefreshAsync
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-bkwnetqn.js";
|
|
4
|
+
import"./packager-tool-gdtpsdn7.js";
|
|
5
|
+
import"./packager-tool-53w8skv5.js";
|
|
4
6
|
import"./packager-tool-nzghfa48.js";
|
|
5
|
-
import"./packager-tool-
|
|
6
|
-
import"./packager-tool-
|
|
7
|
+
import"./packager-tool-2syrt51a.js";
|
|
8
|
+
import"./packager-tool-3jrq7smt.js";
|
|
9
|
+
import"./packager-tool-0f0wt9vh.js";
|
|
7
10
|
import"./packager-tool-dfrk01gn.js";
|
|
8
11
|
import"./packager-tool-1de529jm.js";
|
|
9
12
|
export {
|
|
10
13
|
resourceRefreshAsync
|
|
11
14
|
};
|
|
12
15
|
|
|
13
|
-
//# debugId=
|
|
16
|
+
//# debugId=EF371AE5DDFD388A64756E2164756E21
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { InitOverrideFunction } from "@uipath/solution-sdk";
|
|
2
|
+
import { DeploymentsApi, type SolutionDeploymentAction } from "@uipath/solution-sdk";
|
|
3
|
+
import type { SolutionAuthContext } from "@uipath/solution-sdk/auth";
|
|
4
|
+
export declare const NO_SERVER_REASON = "the server reported no reason.";
|
|
5
|
+
/**
|
|
6
|
+
* How long one validation lookup may take.
|
|
7
|
+
*
|
|
8
|
+
* This runs after the caller's wait has already ended, so it has no budget
|
|
9
|
+
* left to inherit, and the generated SDK hands the request to `fetch` without
|
|
10
|
+
* a deadline of its own. Unbounded, a stalled lookup outlives `--timeout` and
|
|
11
|
+
* the command sits there instead of returning the failure it already knows
|
|
12
|
+
* about.
|
|
13
|
+
*/
|
|
14
|
+
export declare const LOOKUP_TIMEOUT_MS = 15000;
|
|
15
|
+
/**
|
|
16
|
+
* Ask the server why an install/upgrade failed. Deployment records carry a
|
|
17
|
+
* status and no error field, so the validation result is the only place an
|
|
18
|
+
* actionable cause lives (e.g. `SolutionFolderNotFound`).
|
|
19
|
+
*
|
|
20
|
+
* Best-effort: this runs on an already-failing path, so a second failure here
|
|
21
|
+
* must not replace the caller's message with a transport error.
|
|
22
|
+
*/
|
|
23
|
+
export declare function describeValidationFailureAsync(deploymentsApi: DeploymentsApi, deploymentKey: string, deploymentAction: SolutionDeploymentAction, scope: InitOverrideFunction | undefined, signal?: AbortSignal): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* The same question for a deployment known only from its search record.
|
|
26
|
+
*
|
|
27
|
+
* A search row carries two keys and the API documents neither, so ask with
|
|
28
|
+
* `key` and fall back to `installDeploymentKey` when that answers nothing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function describeDeploymentFailureAsync(auth: SolutionAuthContext, deployment: {
|
|
31
|
+
key: string;
|
|
32
|
+
installDeploymentKey?: string;
|
|
33
|
+
}, deploymentAction: SolutionDeploymentAction, scope: InitOverrideFunction | undefined, signal?: AbortSignal): Promise<string>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IFileSystem } from "@uipath/filesystem";
|
|
2
|
+
import { RulesConfigFileType } from "@uipath/solution-packager/node";
|
|
1
3
|
import type { PackCommandOptions } from "../models";
|
|
2
4
|
/**
|
|
3
5
|
* What to do about a rejected governance option. Pairs with the message
|
|
@@ -23,4 +25,62 @@ export declare const GOVERNANCE_OPTION_INSTRUCTIONS: string;
|
|
|
23
25
|
* `Message` from `Instructions`. Owning the wording here keeps the two paths
|
|
24
26
|
* from drifting apart.
|
|
25
27
|
*/
|
|
26
|
-
export declare function validateGovernanceOptions(options: Pick<PackCommandOptions, "governanceFilePath" | "automationOpsProfile">): string | null;
|
|
28
|
+
export declare function validateGovernanceOptions(options: Pick<PackCommandOptions, "governanceFilePath" | "governanceProduct" | "automationOpsProfile">): string | null;
|
|
29
|
+
/** What {@link detectGovernanceFileType} concluded about a policy file. */
|
|
30
|
+
export type GovernanceFileDetection = {
|
|
31
|
+
kind: "detected";
|
|
32
|
+
fileType: RulesConfigFileType;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "unparseable";
|
|
35
|
+
} | {
|
|
36
|
+
kind: "unwrapped-automation-ops";
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Work out which rules-config source a local policy file belongs to.
|
|
40
|
+
*
|
|
41
|
+
* This exists because the compiler's `--policy-file-type` decides whether the
|
|
42
|
+
* policy is applied at all, and it does not fall back: handed an AutomationOps
|
|
43
|
+
* policy under `Studio`, the analyzer runs, reports nothing, and the pack
|
|
44
|
+
* succeeds — a policy escalating a rule to Error is silently discarded. The
|
|
45
|
+
* CLI has no flag for the type (`--governance-file-path` used to hardcode
|
|
46
|
+
* `Studio`), so a user's only realistic policy source — an AutomationOps
|
|
47
|
+
* export — never took effect.
|
|
48
|
+
*
|
|
49
|
+
* Anything that parses as JSON but carries no AutomationOps rule table is
|
|
50
|
+
* passed through as `Studio`. That is Studio's own rules-configuration format,
|
|
51
|
+
* whose schema lives inside the WorkflowCompiler, so the CLI cannot recognise
|
|
52
|
+
* it positively and must not reject it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function detectGovernanceFileType(source: string): GovernanceFileDetection;
|
|
55
|
+
/** Failure message for a policy file that could not be read. */
|
|
56
|
+
export declare function governanceFileUnreadableMessage(path: string): string;
|
|
57
|
+
/** Failure message for an AutomationOps policy stripped of its envelope. */
|
|
58
|
+
export declare function governanceFileUnwrappedMessage(path: string): string;
|
|
59
|
+
/** Failure message for a policy file that is not JSON. */
|
|
60
|
+
export declare function governanceFileUnparseableMessage(path: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Remedy for both read failures above. Deliberately does not say "drop the
|
|
63
|
+
* flag": the user asked for a policy, and packing without one would be the
|
|
64
|
+
* silent no-op this check exists to remove.
|
|
65
|
+
*/
|
|
66
|
+
export declare const GOVERNANCE_FILE_UNUSABLE_INSTRUCTIONS: string;
|
|
67
|
+
/** Outcome of resolving `--governance-file-path` to a rules-config source. */
|
|
68
|
+
export type GovernanceFileTypeResult = {
|
|
69
|
+
ok: true;
|
|
70
|
+
fileType: RulesConfigFileType;
|
|
71
|
+
} | {
|
|
72
|
+
ok: false;
|
|
73
|
+
message: string;
|
|
74
|
+
instructions: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Read the policy file named by `--governance-file-path` and decide which
|
|
78
|
+
* rules-config source it belongs to.
|
|
79
|
+
*
|
|
80
|
+
* Reading it here, rather than leaving it to the packager's options validator,
|
|
81
|
+
* is what makes the choice possible at all: the type has to travel with the
|
|
82
|
+
* path, and the only way to tell the two formats apart is to look inside. A
|
|
83
|
+
* file that cannot be read or is not JSON fails the pack instead of falling
|
|
84
|
+
* back to a source that would discard it.
|
|
85
|
+
*/
|
|
86
|
+
export declare function resolveGovernanceFileTypeAsync(fs: IFileSystem, governanceFilePath: string): Promise<GovernanceFileTypeResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommandContext } from "@uipath/common";
|
|
1
|
+
import { type CliErrorCode, type CommandContext, RESULTS, type RetryHint } from "@uipath/common";
|
|
2
2
|
import { ToolResult } from "@uipath/solutionpackager-tool-core";
|
|
3
3
|
import type { PackCommandOptions } from "../models";
|
|
4
4
|
/**
|
|
@@ -23,7 +23,8 @@ export declare class PackCommandService {
|
|
|
23
23
|
execute(solutionPath: string, options: PackCommandOptions, context: CommandContext): Promise<void>;
|
|
24
24
|
/**
|
|
25
25
|
* The entry guards `executeAsync` runs before it touches a packager:
|
|
26
|
-
* a missing output path, bad governance options,
|
|
26
|
+
* a missing output path, bad governance options, a governance policy file
|
|
27
|
+
* whose rules-config source cannot be derived, and a solution path that
|
|
27
28
|
* is absent or unreadable. Split out so `executeAsync` stays inside the
|
|
28
29
|
* cognitive-complexity budget; each one still returns the `ToolResult`
|
|
29
30
|
* that caller expects rather than throwing.
|
|
@@ -74,3 +75,33 @@ export declare class PackCommandService {
|
|
|
74
75
|
private resolvePackageName;
|
|
75
76
|
private createPackOptions;
|
|
76
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The failure envelope for a pack the packager refused.
|
|
80
|
+
*
|
|
81
|
+
* Most failures keep the shape they have always had — `Error code: <tool code>
|
|
82
|
+
* : <message>` with the packager's own text as the next step — because the
|
|
83
|
+
* cause is whatever the compiler reported and there is nothing better to say.
|
|
84
|
+
* A member package id we know is unpublishable is different: the cause is a
|
|
85
|
+
* name on disk (a member folder, the `.uipx`), so it gets `invalid_argument`, a
|
|
86
|
+
* message without the tool-code prefix, and instructions naming what to
|
|
87
|
+
* rename. Agents branch on `ErrorCode`, and `unknown_error` there tells them
|
|
88
|
+
* this can never be fixed by the caller, which is the opposite of true.
|
|
89
|
+
*
|
|
90
|
+
* Instructions the packager carried up beat the generic next step, which for a
|
|
91
|
+
* non-dry-run pack is the message itself.
|
|
92
|
+
*/
|
|
93
|
+
export declare function packFailureEnvelope(result: {
|
|
94
|
+
errorCode: string;
|
|
95
|
+
message?: string;
|
|
96
|
+
instructions?: string;
|
|
97
|
+
details?: ToolResult["details"];
|
|
98
|
+
}, dryRun: boolean): {
|
|
99
|
+
Result: typeof RESULTS.Failure;
|
|
100
|
+
Message: string;
|
|
101
|
+
Instructions: string;
|
|
102
|
+
ErrorCode?: CliErrorCode;
|
|
103
|
+
Retry?: RetryHint;
|
|
104
|
+
Data?: {
|
|
105
|
+
Projects: unknown[];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CliErrorCode } from "@uipath/common";
|
|
1
2
|
import type { IFileSystem } from "@uipath/filesystem";
|
|
2
3
|
/**
|
|
3
4
|
* A `.uipx` names a project type nothing can pack, and no tool provides one.
|
|
@@ -12,10 +13,12 @@ import type { IFileSystem } from "@uipath/filesystem";
|
|
|
12
13
|
export declare class UnpackableProjectTypeError extends Error {
|
|
13
14
|
readonly __unpackableType = true;
|
|
14
15
|
readonly instructions: string;
|
|
16
|
+
readonly errorCode: CliErrorCode;
|
|
15
17
|
constructor(projectType: string, projectPath: string);
|
|
16
18
|
}
|
|
17
19
|
/** True when `error` is an {@link UnpackableProjectTypeError}, duck-typed. */
|
|
18
20
|
export declare function isUnpackableProjectTypeError(error: unknown): boolean;
|
|
21
|
+
export { toolVerbForProjectType } from "./project-type-tools";
|
|
19
22
|
/**
|
|
20
23
|
* Puts every factory this pack needs in `toolsFactoryRepository`: registers
|
|
21
24
|
* the ones solution-tool owns, then reads project types from the .uipx and
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IFileSystem } from "@uipath/filesystem";
|
|
2
|
+
import { type ProjectContributions } from "./project-contributions";
|
|
3
|
+
export interface PrepareResult {
|
|
4
|
+
/** Contributed problems (when not gating), skips, and unmatched patches. */
|
|
5
|
+
warnings: string[];
|
|
6
|
+
/** Artefact resources whose spec was rewritten. */
|
|
7
|
+
updated: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The projects that told us which template variant their artefact resources
|
|
11
|
+
* come from, keyed by `.uipx` project `Id`. Opaque strings: the value is
|
|
12
|
+
* produced by the tool that owns the project type and consumed by the SDK's
|
|
13
|
+
* reconciler, and nothing in between reads it (AGENTS.md Hard Rule #19).
|
|
14
|
+
*/
|
|
15
|
+
export declare function projectSubTypesFrom(contributions: ProjectContributions): ReadonlyMap<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Bring a solution directory's resource JSONs in line with its projects'
|
|
18
|
+
* authored files. Every path that reads those resources for real — `pack`,
|
|
19
|
+
* `upload`, `resources refresh` — runs this, so a coded app gets the same
|
|
20
|
+
* treatment whichever one the user reaches for.
|
|
21
|
+
*
|
|
22
|
+
* The order is load-bearing:
|
|
23
|
+
*
|
|
24
|
+
* 1. `ensurePackagerTools` — the collect dispatches to registered factories.
|
|
25
|
+
* 2. collect — reads project files only, which the sync never touches, so
|
|
26
|
+
* collecting before and applying after cannot see two different states.
|
|
27
|
+
* 3. gate (pack, upload) — a project reporting a problem with its own files
|
|
28
|
+
* must fail before any write, not leave half-synced resources behind.
|
|
29
|
+
* 4. sync — carries the contributed subTypes, which is what lets reconcile
|
|
30
|
+
* generate (or repair) artefact resources for a type whose template row is
|
|
31
|
+
* keyed `<type>_<subType>`.
|
|
32
|
+
* 5. apply — after the sync, because the sync can create the app resource a
|
|
33
|
+
* patch targets. An unmatched patch here is a contributor bug, not a race,
|
|
34
|
+
* which is why gating callers also fail on one.
|
|
35
|
+
* 6. runtime dependencies — mirrors Orchestrator BE's
|
|
36
|
+
* `ProcessesExportHandlerBase.GetRuntimeDependenciesAsync`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function prepareSolutionResources(solutionDir: string, fs: IFileSystem, options?: {
|
|
39
|
+
gate?: boolean;
|
|
40
|
+
}): Promise<PrepareResult>;
|