@uipath/solution-tool 1.202.0-preview.137 → 1.202.0-preview.139

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 (27) hide show
  1. package/dist/deploy.js +5 -5
  2. package/dist/index.js +13 -13
  3. package/dist/init.js +5 -5
  4. package/dist/{list-484rd8hx.js → list-ag3027x1.js} +3 -3
  5. package/dist/pack.js +6 -6
  6. package/dist/{packager-tool-kjjkk63a.js → packager-tool-12pcyrmh.js} +91 -24
  7. package/dist/{packager-tool-sba5cptt.js → packager-tool-1x1cc4qh.js} +8 -2
  8. package/dist/{packager-tool-fjr8yn4g.js → packager-tool-29bj4s4t.js} +1 -1
  9. package/dist/{packager-tool-6d4e44g7.js → packager-tool-5e69wxe2.js} +104 -31
  10. package/dist/{packager-tool-vxthsps3.js → packager-tool-6bhx9vfz.js} +1 -1
  11. package/dist/{packager-tool-xfg2cveb.js → packager-tool-8t3sjyk9.js} +1 -1
  12. package/dist/{packager-tool-3hbsdwjm.js → packager-tool-9dx65z2d.js} +3 -4
  13. package/dist/{packager-tool-zz9cxrqw.js → packager-tool-9ez6mf86.js} +4 -4
  14. package/dist/{packager-tool-8cw7djz6.js → packager-tool-ar7ae24x.js} +4 -4
  15. package/dist/{packager-tool-m7vg7dwj.js → packager-tool-n3ch3v36.js} +3 -3
  16. package/dist/{packager-tool-x3ehbhsn.js → packager-tool-nzghfa48.js} +2 -3
  17. package/dist/{packager-tool-n41f88jn.js → packager-tool-pc4hb3pv.js} +89 -7
  18. package/dist/{packager-tool-56b5tnnr.js → packager-tool-qpfkpph4.js} +108 -7
  19. package/dist/packager-tool.js +2 -2
  20. package/dist/publish.js +5 -5
  21. package/dist/resource.js +4 -4
  22. package/dist/services/governance-options.d.ts +4 -2
  23. package/dist/services/pack-command-service.d.ts +15 -0
  24. package/dist/services/packager-tool-resolver.d.ts +17 -0
  25. package/dist/templates/AGENTS.md +7 -1
  26. package/dist/tool.js +13 -13
  27. package/package.json +2 -2
package/dist/deploy.js CHANGED
@@ -5,11 +5,11 @@ import {
5
5
  listPackagesAsync,
6
6
  uninstallDeploymentAsync,
7
7
  upgradeDeploymentAsync
8
- } from "./packager-tool-8cw7djz6.js";
9
- import"./packager-tool-m7vg7dwj.js";
10
- import"./packager-tool-56b5tnnr.js";
11
- import"./packager-tool-fjr8yn4g.js";
12
- import"./packager-tool-sba5cptt.js";
8
+ } from "./packager-tool-ar7ae24x.js";
9
+ import"./packager-tool-n3ch3v36.js";
10
+ import"./packager-tool-qpfkpph4.js";
11
+ import"./packager-tool-29bj4s4t.js";
12
+ import"./packager-tool-1x1cc4qh.js";
13
13
  import"./packager-tool-dfrk01gn.js";
14
14
  import"./packager-tool-1de529jm.js";
15
15
  export {
package/dist/index.js CHANGED
@@ -2,21 +2,21 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./packager-tool-kjjkk63a.js";
6
- import"./packager-tool-vxthsps3.js";
7
- import"./packager-tool-8cw7djz6.js";
8
- import"./packager-tool-xfg2cveb.js";
9
- import"./packager-tool-6d4e44g7.js";
10
- import"./packager-tool-3hbsdwjm.js";
11
- import"./packager-tool-zz9cxrqw.js";
12
- import"./packager-tool-m7vg7dwj.js";
13
- import"./packager-tool-56b5tnnr.js";
14
- import"./packager-tool-n41f88jn.js";
15
- import"./packager-tool-x3ehbhsn.js";
16
- import"./packager-tool-fjr8yn4g.js";
5
+ } from "./packager-tool-12pcyrmh.js";
6
+ import"./packager-tool-6bhx9vfz.js";
7
+ import"./packager-tool-ar7ae24x.js";
8
+ import"./packager-tool-8t3sjyk9.js";
9
+ import"./packager-tool-5e69wxe2.js";
10
+ import"./packager-tool-9dx65z2d.js";
11
+ import"./packager-tool-9ez6mf86.js";
12
+ import"./packager-tool-n3ch3v36.js";
13
+ import"./packager-tool-qpfkpph4.js";
14
+ import"./packager-tool-pc4hb3pv.js";
15
+ import"./packager-tool-nzghfa48.js";
16
+ import"./packager-tool-29bj4s4t.js";
17
17
  import {
18
18
  Command
19
- } from "./packager-tool-sba5cptt.js";
19
+ } from "./packager-tool-1x1cc4qh.js";
20
20
  import"./packager-tool-dfrk01gn.js";
