@uipath/solution-tool 1.204.0 → 1.205.0-preview.258

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 (122) hide show
  1. package/README.md +3 -3
  2. package/dist/THIRD-PARTY-NOTICES.md +2 -2
  3. package/dist/archive-extract-x35t9ktj.js +120 -0
  4. package/dist/cleanup-command-service-rc5e42hk.js +149 -0
  5. package/dist/deploy-delete-service-qdbtj3qd.js +25 -0
  6. package/dist/deploy-run-service-m9mg34n5.js +25 -0
  7. package/dist/{deploy-status-service-3req7hje.js → deploy-status-service-kz3nk43q.js} +41 -33
  8. package/dist/deploy.js +23 -17
  9. package/dist/{deployment-search-3mah6f0a.js → deployment-search-jvwyaqek.js} +16 -10
  10. package/dist/{embedded-file-reader-rf2g1kfj.js → embedded-file-reader-z4becc02.js} +2 -2
  11. package/dist/{feed-resolver-bxj9xkgr.js → feed-resolver-3xb7ayx4.js} +10 -9
  12. package/dist/feed-scope-failure-qps17dv3.js +19 -0
  13. package/dist/{feed-session-sxga31vn.js → feed-session-7xqphdrg.js} +3 -3
  14. package/dist/governance-options-amc1v319.js +32 -0
  15. package/dist/index-6wak6hg6.js +667 -0
  16. package/dist/index-prm27bvm.js +138 -0
  17. package/dist/index.js +27 -29
  18. package/dist/init.js +11 -10
  19. package/dist/{list-s5pkkefj.js → list-7jy11vb4.js} +10 -8
  20. package/dist/models/pack-command-types.d.ts +15 -0
  21. package/dist/node-p1scvsw8.js +86 -0
  22. package/dist/pack-command-service-8etwpgm9.js +35 -0
  23. package/dist/pack-project-hjvbvhgx.js +97 -0
  24. package/dist/pack.js +24 -14
  25. package/dist/package-id-c18sx4mz.js +13 -0
  26. package/dist/packager-tool-09fwj7e8.js +171 -0
  27. package/dist/{packager-tool-nfmygm61.js → packager-tool-361zx07h.js} +74 -23
  28. package/dist/packager-tool-37jmavap.js +42 -0
  29. package/dist/{packager-tool-px1j9kre.js → packager-tool-3bwnkjdq.js} +2 -2
  30. package/dist/{packager-tool-gb35b4qs.js → packager-tool-43ahv5mn.js} +192 -96
  31. package/dist/packager-tool-47wzvqw0.js +86 -0
  32. package/dist/{packager-tool-gfhdpkp3.js → packager-tool-4bq36bf5.js} +25 -4
  33. package/dist/packager-tool-4jekgh4s.js +517 -0
  34. package/dist/{packager-tool-zns6n8zp.js → packager-tool-5ddtwzva.js} +1 -1
  35. package/dist/packager-tool-5edvzz80.js +543 -0
  36. package/dist/packager-tool-5y09xhx5.js +1333 -0
  37. package/dist/packager-tool-60af1hw2.js +26 -0
  38. package/dist/{packager-tool-f5gq77m5.js → packager-tool-61pwb567.js} +2 -2
  39. package/dist/{packager-tool-kdwsw2x7.js → packager-tool-69jmxeh0.js} +196 -1519
  40. package/dist/{packager-tool-yrz4mwfn.js → packager-tool-6kz1pv9f.js} +1373 -486
  41. package/dist/{packager-tool-stsnbewn.js → packager-tool-6x35kvbx.js} +17 -8
  42. package/dist/packager-tool-6ybywxxn.js +1809 -0
  43. package/dist/{packager-tool-wfkv9v8b.js → packager-tool-85pen8t9.js} +2196 -3455
  44. package/dist/packager-tool-8ptbmmmp.js +2132 -0
  45. package/dist/{packager-tool-9ex75r32.js → packager-tool-8q4tvv8d.js} +6 -4
  46. package/dist/packager-tool-8rg0s4w9.js +109 -0
  47. package/dist/{packager-tool-7gr2nphb.js → packager-tool-97rcgwvv.js} +224 -6
  48. package/dist/packager-tool-act5r386.js +239 -0
  49. package/dist/packager-tool-amhyxzz6.js +125 -0
  50. package/dist/{packager-tool-j3520gxw.js → packager-tool-an5bpbwe.js} +3556 -1646
  51. package/dist/{packager-tool-e2rtr49j.js → packager-tool-b2nhscfk.js} +15 -31
  52. package/dist/packager-tool-bqw7edje.js +188 -0
  53. package/dist/{packager-tool-4gs8y6pr.js → packager-tool-dwxswyv4.js} +149 -53
  54. package/dist/{packager-tool-fehvgd51.js → packager-tool-e7vczxa8.js} +357 -1370
  55. package/dist/{packager-tool-v8bkkqdb.js → packager-tool-gmwva4yv.js} +5 -5
  56. package/dist/packager-tool-gs3f3tf7.js +103 -0
  57. package/dist/packager-tool-kkfb5kgn.js +182 -0
  58. package/dist/{packager-tool-ds45xby2.js → packager-tool-m74zqwmh.js} +104 -14
  59. package/dist/{packager-tool-fv7xyzg2.js → packager-tool-pbmqk39a.js} +126 -128
  60. package/dist/packager-tool-q5j6k3fy.js +1510 -0
  61. package/dist/packager-tool-qk21gk5m.js +445 -0
  62. package/dist/{packager-tool-bqre28m1.js → packager-tool-qw47eyw7.js} +1 -1
  63. package/dist/packager-tool-resolver-994z3jkj.js +23 -0
  64. package/dist/{packager-tool-gab9y5ct.js → packager-tool-t8gh825q.js} +37 -13
  65. package/dist/{packager-tool-kswwd3hp.js → packager-tool-tx834spe.js} +2376 -4077
  66. package/dist/{packager-tool-zf3929se.js → packager-tool-v1f5e8t9.js} +11 -1
  67. package/dist/{packager-tool-g8kjzrg7.js → packager-tool-wknfv4p5.js} +13 -11
  68. package/dist/{packager-tool-1rzssy0x.js → packager-tool-wy4fx250.js} +19 -18
  69. package/dist/packager-tool-y2k2f6yg.js +68 -0
  70. package/dist/packager-tool.js +2 -2
  71. package/dist/prepare-solution-resources-m1djfj62.js +29 -0
  72. package/dist/project-command-utils-t6pmpvq3.js +90 -0
  73. package/dist/project-contributions-79ndycrx.js +32 -0
  74. package/dist/publish.js +13 -12
  75. package/dist/resource-mutations-c3krjqze.js +36 -0
  76. package/dist/resource-version-lookup-0e3e2j58.js +99 -0
  77. package/dist/resource.js +10 -9
  78. package/dist/restore-command-service-eyx911f2.js +155 -0
  79. package/dist/run-service-p1vzzqe3.js +428 -0
  80. package/dist/services/deploy-activate-service.d.ts +10 -5
  81. package/dist/services/deploy-delete-service.d.ts +8 -4
  82. package/dist/services/deploy-run-service.d.ts +34 -1
  83. package/dist/services/deploy-uninstall-service.d.ts +21 -3
  84. package/dist/services/deploy-upgrade-service.d.ts +35 -1
  85. package/dist/services/deployment-feed-locator.d.ts +15 -4
  86. package/dist/services/deployment-search-client.d.ts +5 -53
  87. package/dist/services/deployment-search.d.ts +58 -3
  88. package/dist/services/deployment-state.d.ts +84 -24
  89. package/dist/services/deployment-validation.d.ts +5 -0
  90. package/dist/services/emit-runtime-dependencies.d.ts +2 -1
  91. package/dist/services/feed-resolver.d.ts +6 -4
  92. package/dist/services/feed-selection.d.ts +47 -0
  93. package/dist/services/http-status.d.ts +2 -7
  94. package/dist/services/pack-command-service.d.ts +9 -0
  95. package/dist/services/pack-project-selection.d.ts +51 -0
  96. package/dist/services/pack-project.d.ts +26 -0
  97. package/dist/services/pack-service.d.ts +7 -3
  98. package/dist/services/package-search-client.d.ts +7 -0
  99. package/dist/services/packager-tool-resolver.d.ts +7 -1
  100. package/dist/services/packages-list-service.d.ts +1 -1
  101. package/dist/services/permanent-deletion-consent.d.ts +110 -0
  102. package/dist/services/pipeline-deploy-poll.d.ts +7 -0
  103. package/dist/services/prepare-solution-resources.d.ts +12 -2
  104. package/dist/services/project-contributions.d.ts +5 -4
  105. package/dist/services/search-failure.d.ts +9 -13
  106. package/dist/services/solution-packager-helpers.d.ts +5 -2
  107. package/dist/services/solution-path.d.ts +1 -1
  108. package/dist/services/uninstall-consent.d.ts +82 -0
  109. package/dist/ship-telemetry-myes7ak5.js +21 -0
  110. package/dist/solution-auth-aead70sw.js +11 -0
  111. package/dist/templates/AGENTS.md +125 -12
  112. package/dist/tool.js +27 -29
  113. package/dist/utils/deployment-errors.d.ts +9 -1
  114. package/package.json +2 -2
  115. package/dist/deploy-delete-service-1zydyyhj.js +0 -22
  116. package/dist/feed-scope-failure-2kndwpf6.js +0 -18
  117. package/dist/packager-tool-f2e9rzxk.js +0 -104
  118. package/dist/packager-tool-resolver-6zwhec62.js +0 -20
  119. package/dist/packager-tool-zdfn32bc.js +0 -4465
  120. package/dist/prepare-solution-resources-jpb5as2s.js +0 -25
  121. package/dist/project-contributions-6wpff2hm.js +0 -30
  122. package/dist/services/legacy-deployment-search-v3.d.ts +0 -23
