@uipath/solution-tool 1.205.0-preview.281 → 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-je9d70vv.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-919yn8wn.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-5fke71jn.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-ha0pxw3h.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-4pa108k7.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-f23a485e.js → packager-tool-55ztfccd.js} +176 -196
  33. package/dist/{packager-tool-45a8fkw0.js → packager-tool-95y24705.js} +37 -39
  34. package/dist/{packager-tool-2vmz56qh.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-gyqfs04e.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-d78ww4hb.js → packager-tool-pyt9fvty.js} +51 -48
  52. package/dist/packager-tool-q5d9df2q.js +74 -0
  53. package/dist/{packager-tool-cvf46scg.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-2t72aez8.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-wm0jaz7p.js → packager-tool-t3a48ys5.js} +305 -657
  61. package/dist/{packager-tool-dnrk1gg6.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-h1tq7bqf.js → packager-tool-vx39dhvn.js} +65 -35
  66. package/dist/{packager-tool-5qzgdb66.js → packager-tool-w34wyhwf.js} +13 -15
  67. package/dist/packager-tool-w8bcwfd3.js +280 -0
  68. package/dist/{packager-tool-1ybnxbp9.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-056k8w2f.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-pzpet021.js → restore-command-service-n880dxre.js} +37 -34
  82. package/dist/{run-service-hk8w2h31.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-0tm600d1.js +0 -25
  102. package/dist/deploy-run-service-hne5w17k.js +0 -25
  103. package/dist/deployment-search-32zvxn35.js +0 -55
  104. package/dist/feed-resolver-pdeb4wkq.js +0 -28
  105. package/dist/feed-scope-failure-4baame72.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-bqgv5fte.js +0 -32
  109. package/dist/index-dqa169gp.js +0 -25
  110. package/dist/index-prm27bvm.js +0 -138
  111. package/dist/index-wdndcwab.js +0 -667
  112. package/dist/node-v7xhqwe2.js +0 -86
  113. package/dist/pack-command-service-b1v9c8cw.js +0 -35
  114. package/dist/package-id-rpzgy31w.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-99jaqabz.js +0 -171
  118. package/dist/packager-tool-9hsmn8th.js +0 -418
  119. package/dist/packager-tool-azre7mm1.js +0 -182
  120. package/dist/packager-tool-fn13r8e1.js +0 -188
  121. package/dist/packager-tool-gdtpsdn7.js +0 -342
  122. package/dist/packager-tool-qw47eyw7.js +0 -43
  123. package/dist/packager-tool-resolver-994z3jkj.js +0 -23
  124. package/dist/packager-tool-tedbebpq.js +0 -5367
  125. package/dist/packager-tool-x1ah4eez.js +0 -68
  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,9 +1,9 @@
1
1
  import {
2
2
  getAuthContext
3
- } from "./packager-tool-43ahv5mn.js";
3
+ } from "./packager-tool-t39pjz7n.js";
4
4
  import {
5
5
  catchError
6
- } from "./packager-tool-6ybywxxn.js";
6
+ } from "./packager-tool-m07vyk89.js";
7
7
 
8
8
  // src/services/studio-web-auth-middleware.ts
9
9
  var studioWebAuthByCommand = new WeakMap;
@@ -1,33 +1,38 @@
1
1
  import {
2
- feedScopeInitOverride,
3
- resolveFeedScope
4
- } from "./packager-tool-azre7mm1.js";
5
- import {
6
- Configuration,
7
- PipelinesApi
8
- } from "./packager-tool-97rcgwvv.js";
2
+ getFileSystem
3
+ } from "./packager-tool-vgrswa8p.js";
9
4
  import {
10
- getSolutionAuthContext
11
- } from "./packager-tool-61pwb567.js";
5
+ catchError,
6
+ extractErrorDetails
7
+ } from "./packager-tool-m07vyk89.js";
12
8
  import {
13
- PollOutcome,
14
9
  logger,
10
+ PollOutcome,
15
11
  mapPollFailure,
16
12
  pollUntil
17
- } from "./packager-tool-tx834spe.js";
13
+ } from "./packager-tool-9vrwpgt3.js";
18
14
  import {
19
- catchError,
20
- extractErrorDetails
21
- } from "./packager-tool-6ybywxxn.js";
15
+ Configuration2,
16
+ PipelinesApi,
17
+ feedSessionRefusalAsync2
18
+ } from "./packager-tool-bs1jn1yn.js";
22
19
  import {
23
- getFileSystem
24
- } from "./packager-tool-v1f5e8t9.js";
20
+ getSolutionAuthContext2
21
+ } from "./packager-tool-ppj5f4y7.js";
22
+ import {
23
+ strToU82,
24
+ strFromU82,
25
+ zipSync2,
26
+ unzipSync2
27
+ } from "./packager-tool-rj2d1g0w.js";
25
28
  import {
26
- strFromU8,
27
- strToU8,
28
- unzipSync,
29
- zipSync
30
- } from "./packager-tool-dfrk01gn.js";
29
+ feedScopeInitOverride2,
30
+ describeFeedResolutionFailureAsync2,
31
+ resolveFeedScope2
32
+ } from "./packager-tool-fqs6hdcy.js";
33
+ import {
34
+ capturePackedSolutionIdentity2
35
+ } from "./packager-tool-f84z7nds.js";
31
36
 
