@uipath/solution-tool 1.206.0-preview.301 → 1.207.0-preview.305

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/dist/{archive-extract-ma0gy822.js → archive-extract-afgwacbg.js} +3 -3
  2. package/dist/{cleanup-command-service-8whhrsvy.js → cleanup-command-service-j9kawew9.js} +20 -15
  3. package/dist/deploy-delete-service-1erqap9a.js +23 -0
  4. package/dist/deploy-run-service-jbs6dxye.js +24 -0
  5. package/dist/{deploy-status-service-at6cxp1a.js → deploy-status-service-4zn90vds.js} +49 -25
  6. package/dist/deploy.js +21 -20
  7. package/dist/{deployment-search-40dknsk1.js → deployment-search-dwzahe4v.js} +9 -9
  8. package/dist/feed-resolver-d14rdjss.js +31 -0
  9. package/dist/feed-scope-failure-w16mze3z.js +20 -0
  10. package/dist/{feed-session-dvyfw5k7.js → feed-session-f2sby6t8.js} +6 -6
  11. package/dist/{first-party-service-6gf3n6d8.js → first-party-service-7cggb17y.js} +1 -1
  12. package/dist/folder-runtime-check-586c41dq.js +25 -0
  13. package/dist/{governance-options-am1hfj5b.js → governance-options-y2xsv7ff.js} +7 -7
  14. package/dist/{packager-tool-5vf0v538.js → index-6ma58k47.js} +33 -708
  15. package/dist/{index-p3x7ztdr.js → index-795rsz0e.js} +1 -1
  16. package/dist/{index-yjvmjpdn.js → index-pzkzbqbs.js} +12 -11
  17. package/dist/{index-1cfw8mj0.js → index-wfqzwh7k.js} +9 -7
  18. package/dist/index.js +26 -26
  19. package/dist/init.js +10 -10
  20. package/dist/{list-vsecskj1.js → list-6pe1nab5.js} +11 -11
  21. package/dist/models/pack-command-types.d.ts +12 -0
  22. package/dist/{node-vndr59bc.js → node-13wj5mzd.js} +6 -6
  23. package/dist/pack-command-service-j9bqnsn1.js +32 -0
  24. package/dist/{pack-project-re7s480k.js → pack-project-3sdddc42.js} +21 -18
  25. package/dist/pack.js +25 -22
  26. package/dist/{package-id-rx8gq6y2.js → package-id-5j4q232a.js} +3 -3
  27. package/dist/{packager-tool-vgrswa8p.js → packager-tool-1db1wqdy.js} +30 -8
  28. package/dist/{packager-tool-vx2c68sb.js → packager-tool-1dsxhz1r.js} +2 -2
  29. package/dist/{packager-tool-t2r6z24f.js → packager-tool-1tvhgac9.js} +15 -6
  30. package/dist/{packager-tool-4pt71nf1.js → packager-tool-2atxqqgd.js} +49 -24
  31. package/dist/packager-tool-3ft8hywr.js +449 -0
  32. package/dist/{packager-tool-g1c0xdh2.js → packager-tool-46x80z85.js} +8 -4
  33. package/dist/{packager-tool-gjfb0wcy.js → packager-tool-4hm40a32.js} +8 -74
  34. package/dist/{packager-tool-f15an17m.js → packager-tool-5p1vy335.js} +1 -1
  35. package/dist/packager-tool-612prgtc.js +140 -0
  36. package/dist/packager-tool-7gqn5apd.js +72 -0
  37. package/dist/{packager-tool-aws5w512.js → packager-tool-887bkh9y.js} +1 -1
  38. package/dist/{packager-tool-vj88gh5b.js → packager-tool-8tckw03n.js} +28 -9
  39. package/dist/{packager-tool-9vtp28fb.js → packager-tool-93qy1v8m.js} +52 -15
  40. package/dist/{packager-tool-fx4ws49n.js → packager-tool-cenfraf4.js} +2 -2
  41. package/dist/{packager-tool-chff74yz.js → packager-tool-cr1khqtm.js} +103 -166
  42. package/dist/{packager-tool-6tn79r1b.js → packager-tool-da3hvfyn.js} +528 -202
  43. package/dist/{packager-tool-2zn98p5r.js → packager-tool-dd937g7k.js} +4 -4
  44. package/dist/{packager-tool-a7s0gbxs.js → packager-tool-devc4w73.js} +7 -2
  45. package/dist/{packager-tool-v7h8s6yj.js → packager-tool-ewbkaecg.js} +18 -11
  46. package/dist/{packager-tool-d7v4083a.js → packager-tool-g08b669a.js} +22 -18
  47. package/dist/{packager-tool-m07vyk89.js → packager-tool-gb3dq79g.js} +36 -9
  48. package/dist/{packager-tool-395kmy70.js → packager-tool-gmbcn83x.js} +3 -3
  49. package/dist/{packager-tool-btz44ase.js → packager-tool-jhtsana2.js} +119 -52
  50. package/dist/{packager-tool-4rvfxkyh.js → packager-tool-jtg2arr8.js} +20 -8
  51. package/dist/{packager-tool-t39pjz7n.js → packager-tool-jtvhkavz.js} +48 -6
  52. package/dist/packager-tool-kffz64hn.js +279 -0
  53. package/dist/{packager-tool-p5322gew.js → packager-tool-kmwjscby.js} +88 -10
  54. package/dist/{packager-tool-ppj5f4y7.js → packager-tool-n1zrk6zv.js} +4 -2
  55. package/dist/{packager-tool-avrdp2za.js → packager-tool-pmc5txbm.js} +4 -6
  56. package/dist/{packager-tool-egc54x78.js → packager-tool-qhht1tc9.js} +2408 -771
  57. package/dist/{packager-tool-zcqfq3vc.js → packager-tool-qm876ezh.js} +84 -29
  58. package/dist/{packager-tool-resolver-30hxk8vm.js → packager-tool-resolver-y52kztnx.js} +6 -6
  59. package/dist/{packager-tool-3ejz0af8.js → packager-tool-rhg3mwkn.js} +14 -8
  60. package/dist/{packager-tool-ckrt4gyr.js → packager-tool-t9zked1m.js} +3 -3
  61. package/dist/{packager-tool-36w7az7k.js → packager-tool-tat0qs6z.js} +26 -10
  62. package/dist/packager-tool-tf0rn1tp.js +741 -0
  63. package/dist/{packager-tool-p5aar2k0.js → packager-tool-tmba5jv0.js} +140 -10
  64. package/dist/{packager-tool-vk3e239z.js → packager-tool-tqe3m1xp.js} +6 -6
  65. package/dist/{packager-tool-1ctvbx0h.js → packager-tool-tr3ttz5c.js} +1 -1
  66. package/dist/{packager-tool-k9dk39tg.js → packager-tool-txygqgb2.js} +3 -3
  67. package/dist/packager-tool-v6jcys3s.js +46 -0
  68. package/dist/packager-tool-w35s60sx.js +179 -0
  69. package/dist/{packager-tool-axqk17xw.js → packager-tool-xbfr6y2x.js} +142 -34
  70. package/dist/{packager-tool-2qsbh4kd.js → packager-tool-yfcscjfp.js} +50 -12
  71. package/dist/{packager-tool-ay4j9x92.js → packager-tool-ykq6gmhc.js} +19 -8
  72. package/dist/packager-tool.js +2 -2
  73. package/dist/prepare-solution-resources-sk3tyy8b.js +26 -0
  74. package/dist/{project-command-utils-82tja3k0.js → project-command-utils-7ygs8xq0.js} +20 -13
  75. package/dist/project-contributions-nzh06q0y.js +31 -0
  76. package/dist/project-identity-telemetry-47k2g7nq.js +18 -0
  77. package/dist/publish.js +14 -14
  78. package/dist/{resource-mutations-h6wfdqr4.js → resource-mutations-qcz2vcxe.js} +9 -9
  79. package/dist/{resource-version-lookup-xzgnvr48.js → resource-version-lookup-w3kzh4z9.js} +9 -9
  80. package/dist/resource.js +9 -9
  81. package/dist/{restore-command-service-wgqxp5tb.js → restore-command-service-m6c8fb7q.js} +20 -15
  82. package/dist/run-service-cmrzccnm.js +1055 -0
  83. package/dist/services/deploy-activate-service.d.ts +5 -2
  84. package/dist/services/deploy-config-file.d.ts +24 -0
  85. package/dist/services/deploy-delete-service.d.ts +1 -1
  86. package/dist/services/deploy-run-service.d.ts +8 -1
  87. package/dist/services/deploy-uninstall-service.d.ts +4 -2
  88. package/dist/services/deploy-upgrade-service.d.ts +23 -2
  89. package/dist/services/deployment-feed-locator.d.ts +19 -6
  90. package/dist/services/deployment-links.d.ts +16 -0
  91. package/dist/services/deployment-progress.d.ts +10 -0
  92. package/dist/services/deployment-search.d.ts +15 -2
  93. package/dist/services/deployment-state.d.ts +9 -0
  94. package/dist/services/feed-resolver.d.ts +17 -0
  95. package/dist/services/feed-selection.d.ts +59 -0
  96. package/dist/services/folder-runtime-check.d.ts +107 -0
  97. package/dist/services/incomplete-feed-sweep.d.ts +6 -0
  98. package/dist/services/pack-command-service.d.ts +6 -0
  99. package/dist/services/pack-project.d.ts +1 -1
  100. package/dist/services/package-metadata-rewrite.d.ts +13 -0
  101. package/dist/services/personal-workspace-resolver.d.ts +4 -1
  102. package/dist/services/prepare-solution-resources.d.ts +11 -6
  103. package/dist/services/project-contributions.d.ts +26 -2
  104. package/dist/services/project-identity-telemetry.d.ts +31 -0
  105. package/dist/services/solution-members.d.ts +31 -0
  106. package/dist/{ship-telemetry-19gx83af.js → ship-telemetry-9djqndmy.js} +4 -4
  107. package/dist/{solution-auth-jxcgd2m0.js → solution-auth-0e3qm74f.js} +3 -3
  108. package/dist/{solution-definition-helper-tqwd6cxn.js → solution-definition-helper-bkyhs1bd.js} +1 -1
  109. package/dist/{solution-identity-c23d9bfv.js → solution-identity-j63p6n81.js} +4 -4
  110. package/dist/templates/AGENTS.md +131 -24
  111. package/dist/tool.js +26 -26
  112. package/package.json +2 -2
  113. package/dist/deploy-delete-service-dwd4qb1m.js +0 -23
  114. package/dist/deploy-run-service-0kzfrvnn.js +0 -23
  115. package/dist/feed-resolver-w4y5aspe.js +0 -27
  116. package/dist/feed-scope-failure-4ef9zxcx.js +0 -20
  117. package/dist/pack-command-service-k7ebbfya.js +0 -29
  118. package/dist/packager-tool-vrqbbh01.js +0 -182
  119. package/dist/packager-tool-wwzg88qy.js +0 -74
  120. package/dist/prepare-solution-resources-h7zvnncd.js +0 -26
  121. package/dist/project-contributions-xx560n8y.js +0 -27
  122. package/dist/run-service-2rc4we5q.js +0 -506
