@uipath/solution-tool 1.204.0-preview.255 → 1.205.0-preview.256

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 (122) hide show
  1. package/README.md +3 -3
  2. package/dist/THIRD-PARTY-NOTICES.md +2 -2
  3. package/dist/archive-extract-x35t9ktj.js +120 -0
  4. package/dist/cleanup-command-service-n4e7vxnw.js +149 -0
  5. package/dist/deploy-delete-service-cag0q8yx.js +25 -0
  6. package/dist/deploy-run-service-f0h8wb9w.js +25 -0
  7. package/dist/{deploy-status-service-6svq7c6w.js → deploy-status-service-yh6xn6e0.js} +41 -33
  8. package/dist/deploy.js +23 -17
  9. package/dist/{deployment-search-v2qtz23x.js → deployment-search-mnywd9nc.js} +16 -10
  10. package/dist/{embedded-file-reader-rf2g1kfj.js → embedded-file-reader-z4becc02.js} +2 -2
  11. package/dist/{feed-resolver-xz3akamf.js → feed-resolver-fve33dxq.js} +10 -9
  12. package/dist/feed-scope-failure-jmg4t1r1.js +19 -0
  13. package/dist/{feed-session-sxga31vn.js → feed-session-7xqphdrg.js} +3 -3
  14. package/dist/governance-options-4vxz7ekn.js +32 -0
  15. package/dist/index-g8c8nf1c.js +667 -0
  16. package/dist/index-prm27bvm.js +138 -0
  17. package/dist/index.js +27 -29
  18. package/dist/init.js +11 -10
  19. package/dist/{list-tjetkspc.js → list-50mepbed.js} +10 -8
  20. package/dist/models/pack-command-types.d.ts +15 -0
  21. package/dist/node-7jm7ksqa.js +86 -0
  22. package/dist/pack-command-service-dewf5vsq.js +35 -0
  23. package/dist/pack-project-xwd1rbaa.js +97 -0
  24. package/dist/pack.js +24 -14
  25. package/dist/package-id-1wr3cy9c.js +13 -0
  26. package/dist/packager-tool-09swr9cp.js +171 -0
  27. package/dist/{packager-tool-a9jx8gf4.js → packager-tool-2vmsh5pt.js} +196 -1519
  28. package/dist/{packager-tool-px1j9kre.js → packager-tool-3bwnkjdq.js} +2 -2
  29. package/dist/{packager-tool-gb35b4qs.js → packager-tool-43ahv5mn.js} +192 -96
  30. package/dist/{packager-tool-9ha2z8h5.js → packager-tool-47by487p.js} +6 -4
  31. package/dist/packager-tool-47wzvqw0.js +86 -0
  32. package/dist/{packager-tool-zns6n8zp.js → packager-tool-5ddtwzva.js} +1 -1
  33. package/dist/packager-tool-5edvzz80.js +543 -0
  34. package/dist/{packager-tool-jq9zw82w.js → packager-tool-5n6jsn41.js} +104 -14
  35. package/dist/packager-tool-60af1hw2.js +26 -0
  36. package/dist/{packager-tool-f5gq77m5.js → packager-tool-61pwb567.js} +2 -2
  37. package/dist/{packager-tool-yrz4mwfn.js → packager-tool-6kz1pv9f.js} +1373 -486
  38. package/dist/packager-tool-6ybywxxn.js +1809 -0
  39. package/dist/packager-tool-8ptbmmmp.js +2132 -0
  40. package/dist/{packager-tool-7gr2nphb.js → packager-tool-97rcgwvv.js} +224 -6
  41. package/dist/{packager-tool-83m6ns0r.js → packager-tool-9t26kde1.js} +3556 -1646
  42. package/dist/packager-tool-act5r386.js +239 -0
  43. package/dist/packager-tool-amhyxzz6.js +125 -0
  44. package/dist/packager-tool-b03rva43.js +188 -0
  45. package/dist/{packager-tool-e2rtr49j.js → packager-tool-b2nhscfk.js} +15 -31
  46. package/dist/{packager-tool-tv9c1e80.js → packager-tool-d6rrfd46.js} +149 -53
  47. package/dist/packager-tool-frr2xmkr.js +445 -0
  48. package/dist/{packager-tool-v8bkkqdb.js → packager-tool-gmwva4yv.js} +5 -5
  49. package/dist/packager-tool-gs3f3tf7.js +103 -0
  50. package/dist/packager-tool-jg692f13.js +517 -0
  51. package/dist/packager-tool-jmpb786m.js +109 -0
  52. package/dist/{packager-tool-5sex4a1h.js → packager-tool-kds8ytzw.js} +74 -23
  53. package/dist/packager-tool-kkfb5kgn.js +182 -0
  54. package/dist/packager-tool-kvcxg0zv.js +1510 -0
  55. package/dist/packager-tool-n3jfjn5r.js +42 -0
  56. package/dist/{packager-tool-fjsn5h8s.js → packager-tool-n5d5dx5j.js} +2196 -3455
  57. package/dist/{packager-tool-yfpcvdpm.js → packager-tool-nsya65z1.js} +357 -1370
  58. package/dist/{packager-tool-fv7xyzg2.js → packager-tool-pbmqk39a.js} +126 -128
  59. package/dist/{packager-tool-bqre28m1.js → packager-tool-qw47eyw7.js} +1 -1
  60. package/dist/{packager-tool-9qgmwy21.js → packager-tool-rc3hwn4b.js} +25 -4
  61. package/dist/packager-tool-resolver-994z3jkj.js +23 -0
  62. package/dist/{packager-tool-tgw5x6vx.js → packager-tool-rvt68c1t.js} +17 -8
  63. package/dist/{packager-tool-gab9y5ct.js → packager-tool-t8gh825q.js} +37 -13
  64. package/dist/{packager-tool-kswwd3hp.js → packager-tool-tx834spe.js} +2376 -4077
  65. package/dist/{packager-tool-zf3929se.js → packager-tool-v1f5e8t9.js} +11 -1
  66. package/dist/{packager-tool-ssq2kzqm.js → packager-tool-w77d72a7.js} +13 -11
  67. package/dist/{packager-tool-1rzssy0x.js → packager-tool-wy4fx250.js} +19 -18
  68. package/dist/packager-tool-wz34ma3s.js +1333 -0
  69. package/dist/packager-tool-zq16e1xv.js +68 -0
  70. package/dist/packager-tool.js +2 -2
  71. package/dist/prepare-solution-resources-m1djfj62.js +29 -0
  72. package/dist/project-command-utils-t6pmpvq3.js +90 -0
  73. package/dist/project-contributions-79ndycrx.js +32 -0
  74. package/dist/publish.js +13 -12
  75. package/dist/resource-mutations-c3krjqze.js +36 -0
  76. package/dist/resource-version-lookup-0e3e2j58.js +99 -0
  77. package/dist/resource.js +10 -9
  78. package/dist/restore-command-service-5v0b9363.js +155 -0
  79. package/dist/run-service-tg6b67wp.js +428 -0
  80. package/dist/services/deploy-activate-service.d.ts +10 -5
  81. package/dist/services/deploy-delete-service.d.ts +8 -4
  82. package/dist/services/deploy-run-service.d.ts +34 -1
  83. package/dist/services/deploy-uninstall-service.d.ts +21 -3
  84. package/dist/services/deploy-upgrade-service.d.ts +35 -1
  85. package/dist/services/deployment-feed-locator.d.ts +15 -4
  86. package/dist/services/deployment-search-client.d.ts +5 -53
  87. package/dist/services/deployment-search.d.ts +58 -3
  88. package/dist/services/deployment-state.d.ts +84 -24
  89. package/dist/services/deployment-validation.d.ts +5 -0
  90. package/dist/services/emit-runtime-dependencies.d.ts +2 -1
  91. package/dist/services/feed-resolver.d.ts +6 -4
  92. package/dist/services/feed-selection.d.ts +47 -0
  93. package/dist/services/http-status.d.ts +2 -7
  94. package/dist/services/pack-command-service.d.ts +9 -0
  95. package/dist/services/pack-project-selection.d.ts +51 -0
  96. package/dist/services/pack-project.d.ts +26 -0
  97. package/dist/services/pack-service.d.ts +7 -3
  98. package/dist/services/package-search-client.d.ts +7 -0
  99. package/dist/services/packager-tool-resolver.d.ts +7 -1
  100. package/dist/services/packages-list-service.d.ts +1 -1
  101. package/dist/services/permanent-deletion-consent.d.ts +110 -0
  102. package/dist/services/pipeline-deploy-poll.d.ts +7 -0
  103. package/dist/services/prepare-solution-resources.d.ts +12 -2
  104. package/dist/services/project-contributions.d.ts +5 -4
  105. package/dist/services/search-failure.d.ts +9 -13
  106. package/dist/services/solution-packager-helpers.d.ts +5 -2
  107. package/dist/services/solution-path.d.ts +1 -1
  108. package/dist/services/uninstall-consent.d.ts +82 -0
  109. package/dist/ship-telemetry-myes7ak5.js +21 -0
  110. package/dist/solution-auth-aead70sw.js +11 -0
  111. package/dist/templates/AGENTS.md +125 -12
  112. package/dist/tool.js +27 -29
  113. package/dist/utils/deployment-errors.d.ts +9 -1
  114. package/package.json +2 -2
  115. package/dist/deploy-delete-service-w3e8x1kq.js +0 -22
  116. package/dist/feed-scope-failure-0j5byccb.js +0 -18
  117. package/dist/packager-tool-f2e9rzxk.js +0 -104
  118. package/dist/packager-tool-resolver-6zwhec62.js +0 -20
  119. package/dist/packager-tool-zdfn32bc.js +0 -4465
  120. package/dist/prepare-solution-resources-jpb5as2s.js +0 -25
  121. package/dist/project-contributions-6wpff2hm.js +0 -30
  122. package/dist/services/legacy-deployment-search-v3.d.ts +0 -23
