@uipath/solution-tool 1.207.0-preview.305 → 1.207.0-preview.307

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 (67) hide show
  1. package/dist/THIRD-PARTY-NOTICES.md +4 -4
  2. package/dist/{cleanup-command-service-j9kawew9.js → cleanup-command-service-0j6qxj96.js} +7 -7
  3. package/dist/{deploy-delete-service-1erqap9a.js → deploy-delete-service-ghyetrvj.js} +8 -8
  4. package/dist/{deploy-run-service-jbs6dxye.js → deploy-run-service-sz77fpsz.js} +9 -9
  5. package/dist/{deploy-status-service-4zn90vds.js → deploy-status-service-aj4m61hg.js} +7 -7
  6. package/dist/deploy.js +13 -13
  7. package/dist/{deployment-search-dwzahe4v.js → deployment-search-mkvzgeq4.js} +4 -4
  8. package/dist/{embedded-file-reader-pxpwcq3n.js → embedded-file-reader-k94wt612.js} +16 -16
  9. package/dist/{feed-resolver-d14rdjss.js → feed-resolver-yj94m9j1.js} +4 -4
  10. package/dist/{feed-scope-failure-w16mze3z.js → feed-scope-failure-7abh61sj.js} +5 -5
  11. package/dist/{feed-session-f2sby6t8.js → feed-session-z8t87r5w.js} +2 -2
  12. package/dist/{first-party-service-7cggb17y.js → first-party-service-bmtxd7wx.js} +1 -1
  13. package/dist/{folder-runtime-check-586c41dq.js → folder-runtime-check-8nf63er2.js} +6 -6
  14. package/dist/{governance-options-y2xsv7ff.js → governance-options-ft8bqz4p.js} +2 -2
  15. package/dist/{index-pzkzbqbs.js → index-j3tpb2cr.js} +1 -1
  16. package/dist/{index-795rsz0e.js → index-jy1760qy.js} +1 -1
  17. package/dist/{index-wfqzwh7k.js → index-nbs04tqr.js} +2 -2
  18. package/dist/index.js +13 -13
  19. package/dist/init.js +1 -1
  20. package/dist/{list-6pe1nab5.js → list-3a1tdrgm.js} +2 -2
  21. package/dist/{node-13wj5mzd.js → node-83xy0gm0.js} +2 -2
  22. package/dist/{pack-command-service-j9bqnsn1.js → pack-command-service-42p3t8xa.js} +11 -11
  23. package/dist/{pack-project-3sdddc42.js → pack-project-w514zr5v.js} +6 -6
  24. package/dist/pack.js +12 -12
  25. package/dist/{package-id-5j4q232a.js → package-id-2dgfbh5h.js} +1 -1
  26. package/dist/{packager-tool-dd937g7k.js → packager-tool-0gyqtxvs.js} +1 -1
  27. package/dist/{packager-tool-46x80z85.js → packager-tool-2syv199e.js} +3 -3
  28. package/dist/{packager-tool-rhg3mwkn.js → packager-tool-3qach0s4.js} +2 -2
  29. package/dist/{packager-tool-4hm40a32.js → packager-tool-4f1k64fh.js} +1 -1
  30. package/dist/{packager-tool-2atxqqgd.js → packager-tool-70ag56bf.js} +6 -6
  31. package/dist/{packager-tool-jtg2arr8.js → packager-tool-71sz9598.js} +1 -1
  32. package/dist/{packager-tool-ewbkaecg.js → packager-tool-7j920ac5.js} +2 -2
  33. package/dist/{packager-tool-612prgtc.js → packager-tool-7s842xrq.js} +3 -3
  34. package/dist/{packager-tool-pmc5txbm.js → packager-tool-849ch2tq.js} +1 -1
  35. package/dist/{packager-tool-tat0qs6z.js → packager-tool-a566400t.js} +2 -2
  36. package/dist/{packager-tool-7gqn5apd.js → packager-tool-a813na66.js} +5 -2
  37. package/dist/{packager-tool-qm876ezh.js → packager-tool-af8n6rqz.js} +3 -3
  38. package/dist/{packager-tool-da3hvfyn.js → packager-tool-bpdyy6vs.js} +65 -65
  39. package/dist/{packager-tool-jhtsana2.js → packager-tool-cwqy5rb5.js} +9 -9
  40. package/dist/{packager-tool-93qy1v8m.js → packager-tool-fbajevvm.js} +1 -1
  41. package/dist/{packager-tool-gmbcn83x.js → packager-tool-fz96p75n.js} +2 -2
  42. package/dist/{packager-tool-8tckw03n.js → packager-tool-gns0nxbt.js} +2 -2
  43. package/dist/{packager-tool-1tvhgac9.js → packager-tool-h8wam8pt.js} +2 -2
  44. package/dist/{packager-tool-tqe3m1xp.js → packager-tool-hczpvrc1.js} +1 -1
  45. package/dist/{packager-tool-yfcscjfp.js → packager-tool-ncgpx1ce.js} +1 -1
  46. package/dist/{packager-tool-5p1vy335.js → packager-tool-p1xfsv6c.js} +91 -3
  47. package/dist/{packager-tool-tf0rn1tp.js → packager-tool-r7fmsz2t.js} +7 -7
  48. package/dist/{packager-tool-resolver-y52kztnx.js → packager-tool-resolver-mynfj0rt.js} +2 -2
  49. package/dist/{packager-tool-ykq6gmhc.js → packager-tool-s9tyw75r.js} +3 -3
  50. package/dist/{packager-tool-cr1khqtm.js → packager-tool-tt9v40x6.js} +2946 -719
  51. package/dist/{packager-tool-kffz64hn.js → packager-tool-w0tmr9xe.js} +4 -4
  52. package/dist/{packager-tool-g08b669a.js → packager-tool-zsv8208n.js} +5 -5
  53. package/dist/{packager-tool-tmba5jv0.js → packager-tool-ztxsccjk.js} +4 -4
  54. package/dist/packager-tool.js +1 -1
  55. package/dist/{prepare-solution-resources-sk3tyy8b.js → prepare-solution-resources-g9y01pgd.js} +5 -5
  56. package/dist/{project-command-utils-7ygs8xq0.js → project-command-utils-yxrgwzf9.js} +1 -1
  57. package/dist/{project-contributions-nzh06q0y.js → project-contributions-c8v3bwjr.js} +4 -4
  58. package/dist/{project-identity-telemetry-47k2g7nq.js → project-identity-telemetry-yxdhswyq.js} +2 -2
  59. package/dist/publish.js +5 -5
  60. package/dist/{resource-mutations-qcz2vcxe.js → resource-mutations-dn4f8xr1.js} +1 -1
  61. package/dist/{resource-version-lookup-w3kzh4z9.js → resource-version-lookup-mksxc1dc.js} +1 -1
  62. package/dist/resource.js +1 -1
  63. package/dist/{restore-command-service-m6c8fb7q.js → restore-command-service-ztbt2ejp.js} +7 -7
  64. package/dist/{run-service-cmrzccnm.js → run-service-r52wgf69.js} +21 -20
  65. package/dist/{solution-definition-helper-bkyhs1bd.js → solution-definition-helper-dreejga4.js} +1 -1
  66. package/dist/tool.js +13 -13
  67. package/package.json +2 -2