@@ -1,82 +1,16 @@
1
1
  import {
2
- getFileSystem
3
- } from "./packager-tool-vgrswa8p.js";
2
+ getLoginStatusAsync
3
+ } from "./packager-tool-jtvhkavz.js";
4
4
  import {
5
- CommandDimensions,
6
- ProjectDimensions,
7
- projectKey,
8
- projectIdentityProperties,
9
- PROJECT_IDENTITY_LOOKUP_BUDGET_MS,
10
- withinProjectIdentityBudget,
11
- catchError,
12
- isProjectTelemetryDisabled
13
- } from "./packager-tool-m07vyk89.js";
5
+ catchError
6
+ } from "./packager-tool-gb3dq79g.js";
14
7
  import {
15
8
  logger,
16
- CommonTelemetryEvents,
17
9
  telemetry
18
- } from "./packager-tool-axqk17xw.js";
19
- import {
20
- toolsFactoryRepository
21
- } from "./packager-tool-a7s0gbxs.js";
22
- import {
23
- getLoginStatusAsync
24
- } from "./packager-tool-t39pjz7n.js";
10
+ } from "./packager-tool-xbfr6y2x.js";
25
11
  import {
26
12
  createNodeSolutionPackager
27
- } from "./packager-tool-4rvfxkyh.js";
28
-
29
- // src/services/project-identity-telemetry.ts
30
- function createProjectActivityObserver(commandName) {
31
- if (isProjectTelemetryDisabled())
32
- return;
33
- const properties = new Map;
34
- const finished = new Set;
35
- return async (project, phase, success, solutionId) => {
36
- if (project.Type !== "Api")
37
- return;
38
- const member = project.Id;
39
- if (phase === "before") {
40
- if (properties.has(member))
41
- return;
42
- const membership = {
43
- [ProjectDimensions.SolutionProjectKey]: projectKey(member),
44
- ...solutionId ? {
45
- [ProjectDimensions.SolutionKey]: projectKey(solutionId)
46
- } : {}
47
- };
48
- const row = (status, id) => ({
49
- ...projectIdentityProperties({
50
- projectType: project.Type,
51
- status,
52
- ...id ? { id } : {}
53
- }),
54
- ...membership
55
- });
56
- const factory = toolsFactoryRepository.canHandleProject(project.Type) ? toolsFactoryRepository.getProjectToolFactory(project.Type) : undefined;
57
- if (!factory?.readProjectIdentityAsync || !project.ProjectPath) {
58
- properties.set(member, row("unsupported"));
59
- return;
60
- }
61
- properties.set(member, row("timeout"));
62
- let descriptor;
63
- try {
64
- descriptor = await withinProjectIdentityBudget(factory.readProjectIdentityAsync(project.ProjectPath, getFileSystem()), () => logger.debug(`project activity identity skipped: no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
65
- } catch {
66
- descriptor = { status: "invalid" };
67
- }
68
- if (descriptor && !finished.has(member))
69
- properties.set(member, row(descriptor.status, descriptor.id));
70
- } else if (!finished.has(member)) {
71
- finished.add(member);
72
- telemetry.trackEvent(CommonTelemetryEvents.ProjectActivity, {
73
- ...properties.get(member),
74
- [CommandDimensions.CommandName]: commandName,
75
- [CommandDimensions.TerminalOutcome]: success ? "success" : "failure"
76
- });
77
- }
78
- };
79
- }
13
+ } from "./packager-tool-jtg2arr8.js";
80
14
 
81
15
  // src/services/solution-packager-helpers.ts
82
16
  async function createSolutionPackager() {
@@ -170,6 +104,6 @@ async function checkSolutionPathAsync(fs, solutionPath) {
170
104
  return { ok: true, absoluteSolutionPath, isUisFile, stats };
171
105
  }
172
106
 
173
- export { createProjectActivityObserver, createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, SOLUTION_PATH_INSTRUCTIONS, checkSolutionPathAsync };
107
+ export { createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, SOLUTION_PATH_INSTRUCTIONS, checkSolutionPathAsync };
174
108
 
175
- //# debugId=ACC079943269204C64756E2164756E21
109
+ //# debugId=C0E9E22DEDE6224364756E2164756E21
@@ -9,7 +9,7 @@ import {
9
9
  ProjectTool,
10
10
  SolutionTool,
11
11
  toolsFactoryRepository
12
- } from "./packager-tool-a7s0gbxs.js";
12
+ } from "./packager-tool-devc4w73.js";
13
13
 
14
14
  // ../packager/packager-tool-connector/src/connector-tool.ts
15
15
  class ConnectorTool extends ProjectTool {
@@ -0,0 +1,140 @@
1
+ import {
2
+ catchError,
3
+ extractErrorDetails
4
+ } from "./packager-tool-gb3dq79g.js";
5
+ import {
6
+ isGuid
7
+ } from "./packager-tool-xbfr6y2x.js";
8
+ import {
9
+ classifyFeedSession2,
10
+ feedSessionRefusal2,
11
+ feedSessionRefusalAsync2
12
+ } from "./packager-tool-tqe3m1xp.js";
13
+ import {
14
+ readDeploymentByKeyAsync2
15
+ } from "./packager-tool-rhg3mwkn.js";
16
+ import {
17
+ feedScopeInitOverride2,
18
+ describeFeedResolutionFailureAsync2,
19
+ resolveFeedScope2
20
+ } from "./packager-tool-ewbkaecg.js";
21
+
22
+ // src/services/feed-selection.ts
23
+ async function resolveFeedSelectionAsync(auth, flags, action) {
24
+ if (!flags.personalWorkspace && flags.feed === undefined) {
25
+ return { ok: true };
26
+ }
27
+ if (flags.personalWorkspace) {
28
+ const refusal = refuseUnlessUser(auth, `${action} in a Personal Workspace`);
29
+ if (refusal) {
30
+ return refusal;
31
+ }
32
+ }
33
+ const [scopeError, scope] = await catchError(resolveFeedScope2({
34
+ personalWorkspace: flags.personalWorkspace,
35
+ feed: flags.feed,
36
+ tenant: flags.tenant,
37
+ loginValidity: flags.loginValidity,
38
+ envFilePath: flags.envFilePath
39
+ }));
40
+ if (scopeError) {
41
+ const failure = await describeFeedResolutionFailureAsync2(scopeError, flags, auth);
42
+ return {
43
+ ok: false,
44
+ reason: "feed_resolution_failed",
45
+ message: failure.message,
46
+ instructions: failure.instructions,
47
+ errorCode: failure.errorCode,
48
+ retry: failure.retry
49
+ };
50
+ }
51
+ if (scope.kind !== "tenant") {
52
+ const feedAction = `${action} in the feed '${scope.name ?? scope.folderKey}'`;
53
+ const refusal = scope.folderKey ? await feedSessionRefusalAsync2(auth, scope.folderKey, "write", feedAction, ALTERNATIVE) : feedSessionRefusalForUserOnly(auth, feedAction);
54
+ if (refusal) {
55
+ return toRefusal(refusal);
56
+ }
57
+ }
58
+ return { ok: true, selectedFeed: scope };
59
+ }
60
+ var ALTERNATIVE = "drop the feed flag to act on a tenant-feed deployment";
61
+ function toRefusal(refusal) {
62
+ return {
63
+ ok: false,
64
+ reason: "feed_requires_user_session",
65
+ message: refusal.message,
66
+ instructions: refusal.instructions,
67
+ errorCode: "permission_denied",
68
+ retry: "RetryWillNotFix"
69
+ };
70
+ }
71
+ function feedSessionRefusalForUserOnly(auth, action) {
72
+ const verdict = classifyFeedSession2(auth);
73
+ return verdict === "user" ? undefined : feedSessionRefusal2(verdict, action, ALTERNATIVE);
74
+ }
75
+ function refuseUnlessUser(auth, action) {
76
+ const refusal = feedSessionRefusalForUserOnly(auth, action);
77
+ return refusal ? toRefusal(refusal) : undefined;
78
+ }
79
+ function missingDeploymentMessage(reference) {
80
+ return isGuid(reference) ? `No deployment with the key or name '${reference}' was found` : `No deployment named '${reference}' was found`;
81
+ }
82
+ async function resolveDeploymentTargetAsync(auth, reference, flags, action) {
83
+ const selection = await resolveFeedSelectionAsync(auth, flags, action);
84
+ if (!selection.ok) {
85
+ return selection;
86
+ }
87
+ const byName = {
88
+ ok: true,
89
+ deploymentName: reference,
90
+ selectedFeed: selection.selectedFeed
91
+ };
92
+ if (!isGuid(reference)) {
93
+ return byName;
94
+ }
95
+ const [readError, record] = await catchError(readDeploymentByKeyAsync2(auth, reference, {
96
+ scope: selection.selectedFeed ? feedScopeInitOverride2(selection.selectedFeed) : undefined
97
+ }));
98
+ if (readError) {
99
+ const detail = await extractErrorDetails(readError);
100
+ return {
101
+ ok: false,
102
+ reason: "lookup_failed",
103
+ message: `Could not read deployment key '${reference}': ${detail.message}`,
104
+ instructions: `${detail.retry === "RetryLater" ? "Retry once the service answers, or pass" : "Pass"} the deployment's name instead (run 'uip solution deploy list' to see it). Details: ${detail.details}`,
105
+ errorCode: detail.errorCode,
106
+ retry: detail.retry
107
+ };
108
+ }
109
+ if (!record) {
110
+ return byName;
111
+ }
112
+ const resolved = {
113
+ deploymentName: record.deploymentName,
114
+ deploymentKey: record.deploymentKey,
115
+ ...record.source === "pipelines" ? { currentKey: record.deploymentKey } : {}
116
+ };
117
+ if (record.locationKey === undefined) {
118
+ return {
119
+ ok: true,
120
+ ...resolved,
121
+ selectedFeed: selection.selectedFeed ?? { kind: "tenant" }
122
+ };
123
+ }
124
+ if (record.locationKey === null) {
125
+ return { ok: true, ...resolved, selectedFeed: { kind: "tenant" } };
126
+ }
127
+ const refusal = await feedSessionRefusalAsync2(auth, record.locationKey, "write", `${action} in the feed '${record.locationKey}'`, "act on a tenant-feed deployment");
128
+ if (refusal) {
129
+ return toRefusal(refusal);
130
+ }
131
+ return {
132
+ ok: true,
133
+ ...resolved,
134
+ selectedFeed: { kind: "folder", folderKey: record.locationKey }
135
+ };
136
+ }
137
+
138
+ export { missingDeploymentMessage, resolveDeploymentTargetAsync };
139
+
140
+ //# debugId=DD6227F78A967DCB64756E2164756E21
@@ -0,0 +1,72 @@
1
+ // ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/error-codes.js
2
+ var ErrorCodes = {
3
+ UnknownException: "0000",
4
+ AuthorizationException: "0004",
5
+ AuthenticationFailed: "0004",
6
+ ResourceNotFound: "1000",
7
+ FolderNotFound: "1001",
8
+ ResourcesNotFound: "1002",
9
+ ResourceLinkRemovedFromSource: "1003",
10
+ ImportCancelled: "1005",
11
+ InvalidBindings: "1006",
12
+ FileNotFound: "1008",
13
+ BindingsFileNotFound: "1010",
14
+ BindingsResourceCannotBeOverridden: "1011",
15
+ BindingsResourceNotFound: "1012",
16
+ NullOrEmptyAccessToken: "1013",
17
+ InvalidInput: "InvalidInput",
18
+ InvalidConfiguration: "InvalidConfiguration",
19
+ Resources: {
20
+ InvalidApiVersion: "2001",
21
+ InvalidName: "2002",
22
+ DuplicateProperties: "2003",
23
+ DuplicateResourceName: "2004",
24
+ PropertyIsRequired: "2005",
25
+ ChoiceTypeMissingOrInvalid: "2006",
26
+ InvalidPropertyType: "2007",
27
+ InvalidEnumValue: "2008",
28
+ InvalidChoiceValue: "2009",
29
+ RegularExpressionDoesNotMatch: "2010",
30
+ InvalidMultiselectValue: "2011",
31
+ ValueOutOfRange: "2012",
32
+ DeletingHiddenResourceIsNotAllowed: "2013",
33
+ InvalidResourceMetadataIdentifier: "2014",
34
+ DeletingProjectArtefactResourceIsNotAllowed: "2015",
35
+ ResourceHasNoFile: "2017",
36
+ InvalidResourceType: "2018",
37
+ DeletingResourceThatIsReferencedByOtherResourcesIsNotAllowed: "2019",
38
+ SyncingProcessArtefactResourceIsNotAllowed: "2020",
39
+ MissingDependencies: "2021",
40
+ MissingFileDependencies: "2022",
41
+ ResourceAttributeMismatch: "2023",
42
+ AppSystemNameConflict: "2024",
43
+ InvalidResourceFile: "2025",
44
+ DuplicatePackageName: "2026",
45
+ TooManySearchKinds: "2027",
46
+ SearchTypesWithSeveralKinds: "2028",
47
+ ResourceNotFound: "1000",
48
+ ResourceAlreadyExists: "Resources.ResourceAlreadyExists",
49
+ ResourceDependencyNotFound: "Resources.ResourceDependencyNotFound",
50
+ FileDependencyNotFound: "Resources.FileDependencyNotFound",
51
+ PropertyInvalidFormat: "Resources.PropertyInvalidFormat",
52
+ PropertyInvalidValue: "Resources.PropertyInvalidValue"
53
+ },
54
+ Solutions: {
55
+ ConfigurationNotFound: "3002",
56
+ SolutionNotFound: "3001",
57
+ SolutionInvalidState: "Solution.SolutionInvalidState",
58
+ SolutionReadOnly: "Solution.SolutionReadOnly"
59
+ },
60
+ Metadata: {
61
+ ResourceMetadataNotFound: "5001"
62
+ },
63
+ Project: {
64
+ ProjectNotFound: "Project.ProjectNotFound",
65
+ ProjectAlreadyExists: "Project.ProjectAlreadyExists",
66
+ ProjectInvalidType: "Project.ProjectInvalidType"
67
+ }
68
+ };
69
+
70
+ export { ErrorCodes };
71
+
72
+ //# debugId=9766D98EF545F5F664756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  catchError
3
- } from "./packager-tool-m07vyk89.js";
3
+ } from "./packager-tool-gb3dq79g.js";
4
4
 
5
5
  // src/services/governance-options.ts
6
6
  var GOVERNANCE_OPTION_INSTRUCTIONS2 = "Pass a value for that option — a policy file path for --governance-file-path, " + "or a product such as StudioWeb for --governance-product — or drop the flag " + "to analyze with the rules shipped with the WorkflowCompiler.";
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./packager-tool-vgrswa8p.js";
3
+ } from "./packager-tool-1db1wqdy.js";
4
4
  import {
5
5
  catchError,
6
6
  extractErrorDetails
7
- } from "./packager-tool-m07vyk89.js";
7
+ } from "./packager-tool-gb3dq79g.js";
8
8
  import {
9
9
  logger,
10
10
  PollOutcome,
11
11
  mapPollFailure,
12
12
  pollUntil
13
- } from "./packager-tool-axqk17xw.js";
13
+ } from "./packager-tool-xbfr6y2x.js";
14
14
  import {
15
15
  Configuration2,
16
16
  PipelinesApi,
17
17
  feedSessionRefusalAsync2
18
- } from "./packager-tool-vk3e239z.js";
18
+ } from "./packager-tool-tqe3m1xp.js";
19
19
  import {
20
20
  getSolutionAuthContext2
21
- } from "./packager-tool-ppj5f4y7.js";
21
+ } from "./packager-tool-n1zrk6zv.js";
22
22
  import {
23
23
  strToU82,
24
24
  strFromU82,
@@ -29,10 +29,10 @@ import {
29
29
  feedScopeInitOverride2,
30
30
  describeFeedResolutionFailureAsync2,
31
31
  resolveFeedScope2
32
- } from "./packager-tool-v7h8s6yj.js";
32
+ } from "./packager-tool-ewbkaecg.js";
33
33
  import {
34
34
  capturePackedSolutionIdentity2
35
- } from "./packager-tool-ckrt4gyr.js";
35
+ } from "./packager-tool-t9zked1m.js";
36
36
 