@@ -1,9 +1,9 @@
1
- import {
2
- catchError
3
- } from "./packager-tool-kswwd3hp.js";
4
1
  import {
5
2
  getAuthContext
6
- } from "./packager-tool-gb35b4qs.js";
3
+ } from "./packager-tool-43ahv5mn.js";
4
+ import {
5
+ catchError
6
+ } from "./packager-tool-6ybywxxn.js";
7
7
 
8
8
  // src/services/studio-web-auth-middleware.ts
9
9
  var studioWebAuthByCommand = new WeakMap;
@@ -66,4 +66,4 @@ async function resolveStudioWebAuthContext(options) {
66
66
 
67
67
  export { useStudioWebAuth, getStudioWebAuth, getStudioWebAuthWithOrganizationId };
68
68
 
69
- //# debugId=407AA4762D049D2964756E2164756E21
69
+ //# debugId=FCF746C59C6BE72F64756E2164756E21
@@ -0,0 +1,103 @@
1
+ import {
2
+ catchError
3
+ } from "./packager-tool-6ybywxxn.js";
4
+
5
+ // src/services/pack-project-selection.ts
6
+ function validatePackProjectOptions(options) {
7
+ if (options.project !== undefined && options.project.trim() === "") {
8
+ return "--project was given an empty value.";
9
+ }
10
+ if (options.project !== undefined && options.name !== undefined) {
11
+ return "--name cannot be used together with --project: it names the solution package, and --project packs a project package. Use --package-id to name that.";
12
+ }
13
+ if (options.packageId === undefined) {
14
+ return;
15
+ }
16
+ if (options.project === undefined) {
17
+ return "--package-id can only be used together with --project.";
18
+ }
19
+ if (options.packageId.trim() === "") {
20
+ return "--package-id was given an empty value.";
21
+ }
22
+ return;
23
+ }
24
+
25
+ class PackProjectError extends Error {
26
+ instructions;
27
+ errorCode = "invalid_argument";
28
+ constructor(message, instructions) {
29
+ super(message);
30
+ this.instructions = instructions;
31
+ this.name = "PackProjectError";
32
+ }
33
+ }
34
+ async function resolvePackProjectAsync(fs, solutionDir, selector) {
35
+ const { projects, solutionName } = await readPackProjectEntriesAsync(fs, solutionDir);
36
+ const wanted = normalizeRelativePath(selector);
37
+ const byId = projects.filter((p) => p.id.toLowerCase() === selector.trim().toLowerCase());
38
+ const matches = byId.length > 0 ? byId : projects.filter((p) => {
39
+ const file = normalizeRelativePath(p.relativePath);
40
+ return wanted !== "" && (file === wanted || projectFolder(file) === wanted);
41
+ });
42
+ if (matches.length === 1) {
43
+ assertInsideSolution(fs, solutionDir, selector, matches[0]);
44
+ return { project: matches[0], solutionName };
45
+ }
46
+ throw new PackProjectError(matches.length === 0 ? `Project '${selector}' is not part of the solution.` : `Project '${selector}' matches more than one project of the solution.`, choicesInstructions(matches.length === 0 ? projects : matches));
47
+ }
48
+ function assertInsideSolution(fs, solutionDir, selector, project) {
49
+ const instructions = "Fix the project's ProjectRelativePath in the .uipx so it names a project file inside the solution folder, then rerun.";
50
+ if (project.relativePath.trim() === "") {
51
+ throw new PackProjectError(`Project '${selector}' has no ProjectRelativePath in the .uipx.`, instructions);
52
+ }
53
+ const relative = fs.path.relative(solutionDir, fs.path.resolve(solutionDir, projectFolder(project.relativePath)));
54
+ if (relative === ".." || relative.startsWith("../") || relative.startsWith("..\\") || fs.path.isAbsolute(relative)) {
55
+ throw new PackProjectError(`Project '${selector}' points outside the solution folder: '${project.relativePath}'.`, instructions);
56
+ }
57
+ if (relative === "") {
58
+ throw new PackProjectError(`Project '${selector}' sits at the solution root ('${project.relativePath}'), so packing it on its own would pack the whole solution with it.`, "Move the project into its own folder inside the solution, update its ProjectRelativePath in the .uipx to match, then rerun.");
59
+ }
60
+ }
61
+ function choicesInstructions(projects) {
62
+ if (projects.length === 0) {
63
+ return "The solution lists no projects. Add one with 'uip solution project add', then rerun.";
64
+ }
65
+ const choices = projects.map((p) => `'${projectFolder(p.relativePath) || p.relativePath}' (Id: ${p.id})`).join(", ");
66
+ return `Pass --project with one of the solution's project Ids or paths: ${choices}.`;
67
+ }
68
+ async function readPackProjectEntriesAsync(fs, solutionDir) {
69
+ const entries = await fs.readdir(solutionDir);
70
+ const uipxFile = entries.find((entry) => entry.endsWith(".uipx"));
71
+ if (!uipxFile) {
72
+ throw new PackProjectError(`No .uipx solution file found in ${solutionDir}.`, "Pass the solution folder, the one that contains the .uipx file.");
73
+ }
74
+ const content = await fs.readFile(fs.path.join(solutionDir, uipxFile), "utf-8");
75
+ const [parseError, manifest] = catchError(() => JSON.parse(content ?? ""));
76
+ if (parseError) {
77
+ throw new PackProjectError(`Failed to parse ${uipxFile}: ${parseError.message}`, `Fix the JSON in ${uipxFile}, then rerun.`);
78
+ }
79
+ const projects = [];
80
+ for (const raw of Array.isArray(manifest?.Projects) ? manifest.Projects : []) {
81
+ const entry = raw;
82
+ if (typeof entry?.Id !== "string" || !entry.Id)
83
+ continue;
84
+ projects.push({
85
+ id: entry.Id,
86
+ type: typeof entry.Type === "string" ? entry.Type : "",
87
+ relativePath: typeof entry.ProjectRelativePath === "string" ? entry.ProjectRelativePath : ""
88
+ });
89
+ }
90
+ return { projects, solutionName: uipxFile.slice(0, -".uipx".length) };
91
+ }
92
+ function normalizeRelativePath(path) {
93
+ return path.trim().replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^(\.\/)+/, "").replace(/\/$/, "").toLowerCase();
94
+ }
95
+ function projectFolder(relativePath) {
96
+ const normalized = relativePath.replace(/\\/g, "/");
97
+ const slash = normalized.lastIndexOf("/");
98
+ return slash === -1 ? "" : normalized.slice(0, slash);
99
+ }
100
+
101
+ export { validatePackProjectOptions, PackProjectError, resolvePackProjectAsync, projectFolder };
102
+
103
+ //# debugId=A02E54BA1CA9A95764756E2164756E21
@@ -0,0 +1,182 @@
1
+ // ../executor/project-executor/src/models/run-status.ts
2
+ var TERMINAL_RUN_STATUSES = [
3
+ "Succeeded" /* Succeeded */,
4
+ "Faulted" /* Faulted */,
5
+ "Cancelled" /* Cancelled */
6
+ ];
7
+ function isTerminalRunStatus(status) {
8
+ return TERMINAL_RUN_STATUSES.includes(status);
9
+ }
10
+
11
+ // ../executor/project-executor/src/models/run-result.ts
12
+ class RunResult {
13
+ status;
14
+ errorCode;
15
+ rawStatus;
16
+ message;
17
+ jobKey;
18
+ instanceId;
19
+ runId;
20
+ traceId;
21
+ steps;
22
+ output;
23
+ url;
24
+ details;
25
+ constructor(status, errorCode = "None" /* None */, message) {
26
+ this.status = status;
27
+ this.errorCode = errorCode;
28
+ this.message = message;
29
+ }
30
+ get isSuccess() {
31
+ return this.status === "Succeeded" /* Succeeded */ && this.errorCode === "None" /* None */;
32
+ }
33
+ get isTerminal() {
34
+ return isTerminalRunStatus(this.status);
35
+ }
36
+ static succeeded(init = {}) {
37
+ return Object.assign(new RunResult("Succeeded" /* Succeeded */, "None" /* None */), init);
38
+ }
39
+ static failed(errorCode, message, init = {}) {
40
+ return Object.assign(new RunResult("Faulted" /* Faulted */, errorCode, message), init);
41
+ }
42
+ }
43
+
44
+ // ../executor/project-executor/src/services/executor-logger.ts
45
+ var noopExecutorLogger = {
46
+ info: () => {},
47
+ warn: () => {},
48
+ error: () => {}
49
+ };
50
+
51
+ // ../executor/project-executor/src/services/executors-factory-repository.ts
52
+ class ExecutorsFactoryRepository {
53
+ factoryMap = new Map;
54
+ onConflict;
55
+ constructor(onConflict) {
56
+ this.onConflict = onConflict ?? ((message) => console.warn(message));
57
+ }
58
+ registerProjectExecutorFactory(factory) {
59
+ for (const projectType of factory.supportedTypes) {
60
+ const existing = this.factoryMap.get(projectType);
61
+ if (existing) {
62
+ if (existing.constructor?.name !== factory.constructor?.name) {
63
+ this.onConflict(`Executor factory conflict for project type '${projectType}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
64
+ }
65
+ continue;
66
+ }
67
+ this.factoryMap.set(projectType, factory);
68
+ }
69
+ }
70
+ canHandleProject(projectType) {
71
+ return this.factoryMap.has(projectType);
72
+ }
73
+ getProjectExecutorFactory(projectType) {
74
+ const factory = this.factoryMap.get(projectType);
75
+ if (!factory) {
76
+ throw new Error(`Cannot run project type '${projectType}': no runner is installed for it. ` + `Project types that can be run: ${this.registeredTypes.join(", ") || "none"}.`);
77
+ }
78
+ return factory;
79
+ }
80
+ get registeredTypes() {
81
+ return [...this.factoryMap.keys()];
82
+ }
83
+ reset() {
84
+ this.factoryMap.clear();
85
+ }
86
+ }
87
+ var REGISTRY_KEY = Symbol.for("@uipath/project-executor/executorsFactoryRepository");
88
+ var _global = globalThis;
89
+ if (!_global[REGISTRY_KEY]) {
90
+ _global[REGISTRY_KEY] = new ExecutorsFactoryRepository;
91
+ }
92
+ var executorsFactoryRepository = _global[REGISTRY_KEY];
93
+
94
+ // ../executor/project-executor/src/services/project-runner.ts
95
+ class ProjectRunner {
96
+ fileSystem;
97
+ logger;
98
+ registry;
99
+ constructor(deps) {
100
+ this.fileSystem = deps.fileSystem;
101
+ this.logger = deps.logger ?? noopExecutorLogger;
102
+ this.registry = deps.registry ?? executorsFactoryRepository;
103
+ }
104
+ canRun(projectType) {
105
+ return this.registry.canHandleProject(projectType);
106
+ }
107
+ get runnableTypes() {
108
+ return this.registry.registeredTypes;
109
+ }
110
+ async runAsync(options, cancellationToken) {
111
+ const { projectType, name } = options.project;
112
+ if (!this.canRun(projectType)) {
113
+ const known = this.runnableTypes.join(", ") || "none";
114
+ return RunResult.failed("UnsupportedProjectType" /* UnsupportedProjectType */, `Cannot run project '${name}' (project type '${projectType}'): ` + `no runner is installed for it. Project types that can be run: ${known}.`);
115
+ }
116
+ let executor;
117
+ try {
118
+ const factory = this.registry.getProjectExecutorFactory(projectType);
119
+ executor = await factory.createAsync(this.logger, this.fileSystem);
120
+ this.logger.info(`Running ${name} (${projectType}) on ${options.target}.`);
121
+ return await executor.runAsync(options, cancellationToken);
122
+ } catch (error) {
123
+ return RunResult.failed("Unknown" /* Unknown */, messageOf(error));
124
+ } finally {
125
+ try {
126
+ await executor?.dispose();
127
+ } catch (error) {
128
+ this.logger.warn(`Failed to dispose the ${projectType} executor: ${messageOf(error)}`);
129
+ }
130
+ }
131
+ }
132
+ }
133
+ function messageOf(error) {
134
+ return error instanceof Error ? error.message : String(error);
135
+ }
136
+ // ../executor/project-executor/src/services/executor-tool-import.ts
137
+ async function importExecutorToolModule(specifier) {
138
+ try {
139
+ return { module: await import(specifier) };
140
+ } catch (error) {
141
+ return {
142
+ error: error instanceof Error ? error : new Error(String(error))
143
+ };
144
+ }
145
+ }
146
+
147
+ // ../executor/project-executor/src/services/executor-tool-module.ts
148
+ var EXECUTOR_FACTORY_EXPORT = "createExecutorFactory";
149
+ function isExecutorFactoryModule(module) {
150
+ return typeof module === "object" && module !== null && typeof module[EXECUTOR_FACTORY_EXPORT] === "function";
151
+ }
152
+
153
+ // ../executor/project-executor/src/services/executor-factory-provider.ts
154
+ var PROVIDER_KEY = Symbol.for("@uipath/project-executor/executorFactoryProvider");
155
+ var _global2 = globalThis;
156
+ function registerExecutorFactoryFromModule(module, source) {
157
+ if (!isExecutorFactoryModule(module)) {
158
+ throw new Error(`${source} does not export ${EXECUTOR_FACTORY_EXPORT}().`);
159
+ }
160
+ const factory = module.createExecutorFactory();
161
+ executorsFactoryRepository.registerProjectExecutorFactory(factory);
162
+ return factory;
163
+ }
164
+ async function ensureExecutorFactory(verb, packageName) {
165
+ const provider = _global2[PROVIDER_KEY];
166
+ if (provider) {
167
+ await provider(verb);
168
+ return;
169
+ }
170
+ if (!packageName) {
171
+ throw new Error(`Running this project type needs the executor factory for '${verb}', and no package provides it.`);
172
+ }
173
+ const specifier = `${packageName}/executor-tool`;
174
+ const { module, error } = await importExecutorToolModule(specifier);
175
+ if (error) {
176
+ throw new Error(`Running this project type needs '${packageName}'. Install it.`, { cause: error });
177
+ }
178
+ registerExecutorFactoryFromModule(module, specifier);
179
+ }
180
+ export { RunResult, executorsFactoryRepository, ensureExecutorFactory, ProjectRunner };
181
+
182
+ //# debugId=C724855DC65EEE6264756E2164756E21
@@ -1,17 +1,106 @@
1
1
  import {
2
+ Configuration,
3
+ PipelinesApi
4
+ } from "./packager-tool-97rcgwvv.js";
5
+ import {
6
+ Configuration as Configuration2,
7
+ DeploymentsApi,
2
8
  SolutionDeploymentAction
3
- } from "./packager-tool-j3520gxw.js";
9
+ } from "./packager-tool-an5bpbwe.js";
10
+ import {
11
+ quoteForShell
12
+ } from "./packager-tool-tx834spe.js";
4
13
  import {
5
14
  catchError
6
- } from "./packager-tool-kswwd3hp.js";
15
+ } from "./packager-tool-6ybywxxn.js";
7
16
 
8
17
  // src/services/deployment-state.ts
9
- function quoteForShell(name) {
10
- return `'${name.replace(/'/g, "'\\''")}'`;
18
+ function pendingResourceApis(auth) {
19
+ const settings = { basePath: auth.basePath, accessToken: auth.accessToken };
20
+ return {
21
+ pipelines: new PipelinesApi(new Configuration(settings)),
22
+ deployments: new DeploymentsApi(new Configuration2(settings))
23
+ };
24
+ }
25
+ function reportedActivationStatus(record) {
26
+ const status = record?.activationStatus;
27
+ return status && status !== "None" ? status : undefined;
11
28
  }
12
29
  var RESOURCES_PAGE_SIZE = 50;
13
30
  var RESOURCES_MAX_PAGES = 10;
14
- async function readPendingResourcesAsync(api, deploymentKey, scope) {
31
+ async function readPendingResourcesAsync(apis, deployment, scope) {
32
+ const blockers = await readActivationBlockersAsync(apis.pipelines, deployment, scope);
33
+ if (blockers) {
34
+ return blockers;
35
+ }
36
+ return readSolutionsPendingResourcesAsync(apis.deployments, deployment.key, scope);
37
+ }
38
+ async function readActivationBlockersAsync(api, deployment, scope) {
39
+ const [readError, result] = await catchError(() => api.pipelinesGetDeploymentValidationResult({ deploymentName: deployment.name }, scope));
40
+ if (readError || !result || result.deploymentAction !== "Activate") {
41
+ return;
42
+ }
43
+ const blockers = toBlockers(result.validationErrors ?? []);
44
+ if (!blockers || !await isCurrentRecordAsync(api, deployment.key)) {
45
+ return;
46
+ }
47
+ return blockers;
48
+ }
49
+ async function isCurrentRecordAsync(api, key, init) {
50
+ const [lookupError, info] = await catchError(() => init ? api.pipelinesGetDeploymentByKey({ key }, init) : api.pipelinesGetDeploymentByKey({ key }));
51
+ return !lookupError && info?.deploymentKey === key;
52
+ }
53
+ function toBlockers(errors) {
54
+ const byResource = new Map;
55
+ for (const error of errors) {
56
+ if (error.level !== "Error") {
57
+ continue;
58
+ }
59
+ const name = error.name ?? error.resource;
60
+ if (!name) {
61
+ return;
62
+ }
63
+ const identity = error.key ?? resourceIdentity(name, error.type);
64
+ const existing = byResource.get(identity);
65
+ if (existing) {
66
+ mergeBlocker(existing, error);
67
+ } else {
68
+ byResource.set(identity, toBlocker(error, name));
69
+ }
70
+ }
71
+ return [...byResource.values()];
72
+ }
73
+ function toBlocker(error, name) {
74
+ const reason = formatValidationText(error.errorCode, error.text);
75
+ return {
76
+ key: error.key ?? "",
77
+ name,
78
+ kind: error.kind ?? "",
79
+ type: error.type,
80
+ ...reason ? { reason } : {},
81
+ ...error.folderPaths && error.folderPaths.length > 0 ? { folderPaths: [...error.folderPaths] } : {}
82
+ };
83
+ }
84
+ function mergeBlocker(blocker, error) {
85
+ const reason = formatValidationText(error.errorCode, error.text);
86
+ if (reason) {
87
+ blocker.reason = blocker.reason ? `${blocker.reason}; ${reason}` : reason;
88
+ }
89
+ const folders = new Set([
90
+ ...blocker.folderPaths ?? [],
91
+ ...error.folderPaths ?? []
92
+ ]);
93
+ if (folders.size > 0) {
94
+ blocker.folderPaths = [...folders];
95
+ }
96
+ }
97
+ function formatValidationText(errorCode, text) {
98
+ if (!text) {
99
+ return;
100
+ }
101
+ return errorCode ? `[${errorCode}] ${text}` : text;
102
+ }
103
+ async function readSolutionsPendingResourcesAsync(api, deploymentKey, scope) {
15
104
  const pending = [];
16
105
  let complete = false;
17
106
  for (let page = 0, skip = 0;page < RESOURCES_MAX_PAGES; page++) {
@@ -57,7 +146,7 @@ async function attachActivationReasonsAsync(api, deploymentKey, pending, scope)
57
146
  }
58
147
  const reasons = new Map;
59
148
  for (const resource of validation.resourceValidationErrors ?? []) {
60
- const texts = (resource.errors ?? []).map((error) => error.errorCode ? `[${error.errorCode}] ${error.text}` : error.text).filter(Boolean);
149
+ const texts = (resource.errors ?? []).map((error) => formatValidationText(error.errorCode, error.text)).filter((text) => Boolean(text));
61
150
  if (texts.length > 0) {
62
151
  reasons.set(resourceIdentity(resource.name, resource.type), texts.join("; "));
63
152
  }
@@ -76,13 +165,14 @@ var MAX_LISTED_RESOURCES = 10;
76
165
  function formatPendingResources(resources) {
77
166
  const described = resources.slice(0, MAX_LISTED_RESOURCES).map((resource) => {
78
167
  const type = resource.type && resource.type !== resource.kind ? ` (${resource.type})` : "";
168
+ const folders = resource.folderPaths?.length ? ` in ${resource.folderPaths.map((path) => `'${path}'`).join(", ")}` : "";
79
169
  const reason = resource.reason ? `: ${resource.reason}` : "";
80
- return `${resource.kind} '${resource.name}'${type}${reason}`;
170
+ return `${resource.kind} '${resource.name}'${type}${folders}${reason}`;
81
171
  }).join("; ");
82
172
  const remaining = resources.length - MAX_LISTED_RESOURCES;
83
173
  return remaining > 0 ? `${described}; and ${remaining} more` : described;
84
174
  }
85
- function activationNextSteps(deployment, pendingResources) {
175
+ function activationNextSteps(deployment, pendingResources, feedSelector = "") {
86
176
  const name = deployment.name;
87
177
  const version = deployment.currentPackageVersion ?? deployment.packageVersion;
88
178
  const installed = `Deployment '${name}' is installed${version ? ` at version ${version}` : ""}`;
@@ -98,11 +188,11 @@ function activationNextSteps(deployment, pendingResources) {
98
188
  case "ReadyToActivate":
99
189
  case "Inactive":
100
190
  return [
101
- `${installed} but inactive. Activate it with: uip solution deploy activate ${quoteForShell(name)}.`
191
+ `${installed} but inactive. Activate it with: uip solution deploy activate ${quoteForShell(name)}${feedSelector}.`
102
192
  ];
103
193
  case "ActivationFailed":
104
194
  return [
105
- `Activation of '${name}' failed. Inspect the deployment in Orchestrator, then retry with: uip solution deploy activate ${quoteForShell(name)}.`
195
+ `Activation of '${name}' failed. Inspect the deployment in Orchestrator, then retry with: uip solution deploy activate ${quoteForShell(name)}${feedSelector}.`
106
196
  ];
107
197
  default:
108
198
  return;
@@ -133,7 +223,7 @@ function deploymentNextSteps(deployment, pendingResources, feedSelector = "") {
133
223
  }
134
224
  return steps;
135
225
  }
136
- return activationNextSteps(deployment, pendingResources);
226
+ return activationNextSteps(deployment, pendingResources, feedSelector);
137
227
  }
138
228
  function describePendingResources(pendingResources) {
139
229
  if (pendingResources === undefined) {
@@ -149,7 +239,7 @@ function describeDraft(deployment, feedSelector) {
149
239
  const state = `(Operation: ${deployment.operation}, OperationStatus: Draft, ActivationStatus: ${deployment.activationStatus})`;
150
240
  switch (deployment.operation) {
151
241
  case "ActivationSetup":
152
- return `Deployment '${name}' has a 'Setup activation' that was started but not completed ${state} and cannot be activated until it is. Finish it in Orchestrator (Tenant > Solutions > Deployments, open the deployment; the UI lists it as 'Activation setup / Draft'). The CLI has no command for this step on an existing deployment. To discard the unfinished setup instead, run: uip solution deploy delete ${quoteForShell(name)} --yes. That removes the draft alone; the deployment returns to its previous record, still waiting for setup.`;
242
+ return `Deployment '${name}' has a 'Setup activation' that was started but not completed ${state} and cannot be activated until it is. Finish it in Orchestrator (Tenant > Solutions > Deployments, open the deployment; the UI lists it as 'Activation setup / Draft'). The CLI has no command for this step on an existing deployment. To discard the unfinished setup instead, run: uip solution deploy delete ${quoteForShell(name)}${feedSelector} --yes. That removes the draft alone; the deployment returns to its previous record, still waiting for setup.`;
153
243
  case "VersionChange":
154
244
  return `Deployment '${name}' has an upgrade that was queued but never installed ${state} and cannot be activated until it settles. 'uip solution deploy upgrade' installs the draft it queues; a draft left by another client stays until it is installed or removed; check it with: uip solution deploy list${feedSelector}.`;
155
245
  case "Install":
@@ -161,6 +251,6 @@ function describeDraft(deployment, feedSelector) {
161
251
  }
162
252
  }
163
253
 
164
- export { quoteForShell, readPendingResourcesAsync, appendDeploymentStateInstructions, explainRefusal, needsPendingResources, deploymentNextSteps };
254
+ export { pendingResourceApis, reportedActivationStatus, readPendingResourcesAsync, readActivationBlockersAsync, isCurrentRecordAsync, appendDeploymentStateInstructions, explainRefusal, needsPendingResources, deploymentNextSteps };
165
255
 
166
- //# debugId=ABAB11E889A49E7364756E2164756E21
256
+ //# debugId=A8B3431B53CA127F64756E2164756E21