@@ -0,0 +1,68 @@
1
+ import {
2
+ describeFeedResolutionFailureAsync,
3
+ resolveFeedScope
4
+ } from "./packager-tool-rvt68c1t.js";
5
+ import {
6
+ classifyFeedSession,
7
+ feedSessionRefusal
8
+ } from "./packager-tool-qw47eyw7.js";
9
+ import {
10
+ catchError
11
+ } from "./packager-tool-6ybywxxn.js";
12
+
13
+ // src/services/feed-selection.ts
14
+ async function resolveFeedSelectionAsync(auth, flags, action) {
15
+ if (!flags.personalWorkspace && flags.feed === undefined) {
16
+ return { ok: true };
17
+ }
18
+ if (flags.personalWorkspace) {
19
+ const refusal = refuseUnlessUser(auth, `${action} in a Personal Workspace`);
20
+ if (refusal) {
21
+ return refusal;
22
+ }
23
+ }
24
+ const [scopeError, scope] = await catchError(resolveFeedScope({
25
+ personalWorkspace: flags.personalWorkspace,
26
+ feed: flags.feed,
27
+ tenant: flags.tenant,
28
+ loginValidity: flags.loginValidity,
29
+ envFilePath: flags.envFilePath
30
+ }));
31
+ if (scopeError) {
32
+ const failure = await describeFeedResolutionFailureAsync(scopeError, flags, auth);
33
+ return {
34
+ ok: false,
35
+ reason: "feed_resolution_failed",
36
+ message: failure.message,
37
+ instructions: failure.instructions,
38
+ errorCode: failure.errorCode,
39
+ retry: failure.retry
40
+ };
41
+ }
42
+ if (scope.kind !== "tenant") {
43
+ const refusal = refuseUnlessUser(auth, `${action} in the feed '${scope.name ?? scope.folderKey}'`);
44
+ if (refusal) {
45
+ return refusal;
46
+ }
47
+ }
48
+ return { ok: true, selectedFeed: scope };
49
+ }
50
+ function refuseUnlessUser(auth, action) {
51
+ const verdict = classifyFeedSession(auth);
52
+ if (verdict === "user") {
53
+ return;
54
+ }
55
+ const { message, instructions } = feedSessionRefusal(verdict, action, "drop the feed flag to act on a tenant-feed deployment");
56
+ return {
57
+ ok: false,
58
+ reason: "feed_requires_user_session",
59
+ message,
60
+ instructions,
61
+ errorCode: "permission_denied",
62
+ retry: "RetryWillNotFix"
63
+ };
64
+ }
65
+
66
+ export { resolveFeedSelectionAsync };
67
+
68
+ //# debugId=9E3902AB9AB273B164756E2164756E21
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  registerPackagerFactories
3
- } from "./packager-tool-zns6n8zp.js";
4
- import"./packager-tool-fv7xyzg2.js";
3
+ } from "./packager-tool-5ddtwzva.js";
4
+ import"./packager-tool-pbmqk39a.js";
5
5
  import"./packager-tool-dfrk01gn.js";