37
37
  // src/services/package-metadata-rewrite.ts
38
38
  import { randomUUID } from "node:crypto";
@@ -40,6 +40,25 @@ var SOLUTION_METADATA_ENTRY = "solutionMetadata.json";
40
40
  function isRecord(value) {
41
41
  return typeof value === "object" && value !== null && !Array.isArray(value);
42
42
  }
43
+ var GUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
44
+ var MAX_SOLUTION_METADATA_BYTES = 1024 * 1024;
45
+ function readPackedSolutionId(archive) {
46
+ try {
47
+ const entries = unzipSync2(archive, {
48
+ filter: (entry) => entry.name === SOLUTION_METADATA_ENTRY && entry.originalSize <= MAX_SOLUTION_METADATA_BYTES
49
+ });
50
+ const metadataBytes = entries[SOLUTION_METADATA_ENTRY];
51
+ if (!metadataBytes)
52
+ return;
53
+ const parsed = JSON.parse(strFromU82(metadataBytes));
54
+ if (!isRecord(parsed) || !isRecord(parsed.spec))
55
+ return;
56
+ const projectKey = parsed.spec.projectKey;
57
+ return typeof projectKey === "string" && GUID_PATTERN.test(projectKey.trim()) ? projectKey.trim() : undefined;
58
+ } catch {
59
+ return;
60
+ }
61
+ }
43
62
  var requireValue = (value, flag) => {
44
63
  const trimmed = value.trim();
45
64
  if (!trimmed) {
@@ -364,6 +383,6 @@ async function mapUploadError(uploadError) {
364
383
  };
365
384
  }
366
385
 
367
- export { publishSolutionAsync2 };
386
+ export { readPackedSolutionId, publishSolutionAsync2 };
368
387
 
369
- //# debugId=44E9C2005B30FB6B64756E2164756E21
388
+ //# debugId=BF8F50CBC88CAD7064756E2164756E21
@@ -1,24 +1,25 @@
1
1
  import {
2
2
  catchError,
3
+ RESULTS,
3
4
  addSdkUserAgentHeader
4
- } from "./packager-tool-m07vyk89.js";
5
+ } from "./packager-tool-gb3dq79g.js";
5
6
  import {
6
7
  ResponseError,
7
8
  SDK_USER_AGENT
8
- } from "./packager-tool-g1c0xdh2.js";
9
+ } from "./packager-tool-46x80z85.js";
9
10
  import {
10
11
  redactTokens,
11
12
  parseAuthChallenge,
12
- RESULTS,
13
13
  summarizePlatformBody,
14
14
  logger
15
- } from "./packager-tool-axqk17xw.js";
15
+ } from "./packager-tool-xbfr6y2x.js";
16
16
  import {
17
17
  zipSync2
18
18
  } from "./packager-tool-rj2d1g0w.js";
