@uipath/solution-tool 1.200.0-preview.120 → 1.201.0-preview.121

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 (37) hide show
  1. package/dist/{browser-strategy-brs3w53e.js → browser-strategy-yccf8mtd.js} +1 -1
  2. package/dist/deploy.js +8 -6
  3. package/dist/index-2fj08e7n.js +2058 -0
  4. package/dist/index-w03qc9m8.js +634 -0
  5. package/dist/index.js +15 -12
  6. package/dist/init.d.ts +6 -8
  7. package/dist/init.js +7 -6
  8. package/dist/js-yaml-4ypbq2tt.js +3145 -0
  9. package/dist/list-kbscmb2k.js +378 -0
  10. package/dist/node-strategy-12qfy0nv.js +348 -0
  11. package/dist/pack.js +9 -20
  12. package/dist/{packager-tool-v3bmxrve.js → packager-tool-112c30jx.js} +806 -93
  13. package/dist/{packager-tool-9j8d0ts5.js → packager-tool-550smwcc.js} +431 -1645
  14. package/dist/{packager-tool-1ps2qeqg.js → packager-tool-5arsyj36.js} +3 -2
  15. package/dist/{packager-tool-kfzzznjr.js → packager-tool-67ssxgph.js} +2 -2
  16. package/dist/packager-tool-7eva0peq.js +265 -0
  17. package/dist/{packager-tool-r1hk3s30.js → packager-tool-95fz7yd0.js} +72 -11
  18. package/dist/{packager-tool-sdhdmkt8.js → packager-tool-9vehmnke.js} +2 -1
  19. package/dist/packager-tool-bcpknnr8.js +6724 -0
  20. package/dist/packager-tool-fzwxq48d.js +4225 -0
  21. package/dist/{packager-tool-37g19zk3.js → packager-tool-krd5v2r5.js} +8 -6
  22. package/dist/{packager-tool-epwm26av.js → packager-tool-nkgvv7yh.js} +6249 -5847
  23. package/dist/{packager-tool-dmdgqh56.js → packager-tool-v33bpncw.js} +87 -31
  24. package/dist/packager-tool-va301fjh.js +1477 -0
  25. package/dist/packager-tool-yktm4v4r.js +67 -0
  26. package/dist/packager-tool.js +1 -1
  27. package/dist/publish.js +8 -6
  28. package/dist/resource.d.ts +2 -3
  29. package/dist/resource.js +6 -5
  30. package/dist/services/deployment-search.d.ts +1 -1
  31. package/dist/services/feed-resolver.d.ts +4 -5
  32. package/dist/templates/AGENTS.md +2 -1
  33. package/dist/tool.js +15 -12
  34. package/package.json +2 -2
  35. package/dist/node-strategy-a4n0d6dx.js +0 -63
  36. package/dist/packager-tool-q90kqh83.js +0 -1161
  37. package/dist/packager-tool-y4wacqkp.js +0 -15811