21
21
  import"./packager-tool-1de529jm.js";
22
22
 
package/dist/init.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  SolutionInitError,
3
3
  solutionInitAsync
4
- } from "./packager-tool-xfg2cveb.js";
4
+ } from "./packager-tool-8t3sjyk9.js";
5
5
  import {
6
6
  addProjectArtifactsToSolutionAsync
7
- } from "./packager-tool-n41f88jn.js";
8
- import"./packager-tool-x3ehbhsn.js";
9
- import"./packager-tool-fjr8yn4g.js";
10
- import"./packager-tool-sba5cptt.js";
7
+ } from "./packager-tool-pc4hb3pv.js";
8
+ import"./packager-tool-nzghfa48.js";
9
+ import"./packager-tool-29bj4s4t.js";
10
+ import"./packager-tool-1x1cc4qh.js";
11
11
  import"./packager-tool-dfrk01gn.js";
12
12
  import"./packager-tool-1de529jm.js";
13
13
  export {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getStudioWebAuth,
3
3
  useStudioWebAuth
4
- } from "./packager-tool-vxthsps3.js";
4
+ } from "./packager-tool-6bhx9vfz.js";
5
5
  import {
6
6
  getStudioWebSolutionProjects,
7
7
  listStudioWebSolutions
8
- } from "./packager-tool-56b5tnnr.js";
8
+ } from "./packager-tool-qpfkpph4.js";
9
9
  import {
10
10
  DEFAULT_PAGE_SIZE,
11
11
  OutputFormatter,
@@ -16,7 +16,7 @@ import {
16
16
  parseBoundedInt,
17
17
  parseOffset,
18
18
  processContext
19
- } from "./packager-tool-sba5cptt.js";
19
+ } from "./packager-tool-1x1cc4qh.js";
20
20
  import"./packager-tool-dfrk01gn.js";
21
21
  import"./packager-tool-1de529jm.js";
22
22
 
package/dist/pack.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  packSolutionAsync
3
- } from "./packager-tool-6d4e44g7.js";
4
- import"./packager-tool-3hbsdwjm.js";
5
- import"./packager-tool-n41f88jn.js";
6
- import"./packager-tool-x3ehbhsn.js";
7
- import"./packager-tool-fjr8yn4g.js";
8
- import"./packager-tool-sba5cptt.js";
3
+ } from "./packager-tool-5e69wxe2.js";
4
+ import"./packager-tool-9dx65z2d.js";
5
+ import"./packager-tool-pc4hb3pv.js";
6
+ import"./packager-tool-nzghfa48.js";
7
+ import"./packager-tool-29bj4s4t.js";
8
+ import"./packager-tool-1x1cc4qh.js";
9
9
  import"./packager-tool-dfrk01gn.js";
10
10
  import"./packager-tool-1de529jm.js";
11
11
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getStudioWebAuthWithOrganizationId,
3
3
  useStudioWebAuth