19
19
  import {
20
- readUipxFile
21
- } from "./packager-tool-p5322gew.js";
20
+ readUipxFile,
21
+ hasUnsafeNameChars
22
+ } from "./packager-tool-kmwjscby.js";
22
23
  import {
23
24
  __toESM,
24
25
  __commonJS
@@ -1637,6 +1638,24 @@ function assertStudioWebCompatibleProjects(projects) {
1637
1638
  throw new StudioWebIncompatibleProjectError2(incompatible.map((p) => p.ProjectRelativePath));
1638
1639
  }
1639
1640
  }
1641
+ var MAX_NAMED_PATHS = 20;
1642
+
1643
+ class StudioWebInvalidFileNameError2 extends Error {
1644
+ offendingPaths;
1645
+ constructor(offendingPaths) {
1646
+ const named = offendingPaths.slice(0, MAX_NAMED_PATHS).join(", ");
1647
+ const more = offendingPaths.length - MAX_NAMED_PATHS;
1648
+ super(`Studio Web cannot import a project file whose name holds a control character or any of : * ? " < > |: ${named}${more > 0 ? `, and ${more} more` : ""}.`);
1649
+ this.offendingPaths = offendingPaths;
1650
+ this.name = "StudioWebInvalidFileNameError";
1651
+ }
1652
+ }
1653
+ function assertStudioWebValidFileNames(projectFilePaths) {
1654
+ const invalid = projectFilePaths.filter((p) => hasUnsafeNameChars(p.replace(/\\/g, "/").split("/").pop() ?? ""));
1655
+ if (invalid.length > 0) {
1656
+ throw new StudioWebInvalidFileNameError2(invalid);
1657
+ }
1658
+ }
1640
1659
 
