@uipath/solution-tool 1.201.0-preview.115 → 1.201.0-preview.122

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.
@@ -1,28 +1,32 @@
1
1
  import {
2
2
  Configuration,
3
- Configuration1 as Configuration2,
4
3
  PipelinesApi,
5
- SearchApi,
6
- deploymentsAutoInstall,
7
4
  feedResolutionFailureInstructions,
8
5
  feedScopeInitOverride,
9
6
  folderKeyInitOverride,
10
7
  resolveFeedScope,
11
- resolvePersonalWorkspace,
8
+ resolvePersonalWorkspace
9
+ } from "./packager-tool-dmms4my7.js";
10
+ import {
11
+ Configuration as Configuration2,
12
+ SearchApi,
13
+ deploymentsAutoInstall,
12
14
  searchPackageVersions
13
- } from "./packager-tool-arbagkf2.js";
15
+ } from "./packager-tool-bna6wzjx.js";
16
+ import {
17
+ getSolutionAuthContext,
18
+ resolveFolder
19
+ } from "./packager-tool-fzwxq48d.js";
14
20
  import {
15
21
  DEFAULT_PAGE_SIZE,
16
22
  PollOutcome,
17
23
  catchError,
18
24
  extractErrorDetails,
19
- getSolutionAuthContext,
20
25
  logger,
21
26
  mapPollFailure,
22
27
  pollUntil,
23
- processContext,
24
- resolveFolder
25
- } from "./packager-tool-r9n45rjm.js";
28
+ processContext
29
+ } from "./packager-tool-bcpknnr8.js";
26
30
  import {
27
31
  getFileSystem
28
32
  } from "./packager-tool-7eva0peq.js";
@@ -7142,7 +7146,7 @@ function formatDeploymentFailureDetails(pipelineDeploymentId, status) {
7142
7146
  }
7143
7147
 
7144
7148
  // src/services/deployment-search.ts
7145
- async function findDeploymentByName(auth, deploymentName) {
7149
+ async function findDeploymentByName(auth, deploymentName, scope) {
7146
7150
  const api = new SearchApi(new Configuration2({
7147
7151
  basePath: auth.basePath,
7148
7152
  accessToken: auth.accessToken
@@ -7157,7 +7161,7 @@ async function findDeploymentByName(auth, deploymentName) {
7157
7161
  operationStatuses: [],
7158
7162
  activationStatuses: []
7159
7163
  }
7160
- });
7164
+ }, scope);
7161
7165
  const values = result.values ?? [];
7162
7166
  const match = values.find((deployment) => deployment.name === deploymentName);
7163
7167
  if (match) {
@@ -8018,6 +8022,54 @@ var fail4 = (reason, message, instructions, exitCode = 1) => ({
8018
8022
  instructions,
8019
8023
  exitCode
8020
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
+ }
8021
8073
  async function uninstallDeploymentAsync(deploymentName, options = {}) {
8022
8074
  const [authError, auth] = await catchError(getSolutionAuthContext({
8023
8075
  tenant: options.tenant,
@@ -8033,8 +8085,20 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
8033
8085
  }));
8034
8086
  const [uninstallError, uninstallResult] = await catchError(api.pipelinesUninstall({ deploymentName }));
8035
8087
  if (uninstallError) {
8036
- const { message, details } = await extractErrorDetails(uninstallError);
8037
- 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);
8038
8102
  }
8039
8103
  if (uninstallResult.complete) {
8040
8104
  return {
@@ -8068,8 +8132,8 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
8068
8132
  }
8069
8133
  const finalStatus = pollResult.data;
8070
8134
  if (finalStatus.status !== "SuccessfulUninstall") {
8071
- const errors2 = coerceWorkflowErrorMessages(finalStatus.errorMessage).map((e) => e.errorMessage).join(", ") || "Unknown error";
8072
- 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.");
8073
8137
  }
8074
8138
  return {
8075
8139
  ok: true,
@@ -8137,4 +8201,4 @@ async function listPackagesAsync(options = {}) {
8137
8201
 
8138
8202
  export { extractDeploymentErrors, formatDeploymentErrorsAsText, activateDeploymentAsync, listDeploymentsAsync, deployRunAsync, uninstallDeploymentAsync, listPackagesAsync };
8139
8203
 
8140
- //# debugId=93842E6BA841F24064756E2164756E21
8204
+ //# debugId=7B9B9E13DA7CE52664756E2164756E21