4
- } from "./packager-tool-vxthsps3.js";
4
+ } from "./packager-tool-6bhx9vfz.js";
5
5
  import {
6
6
  activateDeploymentAsync,
7
7
  deployRunAsync,
@@ -11,11 +11,11 @@ import {
11
11
  listPackagesAsync,
12
12
  uninstallDeploymentAsync,
13
13
  upgradeDeploymentAsync
14
- } from "./packager-tool-8cw7djz6.js";
14
+ } from "./packager-tool-ar7ae24x.js";
15
15
  import {
16
16
  SolutionInitError,
17
17
  solutionInitAsync
18
- } from "./packager-tool-xfg2cveb.js";
18
+ } from "./packager-tool-8t3sjyk9.js";
19
19
  import {
20
20
  GOVERNANCE_OPTION_INSTRUCTIONS,
21
21
  PackCommandService,
@@ -25,14 +25,15 @@ import {
25
25
  checkSolutionPathAsync,
26
26
  createSolutionPackager,
27
27
  ensurePackagerTools,
28
+ isUnpackableProjectTypeError,
28
29
  packSolutionAsync,
29
30
  readSolutionFileAsUint8Array,
30
31
  resolveSdkLogLevel,
31
32
  validateGovernanceOptions
32
- } from "./packager-tool-6d4e44g7.js";
33
+ } from "./packager-tool-5e69wxe2.js";
33
34
  import {
34
35
  publishSolutionAsync
35
- } from "./packager-tool-zz9cxrqw.js";
36
+ } from "./packager-tool-9ez6mf86.js";
36
37
  import {
37
38
  Configuration,
38
39
  PipelinesApi,
@@ -40,7 +41,7 @@ import {
40
41
  feedScopeInitOverride,
41
42
  listSelectablePublishLocations,
42
43
  resolveFeedScope
43
- } from "./packager-tool-m7vg7dwj.js";
44
+ } from "./packager-tool-n3ch3v36.js";
44
45
  import {
45
46
  Configuration as Configuration2,
46
47
  DeploymentActivationStatus,
@@ -48,15 +49,17 @@ import {
48
49
  PackagesApi,
49
50
  SearchApi,
50
51
  StudioWebIncompatibleProjectError,
52
+ buildSolutionUploadFailureOutput,
51
53
  bundleSolution,
52
54
  getProjectDebugStatus,
53
55
  importSolution,
54
56
  isDebugProvisioningSucceeded,
55
57
  isDebugProvisioningTerminal,
58
+ isSolutionUploadHttpError,
56
59
  overwriteSolution,
57
60
  searchPackageVersions,
58
61
  solutionExistsOnStudioWeb
59
- } from "./packager-tool-56b5tnnr.js";
62
+ } from "./packager-tool-qpfkpph4.js";
60
63
  import {
61
64
  Tokens,
62
65
  applyEntryPointEnhancementAsync,
@@ -68,6 +71,8 @@ import {
68
71
  findMatchingLocalResource,
69
72
  findProjectFile,
70
73
  findResourceByKeyInRcs,
74
+ isMissingProjectTypeError,
75
+ isProjectManifestError,
71
76
  normalizeFolderPath,
72
77
  readProjectFile,
73
78
  readSolutionFile,
@@ -78,13 +83,13 @@ import {
78
83
  syncAndLog,
79
84
  syncResourcesFromBindings,
80
85
  writeSolutionFile
81
- } from "./packager-tool-n41f88jn.js";
86
+ } from "./packager-tool-pc4hb3pv.js";
82
87
  import {
83
88
  ToolResult
84
- } from "./packager-tool-x3ehbhsn.js";
89
+ } from "./packager-tool-nzghfa48.js";
85
90
  import {
86
91
  getSolutionAuthContext
87
- } from "./packager-tool-fjr8yn4g.js";
92
+ } from "./packager-tool-29bj4s4t.js";
88
93
  import {
89
94
  DEFAULT_PAGE_SIZE,
90
95
  Option,
@@ -117,7 +122,7 @@ import {
117
122
  unsupportedSolutionProjectType,
118
123
  updateUipxSolutionId,
119
124
  withCompleter
120
- } from "./packager-tool-sba5cptt.js";
125
+ } from "./packager-tool-1x1cc4qh.js";
121
126
  import {
122
127
  strFromU8,
123
128
  unzip,
@@ -130,7 +135,7 @@ import {
130
135
  var package_default = {
131
136
  name: "@uipath/solution-tool",
132
137
  license: "MIT",
133
- version: "1.202.0-preview.137",
138
+ version: "1.202.0-preview.139",
134
139
  description: "Create, pack, publish, and deploy UiPath Automation Solutions.",
135
140
  repository: {
136
141
  type: "git",
@@ -2479,6 +2484,12 @@ function rejectUnsupportedProjectType(projectType, failureMessage) {
2479
2484
  processContext.exit(1);
2480
2485
  return true;
2481
2486
  }
2487
+ function projectManifestInstructions(fileName, readProjectError, verb) {
2488
+ if (fileName !== "uipath.json" || !isMissingProjectTypeError(readProjectError)) {
2489
+ return readProjectError.message;
2490
+ }
2491
+ return `${readProjectError.message} If this is a coded app, scaffold it with 'uip codedapp init <project-path>' — that writes the project.uiproj this command registers — then run 'uip solution projects ${verb} <project-path>' again.`;
2492
+ }
2482
2493
 
2483
2494
  // src/commands/project-add.ts
2484
2495
  var PROJECT_ADD_EXAMPLES = [
@@ -2563,7 +2574,8 @@ var registerProjectAddCommand = (project) => {
2563
2574
  OutputFormatter.error({
2564
2575
  Result: RESULTS.Failure,
2565
2576
  Message: "Failed to add project to solution",
2566
- Instructions: readProjectError.message
2577
+ ...isProjectManifestError(readProjectError) ? { ErrorCode: "invalid_argument" } : {},
2578
+ Instructions: projectManifestInstructions(projectFileInfo.fileName, readProjectError, "add")
2567
2579
  });
2568
2580
  processContext.exit(1);
2569
2581
  return;
@@ -2709,7 +2721,8 @@ var registerProjectImportCommand = (project) => {
2709
2721
  OutputFormatter.error({
2710
2722
  Result: RESULTS.Failure,
2711
2723
  Message: "Failed to import project into solution",
2712
- Instructions: readProjectError.message
2724
+ ...isProjectManifestError(readProjectError) ? { ErrorCode: "invalid_argument" } : {},
2725
+ Instructions: projectManifestInstructions(projectFileInfo.fileName, readProjectError, "import")
2713
2726
  });
2714
2727
  processContext.exit(1);
2715
2728
  return;
@@ -5053,10 +5066,11 @@ Restoring solution dependencies...
5053
5066
  const msg = error instanceof Error ? error.message : String(error);
5054
5067
  OutputFormatter.error({
5055
5068
  Result: RESULTS.Failure,
5069
+ ...isUnpackableProjectTypeError(error) ? { ErrorCode: "invalid_argument" } : {},
5056
5070
  Message: msg,
5057
5071
  Instructions: carriedInstructions(error) ?? "Check that you are logged in (`uip auth login`) and that the solution path is accessible, then rerun: uip solution restore <solutionPath>"
5058
5072
  });
5059
- if (error instanceof Error && error.stack) {
5073
+ if (error instanceof Error && error.stack && !isUnpackableProjectTypeError(error)) {
5060
5074
  logger.error("Stack trace:");
5061
5075
  logger.error(error.stack);
5062
5076
  }
@@ -5935,12 +5949,7 @@ var registerUploadCommand = (program) => {
5935
5949
  } else if (solutionId) {
5936
5950
  const [probeError, exists] = await catchError(solutionExistsOnStudioWeb(studioWebConfig, organizationName, solutionId));
5937
5951
  if (probeError) {
5938
- const errorMessage = await extractErrorMessage(probeError);
5939
- OutputFormatter.error({
5940
- Result: RESULTS.Failure,
5941
- Message: `Failed to check whether solution ${solutionId} exists on Studio Web: ${errorMessage}`,
5942
- Instructions: "Verify your login (uip login) and tenant access, then retry. If the problem persists, contact your UiPath administrator."
5943
- });
5952
+ OutputFormatter.error(await buildProbeFailureOutput(probeError, solutionId, loginStatus.identity));
5944
5953
  processContext.exit(1);
5945
5954
  return;
5946
5955
  }
@@ -5961,6 +5970,16 @@ var registerUploadCommand = (program) => {
5961
5970
  processContext.exit(1);
5962
5971
  return;
5963
5972
  }
5973
+ if (isSolutionUploadHttpError(uploadError)) {
5974
+ OutputFormatter.error(buildSolutionUploadFailureOutput(uploadError, {
5975
+ subject: "solution",
5976
+ importCheckHint: "Run 'uip solution pack' to confirm the solution packs cleanly.",
5977
+ identityType: loginStatus.identity?.type,
5978
+ clientId: loginStatus.identity?.clientId
5979
+ }));
5980
+ processContext.exit(1);
5981
+ return;
5982
+ }
5964
5983
  const errorMessage = await extractErrorMessage(uploadError);
5965
5984
  OutputFormatter.error({
5966
5985
  Result: RESULTS.Failure,
@@ -6021,8 +6040,56 @@ async function updateLocalSolutionId(fs, result, solutionId, uipxPath) {
6021
6040
  }
6022
6041
  return { returnedSolutionId, rewroteLocalSolutionId };
6023
6042
  }
6043
+ function httpStatusOf(error) {
6044
+ if (error instanceof Error && "status" in error) {
6045
+ const status = error.status;
6046
+ if (typeof status === "number")
6047
+ return status;
6048
+ }
6049
+ return;
6050
+ }
6051
+ function probeAuthChallengeOf(error) {
6052
+ if (error instanceof Error && "authChallenge" in error) {
6053
+ const challenge = error.authChallenge;
6054
+ if (challenge && typeof challenge === "object") {
6055
+ return challenge;
6056
+ }
6057
+ }
6058
+ return {};
6059
+ }
6024
6060
  function isSolutionNotFoundError(error) {
6025
- return error instanceof Error && "status" in error && error.status === 404;
6061
+ return httpStatusOf(error) === 404;
6062
+ }
6063
+ async function buildProbeFailureOutput(probeError, solutionId, identity) {
6064
+ const status = httpStatusOf(probeError);
6065
+ const isAuthRefusal = status === 401 || status === 403;
6066
+ const challenge = probeAuthChallengeOf(probeError);
6067
+ const message = isAuthRefusal ? probeError.message : await extractErrorMessage(probeError);
6068
+ const output = {
6069
+ Result: RESULTS.Failure,
6070
+ Message: `Failed to check whether solution ${solutionId} exists on Studio Web: ${message}`,
6071
+ Instructions: isAuthRefusal ? probeAuthInstructions(solutionId, identity, challenge) : "Verify your login (uip login) and tenant access, then retry. If the problem persists, contact your UiPath administrator."
6072
+ };
6073
+ if (status !== undefined) {
6074
+ output.Context = {
6075
+ httpStatus: status,
6076
+ stage: "probe-solution",
6077
+ method: "GET"
6078
+ };
6079
+ }
6080
+ if (status === 401 && identity?.type === "Application" && challenge.error !== "invalid_token") {
6081
+ output.ErrorCode = "permission_denied";
6082
+ }
6083
+ return output;
6084
+ }
6085
+ function probeAuthInstructions(solutionId, identity, challenge) {
6086
+ const quoted = challenge.description ? ` ("${challenge.description}")` : "";
6087
+ if (challenge.error === "invalid_token") {
6088
+ return `Studio Web rejected the credential itself with the reason ` + `\`invalid_token\`${quoted} while checking whether solution ` + `${solutionId} exists. That is the platform refusing this token ` + `rather than the grants behind it, so unlike a grants refusal this ` + `one is worth a fresh 'uip login' — or, in a pipeline, a newly ` + `minted client-credentials token. Check too that the token was ` + `issued for the organization and tenant being called. Nothing was ` + `uploaded.`;
6089
+ }
6090
+ const actor = identity?.type === "Application" ? `This session acts as external application ${identity.clientId ?? "(client id unknown)"}: it needs a Studio Web grant that can read a solution.` : identity?.type === "User" ? "This session acts as a user: check that your account has Studio Web access in this tenant." : "Check that this session may read a solution in Studio Web — an external application needs a StudioWebS2S grant, a user needs Studio Web access in the tenant.";
6091
+ const reported = challenge.error === "insufficient_scope" ? `Studio Web reported \`insufficient_scope\`${quoted}, so the token is good and its grants are not. ` : "";
6092
+ return `Studio Web refused the read, and the session is authenticated, so ` + `re-running 'uip login' mints the same token and fails the same way. ` + `${reported}${actor} Also confirm solution ${solutionId} lives in the organization ` + `and tenant this session logged into. Nothing was uploaded.`;
6026
6093
  }
6027
6094
  function outputError(message) {
6028
6095
  OutputFormatter.error({
@@ -6055,7 +6122,7 @@ var registerCommands = async (program) => {
6055
6122
  registerResourceCommand(program);
6056
6123
  registerDeleteCommand(program);
6057
6124
  if (isPreviewBuild()) {
6058
- const { registerListCommand } = await import("./list-484rd8hx.js");
6125
+ const { registerListCommand } = await import("./list-ag3027x1.js");
6059
6126
  registerListCommand(program);
6060
6127
  }
6061
6128
  registerFeedsCommand(program);
@@ -6063,4 +6130,4 @@ var registerCommands = async (program) => {
6063
6130
 
6064
6131
  export { metadata, registerCommands };
6065
6132
 
6066
- //# debugId=53AC8396C5EA789164756E2164756E21
6133
+ //# debugId=DEF91C7BFB8FCA0A64756E2164756E21
@@ -5436,6 +5436,12 @@ async function extractErrorMessage(error, options) {
5436
5436
  const { message } = await extractErrorDetails(error, options);
5437
5437
  return message;
5438
5438
  }
5439
+ // ../common/src/classified-failure.ts
5440
+ var MAX_QUOTED_BODY_CHARS = 200;
5441
+ function summarizePlatformBody(body) {
5442
+ const trimmed = body.trim().replace(/\s+/g, " ");
5443
+ return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
5444
+ }
5439
5445
  // ../common/src/command-examples.ts
5440
5446
  var examplesByCommand = new WeakMap;
5441
5447
  Command.prototype.examples = function(examples) {
@@ -7817,6 +7823,6 @@ async function findSolutionFileUpward(fs2, startDir) {
7817
7823
  }
7818
7824
  }
7819
7825
 
7820
- export { getFileSystem, catchError, carriedInstructions, extractErrorDetails, extractErrorMessage, logger, telemetry, RESULTS, Pagination, OutputFormatter, Command, Option, isPreviewBuild, processContext, withCompleter, requireConfirmation, DEFAULT_PAGE_SIZE, resolveEnvReference, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, registerPackageMetadataOptions, mapPackageMetadataOptions, PollOutcome, mapPollFailure, pollUntil, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, unsupportedSolutionProjectType, trackShipSucceeded, ensurePackagerFactory, getLoginStatusAsync, getAuthContext, normalizeProjectType, toPortableRelativePath, readUipxFile, resolveSolutionDir, updateUipxSolutionId, findSolutionFileUpward };
7826
+ export { getFileSystem, catchError, carriedInstructions, extractErrorDetails, extractErrorMessage, logger, telemetry, RESULTS, Pagination, OutputFormatter, summarizePlatformBody, Command, Option, isPreviewBuild, processContext, withCompleter, requireConfirmation, DEFAULT_PAGE_SIZE, resolveEnvReference, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, registerPackageMetadataOptions, mapPackageMetadataOptions, PollOutcome, mapPollFailure, pollUntil, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, unsupportedSolutionProjectType, trackShipSucceeded, ensurePackagerFactory, getLoginStatusAsync, getAuthContext, normalizeProjectType, toPortableRelativePath, readUipxFile, resolveSolutionDir, updateUipxSolutionId, findSolutionFileUpward };
7821
7827
 
7822
- //# debugId=62C28FF18B08C6A164756E2164756E21
7828
+ //# debugId=A770E41AF763C8F264756E2164756E21
@@ -3,7 +3,7 @@ import {
3
3
  getAuthContext,
4
4
  getSdkUserAgentToken,
5
5
  installSdkUserAgentHeader
6
- } from "./packager-tool-sba5cptt.js";
6
+ } from "./packager-tool-1x1cc4qh.js";
7
7
 
8
8
  // ../solution-sdk/src/solution-auth.ts
9
9
  async function getSolutionAuthContext(options) {
@@ -12,7 +12,7 @@ import {
12
12
  registerPackagerFactories,
13
13
  toolsFactoryRepository,
14
14
  translate
15
- } from "./packager-tool-3hbsdwjm.js";
15
+ } from "./packager-tool-9dx65z2d.js";
16
16
  import {
17
17
  Tokens,
18
18
  createResourceBuilderServices,
@@ -23,11 +23,11 @@ import {
23
23
  models_BindingsResourceType,
24
24
  readUipxProjects,
25
25
  syncAndLog
26
- } from "./packager-tool-n41f88jn.js";
26
+ } from "./packager-tool-pc4hb3pv.js";
27
27
  import {
28
28
  ToolResult as ToolResult2,
29
29
  toolsFactoryRepository as toolsFactoryRepository2
30
- } from "./packager-tool-x3ehbhsn.js";
30
+ } from "./packager-tool-nzghfa48.js";
31
31
  import {
32
32
  OutputFormatter,
33
33
  RESULTS,
@@ -39,7 +39,7 @@ import {
39
39
  logger,
40
40
  telemetry,
41
41
  unsupportedSolutionProjectType
42
- } from "./packager-tool-sba5cptt.js";
42
+ } from "./packager-tool-1x1cc4qh.js";
43
43
 
44
44
  // ../filesystem/dist/index.js
45
45
  import fs from "node:fs";
@@ -24191,7 +24191,7 @@ var sdkUserAgentHostToken2 = singleton2("SdkUserAgentHostToken");
24191
24191
  var package_default = {
24192
24192
  name: "@uipath/project-packager",
24193
24193
  license: "MIT",
24194
- version: "1.202.0-preview.137",
24194
+ version: "1.202.0-preview.139",
24195
24195
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
24196
24196
  type: "module",
24197
24197
  main: "./dist/index.js",
@@ -37334,7 +37334,7 @@ var sdkUserAgentHostToken22 = singleton22("SdkUserAgentHostToken");
37334
37334
  var package_default2 = {
37335
37335
  name: "@uipath/project-packager",
37336
37336
  license: "MIT",
37337
- version: "1.202.0-preview.137",
37337
+ version: "1.202.0-preview.139",
37338
37338
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
37339
37339
  type: "module",
37340
37340
  main: "./dist/index.js",
@@ -38883,6 +38883,25 @@ var PROJECT_TYPE_TO_TOOL = new Map([
38883
38883
  ["BusinessRules", "maestro"],
38884
38884
  ["Entity", "df"]
38885
38885
  ]);
38886
+ var PACKAGER_OWNED_TYPES = ["Connector"];
38887
+
38888
+ class UnpackableProjectTypeError extends Error {
38889
+ __unpackableType = true;
38890
+ instructions;
38891
+ constructor(projectType, projectPath) {
38892
+ super(`Project '${projectPath}' declares type '${projectType}', which this CLI cannot pack.`);
38893
+ this.name = "UnpackableProjectTypeError";
38894
+ this.instructions = buildUnpackableInstructions(projectType);
38895
+ }
38896
+ }
38897
+ function isUnpackableProjectTypeError(error) {
38898
+ return !!error && typeof error === "object" && error.__unpackableType === true;
38899
+ }
38900
+ function buildUnpackableInstructions(projectType) {
38901
+ const allowed = `Types a solution can contain: ${packableProjectTypes().join(", ")}.`;
38902
+ const codedAppHint = projectType.toLowerCase() === "app" ? " A coded app packs as 'AppV2': scaffold it with 'uip codedapp init <project-path>', which writes project.uiproj and webAppManifest.json and puts the app files under <project-path>/source." : "";
38903
+ return `${allowed}${codedAppHint} Correct the project's Type in the .uipx, or drop the entry with 'uip solution projects remove <project-path>'.`;
38904
+ }
38886
38905
  var TOOL_TO_PACKAGE = new Map([
38887
38906
  ["rpa", "@uipath/rpa-tool"],
38888
38907
  ["codedapp", "@uipath/codedapp-tool"],
@@ -38892,7 +38911,7 @@ var TOOL_TO_PACKAGE = new Map([
38892
38911
  ["function", "@uipath/function-tool"],
38893
38912
  ["df", "@uipath/data-fabric-tool"]
38894
38913
  ]);
38895
- async function readProjectTypes(solutionDir, fs8) {
38914
+ async function readSolutionProjects(solutionDir, fs8) {
38896
38915
  const entries = await fs8.readdir(solutionDir);
38897
38916
  const uipxFile = entries.find((f) => f.endsWith(".uipx"));
38898
38917
  if (!uipxFile)
@@ -38905,27 +38924,42 @@ async function readProjectTypes(solutionDir, fs8) {
38905
38924
  if (parseError) {
38906
38925
  throw new Error(`Failed to parse ${uipxFile}: ${parseError.message}`);
38907
38926
  }
38908
- return (solution.Projects || []).map((p) => p.Type);
38927
+ return (solution.Projects || []).map((p) => ({
38928
+ type: typeof p.Type === "string" ? p.Type : "",
38929
+ path: typeof p.ProjectRelativePath === "string" ? p.ProjectRelativePath : "(no ProjectRelativePath)"
38930
+ }));
38931
+ }
38932
+ function packableProjectTypes() {
38933
+ const types3 = new Set(PROJECT_TYPE_TO_TOOL.keys());
38934
+ for (const type2 of PACKAGER_OWNED_TYPES) {
38935
+ types3.add(type2);
38936
+ }
38937
+ types3.delete("processOrchestration");
38938
+ return [...types3].sort((a, b) => a.localeCompare(b));
38909
38939
  }
38910
38940
  async function ensurePackagerTools(solutionDir, fs8) {
38911
38941
  registerPackagerFactories();
38912
- const projectTypes = await readProjectTypes(solutionDir, fs8);
38913
- if (projectTypes.length === 0)
38942
+ const projects = await readSolutionProjects(solutionDir, fs8);
38943
+ if (projects.length === 0)
38914
38944
  return;
38915
38945
  const neededTools = new Set;
38916
- for (const type2 of projectTypes) {
38946
+ for (const { type: type2, path: path4 } of projects) {
38917
38947
  const unsupported = unsupportedSolutionProjectType(type2);
38918
38948
  if (unsupported) {
38919
38949
  throw new Error(`Project type '${type2}' cannot be packed as part of a solution. ${unsupported} Or drop it with 'uip solution projects remove <project-path>'.`);
38920
38950
  }
38951
+ if (!type2) {
38952
+ logger.warn(`Solution project '${path4}' has no Type. Pack may fail.`);
38953
+ continue;
38954
+ }
38921
38955
  if (toolsFactoryRepository2.canHandleProject(type2))
38922
38956
  continue;
38923
38957
  const toolVerb = PROJECT_TYPE_TO_TOOL.get(type2);
38924
38958
  if (toolVerb) {
38925
38959
  neededTools.add(toolVerb);
38926
- } else {
38927
- logger.warn(`No installable tool packs project type '${type2}'. Pack may fail.`);
38960
+ continue;
38928
38961
  }
38962
+ throw new UnpackableProjectTypeError(type2, path4);
38929
38963
  }
38930
38964
  for (const toolVerb of neededTools) {
38931
38965
  logger.info(`Loading packager factory for '${toolVerb}' to handle project types...`);
@@ -39083,6 +39117,22 @@ class PackCommandService {
39083
39117
  constructor() {
39084
39118
  this.fs = getFileSystem();
39085
39119
  }
39120
+ reportPackThrow(error, dryRun) {
39121
+ const msg = error instanceof Error ? error.message : String(error);
39122
+ const unpackableType = isUnpackableProjectTypeError(error);
39123
+ const dryRunHint = "Inspect the reported error, fix the underlying issue in the solution, then rerun: uip solution pack <solution-path> --dry-run";
39124
+ OutputFormatter.error({
39125
+ Result: RESULTS.Failure,
39126
+ ...unpackableType ? { ErrorCode: "invalid_argument" } : {},
39127
+ Message: msg,
39128
+ Instructions: carriedInstructions(error) ?? (dryRun ? dryRunHint : msg)
39129
+ });
39130
+ if (unpackableType || !(error instanceof Error) || !error.stack) {
39131
+ return;
39132
+ }
39133
+ logger.error("Stack trace:");
39134
+ logger.error(error.stack);
39135
+ }
39086
39136
  async execute(solutionPath, options, context) {
39087
39137
  const check = await checkSolutionPathAsync(this.fs, solutionPath);
39088
39138
  if (!check.ok) {
@@ -39162,16 +39212,7 @@ Packing solution...
39162
39212
  output: resolvedOutput
39163
39213
  }));
39164
39214
  if (error) {
39165
- const msg = error instanceof Error ? error.message : String(error);
39166
- OutputFormatter.error({
39167
- Result: RESULTS.Failure,
39168
- Message: msg,
39169
- Instructions: options.dryRun ? "Inspect the reported error, fix the underlying issue in the solution, then rerun: uip solution pack <solution-path> --dry-run" : msg
39170
- });
39171
- if (error instanceof Error && error.stack) {
39172
- logger.error("Stack trace:");
39173
- logger.error(error.stack);
39174
- }
39215
+ this.reportPackThrow(error, options.dryRun === true);
39175
39216
  context.exit(1);
39176
39217
  return;
39177
39218
  }
@@ -39214,19 +39255,35 @@ Packing solution...
39214
39255
  }
39215
39256
  }
39216
39257
  }
39217
- async executeAsync(solutionPath, options) {
39258
+ async checkPackInputs(solutionPath, options) {
39218
39259
  if (options.output === undefined) {
39219
- return new ToolResult2("INTERNAL_ERROR" /* InternalError */, "Output path is required when invoking executeAsync directly.", []);
39260
+ return {
39261
+ failure: new ToolResult2("INTERNAL_ERROR" /* InternalError */, "Output path is required when invoking executeAsync directly.", [])
39262
+ };
39220
39263
  }
39221
39264
  const governanceError = validateGovernanceOptions(options);
39222
39265
  if (governanceError) {
39223
- return new ToolResult2("INTERNAL_ERROR" /* InternalError */, governanceError, []);
39266
+ return {
39267
+ failure: new ToolResult2("INTERNAL_ERROR" /* InternalError */, governanceError, [])
39268
+ };
39224
39269
  }
39225
- const absoluteOutputPath = this.fs.path.resolve(options.output);
39226
39270
  const check = await checkSolutionPathAsync(this.fs, solutionPath);
39227
39271
  if (!check.ok) {
39228
- return new ToolResult2("INTERNAL_ERROR" /* InternalError */, check.message, []);
39272
+ return {
39273
+ failure: new ToolResult2("INTERNAL_ERROR" /* InternalError */, check.message, [])
39274
+ };
39229
39275
  }
39276
+ return {
39277
+ absoluteOutputPath: this.fs.path.resolve(options.output),
39278
+ check
39279
+ };
39280
+ }
39281
+ async executeAsync(solutionPath, options) {
39282
+ const inputs = await this.checkPackInputs(solutionPath, options);
39283
+ if (inputs.failure) {
39284
+ return inputs.failure;
39285
+ }
39286
+ const { absoluteOutputPath, check } = inputs;
39230
39287
  const { absoluteSolutionPath, isUisFile, stats } = check;
39231
39288
  const isDirectory = stats.isDirectory();
39232
39289
  const packageName = options.name || (isUisFile ? this.fs.path.basename(solutionPath, ".uis") : this.fs.path.basename(solutionPath));
@@ -39261,6 +39318,9 @@ Packing solution...
39261
39318
  return packager.packSolutionAsync(packOptions);
39262
39319
  });
39263
39320
  if (error) {
39321
+ if (isUnpackableProjectTypeError(error)) {
39322
+ throw error;
39323
+ }
39264
39324
  const message = error instanceof Error ? error.message : String(error);
39265
39325
  const instructions = carriedInstructions(error);
39266
39326
  return new ToolResult2("INTERNAL_ERROR" /* InternalError */, instructions ? `${message} ${instructions}` : message, []);
@@ -39406,7 +39466,20 @@ function formatPackFailureInstructions(message, dryRun) {
39406
39466
  // src/services/pack-service.ts
39407
39467
  async function packSolutionAsync(solutionPath, options) {
39408
39468
  const service = new PackCommandService;
39409
- const result = await service.executeAsync(solutionPath, options);
39469
+ const [error, result] = await catchError(service.executeAsync(solutionPath, options));
39470
+ if (error) {
39471
+ if (!isUnpackableProjectTypeError(error)) {
39472
+ throw error;
39473
+ }
39474
+ const message = error instanceof Error ? error.message : String(error);
39475
+ const instructions = carriedInstructions(error);
39476
+ return {
39477
+ ok: false,
39478
+ errorCode: "INTERNAL_ERROR" /* InternalError */,
39479
+ message: instructions ? `${message} ${instructions}` : message,
39480
+ packages: []
39481
+ };
39482
+ }
39410
39483
  return {
39411
39484
  ok: result.errorCode === "SUCCESS" /* Success */,
39412
39485
  errorCode: result.errorCode,
@@ -39415,6 +39488,6 @@ async function packSolutionAsync(solutionPath, options) {
39415
39488
  };
39416
39489
  }
39417
39490
 
39418
- export { SolutionPackOptions, ensurePackagerTools, createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, SOLUTION_PATH_INSTRUCTIONS, checkSolutionPathAsync, GOVERNANCE_OPTION_INSTRUCTIONS, validateGovernanceOptions, PackCommandService, packSolutionAsync };
39491
+ export { SolutionPackOptions, isUnpackableProjectTypeError, ensurePackagerTools, createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, SOLUTION_PATH_INSTRUCTIONS, checkSolutionPathAsync, GOVERNANCE_OPTION_INSTRUCTIONS, validateGovernanceOptions, PackCommandService, packSolutionAsync };
39419
39492
 
39420
- //# debugId=57C636C235AB2E9564756E2164756E21
39493
+ //# debugId=B812A63A80B57B6F64756E2164756E21
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  catchError,
3
3
  getAuthContext
4
- } from "./packager-tool-sba5cptt.js";
4
+ } from "./packager-tool-1x1cc4qh.js";
5
5
 
6
6
  // src/services/studio-web-auth-middleware.ts
7
7
  var studioWebAuthByCommand = new WeakMap;