1641
1660
  // ../solution-sdk/src/zip-utils.ts
1642
1661
  var import_ignore = __toESM(require_ignore(), 1);
@@ -1857,14 +1876,16 @@ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
1857
1876
  if (rootRel) {
1858
1877
  await fs.mkdir(fs.path.join(destBaseDir, rootRel));
1859
1878
  }
1860
- return;
1879
+ return [];
1861
1880
  }
1881
+ const copied = [];
1862
1882
  for (const f of files) {
1863
1883
  const relPath = fs.path.relative(relativeBase, f);
1864
1884
  const destPath = fs.path.join(destBaseDir, relPath);
1865
1885
  const data = await fs.readFile(f);
1866
1886
  if (data) {
1867
1887
  await fs.writeFile(destPath, data);
1888
+ copied.push(f);
1868
1889
  } else {
1869
1890
  logger.warn(`Skipping empty or unreadable file: ${f}`);
1870
1891
  }
@@ -1876,9 +1897,11 @@ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
1876
1897
  }
1877
1898
  await fs.mkdir(fs.path.join(destBaseDir, relPath));
1878
1899
  }
1900
+ return copied;
1879
1901
  }
1880
1902
  async function flattenProjectDir(fs, srcProjectDir, destProjectDir, ignoreRules) {
1881
1903
  await fs.mkdir(destProjectDir);
1904
+ const copied = [];
1882
1905
  const entries = await fs.readdir(srcProjectDir);
1883
1906
  for (const entryName of entries) {
1884
1907
  const srcPath = fs.path.join(srcProjectDir, entryName);
@@ -1893,18 +1916,20 @@ async function flattenProjectDir(fs, srcProjectDir, destProjectDir, ignoreRules)
1893
1916
  const data = await fs.readFile(srcPath);
1894
1917
  if (data) {
1895
1918
  await fs.writeFile(fs.path.join(destProjectDir, entryName), data);
1919
+ copied.push(srcPath);
1896
1920
  }
1897
1921
  } else if (entryStat.isDirectory()) {
1898
1922
  if (DEFAULT_EXCLUDED_DIR_NAMES.has(entryName) || isIgnoredByRules(fs, ignoreRules, srcPath, true)) {
1899
1923
  continue;
1900
1924
  }
1901
- if (entryName === "content" || entryName === "flow_files") {
1902
- await mirrorTree(fs, srcPath, srcPath, destProjectDir, ignoreRules);
1903
- } else {
1904
- await mirrorTree(fs, srcPath, srcProjectDir, destProjectDir, ignoreRules);
1925
+ const relativeBase = entryName === "content" || entryName === "flow_files" ? srcPath : srcProjectDir;
1926
+ const mirrored = await mirrorTree(fs, srcPath, relativeBase, destProjectDir, ignoreRules);
1927
+ for (const f of mirrored) {
1928
+ copied.push(f);
1905
1929
  }
1906
1930
  }
1907
1931
  }
1932
+ return copied;
1908
1933
  }
