@uipath/solution-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.
Files changed (132) hide show
  1. package/dist/{archive-extract-x35t9ktj.js → archive-extract-136rn3ja.js} +13 -15
  2. package/dist/{cleanup-command-service-dwbrt6d9.js → cleanup-command-service-ejakyhea.js} +34 -31
  3. package/dist/deploy-delete-service-r7abfh28.js +23 -0
  4. package/dist/deploy-run-service-rnthz10q.js +23 -0
  5. package/dist/{deploy-status-service-xw2nzh7m.js → deploy-status-service-6my5vm61.js} +72 -62
  6. package/dist/deploy.js +35 -37
  7. package/dist/deployment-search-gfm907tx.js +54 -0
  8. package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
  9. package/dist/feed-resolver-14crsx5y.js +27 -0
  10. package/dist/feed-scope-failure-67cyybn0.js +20 -0
  11. package/dist/feed-session-g94q2bjc.js +23 -0
  12. package/dist/first-party-service-n3vva2m4.js +8 -0
  13. package/dist/governance-options-t20vsznh.js +19 -0
  14. package/dist/index-aspmac9f.js +24 -0
  15. package/dist/index-ddk6v1ej.js +60 -0
  16. package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
  17. package/dist/index-qq4kre7a.js +93 -0
  18. package/dist/index-t262f2xv.js +16 -0
  19. package/dist/index.js +33 -34
  20. package/dist/init.js +18 -21
  21. package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
  22. package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
  23. package/dist/{list-zckdhv0c.js → list-jntan9tx.js} +23 -23
  24. package/dist/models/pack-command-types.d.ts +3 -1
  25. package/dist/node-kwzcw5ex.js +25 -0
  26. package/dist/pack-command-service-pwaeha7y.js +29 -0
  27. package/dist/{pack-project-erd95bt1.js → pack-project-ztt1hfrs.js} +33 -40
  28. package/dist/pack.js +26 -30
  29. package/dist/package-id-4tsg5jsb.js +11 -0
  30. package/dist/{packager-tool-d3cmmbw1.js → packager-tool-1bz9h5ca.js} +11 -11
  31. package/dist/{packager-tool-gs3f3tf7.js → packager-tool-1ctvbx0h.js} +1 -1
  32. package/dist/{packager-tool-r1jvvm8y.js → packager-tool-55ztfccd.js} +176 -196
  33. package/dist/{packager-tool-wrg41m7t.js → packager-tool-95y24705.js} +37 -39
  34. package/dist/{packager-tool-bkjqza3a.js → packager-tool-9j8e5q1z.js} +184 -33
  35. package/dist/{packager-tool-tx834spe.js → packager-tool-9vrwpgt3.js} +757 -309
  36. package/dist/packager-tool-a6va4gc5.js +1178 -0
  37. package/dist/{packager-tool-pbmqk39a.js → packager-tool-a7s0gbxs.js} +33 -28
  38. package/dist/{packager-tool-47wzvqw0.js → packager-tool-aws5w512.js} +6 -6
  39. package/dist/{packager-tool-97rcgwvv.js → packager-tool-bs1jn1yn.js} +331 -55
  40. package/dist/packager-tool-c64hqa8n.js +106 -0
  41. package/dist/{packager-tool-5ddtwzva.js → packager-tool-ca5ngmqv.js} +12 -12
  42. package/dist/{packager-tool-6kz1pv9f.js → packager-tool-d1texmvn.js} +828 -338
  43. package/dist/{packager-tool-1de529jm.js → packager-tool-epsr41wx.js} +12 -3
  44. package/dist/packager-tool-f84z7nds.js +130 -0
  45. package/dist/{packager-tool-8ptbmmmp.js → packager-tool-fp46ebde.js} +147 -76
  46. package/dist/packager-tool-fqs6hdcy.js +290 -0
  47. package/dist/{packager-tool-3bwnkjdq.js → packager-tool-fx4ws49n.js} +12 -12
  48. package/dist/{packager-tool-6ybywxxn.js → packager-tool-m07vyk89.js} +371 -221
  49. package/dist/{packager-tool-hsya909c.js → packager-tool-nrhqgr4z.js} +273 -255
  50. package/dist/{packager-tool-61pwb567.js → packager-tool-ppj5f4y7.js} +6 -7
  51. package/dist/{packager-tool-qqbt4b44.js → packager-tool-pyt9fvty.js} +51 -48
  52. package/dist/packager-tool-q5d9df2q.js +74 -0
  53. package/dist/{packager-tool-ph7fg1aa.js → packager-tool-q8ryk6q9.js} +122 -89
  54. package/dist/{packager-tool-t8gh825q.js → packager-tool-qf8753ee.js} +53 -41
  55. package/dist/{packager-tool-60af1hw2.js → packager-tool-qzcd5c9s.js} +3 -3
  56. package/dist/packager-tool-resolver-td3bhccd.js +20 -0
  57. package/dist/{packager-tool-dfrk01gn.js → packager-tool-rj2d1g0w.js} +154 -154
  58. package/dist/{packager-tool-a4bs7wtm.js → packager-tool-snm6s7b5.js} +15 -15
  59. package/dist/{packager-tool-43ahv5mn.js → packager-tool-t39pjz7n.js} +35 -18
  60. package/dist/{packager-tool-f2hsb9ta.js → packager-tool-t3a48ys5.js} +305 -657
  61. package/dist/{packager-tool-cjjk2ek2.js → packager-tool-t3ahzjh1.js} +356 -298
  62. package/dist/{packager-tool-v1f5e8t9.js → packager-tool-vgrswa8p.js} +53 -8
  63. package/dist/packager-tool-vrtabg73.js +2307 -0
  64. package/dist/{packager-tool-gmwva4yv.js → packager-tool-vx2c68sb.js} +2 -2
  65. package/dist/{packager-tool-4pkzxkty.js → packager-tool-vx39dhvn.js} +65 -35
  66. package/dist/{packager-tool-zn76tbxc.js → packager-tool-w34wyhwf.js} +13 -15
  67. package/dist/packager-tool-w8bcwfd3.js +280 -0
  68. package/dist/{packager-tool-3gwrcgrc.js → packager-tool-wm0h0wa1.js} +18 -18
  69. package/dist/{packager-tool-b2nhscfk.js → packager-tool-wm8nj6e9.js} +18 -18
  70. package/dist/{packager-tool-amhyxzz6.js → packager-tool-x33sdw6n.js} +16 -16
  71. package/dist/{packager-tool-wy4fx250.js → packager-tool-yetmzme9.js} +89 -30
  72. package/dist/{packager-tool-6tyyvhh0.js → packager-tool-z5r49ky9.js} +75 -9
  73. package/dist/packager-tool.js +6 -7
  74. package/dist/prepare-solution-resources-pwnyvtza.js +26 -0
  75. package/dist/{project-command-utils-t6pmpvq3.js → project-command-utils-zcmbecfy.js} +23 -26
  76. package/dist/project-contributions-kh9yftvg.js +27 -0
  77. package/dist/publish.js +17 -17
  78. package/dist/resource-mutations-mfn5k1hb.js +27 -0
  79. package/dist/{resource-version-lookup-0e3e2j58.js → resource-version-lookup-6ejh1hwd.js} +20 -23
  80. package/dist/resource.js +13 -16
  81. package/dist/{restore-command-service-2g02d7s1.js → restore-command-service-n880dxre.js} +37 -34
  82. package/dist/{run-service-6necpy9s.js → run-service-4vhn6mtb.js} +144 -66
  83. package/dist/services/deploy-activate-service.d.ts +2 -1
  84. package/dist/services/deployment-search-client.d.ts +2 -1
  85. package/dist/services/deployment-search.d.ts +39 -0
  86. package/dist/services/feed-resolver.d.ts +13 -1
  87. package/dist/services/feed-selection.d.ts +8 -5
  88. package/dist/services/feed-session.d.ts +34 -0
  89. package/dist/services/install-run.d.ts +92 -0
  90. package/dist/services/prepare-solution-resources.d.ts +11 -2
  91. package/dist/services/project-contributions.d.ts +2 -0
  92. package/dist/services/project-identity-telemetry.d.ts +3 -0
  93. package/dist/services/publish-service.d.ts +20 -3
  94. package/dist/services/solution-identity.d.ts +18 -0
  95. package/dist/ship-telemetry-bkf3800w.js +16 -0
  96. package/dist/solution-auth-jxcgd2m0.js +10 -0
  97. package/dist/solution-identity-92h2fbpa.js +19 -0
  98. package/dist/templates/AGENTS.md +27 -29
  99. package/dist/tool.js +32 -33
  100. package/package.json +2 -2
  101. package/dist/deploy-delete-service-7py597ng.js +0 -25
  102. package/dist/deploy-run-service-446bssn0.js +0 -25
  103. package/dist/deployment-search-qyd6dv0m.js +0 -55
  104. package/dist/feed-resolver-va10c73n.js +0 -28
  105. package/dist/feed-scope-failure-3yxfg1x7.js +0 -19
  106. package/dist/feed-session-7xqphdrg.js +0 -17
  107. package/dist/first-party-service-sd8yaf73.js +0 -27
  108. package/dist/governance-options-8snbrbt1.js +0 -32
  109. package/dist/index-dqa169gp.js +0 -25
  110. package/dist/index-fcwmbjap.js +0 -667
  111. package/dist/index-prm27bvm.js +0 -138
  112. package/dist/node-9hdy9st1.js +0 -86
  113. package/dist/pack-command-service-tr3z33gz.js +0 -35
  114. package/dist/package-id-kdkapmn2.js +0 -13
  115. package/dist/packager-tool-53w8skv5.js +0 -262
  116. package/dist/packager-tool-5edvzz80.js +0 -543
  117. package/dist/packager-tool-6d3fx89p.js +0 -171
  118. package/dist/packager-tool-d8ng7mex.js +0 -68
  119. package/dist/packager-tool-gdtpsdn7.js +0 -342
  120. package/dist/packager-tool-mq5pc4zr.js +0 -418
  121. package/dist/packager-tool-qw47eyw7.js +0 -43
  122. package/dist/packager-tool-resolver-994z3jkj.js +0 -23
  123. package/dist/packager-tool-rg3xgn9a.js +0 -182
  124. package/dist/packager-tool-sxjehksx.js +0 -5367
  125. package/dist/packager-tool-yrdyppjd.js +0 -188
  126. package/dist/prepare-solution-resources-m1djfj62.js +0 -29
  127. package/dist/project-contributions-79ndycrx.js +0 -32
  128. package/dist/resource-mutations-c3krjqze.js +0 -36
  129. package/dist/ship-telemetry-myes7ak5.js +0 -21
  130. package/dist/solution-auth-aead70sw.js +0 -11
  131. /package/dist/{packager-tool-act5r386.js → packager-tool-2pxe2r4j.js} +0 -0
  132. /package/dist/{packager-tool-kkfb5kgn.js → packager-tool-vrqbbh01.js} +0 -0