32
37
  // src/services/package-metadata-rewrite.ts
33
38
  import { randomUUID } from "node:crypto";
@@ -43,14 +48,14 @@ var requireValue = (value, flag) => {
43
48
  return trimmed;
44
49
  };
45
50
  function rewritePackageMetadata(archive, overrides) {
46
- const entries = unzipSync(archive);
51
+ const entries = unzipSync2(archive);
47
52
  const metadataBytes = entries[SOLUTION_METADATA_ENTRY];
48
53
  if (!metadataBytes) {
49
54
  throw new Error(`Package archive has no ${SOLUTION_METADATA_ENTRY} at its root, so its name and version cannot be rewritten. Only a .zip produced by 'uip solution pack' carries that file.`);
50
55
  }
51
56
  let parsed;
52
57
  try {
53
- parsed = JSON.parse(strFromU8(metadataBytes));
58
+ parsed = JSON.parse(strFromU82(metadataBytes));
54
59
  } catch (err) {
55
60
  throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
56
61
  }
@@ -71,11 +76,11 @@ function rewritePackageMetadata(archive, overrides) {
71
76
  zipInput[entryName] = [entryBytes, { level }];
72
77
  }
73
78
  zipInput[SOLUTION_METADATA_ENTRY] = [
74
- strToU8(JSON.stringify(rewritten)),
79
+ strToU82(JSON.stringify(rewritten)),
75
80
  { level: 6 }
76
81
  ];
77
82
  return {
78
- archive: zipSync(zipInput),
83
+ archive: zipSync2(zipInput),
79
84
  packageName,
80
85
  packageVersion,
81
86
  packageVersionKey
@@ -154,8 +159,8 @@ function mergeUploadErrorContext(context, httpStatus, errorCode) {
154
159
  ...errorCode !== undefined ? { errorCode } : {}
155
160
  };
156
161
  }
157
- async function publishSolutionAsync(packagePath, options = {}) {
158
- const [authError, auth] = await catchError(getSolutionAuthContext({
162
+ async function publishSolutionAsync2(packagePath, options = {}) {
163
+ const [authError, auth] = await catchError(getSolutionAuthContext2({
159
164
  tenant: options.tenant,
160
165
  loginValidity: options.loginValidity,
161
166
  envFilePath: options.envFilePath
@@ -220,6 +225,7 @@ async function publishSolutionAsync(packagePath, options = {}) {
220
225
  };
221
226
  }
222
227
  let fileBuffer = readBuffer;
228
+ await capturePackedSolutionIdentity2(options.telemetryCapture, fileBuffer);
223
229
  if (options.packageName !== undefined || options.packageVersion !== undefined) {
224
230
  const [rewriteError, rewritten] = await catchError(Promise.resolve().then(() => rewritePackageMetadata(new Uint8Array(fileBuffer), {
225
231
  packageName: options.packageName,
@@ -236,7 +242,7 @@ async function publishSolutionAsync(packagePath, options = {}) {
236
242
  logger.info(`Publishing ${resolvedPath} as ${rewritten.packageName} ${rewritten.packageVersion} (package version key ${rewritten.packageVersionKey}); the file on disk is unchanged.`);
237
243
  fileBuffer = rewritten.archive;
238
244
  }
239
- const [scopeError, scope] = await catchError(resolveFeedScope({
245
+ const [scopeError, scope] = await catchError(resolveFeedScope2({
240
246
  personalWorkspace: options.personalWorkspace,
241
247
  feed: options.feed,
242
248
  tenant: options.tenant,
@@ -244,18 +250,36 @@ async function publishSolutionAsync(packagePath, options = {}) {
244
250
  envFilePath: options.envFilePath
245
251
  }));
246
252
  if (scopeError) {
253
+ const failure = await describeFeedResolutionFailureAsync2(scopeError, options, auth);
247
254
  return {
248
255
  ok: false,
249
256
  reason: options.feed !== undefined ? "feed_resolution_failed" : "personal_workspace_resolution_failed",
250
- message: scopeError.message
257
+ message: failure.message,
258
+ instructions: failure.instructions,
259
+ cliErrorCode: failure.errorCode,
260
+ retry: failure.retry,
261
+ context: failure.context
251
262
  };
252
263
  }
253
- const configuration = new Configuration({
264
+ if (scope.kind !== "tenant" && scope.folderKey) {
265
+ const refusal = await feedSessionRefusalAsync2(auth, scope.folderKey, "write", `Publishing to the feed '${scope.name ?? scope.folderKey}'`, "omit the feed flag to publish to the tenant feed", "packages");
266
+ if (refusal) {
267
+ return {
268
+ ok: false,
269
+ reason: "feed_requires_user_session",
270
+ message: refusal.message,
271
+ instructions: refusal.instructions,
272
+ cliErrorCode: "permission_denied",
273
+ retry: "RetryWillNotFix"
274
+ };
275
+ }
276
+ }
277
+ const configuration = new Configuration2({
254
278
  basePath: auth.basePath,
255
279
  accessToken: auth.accessToken
256
280
  });
257
281
  const api = new PipelinesApi(configuration);
258
- const feedScope = feedScopeInitOverride(scope);
282
+ const feedScope = feedScopeInitOverride2(scope);
259
283
  const [uploadError, uploadResult] = await catchError(api.pipelinesPackageUpload({
260
284
  body: fileBuffer,
261
285
  locationKey: scope.folderKey
@@ -279,8 +303,14 @@ async function publishSolutionAsync(packagePath, options = {}) {
279
303
  signal: options.signal
280
304
  });
281
305
  if (pollResult.outcome !== PollOutcome.Completed) {
282
- const { reason, message } = mapPollFailure(pollResult, "Package publish");
283
- return { ok: false, reason, message };
306
+ const { reason, message, errorCode, retry } = mapPollFailure(pollResult, "Package publish");
307
+ return {
308
+ ok: false,
309
+ reason,
310
+ message,
311
+ cliErrorCode: errorCode,
312
+ retry
313
+ };
284
314
  }
285
315
  if (!pollResult.data) {
286
316
  return {
@@ -334,6 +364,6 @@ async function mapUploadError(uploadError) {
334
364
  };
335
365
  }
336
366
 
337
- export { publishSolutionAsync };
367
+ export { publishSolutionAsync2 };
338
368
 
339
- //# debugId=20F0484E4118DAEE64756E2164756E21
369
+ //# debugId=44E9C2005B30FB6B64756E2164756E21
@@ -1,23 +1,21 @@
1
1
  import {
2
- PackCommandService
3
- } from "./packager-tool-d78ww4hb.js";
2
+ catchError,
3
+ carriedErrorCode,
4
+ carriedInstructions
5
+ } from "./packager-tool-m07vyk89.js";
4
6
  import {
5
- isUnpackableProjectTypeError
6
- } from "./packager-tool-b2nhscfk.js";
7
+ isUnpackableProjectTypeError2
8
+ } from "./packager-tool-wm8nj6e9.js";
7
9
  import {
8
- carriedErrorCode
9
- } from "./packager-tool-tx834spe.js";
10
- import {
11
- carriedInstructions,
12
- catchError
13
- } from "./packager-tool-6ybywxxn.js";
10
+ PackCommandService2
11
+ } from "./packager-tool-pyt9fvty.js";
14
12
 
15
13
  // src/services/pack-service.ts
16
- async function packSolutionAsync(solutionPath, options) {
17
- const service = new PackCommandService;
14
+ async function packSolutionAsync2(solutionPath, options) {
15
+ const service = new PackCommandService2;
18
16
  const [error, result] = await catchError(service.executeAsync(solutionPath, options));
19
17
  if (error) {
20
- if (!isUnpackableProjectTypeError(error) && carriedErrorCode(error) === undefined) {
18
+ if (!isUnpackableProjectTypeError2(error) && carriedErrorCode(error) === undefined) {
21
19
  throw error;
22
20
  }
23
21
  const message = error instanceof Error ? error.message : String(error);
@@ -37,6 +35,6 @@ async function packSolutionAsync(solutionPath, options) {
37
35
  };
38
36
  }
39
37
 
40
- export { packSolutionAsync };
38
+ export { packSolutionAsync2 };
41
39
 
42
- //# debugId=79D5D443E78F177864756E2164756E21
40
+ //# debugId=B78F157411E2624464756E2164756E21
@@ -0,0 +1,280 @@
1
+ import {
2
+ catchError,
3
+ httpStatusOf2
4
+ } from "./packager-tool-m07vyk89.js";
5
+ import {
6
+ Configuration2,
7
+ PipelinesApi,
8
+ DeploymentSearchTruncatedError,
9
+ searchDeploymentsPage,
10
+ classifyFeedSession2
11
+ } from "./packager-tool-bs1jn1yn.js";
12
+ import {
13
+ Configuration3,
14
+ DeploymentsApi2
15
+ } from "./packager-tool-a6va4gc5.js";
16
+
17
+ // src/services/deployment-search.ts
18
+ async function readDeploymentByKeyAsync2(auth, deploymentKey, options = {}) {
19
+ if (!options.solutionsOnly) {
20
+ const api = new PipelinesApi(new Configuration2({
21
+ basePath: auth.basePath,
22
+ accessToken: auth.accessToken
23
+ }));
24
+ const [error, info] = await catchError(api.pipelinesGetDeploymentByKey({ key: deploymentKey }));
25
+ if (!error) {
26
+ return info ? fromPipelinesRecord(info) : undefined;
27
+ }
28
+ if (httpStatusOf2(error) !== 404) {
29
+ throw error;
30
+ }
31
+ }
32
+ if (classifyFeedSession2(auth) !== "user") {
33
+ return;
34
+ }
35
+ return readDeploymentByKeyViaSolutionsAsync(auth, deploymentKey, options.scope);
36
+ }
37
+ function fromPipelinesRecord(info) {
38
+ return {
39
+ deploymentKey: info.deploymentKey,
40
+ operationStatus: info.operationStatus,
41
+ installedRootFolderKey: info.installedRootFolderKey,
42
+ source: "pipelines"
43
+ };
44
+ }
45
+ async function readDeploymentByKeyViaSolutionsAsync(auth, deploymentKey, scope) {
46
+ const api = new DeploymentsApi2(new Configuration3({
47
+ basePath: auth.basePath,
48
+ accessToken: auth.accessToken
49
+ }));
50
+ const [error, row] = await catchError(api.deploymentsGetByKey({ deploymentKey }, scope));
51
+ if (error) {
52
+ if (httpStatusOf2(error) === 404) {
53
+ return;
54
+ }
55
+ throw error;
56
+ }
57
+ return row ? {
58
+ deploymentKey: row.key,
59
+ operationStatus: row.operationStatus,
60
+ installedRootFolderKey: row.installedRootFolderKey,
61
+ source: "solutions"
62
+ } : undefined;
63
+ }
64
+ async function findDeploymentByName2(auth, deploymentName, scope) {
65
+ return newestDeploymentRow2(await findDeploymentsByName2(auth, deploymentName, scope));
66
+ }
67
+ async function findLiveDeploymentByName2(auth, deploymentName, scope) {
68
+ const newest = await findDeploymentByName2(auth, deploymentName, scope);
69
+ return isCompletedUninstall2(newest) ? undefined : newest;
70
+ }
71
+ function isCompletedUninstall2(row) {
72
+ return row?.operation === "Uninstall" && row.operationStatus === "Successful";
73
+ }
74
+ async function findDeploymentsByPackageName2(auth, packageName, options = {}) {
75
+ return walkDeploymentSearch(auth, { by: "packageName", term: packageName, cap: MAX_PACKAGE_SEARCH_ROWS }, options.scope, (deployment) => deployment.packageName === packageName && (options.folderPath === undefined || deployment.folderPath === options.folderPath));
76
+ }
77
+ var SEARCH_PAGE_SIZE = 50;
78
+ var MAX_PACKAGE_SEARCH_ROWS = 1000;
79
+ var MAX_NAME_SEARCH_ROWS = 5000;
80
+
81
+ class DeploymentSearchCapError2 extends DeploymentSearchTruncatedError {
82
+ name = "DeploymentSearchCapError";
83
+ search;
84
+ term;
85
+ cap;
86
+ partialRows;
87
+ errorCode = "server_error";
88
+ retry = "RetryWillNotFix";
89
+ instructions = "Check the deployments in Orchestrator (Tenant > Solutions > Deployments), which is not limited by this cap.";
90
+ constructor(walk, partialRows) {
91
+ super(walk.cap, "page-cap");
92
+ this.search = walk.by;
93
+ this.term = walk.term;
94
+ this.cap = walk.cap;
95
+ this.partialRows = partialRows;
96
+ const filter = walk.by === "packageName" ? "package name" : "deployment name";
97
+ this.message = `The deployment search by ${filter} '${walk.term}' stopped at its cap of ${walk.cap} rows with rows still unread, so the deployments it found may not be all of them.`;
98
+ }
99
+ }
100
+ async function walkDeploymentSearch(auth, walk, scope, keep) {
101
+ const matches = [];
102
+ const take = SEARCH_PAGE_SIZE;
103
+ for (let skip = 0;; ) {
104
+ const result = await searchDeploymentsPage(auth, { [walk.by]: walk.term, take, skip }, scope);
105
+ const values = result.values ?? [];
106
+ matches.push(...values.filter(keep));
107
+ skip += values.length;
108
+ const total = result.count;
109
+ if (values.length < take || typeof total === "number" && skip >= total) {
110
+ return matches;
111
+ }
112
+ if (skip >= walk.cap) {
113
+ throw new DeploymentSearchCapError2(walk, matches);
114
+ }
115
+ }
116
+ }
117
+ async function findCurrentDeploymentAsync2(auth, deployment, scope) {
118
+ const installKey = deployment.installDeploymentKey ?? deployment.key;
119
+ const rows = await findDeploymentsByPackageName2(auth, deployment.packageName, { scope });
120
+ return rows.find((row) => (row.installDeploymentKey ?? row.key) === installKey);
121
+ }
122
+ function blocksRedeploy2(deployment) {
123
+ if (deployment.operationStatus === "InProgress") {
124
+ return true;
125
+ }
126
+ if (deployment.operationStatus === "Successful") {
127
+ return deployment.operation !== "Uninstall";
128
+ }
129
+ if (deployment.operationStatus === "Draft" || deployment.operationStatus === "Failed" || deployment.operationStatus === "FailedRollback") {
130
+ return deployment.operation !== undefined && deployment.operation !== null && deployment.operation !== "Install";
131
+ }
132
+ return false;
133
+ }
134
+ var MAX_LISTED_DEPLOYMENTS2 = 5;
135
+ function formatExistingDeployments2(deployments, folderByKey) {
136
+ const described = deployments.slice(0, MAX_LISTED_DEPLOYMENTS2).map((deployment) => {
137
+ const resolved = deployment.installedRootFolderKey ? folderByKey?.get(deployment.installedRootFolderKey) : undefined;
138
+ const folder = resolved ?? deployment.folderPath ?? "an unknown folder";
139
+ const current = deployment.currentPackageVersion ?? deployment.packageVersion ?? "an unknown version";
140
+ const target = deployment.targetPackageVersion ?? deployment.newPackageVersionAvailable;
141
+ const version = target && target !== current ? `${current} → ${target}` : current;
142
+ const state = [
143
+ deployment.operation,
144
+ deployment.operationStatus,
145
+ deployment.activationStatus
146
+ ].filter((part) => part !== undefined && part !== null).join("/");
147
+ return `'${deployment.name}' in ${folder} (version ${version}${state ? `, ${state}` : ""})`;
148
+ }).join("; ");
149
+ const remaining = deployments.length - MAX_LISTED_DEPLOYMENTS2;
150
+ return remaining > 0 ? `${described}; and ${remaining} more (see: uip solution deploy list)` : described;
151
+ }
152
+ async function findDeploymentsByName2(auth, deploymentName, scope) {
153
+ return walkDeploymentSearch(auth, {
154
+ by: "deploymentName",
155
+ term: deploymentName,
156
+ cap: MAX_NAME_SEARCH_ROWS
157
+ }, scope, (deployment) => deployment.name === deploymentName);
158
+ }
159
+ async function findDeploymentBestEffort2(auth, deploymentName, scope, prefer = {}) {
160
+ const [lookupError, rows] = await catchError(findDeploymentsByName2(auth, deploymentName, scope));
161
+ if (lookupError || !rows) {
162
+ return;
163
+ }
164
+ if (prefer.deploymentKey) {
165
+ return rows.find((row) => row.key === prefer.deploymentKey && row.operation !== "Uninstall");
166
+ }
167
+ const candidates = rows.filter((row) => row.operation !== "Uninstall");
168
+ return candidates.sort((a, b) => creationMillis(b) - creationMillis(a))[0];
169
+ }
170
+ function newestDeploymentRow2(rows) {
171
+ return [...rows].sort((a, b) => creationMillis(b) - creationMillis(a))[0];
172
+ }
173
+ function creationMillis(row) {
174
+ const millis = row.deploymentCreationTime ? new Date(row.deploymentCreationTime).getTime() : Number.NaN;
175
+ return Number.isFinite(millis) ? millis : 0;
176
+ }
177
+ async function isPipelineDeploymentNotFoundError2(error) {
178
+ if (!error || typeof error !== "object") {
179
+ return false;
180
+ }
181
+ const response = error.response;
182
+ if (!response || typeof response !== "object") {
183
+ return false;
184
+ }
185
+ const status = response.status;
186
+ if (status !== 404) {
187
+ return false;
188
+ }
189
+ const [bodyError, body] = await catchError(response.clone().text());
190
+ if (bodyError || !body) {
191
+ return false;
192
+ }
193
+ return body.includes("PipelineDeploymentNotFound");
194
+ }
195
+ function interpretFailedDeployPoll2(deployment) {
196
+ if (!deployment) {
197
+ return;
198
+ }
199
+ if (deployment.operationStatus === "Failed" || deployment.operationStatus === "FailedRollback") {
200
+ return {
201
+ kind: "DeployFailed",
202
+ operationStatus: deployment.operationStatus
203
+ };
204
+ }
205
+ if (deployment.operationStatus !== "Successful") {
206
+ return;
207
+ }
208
+ switch (deployment.activationStatus) {
209
+ case "Active":
210
+ return { kind: "Active", instanceId: deployment.instanceId };
211
+ case "NeedsSetupToActivate":
212
+ return { kind: "NeedsSetupToActivate" };
213
+ case "ReadyToActivate":
214
+ case "Inactive":
215
+ return { kind: "ReadyToActivate" };
216
+ case "ActivationFailed":
217
+ return { kind: "ActivationFailed" };
218
+ default:
219
+ return;
220
+ }
221
+ }
222
+ function mapOperationStatusToPipelineStatus2(operationStatus) {
223
+ switch (operationStatus) {
224
+ case "Successful":
225
+ return "DeploymentSucceeded";
226
+ case "Failed":
227
+ case "FailedRollback":
228
+ case "Draft":
229
+ return "DeploymentFailed";
230
+ default:
231
+ return;
232
+ }
233
+ }
234
+ function deploymentToTerminalPipelineResult2(deployment) {
235
+ const status = mapOperationStatusToPipelineStatus2(deployment.operationStatus);
236
+ if (!status) {
237
+ return;
238
+ }
239
+ return {
240
+ status,
241
+ validationResult: { validationErrors: [], conflictErrors: [] },
242
+ deploymentKey: deployment.key,
243
+ configurationKey: deployment.configurationKey,
244
+ instanceId: deployment.instanceId,
245
+ conflictFixingErrors: [],
246
+ deploymentScheduleErrors: []
247
+ };
248
+ }
249
+ async function resolveInstalledFolder2(deployment, requested, resolveFolderByKey) {
250
+ const fallback = {
251
+ folderName: requested.folderName,
252
+ folderPath: requested.folderPath,
253
+ requestedMatched: true
254
+ };
255
+ const pathFor = (name, path) => path ?? (requested.parentFolderPath ? `${requested.parentFolderPath}/${name}` : name);
256
+ const folderKey = deployment?.installedRootFolderKey;
257
+ if (folderKey && resolveFolderByKey) {
258
+ const [lookupError, folder] = await catchError(resolveFolderByKey(folderKey));
259
+ if (!lookupError && folder?.name) {
260
+ return {
261
+ folderName: folder.name,
262
+ folderPath: pathFor(folder.name, folder.path ?? deployment?.folderPath ?? undefined),
263
+ requestedMatched: folder.name === requested.folderName
264
+ };
265
+ }
266
+ }
267
+ const resolvedName = deployment?.installedRootFolderName;
268
+ if (resolvedName) {
269
+ return {
270
+ folderName: resolvedName,
271
+ folderPath: pathFor(resolvedName, deployment?.folderPath ?? undefined),
272
+ requestedMatched: resolvedName === requested.folderName
273
+ };
274
+ }
275
+ return fallback;
276
+ }
277
+
278
+ export { readDeploymentByKeyAsync2, findDeploymentByName2, findLiveDeploymentByName2, isCompletedUninstall2, findDeploymentsByPackageName2, DeploymentSearchCapError2, findCurrentDeploymentAsync2, blocksRedeploy2, MAX_LISTED_DEPLOYMENTS2, formatExistingDeployments2, findDeploymentsByName2, findDeploymentBestEffort2, newestDeploymentRow2, isPipelineDeploymentNotFoundError2, interpretFailedDeployPoll2, mapOperationStatusToPipelineStatus2, deploymentToTerminalPipelineResult2, resolveInstalledFolder2 };
279
+
280
+ //# debugId=72BB1B28C8150E9F64756E2164756E21
@@ -1,17 +1,17 @@
1
- import {
2
- findDeploymentByName,
3
- findLiveDeploymentByName
4
- } from "./packager-tool-9hsmn8th.js";
5
- import {
6
- feedScopeInitOverride,
7
- folderKeyInitOverride,
8
- listSelectablePublishLocations,
9
- resolvePersonalWorkspace
10
- } from "./packager-tool-azre7mm1.js";
11
1
  import {
12
2
  catchError,
13
3
  extractErrorDetails
14
- } from "./packager-tool-6ybywxxn.js";
4
+ } from "./packager-tool-m07vyk89.js";
5
+ import {
6
+ findDeploymentByName2,
7
+ findLiveDeploymentByName2
8
+ } from "./packager-tool-w8bcwfd3.js";
9
+ import {
10
+ resolvePersonalWorkspace,
11
+ listSelectablePublishLocations,
12
+ folderKeyInitOverride2,
13
+ feedScopeInitOverride2
14
+ } from "./packager-tool-fqs6hdcy.js";
15
15
 
16
16
  // src/services/deployment-feed-locator.ts
17
17
  var sweepResult = (location, skipped) => ({
@@ -28,7 +28,7 @@ async function nonTenantFeedsAsync(options) {
28
28
  if (!listError) {
29
29
  const rank = (location) => location.type === "PersonalWorkspace" ? 0 : 1;
30
30
  const feeds = [];
31
- const skipped2 = [];
31
+ const skipped = [];
32
32
  const nonTenant = [...locations].filter((location) => location.type !== "Tenant").sort((a, b) => rank(a) - rank(b));
33
33
  for (const location of nonTenant) {
34
34
  const kind = location.type === "PersonalWorkspace" ? "personal" : "folder";
@@ -36,14 +36,14 @@ async function nonTenantFeedsAsync(options) {
36
36
  feeds.push({ kind, folderKey: location.key });
37
37
  continue;
38
38
  }
39
- skipped2.push({
39
+ skipped.push({
40
40
  kind,
41
41
  reason: "no_key",
42
42
  name: location.name,
43
43
  error: new Error(`The list of feeds returned ${kind === "personal" ? "the Personal Workspace" : `folder feed '${location.name}'`} with no folder key, so it could not be searched.`)
44
44
  });
45
45
  }
46
- return { feeds, skipped: skipped2 };
46
+ return { feeds, skipped };
47
47
  }
48
48
  const skipped = [
49
49
  { kind: "folder", reason: "listing_failed", error: listError }
@@ -66,10 +66,10 @@ async function nonTenantFeedsAsync(options) {
66
66
  };
67
67
  }
68
68
  async function findDeploymentAcrossFeeds(auth, deploymentName, options) {
69
- const find = options.includeUninstalled ? findDeploymentByName : findLiveDeploymentByName;
69
+ const find = options.includeUninstalled ? findDeploymentByName2 : findLiveDeploymentByName2;
70
70
  const { selectedFeed } = options;
71
71
  if (selectedFeed) {
72
- const scope = feedScopeInitOverride(selectedFeed);
72
+ const scope = feedScopeInitOverride2(selectedFeed);
73
73
  const feed = selectedFeed.kind !== "tenant" && selectedFeed.folderKey ? { kind: selectedFeed.kind, folderKey: selectedFeed.folderKey } : undefined;
74
74
  const [searchError, deployment] = await catchError(find(auth, deploymentName, scope));
75
75
  if (searchError) {
@@ -98,7 +98,7 @@ async function findDeploymentAcrossFeeds(auth, deploymentName, options) {
98
98
  }
99
99
  const { feeds, skipped } = await nonTenantFeedsAsync(options);
100
100
  for (const feed of feeds) {
101
- const scope = folderKeyInitOverride(feed.folderKey);
101
+ const scope = folderKeyInitOverride2(feed.folderKey);
102
102
  const [searchError, deployment] = await catchError(find(auth, deploymentName, scope));
103
103
  if (searchError) {
104
104
  skipped.push({
@@ -190,4 +190,4 @@ async function reportIncompleteSweepAsync(deploymentName, skipped) {
190
190
 
191
191
  export { findDeploymentAcrossFeeds, isNameOrFeedRefusal, INCOMPLETE_SWEEP_ADVICE, retryAdvice, reportIncompleteSweepAsync };
192
192
 
193
- //# debugId=15DBBF477D4D820E64756E2164756E21
193
+ //# debugId=6A8D55120A286F5C64756E2164756E21
@@ -1,21 +1,21 @@
1
1
  import {
2
- toolOwnedProjectTypes,
3
- toolVerbForProjectType
4
- } from "./packager-tool-60af1hw2.js";
2
+ catchError
3
+ } from "./packager-tool-m07vyk89.js";
5
4
  import {
6
- registerPackagerFactories
7
- } from "./packager-tool-5ddtwzva.js";
5
+ logger,
6
+ unsupportedSolutionProjectType,
7
+ ensurePackagerFactory
8
+ } from "./packager-tool-9vrwpgt3.js";
8
9
  import {
9
10
  toolsFactoryRepository
10
- } from "./packager-tool-pbmqk39a.js";
11
+ } from "./packager-tool-a7s0gbxs.js";
11
12
  import {
12
- ensurePackagerFactory,
13
- logger,
14
- unsupportedSolutionProjectType
15
- } from "./packager-tool-tx834spe.js";
13
+ registerPackagerFactories2
14
+ } from "./packager-tool-ca5ngmqv.js";
16
15
  import {
17
- catchError
18
- } from "./packager-tool-6ybywxxn.js";
16
+ toolVerbForProjectType2,
17
+ toolOwnedProjectTypes
18
+ } from "./packager-tool-qzcd5c9s.js";
19
19
 
20
20
  // src/services/packager-tool-resolver.ts
21
21
  var PACKAGER_OWNED_TYPES = ["Connector"];
@@ -30,7 +30,7 @@ class UnpackableProjectTypeError extends Error {
30
30
  this.instructions = buildUnpackableInstructions(projectType);
31
31
  }
32
32
  }
33
- function isUnpackableProjectTypeError(error) {
33
+ function isUnpackableProjectTypeError2(error) {
34
34
  return !!error && typeof error === "object" && error.__unpackableType === true;
35
35
  }
36
36
  function buildUnpackableInstructions(projectType) {
@@ -73,8 +73,8 @@ function packableProjectTypes() {
73
73
  types.delete("processOrchestration");
74
74
  return [...types].sort((a, b) => a.localeCompare(b));
75
75
  }
76
- async function ensurePackagerTools(solutionDir, fs, options) {
77
- registerPackagerFactories();
76
+ async function ensurePackagerTools2(solutionDir, fs, options) {
77
+ registerPackagerFactories2();
78
78
  const only = options?.onlyProjectRelativePath;
79
79
  const projects = (await readSolutionProjects(solutionDir, fs)).filter((project) => only === undefined || project.path === only);
80
80
  if (projects.length === 0)
@@ -91,7 +91,7 @@ async function ensurePackagerTools(solutionDir, fs, options) {
91
91
  }
92
92
  if (toolsFactoryRepository.canHandleProject(type))
93
93
  continue;
94
- const toolVerb = toolVerbForProjectType(type);
94
+ const toolVerb = toolVerbForProjectType2(type);
95
95
  if (toolVerb) {
96
96
  neededTools.add(toolVerb);
97
97
  continue;
@@ -104,6 +104,6 @@ async function ensurePackagerTools(solutionDir, fs, options) {
104
104
  }
105
105
  }
106
106
 
107
- export { UnpackableProjectTypeError, isUnpackableProjectTypeError, ensurePackagerTools };
107
+ export { isUnpackableProjectTypeError2, ensurePackagerTools2 };
108
108
 
109
- //# debugId=CFEFCC90AA8142B364756E2164756E21
109
+ //# debugId=ADCB9B72454672F864756E2164756E21