6
6
  import"./packager-tool-1de529jm.js";
7
7
  export {
@@ -0,0 +1,29 @@
1
+ import {
2
+ prepareSolutionResources,
3
+ projectBindingsFrom,
4
+ projectSubTypesFrom
5
+ } from "./packager-tool-t8gh825q.js";
6
+ import"./packager-tool-wy4fx250.js";
7
+ import"./packager-tool-b2nhscfk.js";
8
+ import"./packager-tool-60af1hw2.js";
9
+ import"./packager-tool-5ddtwzva.js";
10
+ import"./packager-tool-6kz1pv9f.js";
11
+ import"./packager-tool-gdtpsdn7.js";
12
+ import"./packager-tool-53w8skv5.js";
13
+ import"./packager-tool-pbmqk39a.js";
14
+ import"./packager-tool-61pwb567.js";
15
+ import"./packager-tool-8ptbmmmp.js";
16
+ import"./packager-tool-5edvzz80.js";
17
+ import"./packager-tool-43ahv5mn.js";
18
+ import"./packager-tool-tx834spe.js";
19
+ import"./packager-tool-6ybywxxn.js";
20
+ import"./packager-tool-v1f5e8t9.js";
21
+ import"./packager-tool-dfrk01gn.js";
22
+ import"./packager-tool-1de529jm.js";
23
+ export {
24
+ prepareSolutionResources,
25
+ projectBindingsFrom,
26
+ projectSubTypesFrom
27
+ };
28
+
29
+ //# debugId=9908FC9B281216AE64756E2164756E21
@@ -0,0 +1,90 @@
1
+ import {
2
+ toolVerbForProjectType
3
+ } from "./packager-tool-60af1hw2.js";
4
+ import {
5
+ hasAnyTemplateRow,
6
+ hasBareTemplateRow,
7
+ isMissingProjectTypeError
8
+ } from "./packager-tool-6kz1pv9f.js";
9
+ import"./packager-tool-gdtpsdn7.js";
10
+ import"./packager-tool-53w8skv5.js";
11
+ import"./packager-tool-pbmqk39a.js";
12
+ import"./packager-tool-61pwb567.js";
13
+ import"./packager-tool-8ptbmmmp.js";
14
+ import"./packager-tool-5edvzz80.js";
15
+ import"./packager-tool-43ahv5mn.js";
16
+ import {
17
+ OutputFormatter,
18
+ RESULTS,
19
+ processContext,
20
+ unsupportedSolutionProjectType
21
+ } from "./packager-tool-tx834spe.js";
22
+ import"./packager-tool-6ybywxxn.js";
23
+ import"./packager-tool-v1f5e8t9.js";
24
+ import"./packager-tool-dfrk01gn.js";
25
+ import"./packager-tool-1de529jm.js";
26
+
27
+ // src/commands/project-command-utils.ts
28
+ async function resolveSolutionSearchStart(fs, resolvedPath) {
29
+ const stat = await fs.stat(resolvedPath);
30
+ if (!stat || stat.isDirectory()) {
31
+ return resolvedPath;
32
+ }
33
+ return fs.path.dirname(resolvedPath);
34
+ }
35
+ var PROJECT_MANIFEST_FILE_NAMES = new Set([
36
+ "project.uiproj",
37
+ "project.json",
38
+ "uipath.json"
39
+ ]);
40
+ async function resolveProjectManifestDirectory(fs, resolvedPath) {
41
+ if (!PROJECT_MANIFEST_FILE_NAMES.has(fs.path.basename(resolvedPath))) {
42
+ return resolvedPath;
43
+ }
44
+ const stat = await fs.stat(resolvedPath);
45
+ if (!stat || stat.isDirectory()) {
46
+ return resolvedPath;
47
+ }
48
+ return fs.path.dirname(resolvedPath);
49
+ }
50
+ function rejectUnsupportedProjectType(projectType, failureMessage) {
51
+ const reason = unsupportedSolutionProjectType(projectType);
52
+ if (!reason) {
53
+ return false;
54
+ }
55
+ OutputFormatter.error({
56
+ Result: RESULTS.Failure,
57
+ Message: failureMessage,
58
+ Instructions: reason
59
+ });
60
+ processContext.exit(1);
61
+ return true;
62
+ }
63
+ function projectManifestInstructions(fileName, readProjectError, verb) {
64
+ if (fileName !== "uipath.json" || !isMissingProjectTypeError(readProjectError)) {
65
+ return readProjectError.message;
66
+ }
67
+ 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.`;
68
+ }
69
+ function resourcesPendingForProjectType(projectType) {
70
+ return !hasBareTemplateRow(projectType) && hasAnyTemplateRow(projectType);
71
+ }
72
+ function hostGeneratesResources(projectType) {
73
+ return hasBareTemplateRow(projectType);
74
+ }
75
+ function resourcesPendingWarning(projectType) {
76
+ const verb = toolVerbForProjectType(projectType);
77
+ const needs = verb ? `that needs the '${verb}' tool installed ('uip tools install ${verb}')` : "that needs the tool that owns this project type installed";
78
+ return `No solution resources were generated for this project yet. Run 'uip solution resources refresh' to create them — ${needs}. 'uip solution pack' and 'uip solution upload' do it too.`;
79
+ }
80
+ export {
81
+ hostGeneratesResources,
82
+ projectManifestInstructions,
83
+ rejectUnsupportedProjectType,
84
+ resolveProjectManifestDirectory,
85
+ resolveSolutionSearchStart,
86
+ resourcesPendingForProjectType,
87
+ resourcesPendingWarning
88
+ };
89
+
90
+ //# debugId=FC9FF782E4DE0FAD64756E2164756E21
@@ -0,0 +1,32 @@
1
+ import {
2
+ ProjectContributionsError,
3
+ applyProjectContributions,
4
+ assertNoContributionErrors,
5
+ collectProjectContributions,
6
+ contributionErrorMessages
7
+ } from "./packager-tool-wy4fx250.js";
8
+ import"./packager-tool-b2nhscfk.js";
9
+ import"./packager-tool-60af1hw2.js";
10
+ import"./packager-tool-5ddtwzva.js";
11
+ import"./packager-tool-6kz1pv9f.js";
12
+ import"./packager-tool-gdtpsdn7.js";
13
+ import"./packager-tool-53w8skv5.js";
14
+ import"./packager-tool-pbmqk39a.js";
15
+ import"./packager-tool-61pwb567.js";
16
+ import"./packager-tool-8ptbmmmp.js";
17
+ import"./packager-tool-5edvzz80.js";
18
+ import"./packager-tool-43ahv5mn.js";
19
+ import"./packager-tool-tx834spe.js";
20
+ import"./packager-tool-6ybywxxn.js";
21
+ import"./packager-tool-v1f5e8t9.js";
22
+ import"./packager-tool-dfrk01gn.js";
23
+ import"./packager-tool-1de529jm.js";
24
+ export {
25
+ ProjectContributionsError,
26
+ applyProjectContributions,
27
+ assertNoContributionErrors,
28
+ collectProjectContributions,
29
+ contributionErrorMessages
30
+ };
31
+
32
+ //# debugId=F2121F275677FE5B64756E2164756E21
package/dist/publish.js CHANGED
@@ -1,20 +1,21 @@
1
1
  import {
2
2
  publishSolutionAsync
3
- } from "./packager-tool-ssq2kzqm.js";
4
- import"./packager-tool-7gr2nphb.js";
5
- import"./packager-tool-tgw5x6vx.js";
6
- import"./packager-tool-83m6ns0r.js";
7
- import"./packager-tool-bqre28m1.js";
8
- import"./packager-tool-f5gq77m5.js";
9
- import"./packager-tool-zdfn32bc.js";
10
- import"./packager-tool-f2e9rzxk.js";
11
- import"./packager-tool-kswwd3hp.js";
12
- import"./packager-tool-gb35b4qs.js";
13
- import"./packager-tool-zf3929se.js";
3
+ } from "./packager-tool-w77d72a7.js";
4
+ import"./packager-tool-rvt68c1t.js";
5
+ import"./packager-tool-97rcgwvv.js";
6
+ import"./packager-tool-9t26kde1.js";
7
+ import"./packager-tool-qw47eyw7.js";
8
+ import"./packager-tool-61pwb567.js";
9
+ import"./packager-tool-8ptbmmmp.js";
10
+ import"./packager-tool-5edvzz80.js";
11
+ import"./packager-tool-43ahv5mn.js";
12
+ import"./packager-tool-tx834spe.js";
13
+ import"./packager-tool-6ybywxxn.js";
14
+ import"./packager-tool-v1f5e8t9.js";
14
15
  import"./packager-tool-dfrk01gn.js";
15
16
  import"./packager-tool-1de529jm.js";
16
17
  export {
17
18
  publishSolutionAsync
18
19
  };
19
20
 
20
- //# debugId=53632877CEAF58FA64756E2164756E21
21
+ //# debugId=7A6F1689DB243A9C64756E2164756E21
@@ -0,0 +1,36 @@
1
+ import {
2
+ createLocalResource,
3
+ findMatchingLocalResource,
4
+ findResourceByKeyInRcs,
5
+ formatResourceSubtypes,
6
+ normalizeFolderPath,
7
+ resolveResourceKindMetadata,
8
+ sameResourceSubtype,
9
+ searchRcsResources,
10
+ uniqueNameForResource
11
+ } from "./packager-tool-6kz1pv9f.js";
12
+ import"./packager-tool-gdtpsdn7.js";
13
+ import"./packager-tool-53w8skv5.js";
14
+ import"./packager-tool-pbmqk39a.js";
15
+ import"./packager-tool-61pwb567.js";
16
+ import"./packager-tool-8ptbmmmp.js";
17
+ import"./packager-tool-5edvzz80.js";
18
+ import"./packager-tool-43ahv5mn.js";
19
+ import"./packager-tool-tx834spe.js";
20
+ import"./packager-tool-6ybywxxn.js";
21
+ import"./packager-tool-v1f5e8t9.js";
22
+ import"./packager-tool-dfrk01gn.js";
23
+ import"./packager-tool-1de529jm.js";
24
+ export {
25
+ createLocalResource,
26
+ findMatchingLocalResource,
27
+ findResourceByKeyInRcs,
28
+ formatResourceSubtypes,
29
+ normalizeFolderPath,
30
+ resolveResourceKindMetadata,
31
+ sameResourceSubtype,
32
+ searchRcsResources,
33
+ uniqueNameForResource
34
+ };
35
+
36
+ //# debugId=D31EF3B783FEE07064756E2164756E21
@@ -0,0 +1,99 @@
1
+ import {
2
+ createResourceKindMetadataResolver,
3
+ exportResourceDefinitionAsync,
4
+ getRemoteResourceClients,
5
+ readSpecProperty
6
+ } from "./packager-tool-6kz1pv9f.js";
7
+ import"./packager-tool-gdtpsdn7.js";
8
+ import"./packager-tool-53w8skv5.js";
9
+ import"./packager-tool-pbmqk39a.js";
10
+ import"./packager-tool-61pwb567.js";
11
+ import"./packager-tool-8ptbmmmp.js";
12
+ import"./packager-tool-5edvzz80.js";
13
+ import"./packager-tool-43ahv5mn.js";
14
+ import {
15
+ logger
16
+ } from "./packager-tool-tx834spe.js";
17
+ import {
18
+ catchError
19
+ } from "./packager-tool-6ybywxxn.js";
20
+ import"./packager-tool-v1f5e8t9.js";
21
+ import"./packager-tool-dfrk01gn.js";
22
+ import"./packager-tool-1de529jm.js";
23
+
24
+ // src/services/resource-version-lookup.ts
25
+ var VERSION_PROPERTY = "version";
26
+ var LOOKUP_CONCURRENCY = 5;
27
+ async function resolveResourceVersionsAsync(services, builder, targets) {
28
+ const versions = new Map;
29
+ if (targets.length === 0) {
30
+ return versions;
31
+ }
32
+ const resolveKind = await createResourceKindMetadataResolver(services);
33
+ const versioned = [];
34
+ for (const target of targets) {
35
+ const metadata = await resolveKind(target.kind, target.type);
36
+ if (metadata?.specProperties.has(VERSION_PROPERTY)) {
37
+ versioned.push(target);
38
+ }
39
+ }
40
+ if (versioned.length === 0) {
41
+ return versions;
42
+ }
43
+ const { importer } = getRemoteResourceClients(services);
44
+ for (let i = 0;i < versioned.length; i += LOOKUP_CONCURRENCY) {
45
+ const batch = versioned.slice(i, i + LOOKUP_CONCURRENCY);
46
+ const resolved = await Promise.all(batch.map((target) => target.source === "Local" ? readLocalVersionAsync(builder, target) : readRemoteVersionAsync(importer, target)));
47
+ for (const [id, version] of resolved) {
48
+ if (version !== undefined) {
49
+ versions.set(id, version);
50
+ }
51
+ }
52
+ }
53
+ return versions;
54
+ }
55
+ async function readLocalVersionAsync(builder, target) {
56
+ const [error, configuration] = await catchError(builder.getConfigurationAsync(target.key));
57
+ if (error || !configuration) {
58
+ warnLookupFailed(target, error);
59
+ return [target.id, undefined];
60
+ }
61
+ return [target.id, readVersion(configuration.spec)];
62
+ }
63
+ async function readRemoteVersionAsync(importer, target) {
64
+ const reference = {
65
+ kind: target.kind,
66
+ type: target.type,
67
+ key: target.key,
68
+ name: target.name,
69
+ folder: target.folderFullyQualifiedName ? {
70
+ fullyQualifiedName: target.folderFullyQualifiedName,
71
+ folderKey: target.folderKey
72
+ } : undefined
73
+ };
74
+ const [error, primary] = await catchError(exportResourceDefinitionAsync(importer, reference));
75
+ if (error) {
76
+ warnLookupFailed(target, error);
77
+ return [target.id, undefined];
78
+ }
79
+ if (!primary) {
80
+ logger.warn(`Export for ${target.kind} '${target.name ?? target.key}' returned no definition for that key; version omitted.`);
81
+ return [target.id, undefined];
82
+ }
83
+ return [target.id, readVersion(primary.spec)];
84
+ }
85
+ function readVersion(spec) {
86
+ const value = readSpecProperty(spec, VERSION_PROPERTY);
87
+ if (value === undefined || value === null || value === "") {
88
+ return;
89
+ }
90
+ return typeof value === "string" ? value : String(value);
91
+ }
92
+ function warnLookupFailed(target, error) {
93
+ logger.warn(`Failed to read the version of ${target.kind} '${target.name ?? target.key}': ${error?.message ?? "no configuration returned"}`);
94
+ }
95
+ export {
96
+ resolveResourceVersionsAsync
97
+ };
98
+
99
+ //# debugId=39D9D0F8102E78A564756E2164756E21
package/dist/resource.js CHANGED
@@ -1,19 +1,20 @@
1
1
  import {
2
2
  resourceRefreshAsync
3
- } from "./packager-tool-yrz4mwfn.js";
3
+ } from "./packager-tool-6kz1pv9f.js";
4
4
  import"./packager-tool-gdtpsdn7.js";
5
5
  import"./packager-tool-53w8skv5.js";
6
- import"./packager-tool-fv7xyzg2.js";
7
- import"./packager-tool-f5gq77m5.js";
8
- import"./packager-tool-zdfn32bc.js";
9
- import"./packager-tool-f2e9rzxk.js";
10
- import"./packager-tool-kswwd3hp.js";
11
- import"./packager-tool-gb35b4qs.js";
12
- import"./packager-tool-zf3929se.js";
6
+ import"./packager-tool-pbmqk39a.js";
7
+ import"./packager-tool-61pwb567.js";
8
+ import"./packager-tool-8ptbmmmp.js";
9
+ import"./packager-tool-5edvzz80.js";
10
+ import"./packager-tool-43ahv5mn.js";
11
+ import"./packager-tool-tx834spe.js";
12
+ import"./packager-tool-6ybywxxn.js";
13
+ import"./packager-tool-v1f5e8t9.js";
13
14
  import"./packager-tool-dfrk01gn.js";
14
15
  import"./packager-tool-1de529jm.js";
15
16
  export {
16
17
  resourceRefreshAsync
17
18
  };
18
19
 
19
- //# debugId=95E0C3E4B3A79D3C64756E2164756E21
20
+ //# debugId=769B19CBADFAADC064756E2164756E21
@@ -0,0 +1,155 @@
1
+ import {
2
+ SOLUTION_PATH_INSTRUCTIONS,
3
+ applyAuthConnection,
4
+ checkSolutionPathAsync,
5
+ createSolutionPackager,
6
+ readSolutionFileAsUint8Array,
7
+ resolveSdkLogLevel
8
+ } from "./packager-tool-jmpb786m.js";
9
+ import {
10
+ ensurePackagerTools,
11
+ isUnpackableProjectTypeError
12
+ } from "./packager-tool-b2nhscfk.js";
13
+ import"./packager-tool-60af1hw2.js";
14
+ import {
15
+ SolutionPackOptions
16
+ } from "./packager-tool-wz34ma3s.js";
17
+ import"./packager-tool-09swr9cp.js";
18
+ import"./packager-tool-b03rva43.js";
19
+ import"./packager-tool-n5d5dx5j.js";
20
+ import"./packager-tool-5ddtwzva.js";
21
+ import {
22
+ ToolResult
23
+ } from "./packager-tool-pbmqk39a.js";
24
+ import"./packager-tool-43ahv5mn.js";
25
+ import {
26
+ OutputFormatter,
27
+ RESULTS,
28
+ logger
29
+ } from "./packager-tool-tx834spe.js";
30
+ import {
31
+ carriedInstructions,
32
+ catchError
33
+ } from "./packager-tool-6ybywxxn.js";
34
+ import {
35
+ getFileSystem
36
+ } from "./packager-tool-v1f5e8t9.js";
37
+ import"./packager-tool-dfrk01gn.js";
38
+ import"./packager-tool-1de529jm.js";
39
+
40
+ // src/services/restore-command-service.ts
41
+ class RestoreCommandService {
42
+ packager = null;
43
+ fs;
44
+ constructor() {
45
+ this.fs = getFileSystem();
46
+ }
47
+ async execute(solutionPath, options, context) {
48
+ const check = await checkSolutionPathAsync(this.fs, solutionPath);
49
+ if (!check.ok) {
50
+ OutputFormatter.error({
51
+ Result: RESULTS.Failure,
52
+ Message: check.message,
53
+ Instructions: SOLUTION_PATH_INSTRUCTIONS,
54
+ ErrorCode: check.errorCode
55
+ });
56
+ if (check.statError?.stack) {
57
+ logger.error("Stack trace:");
58
+ logger.error(check.statError.stack);
59
+ }
60
+ context.exit(1);
61
+ return;
62
+ }
63
+ const { absoluteSolutionPath, isUisFile } = check;
64
+ const solutionName = isUisFile ? this.fs.path.basename(solutionPath, ".uis") : this.fs.path.basename(solutionPath);
65
+ logger.info(`
66
+ Restoring solution dependencies...
67
+ `);
68
+ logger.info("Details:");
69
+ logger.info(` Solution: ${absoluteSolutionPath}`);
70
+ logger.info("");
71
+ const [error, result] = await catchError(this.executeAsync(solutionPath, options));
72
+ if (error) {
73
+ const msg = error instanceof Error ? error.message : String(error);
74
+ OutputFormatter.error({
75
+ Result: RESULTS.Failure,
76
+ ...isUnpackableProjectTypeError(error) ? { ErrorCode: "invalid_argument" } : {},
77
+ Message: msg,
78
+ Instructions: carriedInstructions(error) ?? "Check that you are logged in (`uip auth login`) and that the solution path is accessible, then rerun: uip solution restore <solution-path>"
79
+ });
80
+ if (error instanceof Error && error.stack && !isUnpackableProjectTypeError(error)) {
81
+ logger.error("Stack trace:");
82
+ logger.error(error.stack);
83
+ }
84
+ context.exit(1);
85
+ return;
86
+ }
87
+ if (result.errorCode !== "SUCCESS" /* Success */) {
88
+ OutputFormatter.error({
89
+ Result: RESULTS.Failure,
90
+ Message: `Error code: ${result.errorCode} : ${result.message}`,
91
+ Instructions: "Resolve the reported dependency issue, ensure you are logged in with `uip auth login`, then rerun: uip solution restore <solution-path>"
92
+ });
93
+ context.exit(1);
94
+ return;
95
+ }
96
+ OutputFormatter.success({
97
+ Result: RESULTS.Success,
98
+ Code: "SolutionRestore",
99
+ Data: {
100
+ Solution: solutionName,
101
+ Status: "Restored"
102
+ }
103
+ });
104
+ }
105
+ async executeAsync(solutionPath, options) {
106
+ const check = await checkSolutionPathAsync(this.fs, solutionPath);
107
+ if (!check.ok) {
108
+ if (check.statError) {
109
+ throw check.statError;
110
+ }
111
+ return new ToolResult("INTERNAL_ERROR" /* InternalError */, check.message, []);
112
+ }
113
+ const { absoluteSolutionPath, isUisFile } = check;
114
+ const solutionName = isUisFile ? this.fs.path.basename(solutionPath, ".uis") : this.fs.path.basename(solutionPath);
115
+ const packager = await this.ensurePackagerAsync();
116
+ let inputPath;
117
+ if (isUisFile) {
118
+ const uint8Array = await readSolutionFileAsUint8Array(this.fs, absoluteSolutionPath);
119
+ inputPath = await packager.setupAsync(uint8Array);
120
+ } else {
121
+ inputPath = await packager.setupAsync(absoluteSolutionPath);
122
+ }
123
+ await ensurePackagerTools(inputPath, this.fs);
124
+ const restoreOptions = await this.createRestoreOptions(inputPath, solutionName, options);
125
+ return packager.restoreSolutionAsync(restoreOptions);
126
+ }
127
+ async ensurePackagerAsync() {
128
+ if (!this.packager) {
129
+ this.packager = await createSolutionPackager();
130
+ }
131
+ return this.packager;
132
+ }
133
+ async createRestoreOptions(inputPath, solutionName, options) {
134
+ const restoreOptions = new SolutionPackOptions;
135
+ restoreOptions.inputPath = inputPath;
136
+ restoreOptions.configuration = "Release" /* Release */;
137
+ restoreOptions.excludeConfiguredSources = options.excludeConfiguredSources ?? false;
138
+ restoreOptions.package = {
139
+ id: solutionName,
140
+ version: "1.0.0",
141
+ author: "",
142
+ description: ""
143
+ };
144
+ restoreOptions.logLevel = resolveSdkLogLevel();
145
+ restoreOptions.nuGetSourcesConfigPath = options.nugetSourcesConfigPath;
146
+ restoreOptions.feedFolder = options.feedFolder;
147
+ await applyAuthConnection(restoreOptions, options.loginValidity);
148
+ return restoreOptions;
149
+ }
150
+ }
151
+ export {
152
+ RestoreCommandService
153
+ };
154
+
155
+ //# debugId=B15EA9113DA4F34C64756E2164756E21