@@ -1,418 +0,0 @@
1
- import {
2
- Configuration,
3
- PipelinesApi
4
- } from "./packager-tool-97rcgwvv.js";
5
- import {
6
- Configuration as Configuration2,
7
- DeploymentSearchItemDto2FromJSON,
8
- DeploymentsApi,
9
- SearchApi
10
- } from "./packager-tool-sxjehksx.js";
11
- import {
12
- classifyFeedSession
13
- } from "./packager-tool-qw47eyw7.js";
14
- import {
15
- resolveSessionIdentity
16
- } from "./packager-tool-43ahv5mn.js";
17
- import {
18
- httpStatusOf,
19
- logger
20
- } from "./packager-tool-tx834spe.js";
21
- import {
22
- catchError
23
- } from "./packager-tool-6ybywxxn.js";
24
-
25
- // ../solution-sdk/src/legacy-deployment-search-v3.ts
26
- var LEGACY_V3_SEARCH_ROUTE = "POST /api/v3/search/deployments";
27
- async function searchDeploymentsLegacyV3(auth, query, scope) {
28
- const api = new SearchApi(new Configuration2({
29
- basePath: auth.basePath,
30
- accessToken: auth.accessToken
31
- }));
32
- const response = await api.searchSearchDeployments22Raw({ deploymentsSearchRequest2: toLegacyV3Request(query) }, scope);
33
- return response.raw.json();
34
- }
35
- function toLegacyV3Request(query) {
36
- return {
37
- searchTerm: query.searchTerm ?? query.deploymentName ?? query.packageName,
38
- packageName: query.packageName,
39
- ...query.targetFolderName ? { targetFolderName: query.targetFolderName } : {},
40
- take: query.take,
41
- skip: query.skip,
42
- orderByColumn: query.orderByColumn,
43
- orderByDirection: query.orderByDirection,
44
- operationStatuses: query.operationStatuses ?? [],
45
- activationStatuses: query.activationStatuses ?? []
46
- };
47
- }
48
-
49
- // ../solution-sdk/src/pipelines-route.ts
50
- async function isMissingPipelinesRoute(error) {
51
- const status = httpStatusOf(error);
52
- if (status === 405) {
53
- return true;
54
- }
55
- if (status !== 404 || !error || typeof error !== "object") {
56
- return false;
57
- }
58
- if (!("response" in error)) {
59
- return true;
60
- }
61
- const response = error.response;
62
- if (!(response instanceof Response)) {
63
- return false;
64
- }
65
- const [readError, body] = await catchError((async () => response.clone().text())());
66
- if (readError) {
67
- return false;
68
- }
69
- return body.trim() === "";
70
- }
71
- function isApplicationSession(auth) {
72
- const identity = auth.identity ?? resolveSessionIdentity(auth.accessToken);
73
- return identity?.type === "Application";
74
- }
75
- function notAPage(route, what, options) {
76
- return new Error(`${route} answered with ${what}.`, options);
77
- }
78
- function parseSearchPage(body, route, kind) {
79
- if (!body || typeof body !== "object" || Array.isArray(body)) {
80
- throw notAPage(route, `a body that is not a page of ${kind.plural}`);
81
- }
82
- const values = "values" in body ? body.values : undefined;
83
- if (values !== undefined && values !== null && !Array.isArray(values)) {
84
- throw notAPage(route, `\`values\` that is not a list of ${kind.plural}`);
85
- }
86
- const rows = Array.isArray(values) ? values : [];
87
- const count = "count" in body && typeof body.count === "number" && body.count >= 0 ? body.count : undefined;
88
- return { count, values: rows.map((row) => parseRow(row, route, kind)) };
89
- }
90
- function parseRow(row, route, kind) {
91
- const what = `a row that is not a ${kind.singular}`;
92
- if (!row || typeof row !== "object" || Array.isArray(row)) {
93
- throw notAPage(route, what);
94
- }
95
- if (kind.isRow && !kind.isRow(row)) {
96
- throw notAPage(route, what);
97
- }
98
- const [error, parsed] = catchError(() => kind.fromJSON(row));
99
- if (error) {
100
- throw notAPage(route, what, { cause: error });
101
- }
102
- return parsed;
103
- }
104
-
105
- // ../solution-sdk/src/deployment-search.ts
106
- var PIPELINES_SEARCH_ROUTE = "POST /v1/pipelines/deployments/search";
107
-
108
- class DeploymentSearchNeedsUserSessionError extends Error {
109
- constructor() {
110
- super("This server's deployment search reads user sessions only; an application (client-credentials) login cannot read it. Sign in with 'uip login' to use it.");
111
- this.name = "DeploymentSearchNeedsUserSessionError";
112
- }
113
- }
114
- var serversWithoutPipelinesSearch = new Set;
115
- var DEPLOYMENT_ROWS = {
116
- singular: "deployment",
117
- plural: "deployments",
118
- fromJSON: DeploymentSearchItemDto2FromJSON
119
- };
120
- async function searchDeploymentsPage(auth, query, scope) {
121
- if (!serversWithoutPipelinesSearch.has(auth.basePath)) {
122
- const [error, body2] = await catchError(searchViaPipelines(auth, query, scope));
123
- if (!error) {
124
- return {
125
- ...parseSearchPage(body2, PIPELINES_SEARCH_ROUTE, DEPLOYMENT_ROWS),
126
- source: "pipelines"
127
- };
128
- }
129
- if (!await isMissingPipelinesRoute(error)) {
130
- throw error;
131
- }
132
- serversWithoutPipelinesSearch.add(auth.basePath);
133
- logger.debug(`${PIPELINES_SEARCH_ROUTE} is not served at ${auth.basePath}; using the deprecated ${LEGACY_V3_SEARCH_ROUTE}.`);
134
- }
135
- if (isApplicationSession(auth)) {
136
- throw new DeploymentSearchNeedsUserSessionError;
137
- }
138
- const body = await searchDeploymentsLegacyV3(auth, query, scope);
139
- return {
140
- ...parseSearchPage(body, LEGACY_V3_SEARCH_ROUTE, DEPLOYMENT_ROWS),
141
- source: "legacy-v3"
142
- };
143
- }
144
- async function searchViaPipelines(auth, query, scope) {
145
- const api = new PipelinesApi(new Configuration({
146
- basePath: auth.basePath,
147
- accessToken: auth.accessToken
148
- }));
149
- const response = await api.pipelinesSearchDeploymentsRaw({
150
- pipelineDeploymentsSearchRequest: {
151
- take: query.take,
152
- skip: query.skip,
153
- deploymentName: query.deploymentName,
154
- packageName: query.packageName,
155
- targetFolderName: query.targetFolderName,
156
- searchTerm: query.searchTerm,
157
- orderByColumn: query.orderByColumn,
158
- orderByDirection: query.orderByDirection,
159
- operationStatuses: query.operationStatuses,
160
- activationStatuses: query.activationStatuses
161
- }
162
- }, scope);
163
- return response.raw.json();
164
- }
165
- // src/services/http-status.ts
166
- function isAuthRefusal(error) {
167
- const status = httpStatusOf(error);
168
- return status === 401 || status === 403;
169
- }
170
-
171
- // src/services/deployment-search.ts
172
- async function readDeploymentByKeyAsync(auth, deploymentKey, options = {}) {
173
- if (!options.solutionsOnly) {
174
- const api = new PipelinesApi(new Configuration({
175
- basePath: auth.basePath,
176
- accessToken: auth.accessToken
177
- }));
178
- const [error, info] = await catchError(api.pipelinesGetDeploymentByKey({ key: deploymentKey }));
179
- if (!error) {
180
- return info ? fromPipelinesRecord(info) : undefined;
181
- }
182
- if (httpStatusOf(error) !== 404) {
183
- throw error;
184
- }
185
- }
186
- if (classifyFeedSession(auth) !== "user") {
187
- return;
188
- }
189
- return readDeploymentByKeyViaSolutionsAsync(auth, deploymentKey, options.scope);
190
- }
191
- function fromPipelinesRecord(info) {
192
- return {
193
- deploymentKey: info.deploymentKey,
194
- operationStatus: info.operationStatus,
195
- installedRootFolderKey: info.installedRootFolderKey,
196
- source: "pipelines"
197
- };
198
- }
199
- async function readDeploymentByKeyViaSolutionsAsync(auth, deploymentKey, scope) {
200
- const api = new DeploymentsApi(new Configuration2({
201
- basePath: auth.basePath,
202
- accessToken: auth.accessToken
203
- }));
204
- const [error, row] = await catchError(api.deploymentsGetByKey({ deploymentKey }, scope));
205
- if (error) {
206
- if (httpStatusOf(error) === 404) {
207
- return;
208
- }
209
- throw error;
210
- }
211
- return row ? {
212
- deploymentKey: row.key,
213
- operationStatus: row.operationStatus,
214
- installedRootFolderKey: row.installedRootFolderKey,
215
- source: "solutions"
216
- } : undefined;
217
- }
218
- async function findDeploymentByName(auth, deploymentName, scope) {
219
- return newestDeploymentRow(await findDeploymentsByName(auth, deploymentName, scope));
220
- }
221
- async function findLiveDeploymentByName(auth, deploymentName, scope) {
222
- const newest = await findDeploymentByName(auth, deploymentName, scope);
223
- return isCompletedUninstall(newest) ? undefined : newest;
224
- }
225
- function isCompletedUninstall(row) {
226
- return row?.operation === "Uninstall" && row.operationStatus === "Successful";
227
- }
228
- async function findDeploymentsByPackageName(auth, packageName, options = {}) {
229
- const take = 50;
230
- const maxPages = 20;
231
- const matches = [];
232
- for (let page = 0, skip = 0;page < maxPages; page++) {
233
- const result = await searchDeploymentsPage(auth, { packageName, take, skip }, options.scope);
234
- const values = result.values ?? [];
235
- for (const deployment of values) {
236
- if (deployment.packageName === packageName && (options.folderPath === undefined || deployment.folderPath === options.folderPath)) {
237
- matches.push(deployment);
238
- }
239
- }
240
- if (values.length < take) {
241
- break;
242
- }
243
- skip += values.length;
244
- }
245
- return matches;
246
- }
247
- async function findCurrentDeploymentAsync(auth, deployment, scope) {
248
- const installKey = deployment.installDeploymentKey ?? deployment.key;
249
- const rows = await findDeploymentsByPackageName(auth, deployment.packageName, { scope });
250
- return rows.find((row) => (row.installDeploymentKey ?? row.key) === installKey);
251
- }
252
- function blocksRedeploy(deployment) {
253
- if (deployment.operationStatus === "InProgress") {
254
- return true;
255
- }
256
- if (deployment.operationStatus === "Successful") {
257
- return deployment.operation !== "Uninstall";
258
- }
259
- if (deployment.operationStatus === "Draft" || deployment.operationStatus === "Failed" || deployment.operationStatus === "FailedRollback") {
260
- return deployment.operation !== undefined && deployment.operation !== null && deployment.operation !== "Install";
261
- }
262
- return false;
263
- }
264
- var MAX_LISTED_DEPLOYMENTS = 5;
265
- function formatExistingDeployments(deployments, folderByKey) {
266
- const described = deployments.slice(0, MAX_LISTED_DEPLOYMENTS).map((deployment) => {
267
- const resolved = deployment.installedRootFolderKey ? folderByKey?.get(deployment.installedRootFolderKey) : undefined;
268
- const folder = resolved ?? deployment.folderPath ?? "an unknown folder";
269
- const current = deployment.currentPackageVersion ?? deployment.packageVersion ?? "an unknown version";
270
- const target = deployment.targetPackageVersion ?? deployment.newPackageVersionAvailable;
271
- const version = target && target !== current ? `${current} → ${target}` : current;
272
- const state = [
273
- deployment.operation,
274
- deployment.operationStatus,
275
- deployment.activationStatus
276
- ].filter((part) => part !== undefined && part !== null).join("/");
277
- return `'${deployment.name}' in ${folder} (version ${version}${state ? `, ${state}` : ""})`;
278
- }).join("; ");
279
- const remaining = deployments.length - MAX_LISTED_DEPLOYMENTS;
280
- return remaining > 0 ? `${described}; and ${remaining} more (see: uip solution deploy list)` : described;
281
- }
282
- async function findDeploymentsByName(auth, deploymentName, scope) {
283
- const matches = [];
284
- const take = 50;
285
- for (let skip = 0;; ) {
286
- const result = await searchDeploymentsPage(auth, { deploymentName, take, skip }, scope);
287
- const values = result.values ?? [];
288
- matches.push(...values.filter((deployment) => deployment.name === deploymentName));
289
- skip += values.length;
290
- const total = result.count;
291
- if (values.length < take || typeof total === "number" && skip >= total || skip >= MAX_SEARCH_ROWS) {
292
- return matches;
293
- }
294
- }
295
- }
296
- var MAX_SEARCH_ROWS = 5000;
297
- async function findDeploymentBestEffort(auth, deploymentName, scope, prefer = {}) {
298
- const [lookupError, rows] = await catchError(findDeploymentsByName(auth, deploymentName, scope));
299
- if (lookupError || !rows) {
300
- return;
301
- }
302
- if (prefer.deploymentKey) {
303
- return rows.find((row) => row.key === prefer.deploymentKey && row.operation !== "Uninstall");
304
- }
305
- const candidates = rows.filter((row) => row.operation !== "Uninstall");
306
- return candidates.sort((a, b) => creationMillis(b) - creationMillis(a))[0];
307
- }
308
- function newestDeploymentRow(rows) {
309
- return [...rows].sort((a, b) => creationMillis(b) - creationMillis(a))[0];
310
- }
311
- function creationMillis(row) {
312
- const millis = row.deploymentCreationTime ? new Date(row.deploymentCreationTime).getTime() : Number.NaN;
313
- return Number.isFinite(millis) ? millis : 0;
314
- }
315
- async function isPipelineDeploymentNotFoundError(error) {
316
- if (!error || typeof error !== "object") {
317
- return false;
318
- }
319
- const response = error.response;
320
- if (!response || typeof response !== "object") {
321
- return false;
322
- }
323
- const status = response.status;
324
- if (status !== 404) {
325
- return false;
326
- }
327
- const [bodyError, body] = await catchError(response.clone().text());
328
- if (bodyError || !body) {
329
- return false;
330
- }
331
- return body.includes("PipelineDeploymentNotFound");
332
- }
333
- function interpretFailedDeployPoll(deployment) {
334
- if (!deployment) {
335
- return;
336
- }
337
- if (deployment.operationStatus === "Failed" || deployment.operationStatus === "FailedRollback") {
338
- return {
339
- kind: "DeployFailed",
340
- operationStatus: deployment.operationStatus
341
- };
342
- }
343
- if (deployment.operationStatus !== "Successful") {
344
- return;
345
- }
346
- switch (deployment.activationStatus) {
347
- case "Active":
348
- return { kind: "Active", instanceId: deployment.instanceId };
349
- case "NeedsSetupToActivate":
350
- return { kind: "NeedsSetupToActivate" };
351
- case "ReadyToActivate":
352
- case "Inactive":
353
- return { kind: "ReadyToActivate" };
354
- case "ActivationFailed":
355
- return { kind: "ActivationFailed" };
356
- default:
357
- return;
358
- }
359
- }
360
- function mapOperationStatusToPipelineStatus(operationStatus) {
361
- switch (operationStatus) {
362
- case "Successful":
363
- return "DeploymentSucceeded";
364
- case "Failed":
365
- case "FailedRollback":
366
- case "Draft":
367
- return "DeploymentFailed";
368
- default:
369
- return;
370
- }
371
- }
372
- function deploymentToTerminalPipelineResult(deployment) {
373
- const status = mapOperationStatusToPipelineStatus(deployment.operationStatus);
374
- if (!status) {
375
- return;
376
- }
377
- return {
378
- status,
379
- validationResult: { validationErrors: [], conflictErrors: [] },
380
- deploymentKey: deployment.key,
381
- configurationKey: deployment.configurationKey,
382
- instanceId: deployment.instanceId,
383
- conflictFixingErrors: [],
384
- deploymentScheduleErrors: []
385
- };
386
- }
387
- async function resolveInstalledFolder(deployment, requested, resolveFolderByKey) {
388
- const fallback = {
389
- folderName: requested.folderName,
390
- folderPath: requested.folderPath,
391
- requestedMatched: true
392
- };
393
- const pathFor = (name, path) => path ?? (requested.parentFolderPath ? `${requested.parentFolderPath}/${name}` : name);
394
- const folderKey = deployment?.installedRootFolderKey;
395
- if (folderKey && resolveFolderByKey) {
396
- const [lookupError, folder] = await catchError(resolveFolderByKey(folderKey));
397
- if (!lookupError && folder?.name) {
398
- return {
399
- folderName: folder.name,
400
- folderPath: pathFor(folder.name, folder.path ?? deployment?.folderPath ?? undefined),
401
- requestedMatched: folder.name === requested.folderName
402
- };
403
- }
404
- }
405
- const resolvedName = deployment?.installedRootFolderName;
406
- if (resolvedName) {
407
- return {
408
- folderName: resolvedName,
409
- folderPath: pathFor(resolvedName, deployment?.folderPath ?? undefined),
410
- requestedMatched: resolvedName === requested.folderName
411
- };
412
- }
413
- return fallback;
414
- }
415
-
416
- export { isMissingPipelinesRoute, isApplicationSession, parseSearchPage, DeploymentSearchNeedsUserSessionError, searchDeploymentsPage, isAuthRefusal, readDeploymentByKeyAsync, readDeploymentByKeyViaSolutionsAsync, findDeploymentByName, findLiveDeploymentByName, isCompletedUninstall, findDeploymentsByPackageName, findCurrentDeploymentAsync, blocksRedeploy, MAX_LISTED_DEPLOYMENTS, formatExistingDeployments, findDeploymentsByName, findDeploymentBestEffort, newestDeploymentRow, isPipelineDeploymentNotFoundError, interpretFailedDeployPoll, mapOperationStatusToPipelineStatus, deploymentToTerminalPipelineResult, resolveInstalledFolder };
417
-
418
- //# debugId=FCF9A6B25A39008364756E2164756E21
@@ -1,43 +0,0 @@
1
- import {
2
- resolveSessionIdentity
3
- } from "./packager-tool-43ahv5mn.js";
4
-
5
- // src/services/feed-session.ts
6
- function classifyFeedSession(session) {
7
- const type = (session.identity ?? resolveSessionIdentity(session.accessToken))?.type;
8
- if (type === "User") {
9
- return "user";
10
- }
11
- return type === "Application" ? "application" : "unknown";
12
- }
13
- function feedSessionRefusal(verdict, action, alternative) {
14
- if (verdict === "application") {
15
- return {
16
- message: `${action} needs a user session; this session is an external app.`,
17
- instructions: `The server does not apply X-UIPATH-FolderKey to client-credentials requests, so the request would run against the tenant feed instead. Run it with a user session ('uip login'), or ${alternative}.`
18
- };
19
- }
20
- return {
21
- message: `${action} needs a user session, and this session's kind could not be read from its token.`,
22
- instructions: `The server applies X-UIPATH-FolderKey to user-token requests only, and a session that cannot be shown to be a user's is not allowed to act on a feed — guessing wrong would run the request against the tenant feed. Refresh the session with 'uip login' (an interactive login is recorded as a user session), or ${alternative}.`
23
- };
24
- }
25
- function feedReadRefusalForApplication(session, action) {
26
- if (classifyFeedSession(session) !== "application") {
27
- return;
28
- }
29
- return feedSessionRefusal("application", action, "drop the feed flag to read the tenant feed");
30
- }
31
-
32
- class FeedReadRefusedError extends Error {
33
- refusal;
34
- constructor(refusal) {
35
- super(refusal.message);
36
- this.refusal = refusal;
37
- this.name = "FeedReadRefusedError";
38
- }
39
- }
40
-
41
- export { classifyFeedSession, feedSessionRefusal, feedReadRefusalForApplication, FeedReadRefusedError };
42
-
43
- //# debugId=46593028C6477B8B64756E2164756E21
@@ -1,23 +0,0 @@
1
- import {
2
- UnpackableProjectTypeError,
3
- ensurePackagerTools,
4
- isUnpackableProjectTypeError
5
- } from "./packager-tool-b2nhscfk.js";
6
- import {
7
- toolVerbForProjectType
8
- } from "./packager-tool-60af1hw2.js";
9
- import"./packager-tool-5ddtwzva.js";
10
- import"./packager-tool-pbmqk39a.js";
11
- import"./packager-tool-tx834spe.js";
12
- import"./packager-tool-6ybywxxn.js";
13
- import"./packager-tool-v1f5e8t9.js";
14
- import"./packager-tool-dfrk01gn.js";
15
- import"./packager-tool-1de529jm.js";
16
- export {
17
- UnpackableProjectTypeError,
18
- ensurePackagerTools,
19
- isUnpackableProjectTypeError,
20
- toolVerbForProjectType
21
- };
22
-
23
- //# debugId=0070262AA7F4F4B364756E2164756E21
@@ -1,182 +0,0 @@
1
- import {
2
- getAvailablePublishLocationsV2
3
- } from "./packager-tool-sxjehksx.js";
4
- import {
5
- classifyFeedSession
6
- } from "./packager-tool-qw47eyw7.js";
7
- import {
8
- PersonalWorkspacesApi,
9
- createOrchestratorConfig
10
- } from "./packager-tool-8ptbmmmp.js";
11
- import {
12
- getLoginStatusAsync
13
- } from "./packager-tool-43ahv5mn.js";
14
- import {
15
- extractErrorDetails
16
- } from "./packager-tool-6ybywxxn.js";
17
-
18
- // src/services/personal-workspace-resolver.ts
19
- async function resolvePersonalWorkspace(options) {
20
- const config = await createOrchestratorConfig(options);
21
- const api = new PersonalWorkspacesApi(config);
22
- const pw = await api.personalWorkspacesGetPersonalWorkspace();
23
- if (!pw?.key || !pw.name) {
24
- throw new Error("Personal Workspace not configured for the current user. " + "Enable Personal Workspace in Orchestrator (or sign in as a user that has one), then retry.");
25
- }
26
- return { key: pw.key, name: pw.name };
27
- }
28
-
29
- // src/services/publish-locations-service.ts
30
- async function resolveStudioWebTarget(options) {
31
- const loginStatus = await getLoginStatusAsync({
32
- ensureTokenValidityMinutes: options?.loginValidity,
33
- envFilePath: options?.envFilePath
34
- });
35
- if (loginStatus.loginStatus !== "Logged in" || !loginStatus.accessToken || !loginStatus.baseUrl) {
36
- throw new Error("Not logged in. Run 'uip login' first.");
37
- }
38
- if (!loginStatus.organizationName) {
39
- throw new Error("Organization name is not available. Re-authenticate with 'uip login'.");
40
- }
41
- if (options?.tenant && loginStatus.tenantName && options.tenant.toLowerCase() !== loginStatus.tenantName.toLowerCase()) {
42
- throw new Error(`Feeds are resolved for the logged-in tenant ('${loginStatus.tenantName}'), so --tenant '${options.tenant}' can't apply here. Switch tenants first with: uip login tenant set ${options.tenant}.`);
43
- }
44
- return {
45
- config: {
46
- baseUrl: loginStatus.baseUrl,
47
- authToken: loginStatus.accessToken,
48
- tenantId: loginStatus.tenantId
49
- },
50
- organizationName: loginStatus.organizationName
51
- };
52
- }
53
- function isSelectableFeed(location) {
54
- switch (location.type) {
55
- case "Tenant":
56
- case "Folder":
57
- return true;
58
- case "PersonalWorkspace":
59
- return location.isMyPersonalWorkspace;
60
- default:
61
- return false;
62
- }
63
- }
64
- async function listSelectablePublishLocations(options) {
65
- const { config, organizationName } = await resolveStudioWebTarget(options);
66
- const all = await getAvailablePublishLocationsV2(config, organizationName);
67
- return all.filter(isSelectableFeed);
68
- }
69
-
70
- // src/services/feed-resolver.ts
71
- function folderKeyInitOverride(folderKey) {
72
- return async ({ init }) => ({
73
- headers: { ...init.headers, "X-UIPATH-FolderKey": folderKey }
74
- });
75
- }
76
- function feedScopeInitOverride(scope) {
77
- const { folderKey } = scope;
78
- if (!folderKey) {
79
- return;
80
- }
81
- return folderKeyInitOverride(folderKey);
82
- }
83
- function feedSelectorFlag(scope) {
84
- if (!scope || scope.kind === "tenant" || !scope.folderKey) {
85
- return "";
86
- }
87
- return scope.kind === "personal" ? " --personal-workspace" : ` --feed ${scope.folderKey}`;
88
- }
89
- function feedResolutionFailureInstructions(options) {
90
- if (options.personalWorkspace) {
91
- return "Personal Workspace resolution needs an interactive user session and an enabled Personal Workspace. Log in as a user with a Personal Workspace, or omit --personal-workspace to use the tenant feed.";
92
- }
93
- if (options.feed !== undefined) {
94
- return "List the feeds you can target with: uip solution feeds list.";
95
- }
96
- return "Check the selected feed and try again.";
97
- }
98
- async function describeFeedResolutionFailureAsync(error, options, session) {
99
- const details = await extractErrorDetails(error);
100
- if (options.personalWorkspace && isRefusal(details.context?.httpStatus) && classifyFeedSession(session) === "application") {
101
- return {
102
- message: "--personal-workspace needs a user session; this session is an external app, which has no Personal Workspace.",
103
- instructions: "Run it with a user session that has a Personal Workspace ('uip login'). A client-credentials login cannot target one.",
104
- errorCode: "permission_denied",
105
- retry: "RetryWillNotFix",
106
- context: details.context
107
- };
108
- }
109
- if (options.feed !== undefined && isRefusal(details.context?.httpStatus) && classifyFeedSession(session) === "application") {
110
- return {
111
- message: `--feed '${options.feed}' could not be checked: Studio Web refused this external app the list of publish locations (HTTP ${details.context?.httpStatus}).`,
112
- instructions: "Give the external application the Studio Web (StudioWebS2S) grants that cover reading publish locations, or run it with a user session ('uip login'). To use the tenant feed, omit --feed.",
113
- errorCode: "permission_denied",
114
- retry: "RetryWillNotFix",
115
- context: details.context
116
- };
117
- }
118
- return {
119
- message: details.message,
120
- instructions: feedResolutionFailureInstructions(options),
121
- errorCode: details.errorCode,
122
- retry: details.retry,
123
- context: details.context
124
- };
125
- }
126
- function isRefusal(status) {
127
- return status !== undefined && status >= 400 && status < 500 && status !== 408 && status !== 429;
128
- }
129
- async function resolveFeedScope(options) {
130
- const { personalWorkspace, feed } = options;
131
- if (personalWorkspace && feed !== undefined) {
132
- throw new Error("Use either --personal-workspace or --feed, not both.");
133
- }
134
- if (personalWorkspace) {
135
- const pw = await resolvePersonalWorkspace({
136
- tenant: options.tenant,
137
- loginValidity: options.loginValidity,
138
- envFilePath: options.envFilePath
139
- });
140
- return { kind: "personal", folderKey: pw.key, name: pw.name };
141
- }
142
- if (feed !== undefined) {
143
- return resolveNamedFeed(feed, options);
144
- }
145
- return { kind: "tenant" };
146
- }
147
- async function resolveNamedFeed(feed, options) {
148
- const locations = await listSelectablePublishLocations({
149
- tenant: options.tenant,
150
- envFilePath: options.envFilePath,
151
- loginValidity: options.loginValidity
152
- });
153
- const match = matchFeed(feed, locations);
154
- const kind = match.type === "Tenant" ? "tenant" : match.type === "PersonalWorkspace" ? "personal" : "folder";
155
- if (kind !== "tenant" && !match.key) {
156
- throw new Error(`Feed '${match.name || feed}' has no folder key in the publish-locations response, so it can't be targeted. Run 'uip solution feeds list' and pick a feed with a Key.`);
157
- }
158
- return {
159
- kind,
160
- folderKey: kind === "tenant" ? undefined : match.key,
161
- name: match.name
162
- };
163
- }
164
- function matchFeed(feed, locations) {
165
- const byKey = locations.find((location) => location.key === feed);
166
- if (byKey) {
167
- return byKey;
168
- }
169
- const target = feed.toLowerCase();
170
- const byName = locations.filter((location) => location.name.toLowerCase() === target);
171
- if (byName.length === 1) {
172
- return byName[0];
173
- }
174
- if (byName.length > 1) {
175
- throw new Error(`More than one feed is named '${feed}'. Pass its key instead — ` + "'uip solution feeds list' shows each feed's key.");
176
- }
177
- throw new Error(`Feed '${feed}' is not an available publish location. ` + "Run 'uip solution feeds list' to see the feeds you can publish to.");
178
- }
179
-
180
- export { resolvePersonalWorkspace, listSelectablePublishLocations, folderKeyInitOverride, feedScopeInitOverride, feedSelectorFlag, feedResolutionFailureInstructions, describeFeedResolutionFailureAsync, resolveFeedScope };
181
-
182
- //# debugId=5F1D84C9922C98B064756E2164756E21