1909
1934
  async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
1910
1935
  const resolvedPath = fs.path.resolve(solutionDir);
@@ -1939,6 +1964,7 @@ async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
1939
1964
  try {
1940
1965
  await fs.writeFile(fs.path.join(stagingDir, "SolutionStorage.json"), JSON.stringify(solutionStorage));
1941
1966
  await fs.writeFile(fs.path.join(stagingDir, uipxFileName), JSON.stringify(uipx));
1967
+ const projectFiles = [];
1942
1968
  for (const project of uipx.Projects) {
1943
1969
  const projectDir = fs.path.dirname(project.ProjectRelativePath);
1944
1970
  const srcProjectPath = fs.path.join(resolvedPath, projectDir);
@@ -1951,8 +1977,12 @@ async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
1951
1977
  if (isIgnoredByRules(fs, projectRules, manifestPath, false)) {
1952
1978
  throw new UipignoreExcludesProjectError2(project.ProjectRelativePath);
1953
1979
  }
1954
- await flattenProjectDir(fs, srcProjectPath, fs.path.join(stagingDir, projectDir), projectRules);
1980
+ const copied = await flattenProjectDir(fs, srcProjectPath, fs.path.join(stagingDir, projectDir), projectRules);
1981
+ for (const f of copied) {
1982
+ projectFiles.push(toForwardSlash(fs.path.relative(resolvedPath, f)));
1983
+ }
1955
1984
  }
1985
+ assertStudioWebValidFileNames(projectFiles);
1956
1986
  const resourcesPath = fs.path.join(resolvedPath, "resources");
1957
1987
  if (!isTopLevelTreeExcluded(resourcesPath, "resources") && await fs.exists(resourcesPath)) {
1958
1988
  await mirrorTree(fs, resourcesPath, resolvedPath, stagingDir, solutionRules);
@@ -2130,6 +2160,7 @@ function buildAuthRefusalInstructions({
2130
2160
  const closing = bodySuffix ? `If the grants and the tenant are already right, report the platform ` + `response, including its traceId.${bodySuffix}` : challenge.error ? `If the grants and the tenant are already right, report that reason ` + `together with the request path and status above.` : `If the grants and the tenant are already right, report the request ` + `path and status above — Studio Web returned no response body and ` + `no authentication challenge, so there is nothing further to quote.`;
2131
2161
  return `Studio Web ${refusal} while ${what}. ${diagnosis}${actor}${tenant}` + `Nothing was uploaded and nothing ran, so the ${subject} is not the ` + `cause. ${closing}`;
2132
2162
  }
2163
+ var INVALID_FILE_NAME_ERROR_CODE = "20039";
2133
2164
  function buildSolutionUploadFailureOutput2(err, options = {}) {
2134
2165
  const stage = err.operation === "overwrite" ? "overwrite-solution" : "import-solution";
2135
2166
  const authRefusal = isAuthRefusal(err.status);
@@ -2150,7 +2181,8 @@ function buildSolutionUploadFailureOutput2(err, options = {}) {
2150
2181
  identityType: options.identityType,
2151
2182
  clientId: options.clientId
2152
2183
  }) : undefined;
2153
- const Instructions = authInstructions ?? (err.operation === "overwrite" ? `Studio Web refused to replace the contents of solution ` + `${target}. Nothing was uploaded and nothing ran, so the ` + `${subject} is not the cause: do not re-author it, and do not ` + `copy the project into another solution. Confirm that ${target} ` + `is a solution you can still write to, and that it is the one ` + `this project should publish to — it comes from the SolutionId ` + `recorded in the enclosing solution file. If it is right, report ` + `the platform response.${bodySuffix}` : `Studio Web refused to import the solution package. Nothing was ` + `uploaded and nothing ran, so no part of the ${subject} executed ` + `— but the package itself may be what was rejected.${importHint} ` + `Report the platform response if the ${subject} is ` + `well-formed.${bodySuffix}`);
2184
+ const invalidFileName = err.parsedErrorCode === INVALID_FILE_NAME_ERROR_CODE;
2185
+ const Instructions = authInstructions ?? (invalidFileName ? `Studio Web refused a file name in the uploaded solution ` + `package: a file inside a project folder has a name holding a ` + `control character or one of : * ? " < > |, and the platform ` + `does not say which file. Rename that file, or move it out ` + `of the project folder, and upload again. Retrying ` + `unchanged fails the same way.${bodySuffix}` : err.operation === "overwrite" ? `Studio Web refused to replace the contents of solution ` + `${target}. Nothing was uploaded and nothing ran, so the ` + `${subject} is not the cause: do not re-author it, and do not ` + `copy the project into another solution. Confirm that ${target} ` + `is a solution you can still write to, and that it is the one ` + `this project should publish to — it comes from the SolutionId ` + `recorded in the enclosing solution file. If it is right, report ` + `the platform response.${bodySuffix}` : `Studio Web refused to import the solution package. Nothing was ` + `uploaded and nothing ran, so no part of the ${subject} executed ` + `— but the package itself may be what was rejected.${importHint} ` + `Report the platform response if the ${subject} is ` + `well-formed.${bodySuffix}`);
2154
2186
  const Context = {
2155
2187
  httpStatus: err.status,
2156
2188
  stage,
@@ -2169,6 +2201,11 @@ function buildSolutionUploadFailureOutput2(err, options = {}) {
2169
2201
  if (err.status === 401 && options.identityType === "Application") {
2170
2202
  output.ErrorCode = "permission_denied";
2171
2203
  }
2204
+ if (invalidFileName) {
2205
+ output.ErrorCode = "invalid_argument";
2206
+ output.Retry = "RetryWillNotFix";
2207
+ return output;
2208
+ }
2172
2209
  if (err.operation === "overwrite" && err.status >= 500 && err.status < 600) {
2173
2210
  output.Retry = "RetryAfter30Seconds";
2174
2211
  }
@@ -2288,6 +2325,6 @@ async function overwriteSolution2(config, organizationName, fileBuffer, fileName
2288
2325
  }
2289
2326
  return await response.json();
2290
2327
  }
2291
- export { getAvailablePublishLocationsV22, StudioWebIncompatibleProjectError2, UipignoreExcludesProjectError2, bundleSolution2, isDebugProvisioningTerminal2, isDebugProvisioningSucceeded2, getProjectDebugStatus2, getStudioWebSolutionProjects2, listStudioWebSolutions2, isSolutionUploadHttpError2, buildSolutionUploadFailureOutput2, solutionExistsOnStudioWeb2, importSolution2, overwriteSolution2 };
2328
+ export { getAvailablePublishLocationsV22, StudioWebIncompatibleProjectError2, StudioWebInvalidFileNameError2, UipignoreExcludesProjectError2, bundleSolution2, isDebugProvisioningTerminal2, isDebugProvisioningSucceeded2, getProjectDebugStatus2, getStudioWebSolutionProjects2, listStudioWebSolutions2, isSolutionUploadHttpError2, buildSolutionUploadFailureOutput2, solutionExistsOnStudioWeb2, importSolution2, overwriteSolution2 };
2292
2329
 
2293
- //# debugId=93F6A3F6E5495ACA64756E2164756E21
2330
+ //# debugId=9EDD6B0BB2F87F8864756E2164756E21
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./packager-tool-vgrswa8p.js";
3
+ } from "./packager-tool-1db1wqdy.js";
4
4
  import {
5
5
  catchError
6
- } from "./packager-tool-m07vyk89.js";
6
+ } from "./packager-tool-gb3dq79g.js";
7
7
 
8
8
  // src/services/solution-init-service.ts
9
9
  var AGENTS_FILENAME = "AGENTS.md";