@uipath/solution-tool 1.201.0-preview.115 → 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.
@@ -1,15 +1,17 @@
1
1
  import {
2
2
  UsersApi,
3
- catchError,
4
3
  createApiClient,
4
+ getSolutionAuthContext
5
+ } from "./packager-tool-fzwxq48d.js";
6
+ import {
7
+ catchError,
5
8
  extractErrorMessage,
6
9
  findSolutionFileUpward,
7
10
  getLoginStatusAsync,
8
- getSolutionAuthContext,
9
11
  isGuid,
10
12
  logger,
11
13
  normalizeProjectType
12
- } from "./packager-tool-r9n45rjm.js";
14
+ } from "./packager-tool-bcpknnr8.js";
13
15
  import {
14
16
  getFileSystem
15
17
  } from "./packager-tool-7eva0peq.js";
@@ -16437,4 +16439,4 @@ async function resourceRefreshAsync(solutionPath = ".", options = {}) {
16437
16439
  }
16438
16440
  export { Tokens, models_BindingsResourceType, getResourceName, getFolderPathProperty, getResourceKindForBinding, applyEntryPointEnhancementAsync, createResourceBuilderServices, findProjectFile, readProjectFile, readSolutionFile, resolveSolutionFilePath, writeSolutionFile, restoreSolutionFile, createProjectInSolutionBuilder, normalizeFolderPath, findMatchingLocalResource, addProjectArtifactsToSolutionAsync, assertSolutionManifest, syncResourcesFromBindings, findResourceByKeyInRcs, searchRcsResources, findResourceInRcs, createLocalResource, readUipxProjects, syncAndLog, resourceRefreshAsync };
16439
16441
 
16440
- //# debugId=74F623B6774EA9EC64756E2164756E21
16442
+ //# debugId=66F9229297D31A8664756E2164756E21
@@ -23,7 +23,7 @@ import {
23
23
  models_BindingsResourceType,
24
24
  readUipxProjects,
25
25
  syncAndLog
26
- } from "./packager-tool-ngh4qwjv.js";
26
+ } from "./packager-tool-krd5v2r5.js";
27
27
  import {
28
28
  ToolResult as ToolResult2,
29
29
  toolsFactoryRepository as toolsFactoryRepository2
@@ -37,7 +37,7 @@ import {
37
37
  logger,
38
38
  telemetry,
39
39
  unsupportedSolutionProjectType
40
- } from "./packager-tool-r9n45rjm.js";
40
+ } from "./packager-tool-bcpknnr8.js";
41
41
  import {
42
42
  getFileSystem
43
43
  } from "./packager-tool-7eva0peq.js";
@@ -23247,6 +23247,7 @@ var TLS_ERROR_CODES = new Set([
23247
23247
  ]);
23248
23248
  var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
23249
23249
  var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
23250
+ var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
23250
23251
  var logFilePathSlot = singleton("logFilePath");
23251
23252
  function setGlobalLogFilePath(path3) {
23252
23253
  logFilePathSlot.set(path3);
@@ -23665,7 +23666,6 @@ var SENSITIVE_KEY_PREFIXES = new Set([
23665
23666
  "oauth"
23666
23667
  ]);
23667
23668
  var factorySlot = singleton("PackagerFactoryProvider");
23668
- var moduleSlot = singleton("ToolModuleProvider");
23669
23669
  var RulesConfigFileType;
23670
23670
  ((RulesConfigFileType2) => {
23671
23671
  RulesConfigFileType2["Default"] = "Default";
@@ -23804,7 +23804,7 @@ var sdkUserAgentHostToken2 = singleton2("SdkUserAgentHostToken");
23804
23804
  var package_default = {
23805
23805
  name: "@uipath/project-packager",
23806
23806
  license: "MIT",
23807
- version: "1.201.0-preview.115",
23807
+ version: "1.201.0-preview.121",
23808
23808
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
23809
23809
  type: "module",
23810
23810
  main: "./dist/index.js",
@@ -33817,6 +33817,7 @@ var TLS_ERROR_CODES3 = new Set([
33817
33817
  ]);
33818
33818
  var TLS_INSTRUCTIONS2 = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
33819
33819
  var NETWORK_INSTRUCTIONS2 = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
33820
+ var LOCAL_PERMISSION_ERROR_CODES2 = new Set(["EACCES", "EPERM", "EROFS"]);
33820
33821
  var import__2 = __toESM3(require_commander2(), 1);
33821
33822
  var {
33822
33823
  program: program2,
@@ -34972,6 +34973,7 @@ var CLI_ERROR_CODES = [
34972
34973
  "invalid_argument",
34973
34974
  "authentication_required",
34974
34975
  "permission_denied",
34976
+ "local_permission_denied",
34975
34977
  "not_found",
34976
34978
  "rate_limited",
34977
34979
  "network_error",
@@ -35408,12 +35410,16 @@ function defaultErrorCodeForHttpStatus(status) {
35408
35410
  return "server_error";
35409
35411
  return;
35410
35412
  }
35413
+ var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
35411
35414
  function defaultErrorCodeForFailure(data) {
35412
35415
  if (data.Result === RESULTS2.Failure) {
35413
35416
  const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
35414
35417
  const errorCode = defaultErrorCodeForHttpStatus(status);
35415
35418
  if (errorCode)
35416
35419
  return errorCode;
35420
+ if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
35421
+ return "local_permission_denied";
35422
+ }
35417
35423
  }
35418
35424
  return defaultErrorCodeForResult(data.Result);
35419
35425
  }
@@ -35879,9 +35885,8 @@ var ScreenLogger2;
35879
35885
  ScreenLogger22.progress = progress;
35880
35886
  })(ScreenLogger2 ||= {});
35881
35887
  var sdkUserAgentHostToken3 = singleton3("SdkUserAgentHostToken");
35882
- var factorySlot2 = singleton3("PackagerFactoryProvider");
35883
- var moduleSlot2 = singleton3("ToolModuleProvider");
35884
35888
  var shippedKeysSlot = singleton3("ShipSucceededDedupeKeys");
35889
+ var factorySlot2 = singleton3("PackagerFactoryProvider");
35885
35890
  var globalLogHandler2 = (logMessage) => {
35886
35891
  const formattedMessage = logMessage.toFormattedString();
35887
35892
  switch (logMessage.logLevel) {
@@ -36300,7 +36305,7 @@ var sdkUserAgentHostToken22 = singleton22("SdkUserAgentHostToken");
36300
36305
  var package_default2 = {
36301
36306
  name: "@uipath/project-packager",
36302
36307
  license: "MIT",
36303
- version: "1.201.0-preview.115",
36308
+ version: "1.201.0-preview.121",
36304
36309
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
36305
36310
  type: "module",
36306
36311
  main: "./dist/index.js",
@@ -38312,4 +38317,4 @@ async function packSolutionAsync(solutionPath, options) {
38312
38317
 
38313
38318
  export { SolutionPackOptions, ensurePackagerTools, createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, GOVERNANCE_OPTION_INSTRUCTIONS, validateGovernanceOptions, PackCommandService, packSolutionAsync };
38314
38319
 
38315
- //# debugId=C6F7B559131A0F7564756E2164756E21
38320
+ //# debugId=1239C1426CC5724A64756E2164756E21
@@ -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-va301fjh.js";
10
+ import {
11
+ Configuration as Configuration2,
12
+ SearchApi,
13
+ deploymentsAutoInstall,
12
14
  searchPackageVersions
13
- } from "./packager-tool-arbagkf2.js";
15
+ } from "./packager-tool-550smwcc.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