@@ -144,7 +144,7 @@ class ConnectorToolFactory {
144
144
  return new ConnectorTool(fileSystem, logger);
145
145
  }
146
146
  }
147
- // node_modules/@uipath/resource-builder-tool/dist/index.js
147
+ // ../../node_modules/@uipath/resource-builder-tool/dist/index.js
148
148
  function _define_property(obj, key, value) {
149
149
  if (key in obj)
150
150
  Object.defineProperty(obj, key, {
@@ -157,6 +157,24 @@ function _define_property(obj, key, value) {
157
157
  obj[key] = value;
158
158
  return obj;
159
159
  }
160
+ function attachedFileStoredPath(kind, name) {
161
+ return `resources/files/${kind}/${name}`;
162
+ }
163
+ function isPathInside(root, resolved) {
164
+ const windows = /^[A-Za-z]:[\\/]|^\\\\/.test(root);
165
+ if (windows) {
166
+ const base = root.replace(/\//g, "\\").replace(/\\+$/, "").toLowerCase();
167
+ return resolved.replace(/\//g, "\\").toLowerCase().startsWith(`${base}\\`);
168
+ }
169
+ const base = root.replace(/\/+$/, "");
170
+ return resolved.startsWith(`${base}/`);
171
+ }
172
+ function isValidFileName(name) {
173
+ return !!name && !/[/\\:*?"<>|]/.test(name);
174
+ }
175
+ function isPlainName(name) {
176
+ return isValidFileName(name) && name !== "." && name !== "..";
177
+ }
160
178
  var KNOWN_ARCHIVE_FILE_NAMES = {
161
179
  packageInfoJsonFileName: "packageInfo.json",
162
180
  metadataJsonFileName: "solutionMetadata.json"
@@ -448,13 +466,20 @@ class ResourceBuilderTool extends SolutionTool {
448
466
  projectsToBuild: options.projectsToBuild
449
467
  });
450
468
  const files = this.extractFilesFromResources(filteredResources);
469
+ const outputPath = options.outputPath ?? "";
470
+ const copyFailures = await this.copyAttachedFilesAsync(files, outputPath, cancellationToken);
471
+ if (copyFailures.length > 0) {
472
+ const message = copyFailures.join(`
473
+ `);
474
+ this.logger.error(message);
475
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, message);
476
+ }
451
477
  const filesToDownload = files.filter((f) => f.url != null);
452
478
  if (filesToDownload.length === 0) {
453
479
  this.logger.info("No files to download.");
454
480
  this.logger.info("Restore finished.");
455
481
  return ToolResult.success();
456
482
  }
457
- const outputPath = options.outputPath ?? "";
458
483
  const downloadTasks = [];
459
484
  const semaphore = new Semaphore(MAX_DOWNLOAD_CONCURRENCY);
460
485
  for (const file of filesToDownload) {
@@ -807,6 +832,69 @@ class ResourceBuilderTool extends SolutionTool {
807
832
  return;
808
833
  }
809
834
  }
835
+ async copyAttachedFilesAsync(files, outputPath, cancellationToken) {
836
+ const failures = [];
837
+ const seen = new Set;
838
+ for (const file of files) {
839
+ throwIfCancelled(cancellationToken);
840
+ const id = `${file.key}/${file.name}`.toLowerCase();
841
+ if (file.url != null || !isPlainName(file.key) || !isPlainName(file.kind) || !isPlainName(file.name) || seen.has(id))
842
+ continue;
843
+ seen.add(id);
844
+ const stored = attachedFileStoredPath(file.kind, file.name);
845
+ const source = Path.join(this.inputPath, stored);
846
+ const target = Path.join(outputPath, KNOWN_ARCHIVE_FOLDERS.files, file.key, file.name);
847
+ if (!await this.fileSystem.exists(source)) {
848
+ this.logger.warn(`File ${file.name} has no download url and was not found at ${source}.`);
849
+ await this.removeStaleTargetAsync(target);
850
+ continue;
851
+ }
852
+ if (!await this.isPlainFileInsideInput(source, stored)) {
853
+ failures.push(`InvalidResourceFilePath: ${stored} must be a regular file inside the solution folder, not a symbolic link or junction.`);
854
+ continue;
855
+ }
856
+ const content = await this.fileSystem.readFile(source);
857
+ if (content == null) {
858
+ this.logger.warn(`File ${file.name} could not be read at ${source}.`);
859
+ await this.removeStaleTargetAsync(target);
860
+ continue;
861
+ }
862
+ if (content.byteLength === 0) {
863
+ failures.push(`InvalidResourceFilePath: ${stored} is empty or not a regular file.`);
864
+ continue;
865
+ }
866
+ await this.fileSystem.mkdir(Path.dirname(target));
867
+ try {
868
+ await this.fileSystem.writeFile(target, content);
869
+ } catch (error) {
870
+ try {
871
+ await this.fileSystem.rm(target);
872
+ } catch (cleanupError) {
873
+ this.logger.warn(`Could not remove the incomplete file ${target}: ${String(cleanupError)}`);
874
+ }
875
+ throw error;
876
+ }
877
+ this.logger.info(`Copied attached file ${file.name} to ${target}.`);
878
+ }
879
+ return failures;
880
+ }
881
+ async removeStaleTargetAsync(target) {
882
+ if (!await this.fileSystem.exists(target))
883
+ return;
884
+ try {
885
+ await this.fileSystem.rm(target);
886
+ } catch (error) {
887
+ this.logger.warn(`Could not remove the stale file ${target}: ${String(error)}`);
888
+ }
889
+ }
890
+ async isPlainFileInsideInput(source, stored) {
891
+ const stats = await this.fileSystem.stat(source);
892
+ if (!stats?.isFile())
893
+ return false;
894
+ const root = await this.fileSystem.realpath(this.inputPath);
895
+ const resolved = await this.fileSystem.realpath(source);
896
+ return isPathInside(root, resolved) && Path.normalize(resolved) === Path.normalize(Path.join(root, stored));
897
+ }
810
898
  extractFilesFromResources(resources) {
811
899
  const files = [];
812
900
  for (const resource of resources)
@@ -882,4 +970,4 @@ function registerPackagerFactories2() {
882
970
 
883
971
  export { registerPackagerFactories2 };
884
972
 
885
- //# debugId=1D227596F80BD51264756E2164756E21
973
+ //# debugId=2E8BD12F2BBFA44D64756E2164756E21
@@ -19,12 +19,12 @@ import {
19
19
  classifyFeedSession2,
20
20
  feedSessionRefusal2,
21
21
  feedSessionRefusalAsync2
22
- } from "./packager-tool-tqe3m1xp.js";
22
+ } from "./packager-tool-hczpvrc1.js";
23
23
  import {
24
24
  Configuration3,
25
25
  SolutionDeploymentAction2,
26
26
  DeploymentsApi2
27
- } from "./packager-tool-46x80z85.js";
27
+ } from "./packager-tool-2syv199e.js";
28
28
  import {
29
29
  getSolutionAuthContext2
30
30
  } from "./packager-tool-n1zrk6zv.js";
@@ -40,7 +40,7 @@ import {
40
40
  newestDeploymentRow2,
41
41
  interpretFailedDeployPoll2,
42
42
  resolveInstalledFolder2
43
- } from "./packager-tool-rhg3mwkn.js";
43
+ } from "./packager-tool-3qach0s4.js";
44
44
  import {
45
45
  activateDeployment,
46
46
  buildDeploymentLinks,
@@ -51,7 +51,7 @@ import {
51
51
  ACKNOWLEDGE_PERMANENT_DELETION_FLAG,
52
52
  finiteOr,
53
53
  runInstallToOutcomeAsync
54
- } from "./packager-tool-tmba5jv0.js";
54
+ } from "./packager-tool-ztxsccjk.js";
55
55
  import {
56
56
  resolveParentFolder,
57
57
  resolveFolderInfo,
@@ -61,12 +61,12 @@ import {
61
61
  deleteDeploymentCommand2,
62
62
  describeFeedResolutionFailureAsync2,
63
63
  resolveFeedScope2
64
- } from "./packager-tool-ewbkaecg.js";
64
+ } from "./packager-tool-7j920ac5.js";
65
65
  import {
66
66
  linkedProcessNamesFromConfig2,
67
67
  checkFolderRuntimesAsync2,
68
68
  logFolderRuntimeWarnings2
69
- } from "./packager-tool-kffz64hn.js";
69
+ } from "./packager-tool-w0tmr9xe.js";
70
70
  import {
71
71
  formatDeploymentFailureDetails,
72
72
  hasServerErrorCode,
@@ -82,7 +82,7 @@ import {
82
82
  appendDeploymentStateInstructions,
83
83
  needsPendingResources,
84
84
  deploymentNextSteps
85
- } from "./packager-tool-1tvhgac9.js";
85
+ } from "./packager-tool-h8wam8pt.js";
86
86
 
87
87
  // src/services/deploy-run-service.ts
88
88
  var DEFAULT_TIMEOUT_SECONDS = 360;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  isUnpackableProjectTypeError2,
3
3
  ensurePackagerTools2
4
- } from "./packager-tool-dd937g7k.js";
4
+ } from "./packager-tool-0gyqtxvs.js";
5
5
  import {
6
6
  toolVerbForProjectType2
7
7
  } from "./packager-tool-qzcd5c9s.js";
8
- import"./packager-tool-5p1vy335.js";
8
+ import"./packager-tool-p1xfsv6c.js";
9
9
  import"./packager-tool-devc4w73.js";
10
10
  import"./packager-tool-xbfr6y2x.js";
11
11
  import"./packager-tool-gb3dq79g.js";
@@ -17,10 +17,10 @@ import {
17
17
  findResourceInRcs2,
18
18
  readUipxProjects2,
19
19
  syncAndLog2
20
- } from "./packager-tool-cr1khqtm.js";
20
+ } from "./packager-tool-tt9v40x6.js";
21
21
  import {
22
22
  ensurePackagerTools2
23
- } from "./packager-tool-dd937g7k.js";
23
+ } from "./packager-tool-0gyqtxvs.js";
24
24
  import {
25
25
  ProjectContributionsError2,
26
26
  collectProjectContributions2,
@@ -28,7 +28,7 @@ import {
28
28
  assertNoContributionErrors2,
29
29
  contributionErrorMessages2,
30
30
  applyProjectContributions2
31
- } from "./packager-tool-yfcscjfp.js";
31
+ } from "./packager-tool-ncgpx1ce.js";
32
32
 
33
33
  // src/services/emit-runtime-dependencies.ts
34
34
  import { createHash } from "node:crypto";