@uipath/solution-tool 1.205.0-preview.281 → 1.206.0-preview.279
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.
- package/dist/{archive-extract-x35t9ktj.js → archive-extract-136rn3ja.js} +13 -15
- package/dist/{cleanup-command-service-je9d70vv.js → cleanup-command-service-ejakyhea.js} +34 -31
- package/dist/deploy-delete-service-r7abfh28.js +23 -0
- package/dist/deploy-run-service-rnthz10q.js +23 -0
- package/dist/{deploy-status-service-919yn8wn.js → deploy-status-service-6my5vm61.js} +72 -62
- package/dist/deploy.js +35 -37
- package/dist/deployment-search-gfm907tx.js +54 -0
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/feed-resolver-14crsx5y.js +27 -0
- package/dist/feed-scope-failure-67cyybn0.js +20 -0
- package/dist/feed-session-g94q2bjc.js +23 -0
- package/dist/first-party-service-n3vva2m4.js +8 -0
- package/dist/governance-options-t20vsznh.js +19 -0
- package/dist/index-aspmac9f.js +24 -0
- package/dist/index-ddk6v1ej.js +60 -0
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-qq4kre7a.js +93 -0
- package/dist/index-t262f2xv.js +16 -0
- package/dist/index.js +33 -34
- package/dist/init.js +18 -21
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{list-5fke71jn.js → list-jntan9tx.js} +23 -23
- package/dist/models/pack-command-types.d.ts +3 -1
- package/dist/node-kwzcw5ex.js +25 -0
- package/dist/pack-command-service-pwaeha7y.js +29 -0
- package/dist/{pack-project-ha0pxw3h.js → pack-project-ztt1hfrs.js} +33 -40
- package/dist/pack.js +26 -30
- package/dist/package-id-4tsg5jsb.js +11 -0
- package/dist/{packager-tool-4pa108k7.js → packager-tool-1bz9h5ca.js} +11 -11
- package/dist/{packager-tool-gs3f3tf7.js → packager-tool-1ctvbx0h.js} +1 -1
- package/dist/{packager-tool-f23a485e.js → packager-tool-55ztfccd.js} +176 -196
- package/dist/{packager-tool-45a8fkw0.js → packager-tool-95y24705.js} +37 -39
- package/dist/{packager-tool-2vmz56qh.js → packager-tool-9j8e5q1z.js} +184 -33
- package/dist/{packager-tool-tx834spe.js → packager-tool-9vrwpgt3.js} +757 -309
- package/dist/packager-tool-a6va4gc5.js +1178 -0
- package/dist/{packager-tool-pbmqk39a.js → packager-tool-a7s0gbxs.js} +33 -28
- package/dist/{packager-tool-47wzvqw0.js → packager-tool-aws5w512.js} +6 -6
- package/dist/{packager-tool-97rcgwvv.js → packager-tool-bs1jn1yn.js} +331 -55
- package/dist/packager-tool-c64hqa8n.js +106 -0
- package/dist/{packager-tool-5ddtwzva.js → packager-tool-ca5ngmqv.js} +12 -12
- package/dist/{packager-tool-6kz1pv9f.js → packager-tool-d1texmvn.js} +828 -338
- package/dist/{packager-tool-1de529jm.js → packager-tool-epsr41wx.js} +12 -3
- package/dist/packager-tool-f84z7nds.js +130 -0
- package/dist/{packager-tool-8ptbmmmp.js → packager-tool-fp46ebde.js} +147 -76
- package/dist/packager-tool-fqs6hdcy.js +290 -0
- package/dist/{packager-tool-3bwnkjdq.js → packager-tool-fx4ws49n.js} +12 -12
- package/dist/{packager-tool-6ybywxxn.js → packager-tool-m07vyk89.js} +371 -221
- package/dist/{packager-tool-gyqfs04e.js → packager-tool-nrhqgr4z.js} +273 -255
- package/dist/{packager-tool-61pwb567.js → packager-tool-ppj5f4y7.js} +6 -7
- package/dist/{packager-tool-d78ww4hb.js → packager-tool-pyt9fvty.js} +51 -48
- package/dist/packager-tool-q5d9df2q.js +74 -0
- package/dist/{packager-tool-cvf46scg.js → packager-tool-q8ryk6q9.js} +122 -89
- package/dist/{packager-tool-t8gh825q.js → packager-tool-qf8753ee.js} +53 -41
- package/dist/{packager-tool-60af1hw2.js → packager-tool-qzcd5c9s.js} +3 -3
- package/dist/packager-tool-resolver-td3bhccd.js +20 -0
- package/dist/{packager-tool-dfrk01gn.js → packager-tool-rj2d1g0w.js} +154 -154
- package/dist/{packager-tool-2t72aez8.js → packager-tool-snm6s7b5.js} +15 -15
- package/dist/{packager-tool-43ahv5mn.js → packager-tool-t39pjz7n.js} +35 -18
- package/dist/{packager-tool-wm0jaz7p.js → packager-tool-t3a48ys5.js} +305 -657
- package/dist/{packager-tool-dnrk1gg6.js → packager-tool-t3ahzjh1.js} +356 -298
- package/dist/{packager-tool-v1f5e8t9.js → packager-tool-vgrswa8p.js} +53 -8
- package/dist/packager-tool-vrtabg73.js +2307 -0
- package/dist/{packager-tool-gmwva4yv.js → packager-tool-vx2c68sb.js} +2 -2
- package/dist/{packager-tool-h1tq7bqf.js → packager-tool-vx39dhvn.js} +65 -35
- package/dist/{packager-tool-5qzgdb66.js → packager-tool-w34wyhwf.js} +13 -15
- package/dist/packager-tool-w8bcwfd3.js +280 -0
- package/dist/{packager-tool-1ybnxbp9.js → packager-tool-wm0h0wa1.js} +18 -18
- package/dist/{packager-tool-b2nhscfk.js → packager-tool-wm8nj6e9.js} +18 -18
- package/dist/{packager-tool-amhyxzz6.js → packager-tool-x33sdw6n.js} +16 -16
- package/dist/{packager-tool-wy4fx250.js → packager-tool-yetmzme9.js} +89 -30
- package/dist/{packager-tool-056k8w2f.js → packager-tool-z5r49ky9.js} +75 -9
- package/dist/packager-tool.js +6 -7
- package/dist/prepare-solution-resources-pwnyvtza.js +26 -0
- package/dist/{project-command-utils-t6pmpvq3.js → project-command-utils-zcmbecfy.js} +23 -26
- package/dist/project-contributions-kh9yftvg.js +27 -0
- package/dist/publish.js +17 -17
- package/dist/resource-mutations-mfn5k1hb.js +27 -0
- package/dist/{resource-version-lookup-0e3e2j58.js → resource-version-lookup-6ejh1hwd.js} +20 -23
- package/dist/resource.js +13 -16
- package/dist/{restore-command-service-pzpet021.js → restore-command-service-n880dxre.js} +37 -34
- package/dist/{run-service-hk8w2h31.js → run-service-4vhn6mtb.js} +144 -66
- package/dist/services/deploy-activate-service.d.ts +2 -1
- package/dist/services/deployment-search-client.d.ts +2 -1
- package/dist/services/deployment-search.d.ts +39 -0
- package/dist/services/feed-resolver.d.ts +13 -1
- package/dist/services/feed-selection.d.ts +8 -5
- package/dist/services/feed-session.d.ts +34 -0
- package/dist/services/install-run.d.ts +92 -0
- package/dist/services/prepare-solution-resources.d.ts +11 -2
- package/dist/services/project-contributions.d.ts +2 -0
- package/dist/services/project-identity-telemetry.d.ts +3 -0
- package/dist/services/publish-service.d.ts +20 -3
- package/dist/services/solution-identity.d.ts +18 -0
- package/dist/ship-telemetry-bkf3800w.js +16 -0
- package/dist/solution-auth-jxcgd2m0.js +10 -0
- package/dist/solution-identity-92h2fbpa.js +19 -0
- package/dist/templates/AGENTS.md +27 -29
- package/dist/tool.js +32 -33
- package/package.json +2 -2
- package/dist/deploy-delete-service-0tm600d1.js +0 -25
- package/dist/deploy-run-service-hne5w17k.js +0 -25
- package/dist/deployment-search-32zvxn35.js +0 -55
- package/dist/feed-resolver-pdeb4wkq.js +0 -28
- package/dist/feed-scope-failure-4baame72.js +0 -19
- package/dist/feed-session-7xqphdrg.js +0 -17
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/governance-options-bqgv5fte.js +0 -32
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-prm27bvm.js +0 -138
- package/dist/index-wdndcwab.js +0 -667
- package/dist/node-v7xhqwe2.js +0 -86
- package/dist/pack-command-service-b1v9c8cw.js +0 -35
- package/dist/package-id-rpzgy31w.js +0 -13
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-5edvzz80.js +0 -543
- package/dist/packager-tool-99jaqabz.js +0 -171
- package/dist/packager-tool-9hsmn8th.js +0 -418
- package/dist/packager-tool-azre7mm1.js +0 -182
- package/dist/packager-tool-fn13r8e1.js +0 -188
- package/dist/packager-tool-gdtpsdn7.js +0 -342
- package/dist/packager-tool-qw47eyw7.js +0 -43
- package/dist/packager-tool-resolver-994z3jkj.js +0 -23
- package/dist/packager-tool-tedbebpq.js +0 -5367
- package/dist/packager-tool-x1ah4eez.js +0 -68
- package/dist/prepare-solution-resources-m1djfj62.js +0 -29
- package/dist/project-contributions-79ndycrx.js +0 -32
- package/dist/resource-mutations-c3krjqze.js +0 -36
- package/dist/ship-telemetry-myes7ak5.js +0 -21
- package/dist/solution-auth-aead70sw.js +0 -11
- /package/dist/{packager-tool-act5r386.js → packager-tool-2pxe2r4j.js} +0 -0
- /package/dist/{packager-tool-kkfb5kgn.js → packager-tool-vrqbbh01.js} +0 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError,
|
|
3
|
+
httpStatusOf2,
|
|
4
|
+
extractErrorDetails
|
|
5
|
+
} from "./packager-tool-m07vyk89.js";
|
|
6
|
+
import {
|
|
7
|
+
isGuid
|
|
8
|
+
} from "./packager-tool-9vrwpgt3.js";
|
|
9
|
+
import {
|
|
10
|
+
getAuthContext
|
|
11
|
+
} from "./packager-tool-t39pjz7n.js";
|
|
12
|
+
import {
|
|
13
|
+
getSolutionAuthContext2
|
|
14
|
+
} from "./packager-tool-ppj5f4y7.js";
|
|
15
|
+
import {
|
|
16
|
+
classifyFeedSession2
|
|
17
|
+
} from "./packager-tool-bs1jn1yn.js";
|
|
18
|
+
import {
|
|
19
|
+
PersonalWorkspacesApi,
|
|
20
|
+
createOrchestratorConfig,
|
|
21
|
+
resolveFolder
|
|
22
|
+
} from "./packager-tool-fp46ebde.js";
|
|
23
|
+
import {
|
|
24
|
+
getAvailablePublishLocationsV22
|
|
25
|
+
} from "./packager-tool-vrtabg73.js";
|
|
26
|
+
|
|
27
|
+
// src/services/personal-workspace-resolver.ts
|
|
28
|
+
async function resolvePersonalWorkspace(options) {
|
|
29
|
+
const config = await createOrchestratorConfig(options);
|
|
30
|
+
const api = new PersonalWorkspacesApi(config);
|
|
31
|
+
const pw = await api.personalWorkspacesGetPersonalWorkspace();
|
|
32
|
+
if (!pw?.key || !pw.name) {
|
|
33
|
+
throw new Error("Personal Workspace not configured for the current user. " + "Enable Personal Workspace in Orchestrator (or sign in as a user that has one), then retry.");
|
|
34
|
+
}
|
|
35
|
+
return { key: pw.key, name: pw.name };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/services/folder-helper.ts
|
|
39
|
+
async function resolveParentFolder(options) {
|
|
40
|
+
if (!options.folderPath && !options.folderKey && !options.personalWorkspace) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (options.personalWorkspace) {
|
|
44
|
+
const [pwError, pw] = await catchError(resolvePersonalWorkspace({
|
|
45
|
+
tenant: options.tenant,
|
|
46
|
+
loginValidity: options.loginValidity,
|
|
47
|
+
envFilePath: options.envFilePath
|
|
48
|
+
}));
|
|
49
|
+
if (pwError) {
|
|
50
|
+
throw new Error(`Failed to resolve Personal Workspace: ${pwError.message}`);
|
|
51
|
+
}
|
|
52
|
+
return pw.name;
|
|
53
|
+
}
|
|
54
|
+
if (options.folderPath) {
|
|
55
|
+
return options.folderPath;
|
|
56
|
+
}
|
|
57
|
+
const [resolveError, resolved] = await catchError(resolveFolder({ folderKey: options.folderKey }, {
|
|
58
|
+
tenant: options.tenant,
|
|
59
|
+
loginValidity: options.loginValidity,
|
|
60
|
+
envFilePath: options.envFilePath
|
|
61
|
+
}));
|
|
62
|
+
if (resolveError) {
|
|
63
|
+
throw new Error(`Failed to resolve folder key '${options.folderKey}': ${resolveError.message}`);
|
|
64
|
+
}
|
|
65
|
+
if (!resolved) {
|
|
66
|
+
throw new Error(`Folder not found for key '${options.folderKey}'.`);
|
|
67
|
+
}
|
|
68
|
+
return resolved.path;
|
|
69
|
+
}
|
|
70
|
+
async function resolveFolderInfo(options) {
|
|
71
|
+
if (!options.folderPath && !options.folderKey) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const [resolveError, resolved] = await catchError(resolveFolder({ folderPath: options.folderPath, folderKey: options.folderKey }, {
|
|
75
|
+
tenant: options.tenant,
|
|
76
|
+
loginValidity: options.loginValidity,
|
|
77
|
+
envFilePath: options.envFilePath
|
|
78
|
+
}));
|
|
79
|
+
if (resolveError) {
|
|
80
|
+
throw new Error(`Failed to resolve folder '${options.folderPath ?? options.folderKey}': ${resolveError.message}`, { cause: resolveError });
|
|
81
|
+
}
|
|
82
|
+
if (!resolved) {
|
|
83
|
+
throw new Error(`Folder not found: '${options.folderPath ?? options.folderKey}'.`);
|
|
84
|
+
}
|
|
85
|
+
return { key: resolved.key, path: resolved.path };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/services/publish-locations-service.ts
|
|
89
|
+
async function resolveStudioWebTarget(options) {
|
|
90
|
+
const auth = await getAuthContext({
|
|
91
|
+
ensureTokenValidityMinutes: options?.loginValidity,
|
|
92
|
+
envFilePath: options?.envFilePath,
|
|
93
|
+
requireOrganizationName: true
|
|
94
|
+
});
|
|
95
|
+
if (options?.tenant && auth.tenantName && options.tenant.toLowerCase() !== auth.tenantName.toLowerCase()) {
|
|
96
|
+
throw new Error(`Feeds are resolved for the logged-in tenant ('${auth.tenantName}'), so --tenant '${options.tenant}' can't apply here. Switch tenants first with: uip login tenant set ${options.tenant}.`);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
config: {
|
|
100
|
+
baseUrl: auth.baseUrl,
|
|
101
|
+
authToken: auth.accessToken,
|
|
102
|
+
tenantId: auth.tenantId
|
|
103
|
+
},
|
|
104
|
+
organizationName: auth.organizationName
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function isSelectableFeed(location) {
|
|
108
|
+
switch (location.type) {
|
|
109
|
+
case "Tenant":
|
|
110
|
+
case "Folder":
|
|
111
|
+
return true;
|
|
112
|
+
case "PersonalWorkspace":
|
|
113
|
+
return location.isMyPersonalWorkspace;
|
|
114
|
+
default:
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async function listSelectablePublishLocations(options) {
|
|
119
|
+
const { config, organizationName } = await resolveStudioWebTarget(options);
|
|
120
|
+
const all = await getAvailablePublishLocationsV22(config, organizationName);
|
|
121
|
+
return all.filter(isSelectableFeed);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// src/services/feed-resolver.ts
|
|
125
|
+
function folderKeyInitOverride2(folderKey) {
|
|
126
|
+
return async ({ init }) => ({
|
|
127
|
+
headers: { ...init.headers, "X-UIPATH-FolderKey": folderKey }
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function feedScopeInitOverride2(scope) {
|
|
131
|
+
const { folderKey } = scope;
|
|
132
|
+
if (!folderKey) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
return folderKeyInitOverride2(folderKey);
|
|
136
|
+
}
|
|
137
|
+
function feedSelectorFlag2(scope) {
|
|
138
|
+
if (!scope || scope.kind === "tenant" || !scope.folderKey) {
|
|
139
|
+
return "";
|
|
140
|
+
}
|
|
141
|
+
return scope.kind === "personal" ? " --personal-workspace" : ` --feed ${scope.folderKey}`;
|
|
142
|
+
}
|
|
143
|
+
function feedResolutionFailureInstructions(options) {
|
|
144
|
+
if (options.personalWorkspace) {
|
|
145
|
+
return "Personal Workspace resolution needs an interactive user session and an enabled Personal Workspace. Log in as a user with a Personal Workspace, or omit --personal-workspace to use the tenant feed.";
|
|
146
|
+
}
|
|
147
|
+
if (options.feed !== undefined) {
|
|
148
|
+
return "List the feeds you can target with: uip solution feeds list.";
|
|
149
|
+
}
|
|
150
|
+
return "Check the selected feed and try again.";
|
|
151
|
+
}
|
|
152
|
+
async function describeFeedResolutionFailureAsync2(error, options, session) {
|
|
153
|
+
const details = await extractErrorDetails(error);
|
|
154
|
+
if (error instanceof ApplicationFeedResolutionError) {
|
|
155
|
+
return {
|
|
156
|
+
message: error.message,
|
|
157
|
+
instructions: "Pass the feed's folder key to --feed (it is used as given, with no extra scope), give the external application the OR.Folders scope so a folder path can be looked up, or give it the Studio Web (StudioWebS2S) grants that cover reading publish locations; or run it with a user session ('uip login'). To use the tenant feed, omit --feed.",
|
|
158
|
+
errorCode: "permission_denied",
|
|
159
|
+
retry: "RetryWillNotFix",
|
|
160
|
+
context: details.context
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (options.personalWorkspace && isRefusal(details.context?.httpStatus) && classifyFeedSession2(session) === "application") {
|
|
164
|
+
return {
|
|
165
|
+
message: "--personal-workspace needs a user session; this session is an external app, which has no Personal Workspace.",
|
|
166
|
+
instructions: "Run it with a user session that has a Personal Workspace ('uip login'). A client-credentials login cannot target one.",
|
|
167
|
+
errorCode: "permission_denied",
|
|
168
|
+
retry: "RetryWillNotFix",
|
|
169
|
+
context: details.context
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
if (options.feed !== undefined && isRefusal(details.context?.httpStatus) && classifyFeedSession2(session) === "application") {
|
|
173
|
+
return {
|
|
174
|
+
message: `--feed '${options.feed}' could not be checked: Studio Web refused this external app the list of publish locations (HTTP ${details.context?.httpStatus}).`,
|
|
175
|
+
instructions: "Give the external application the Studio Web (StudioWebS2S) grants that cover reading publish locations, or run it with a user session ('uip login'). To use the tenant feed, omit --feed.",
|
|
176
|
+
errorCode: "permission_denied",
|
|
177
|
+
retry: "RetryWillNotFix",
|
|
178
|
+
context: details.context
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
message: details.message,
|
|
183
|
+
instructions: feedResolutionFailureInstructions(options),
|
|
184
|
+
errorCode: details.errorCode,
|
|
185
|
+
retry: details.retry,
|
|
186
|
+
context: details.context
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function isRefusal(status) {
|
|
190
|
+
return status !== undefined && status >= 400 && status < 500 && status !== 408 && status !== 429;
|
|
191
|
+
}
|
|
192
|
+
async function resolveFeedScope2(options) {
|
|
193
|
+
const { personalWorkspace, feed } = options;
|
|
194
|
+
if (personalWorkspace && feed !== undefined) {
|
|
195
|
+
throw new Error("Use either --personal-workspace or --feed, not both.");
|
|
196
|
+
}
|
|
197
|
+
if (personalWorkspace) {
|
|
198
|
+
const pw = await resolvePersonalWorkspace({
|
|
199
|
+
tenant: options.tenant,
|
|
200
|
+
loginValidity: options.loginValidity,
|
|
201
|
+
envFilePath: options.envFilePath
|
|
202
|
+
});
|
|
203
|
+
return { kind: "personal", folderKey: pw.key, name: pw.name };
|
|
204
|
+
}
|
|
205
|
+
if (feed !== undefined) {
|
|
206
|
+
return resolveNamedFeed(feed, options);
|
|
207
|
+
}
|
|
208
|
+
return { kind: "tenant" };
|
|
209
|
+
}
|
|
210
|
+
async function resolveNamedFeed(feed, options) {
|
|
211
|
+
const [listingError, locations] = await catchError(listSelectablePublishLocations({
|
|
212
|
+
tenant: options.tenant,
|
|
213
|
+
envFilePath: options.envFilePath,
|
|
214
|
+
loginValidity: options.loginValidity
|
|
215
|
+
}));
|
|
216
|
+
if (listingError) {
|
|
217
|
+
const refusedStatus = await applicationRefusedListingStatusAsync(listingError, options);
|
|
218
|
+
if (refusedStatus !== undefined) {
|
|
219
|
+
return resolveFeedForApplication(feed, options, refusedStatus);
|
|
220
|
+
}
|
|
221
|
+
throw listingError;
|
|
222
|
+
}
|
|
223
|
+
const match = matchFeed(feed, locations);
|
|
224
|
+
const kind = match.type === "Tenant" ? "tenant" : match.type === "PersonalWorkspace" ? "personal" : "folder";
|
|
225
|
+
if (kind !== "tenant" && !match.key) {
|
|
226
|
+
throw new Error(`Feed '${match.name || feed}' has no folder key in the publish-locations response, so it can't be targeted. Run 'uip solution feeds list' and pick a feed with a Key.`);
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
kind,
|
|
230
|
+
folderKey: kind === "tenant" ? undefined : match.key,
|
|
231
|
+
name: match.name
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
async function applicationRefusedListingStatusAsync(error, options) {
|
|
235
|
+
const status = httpStatusOf2(error);
|
|
236
|
+
if (status !== 401 && status !== 403) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const [authError, auth] = await catchError(getSolutionAuthContext2({
|
|
240
|
+
tenant: options.tenant,
|
|
241
|
+
loginValidity: options.loginValidity,
|
|
242
|
+
envFilePath: options.envFilePath
|
|
243
|
+
}));
|
|
244
|
+
return !authError && classifyFeedSession2(auth) === "application" ? status : undefined;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
class ApplicationFeedResolutionError extends Error {
|
|
248
|
+
feed;
|
|
249
|
+
status;
|
|
250
|
+
name = "ApplicationFeedResolutionError";
|
|
251
|
+
constructor(feed, status, reason) {
|
|
252
|
+
super(`--feed '${feed}' could not be resolved for this external app: the publish-locations listing refused it (HTTP ${status}), and the Orchestrator folder lookup failed: ${reason}`);
|
|
253
|
+
this.feed = feed;
|
|
254
|
+
this.status = status;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async function resolveFeedForApplication(feed, options, listingStatus) {
|
|
258
|
+
if (isGuid(feed)) {
|
|
259
|
+
return { kind: "folder", folderKey: feed };
|
|
260
|
+
}
|
|
261
|
+
const [error, folder] = await catchError(resolveFolderInfo({
|
|
262
|
+
folderPath: feed,
|
|
263
|
+
tenant: options.tenant,
|
|
264
|
+
loginValidity: options.loginValidity,
|
|
265
|
+
envFilePath: options.envFilePath
|
|
266
|
+
}));
|
|
267
|
+
if (error || !folder) {
|
|
268
|
+
throw new ApplicationFeedResolutionError(feed, listingStatus, error?.message ?? "folder not found");
|
|
269
|
+
}
|
|
270
|
+
return { kind: "folder", folderKey: folder.key, name: folder.path };
|
|
271
|
+
}
|
|
272
|
+
function matchFeed(feed, locations) {
|
|
273
|
+
const byKey = locations.find((location) => location.key === feed);
|
|
274
|
+
if (byKey) {
|
|
275
|
+
return byKey;
|
|
276
|
+
}
|
|
277
|
+
const target = feed.toLowerCase();
|
|
278
|
+
const byName = locations.filter((location) => location.name.toLowerCase() === target);
|
|
279
|
+
if (byName.length === 1) {
|
|
280
|
+
return byName[0];
|
|
281
|
+
}
|
|
282
|
+
if (byName.length > 1) {
|
|
283
|
+
throw new Error(`More than one feed is named '${feed}'. Pass its key instead — ` + "'uip solution feeds list' shows each feed's key.");
|
|
284
|
+
}
|
|
285
|
+
throw new Error(`Feed '${feed}' is not an available publish location. ` + "Run 'uip solution feeds list' to see the feeds you can publish to.");
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export { resolvePersonalWorkspace, resolveParentFolder, resolveFolderInfo, listSelectablePublishLocations, folderKeyInitOverride2, feedScopeInitOverride2, feedSelectorFlag2, describeFeedResolutionFailureAsync2, resolveFeedScope2 };
|
|
289
|
+
|
|
290
|
+
//# debugId=4DD932FEEA2EF6A664756E2164756E21
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
catchError
|
|
3
|
-
} from "./packager-tool-6ybywxxn.js";
|
|
4
1
|
import {
|
|
5
2
|
getFileSystem
|
|
6
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-vgrswa8p.js";
|
|
4
|
+
import {
|
|
5
|
+
catchError
|
|
6
|
+
} from "./packager-tool-m07vyk89.js";
|
|
7
7
|
|
|
8
8
|
// src/services/solution-init-service.ts
|
|
9
9
|
var AGENTS_FILENAME = "AGENTS.md";
|
|
10
10
|
var CLAUDE_FILENAME = "CLAUDE.md";
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class SolutionInitError2 extends Error {
|
|
13
13
|
stage;
|
|
14
14
|
constructor(stage, cause) {
|
|
15
15
|
super(cause instanceof Error ? cause.message : String(cause), {
|
|
@@ -19,7 +19,7 @@ class SolutionInitError extends Error {
|
|
|
19
19
|
this.name = "SolutionInitError";
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
async function
|
|
22
|
+
async function solutionInitAsync2(solutionName, options = {}) {
|
|
23
23
|
const fs = getFileSystem();
|
|
24
24
|
const base = fs.path.basename(solutionName);
|
|
25
25
|
const hasExtension = base.lastIndexOf(".") > 0;
|
|
@@ -28,7 +28,7 @@ async function solutionInitAsync(solutionName, options = {}) {
|
|
|
28
28
|
const parentDir = fs.path.resolve(options.cwd ?? ".", fs.path.dirname(solutionName), nameWithoutExt);
|
|
29
29
|
const [mkdirError] = await catchError(fs.mkdir(parentDir));
|
|
30
30
|
if (mkdirError) {
|
|
31
|
-
throw new
|
|
31
|
+
throw new SolutionInitError2("directory", mkdirError);
|
|
32
32
|
}
|
|
33
33
|
let agentsPath;
|
|
34
34
|
let claudePath;
|
|
@@ -37,11 +37,11 @@ async function solutionInitAsync(solutionName, options = {}) {
|
|
|
37
37
|
claudePath = fs.path.join(parentDir, CLAUDE_FILENAME);
|
|
38
38
|
const [agentsError] = await catchError(fs.writeFile(agentsPath, options.briefingContent));
|
|
39
39
|
if (agentsError) {
|
|
40
|
-
throw new
|
|
40
|
+
throw new SolutionInitError2("briefing", agentsError);
|
|
41
41
|
}
|
|
42
42
|
const [claudeError] = await catchError(fs.writeFile(claudePath, options.briefingContent));
|
|
43
43
|
if (claudeError) {
|
|
44
|
-
throw new
|
|
44
|
+
throw new SolutionInitError2("briefing", claudeError);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
const filePath = fs.path.join(parentDir, fileName);
|
|
@@ -54,7 +54,7 @@ async function solutionInitAsync(solutionName, options = {}) {
|
|
|
54
54
|
const [manifestError] = await catchError(fs.writeFile(filePath, `${JSON.stringify(solution, null, 2)}
|
|
55
55
|
`));
|
|
56
56
|
if (manifestError) {
|
|
57
|
-
throw new
|
|
57
|
+
throw new SolutionInitError2("manifest", manifestError);
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
solutionFile: filePath,
|
|
@@ -65,6 +65,6 @@ async function solutionInitAsync(solutionName, options = {}) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
export {
|
|
68
|
+
export { SolutionInitError2, solutionInitAsync2 };
|
|
69
69
|
|
|
70
|
-
//# debugId=
|
|
70
|
+
//# debugId=91E257743F3E2B0964756E2164756E21
|