@@ -1,29 +1,35 @@
1
1
  import {
2
2
  Configuration,
3
- Configuration1 as Configuration2,
4
3
  PipelinesApi,
5
- SearchApi,
6
- deploymentsAutoInstall,
4
+ feedResolutionFailureInstructions,
7
5
  feedScopeInitOverride,
6
+ folderKeyInitOverride,
8
7
  resolveFeedScope,
9
- resolvePersonalWorkspace,
8
+ resolvePersonalWorkspace
9
+ } from "./packager-tool-va301fjh.js";
10
+ import {
11
+ Configuration as Configuration2,
12
+ SearchApi,
13
+ deploymentsAutoInstall,
10
14
  searchPackageVersions
11
- } from "./packager-tool-9j8d0ts5.js";
15
+ } from "./packager-tool-550smwcc.js";
16
+ import {
17
+ getSolutionAuthContext,
18
+ resolveFolder
19
+ } from "./packager-tool-fzwxq48d.js";
12
20
  import {
13
21
  DEFAULT_PAGE_SIZE,
14
22
  PollOutcome,
15
23
  catchError,
16
24
  extractErrorDetails,
17
- getSolutionAuthContext,
18
25
  logger,
19
26
  mapPollFailure,
20
27
  pollUntil,
21
- processContext,
22
- resolveFolder
23
- } from "./packager-tool-y4wacqkp.js";
28
+ processContext
29
+ } from "./packager-tool-bcpknnr8.js";
24
30
  import {
25
31
  getFileSystem
26
- } from "./packager-tool-q90kqh83.js";
32
+ } from "./packager-tool-7eva0peq.js";
27
33
  import {
28
34
  __commonJS,
29
35
  __require
@@ -7140,7 +7146,7 @@ function formatDeploymentFailureDetails(pipelineDeploymentId, status) {
7140
7146
  }
7141
7147
 
7142
7148
  // src/services/deployment-search.ts
7143
- async function findDeploymentByName(auth, deploymentName) {
7149
+ async function findDeploymentByName(auth, deploymentName, scope) {
7144
7150
  const api = new SearchApi(new Configuration2({
7145
7151
  basePath: auth.basePath,
7146
7152
  accessToken: auth.accessToken
@@ -7155,7 +7161,7 @@ async function findDeploymentByName(auth, deploymentName) {
7155
7161
  operationStatuses: [],
7156
7162
  activationStatuses: []
7157
7163
  }
7158
- });
7164
+ }, scope);
7159
7165
  const values = result.values ?? [];
7160
7166
  const match = values.find((deployment) => deployment.name === deploymentName);
7161
7167
  if (match) {
@@ -7525,7 +7531,7 @@ async function listDeploymentsAsync(options = {}) {
7525
7531
  envFilePath: options.envFilePath
7526
7532
  }));
7527
7533
  if (scopeError) {
7528
- return fail2("feed_resolution_failed", scopeError.message, "List the feeds you can query with: uip solution feeds list.");
7534
+ return fail2("feed_resolution_failed", scopeError.message, feedResolutionFailureInstructions(options));
7529
7535
  }
7530
7536
  const api = new SearchApi(new Configuration2({
7531
7537
  basePath: auth.basePath,
@@ -7622,12 +7628,7 @@ async function deployToFeed(auth, target, params) {
7622
7628
  accessToken: auth.accessToken
7623
7629
  });
7624
7630
  const searchApi = new SearchApi(config);
7625
- const feedScope = ({ init }) => ({
7626
- headers: {
7627
- ...init.headers,
7628
- "X-UIPATH-FolderKey": target.feedFolderKey
7629
- }
7630
- });
7631
+ const feedScope = folderKeyInitOverride(target.feedFolderKey);
7631
7632
  const take = 50;
7632
7633
  let pkg;
7633
7634
  for (let skip = 0;; ) {
@@ -7963,12 +7964,7 @@ async function deployRunViaFeedAsync(auth, scope, options) {
7963
7964
  if (deployError) {
7964
7965
  const { message, details, context, parsedErrors } = await extractErrorDetails(deployError);
7965
7966
  if (isExistingDeploymentConflict(context?.httpStatus, message, details, parsedErrors)) {
7966
- const feedLookupScope = async ({ init }) => ({
7967
- headers: {
7968
- ...init.headers,
7969
- "X-UIPATH-FolderKey": scope.folderKey
7970
- }
7971
- });
7967
+ const feedLookupScope = folderKeyInitOverride(scope.folderKey);
7972
7968
  const existing = await findDeploymentByPackageName(auth, options.packageName, undefined, feedLookupScope);
7973
7969
  return fail3("deployment_exists", message, buildDeploymentExistsInstructions(options.packageName, existing));
7974
7970
  }
@@ -8026,6 +8022,54 @@ var fail4 = (reason, message, instructions, exitCode = 1) => ({
8026
8022
  instructions,
8027
8023
  exitCode
8028
8024
  });
8025
+ function requestErrorInstructions(deploymentName, errorCode, details) {
8026
+ switch (errorCode) {
8027
+ case "authentication_required":
8028
+ return `Your session may have expired. Run 'uip login' and retry. Details: ${details}`;
8029
+ case "permission_denied":
8030
+ return `Your account lacks permission to uninstall this deployment. Check your Orchestrator roles, then retry. Details: ${details}`;
8031
+ case "rate_limited":
8032
+ return `Too many requests. Wait a moment and retry. Details: ${details}`;
8033
+ case "network_error":
8034
+ return `Could not reach Orchestrator. Check your connection and retry. Details: ${details}`;
8035
+ case "server_error":
8036
+ return `Orchestrator returned a server error. Wait and retry; if it persists, check Orchestrator status. Details: ${details}`;
8037
+ case "not_found":
8038
+ return `No deployment named '${deploymentName}' was found. Run 'uip solution deploy list' to see valid deployment names. Details: ${details}`;
8039
+ default:
8040
+ return `Uninstall request failed. Run 'uip solution deploy list' to check the deployment's state, then retry. Details: ${details}`;
8041
+ }
8042
+ }
8043
+ function buildDeploymentStateInstructions(deployment, details) {
8044
+ const availableActions = deployment.actions?.length ? deployment.actions.join(", ") : "none";
8045
+ const status = `(ActivationStatus: ${deployment.activationStatus}, OperationStatus: ${deployment.operationStatus})`;
8046
+ if (deployment.operationStatus === "InProgress") {
8047
+ return `Deployment '${deployment.name}' has an operation in progress ${status}, so it can't be uninstalled yet. Wait for it to finish — run 'uip solution deploy list' to recheck — then retry. Available actions: ${availableActions}. Details: ${details}`;
8048
+ }
8049
+ if (deployment.actions?.includes("Uninstall")) {
8050
+ return `Deployment '${deployment.name}' lists uninstall as available but Orchestrator rejected the request ${status}. Run 'uip solution deploy list' to recheck its state, then retry. If it stays stuck, uninstall it from the Orchestrator Solutions UI. Details: ${details}`;
8051
+ }
8052
+ if (deployment.activationStatus === "Inactive") {
8053
+ return `Deployment '${deployment.name}' cannot be uninstalled in its current state ${status}. Available actions: ${availableActions}. Superseded or inactive deployments cannot be uninstalled from the CLI — remove them from the Orchestrator Solutions UI. Run 'uip solution deploy list' to see the current deployments. Details: ${details}`;
8054
+ }
8055
+ return `Deployment '${deployment.name}' cannot be uninstalled in its current state ${status}. Available actions: ${availableActions}. Run 'uip solution deploy list' to recheck its state, or remove it from the Orchestrator Solutions UI. Details: ${details}`;
8056
+ }
8057
+ async function findDeploymentAcrossFeeds(auth, deploymentName, options) {
8058
+ const tenantMatch = await findDeploymentByName(auth, deploymentName);
8059
+ if (tenantMatch) {
8060
+ return tenantMatch;
8061
+ }
8062
+ const [, pwMatch] = await catchError((async () => {
8063
+ const scope = await resolveFeedScope({
8064
+ personalWorkspace: true,
8065
+ tenant: options.tenant,
8066
+ loginValidity: options.loginValidity,
8067
+ envFilePath: options.envFilePath
8068
+ });
8069
+ return findDeploymentByName(auth, deploymentName, feedScopeInitOverride(scope));
8070
+ })());
8071
+ return pwMatch ?? undefined;
8072
+ }
8029
8073
  async function uninstallDeploymentAsync(deploymentName, options = {}) {
8030
8074
  const [authError, auth] = await catchError(getSolutionAuthContext({
8031
8075
  tenant: options.tenant,
@@ -8041,8 +8085,20 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
8041
8085
  }));
8042
8086
  const [uninstallError, uninstallResult] = await catchError(api.pipelinesUninstall({ deploymentName }));
8043
8087
  if (uninstallError) {
8044
- const { message, details } = await extractErrorDetails(uninstallError);
8045
- return fail4("uninstall_request_failed", message, `Check deployment name matches an existing deployment. Details: ${details}`);
8088
+ const { message, details, errorCode } = await extractErrorDetails(uninstallError);
8089
+ if (errorCode !== "invalid_argument") {
8090
+ return fail4("uninstall_request_failed", message, requestErrorInstructions(deploymentName, errorCode, details));
8091
+ }
8092
+ const [lookupError, deployment] = await catchError(findDeploymentAcrossFeeds(auth, deploymentName, options));
8093
+ let instructions;
8094
+ if (lookupError) {
8095
+ instructions = `Check the deployment name matches an existing deployment (run 'uip solution deploy list'). Details: ${details}`;
8096
+ } else if (deployment) {
8097
+ instructions = buildDeploymentStateInstructions(deployment, details);
8098
+ } else {
8099
+ instructions = `No deployment named '${deploymentName}' was found in your tenant or Personal Workspace. Check the name with 'uip solution deploy list'. Details: ${details}`;
8100
+ }
8101
+ return fail4("uninstall_request_failed", message, instructions);
8046
8102
  }
8047
8103
  if (uninstallResult.complete) {
8048
8104
  return {
@@ -8076,8 +8132,8 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
8076
8132
  }
8077
8133
  const finalStatus = pollResult.data;
8078
8134
  if (finalStatus.status !== "SuccessfulUninstall") {
8079
- const errors2 = coerceWorkflowErrorMessages(finalStatus.errorMessage).map((e) => e.errorMessage).join(", ") || "Unknown error";
8080
- return fail4("uninstall_failed", `Uninstall failed with status: ${finalStatus.status}`, errors2);
8135
+ const errors2 = coerceWorkflowErrorMessages(finalStatus.errorMessage).map((e) => e.errorMessage).join(", ");
8136
+ return fail4("uninstall_failed", `Uninstall failed with status: ${finalStatus.status}`, errors2 || "Orchestrator ended the uninstall in a FailedUninstall state without an error detail. Run 'uip solution deploy list' to recheck the deployment's state and retry. If it stays in a failed state, remove it from the Orchestrator Solutions UI.");
8081
8137
  }
8082
8138
  return {
8083
8139
  ok: true,
@@ -8114,7 +8170,7 @@ async function listPackagesAsync(options = {}) {
8114
8170
  envFilePath: options.envFilePath
8115
8171
  }));
8116
8172
  if (scopeError) {
8117
- return fail5("feed_resolution_failed", scopeError.message, "List the feeds you can query with: uip solution feeds list.");
8173
+ return fail5("feed_resolution_failed", scopeError.message, feedResolutionFailureInstructions(options));
8118
8174
  }
8119
8175
  const searchApi = new SearchApi(new Configuration2({
8120
8176
  basePath: auth.basePath,
@@ -8145,4 +8201,4 @@ async function listPackagesAsync(options = {}) {
8145
8201
 
8146
8202
  export { extractDeploymentErrors, formatDeploymentErrorsAsText, activateDeploymentAsync, listDeploymentsAsync, deployRunAsync, uninstallDeploymentAsync, listPackagesAsync };
8147
8203
 
8148
- //# debugId=BE94E7E8ACEB5FD864756E2164756E21
8204
+ //# debugId=7B9B9E13DA7CE52664756E2164756E21