@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.
- package/README.md +3 -3
- package/dist/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/archive-extract-x35t9ktj.js +120 -0
- package/dist/cleanup-command-service-n4e7vxnw.js +149 -0
- package/dist/deploy-delete-service-cag0q8yx.js +25 -0
- package/dist/deploy-run-service-f0h8wb9w.js +25 -0
- package/dist/{deploy-status-service-6svq7c6w.js → deploy-status-service-yh6xn6e0.js} +41 -33
- package/dist/deploy.js +23 -17
- package/dist/{deployment-search-v2qtz23x.js → deployment-search-mnywd9nc.js} +16 -10
- package/dist/{embedded-file-reader-rf2g1kfj.js → embedded-file-reader-z4becc02.js} +2 -2
- package/dist/{feed-resolver-xz3akamf.js → feed-resolver-fve33dxq.js} +10 -9
- package/dist/feed-scope-failure-jmg4t1r1.js +19 -0
- package/dist/{feed-session-sxga31vn.js → feed-session-7xqphdrg.js} +3 -3
- package/dist/governance-options-4vxz7ekn.js +32 -0
- package/dist/index-g8c8nf1c.js +667 -0
- package/dist/index-prm27bvm.js +138 -0
- package/dist/index.js +27 -29
- package/dist/init.js +11 -10
- package/dist/{list-tjetkspc.js → list-50mepbed.js} +10 -8
- package/dist/models/pack-command-types.d.ts +15 -0
- package/dist/node-7jm7ksqa.js +86 -0
- package/dist/pack-command-service-dewf5vsq.js +35 -0
- package/dist/pack-project-xwd1rbaa.js +97 -0
- package/dist/pack.js +24 -14
- package/dist/package-id-1wr3cy9c.js +13 -0
- package/dist/packager-tool-09swr9cp.js +171 -0
- package/dist/{packager-tool-a9jx8gf4.js → packager-tool-2vmsh5pt.js} +196 -1519
- package/dist/{packager-tool-px1j9kre.js → packager-tool-3bwnkjdq.js} +2 -2
- package/dist/{packager-tool-gb35b4qs.js → packager-tool-43ahv5mn.js} +192 -96
- package/dist/{packager-tool-9ha2z8h5.js → packager-tool-47by487p.js} +6 -4
- package/dist/packager-tool-47wzvqw0.js +86 -0
- package/dist/{packager-tool-zns6n8zp.js → packager-tool-5ddtwzva.js} +1 -1
- package/dist/packager-tool-5edvzz80.js +543 -0
- package/dist/{packager-tool-jq9zw82w.js → packager-tool-5n6jsn41.js} +104 -14
- package/dist/packager-tool-60af1hw2.js +26 -0
- package/dist/{packager-tool-f5gq77m5.js → packager-tool-61pwb567.js} +2 -2
- package/dist/{packager-tool-yrz4mwfn.js → packager-tool-6kz1pv9f.js} +1373 -486
- package/dist/packager-tool-6ybywxxn.js +1809 -0
- package/dist/packager-tool-8ptbmmmp.js +2132 -0
- package/dist/{packager-tool-7gr2nphb.js → packager-tool-97rcgwvv.js} +224 -6
- package/dist/{packager-tool-83m6ns0r.js → packager-tool-9t26kde1.js} +3556 -1646
- package/dist/packager-tool-act5r386.js +239 -0
- package/dist/packager-tool-amhyxzz6.js +125 -0
- package/dist/packager-tool-b03rva43.js +188 -0
- package/dist/{packager-tool-e2rtr49j.js → packager-tool-b2nhscfk.js} +15 -31
- package/dist/{packager-tool-tv9c1e80.js → packager-tool-d6rrfd46.js} +149 -53
- package/dist/packager-tool-frr2xmkr.js +445 -0
- package/dist/{packager-tool-v8bkkqdb.js → packager-tool-gmwva4yv.js} +5 -5
- package/dist/packager-tool-gs3f3tf7.js +103 -0
- package/dist/packager-tool-jg692f13.js +517 -0
- package/dist/packager-tool-jmpb786m.js +109 -0
- package/dist/{packager-tool-5sex4a1h.js → packager-tool-kds8ytzw.js} +74 -23
- package/dist/packager-tool-kkfb5kgn.js +182 -0
- package/dist/packager-tool-kvcxg0zv.js +1510 -0
- package/dist/packager-tool-n3jfjn5r.js +42 -0
- package/dist/{packager-tool-fjsn5h8s.js → packager-tool-n5d5dx5j.js} +2196 -3455
- package/dist/{packager-tool-yfpcvdpm.js → packager-tool-nsya65z1.js} +357 -1370
- package/dist/{packager-tool-fv7xyzg2.js → packager-tool-pbmqk39a.js} +126 -128
- package/dist/{packager-tool-bqre28m1.js → packager-tool-qw47eyw7.js} +1 -1
- package/dist/{packager-tool-9qgmwy21.js → packager-tool-rc3hwn4b.js} +25 -4
- package/dist/packager-tool-resolver-994z3jkj.js +23 -0
- package/dist/{packager-tool-tgw5x6vx.js → packager-tool-rvt68c1t.js} +17 -8
- package/dist/{packager-tool-gab9y5ct.js → packager-tool-t8gh825q.js} +37 -13
- package/dist/{packager-tool-kswwd3hp.js → packager-tool-tx834spe.js} +2376 -4077
- package/dist/{packager-tool-zf3929se.js → packager-tool-v1f5e8t9.js} +11 -1
- package/dist/{packager-tool-ssq2kzqm.js → packager-tool-w77d72a7.js} +13 -11
- package/dist/{packager-tool-1rzssy0x.js → packager-tool-wy4fx250.js} +19 -18
- package/dist/packager-tool-wz34ma3s.js +1333 -0
- package/dist/packager-tool-zq16e1xv.js +68 -0
- package/dist/packager-tool.js +2 -2
- package/dist/prepare-solution-resources-m1djfj62.js +29 -0
- package/dist/project-command-utils-t6pmpvq3.js +90 -0
- package/dist/project-contributions-79ndycrx.js +32 -0
- package/dist/publish.js +13 -12
- package/dist/resource-mutations-c3krjqze.js +36 -0
- package/dist/resource-version-lookup-0e3e2j58.js +99 -0
- package/dist/resource.js +10 -9
- package/dist/restore-command-service-5v0b9363.js +155 -0
- package/dist/run-service-tg6b67wp.js +428 -0
- package/dist/services/deploy-activate-service.d.ts +10 -5
- package/dist/services/deploy-delete-service.d.ts +8 -4
- package/dist/services/deploy-run-service.d.ts +34 -1
- package/dist/services/deploy-uninstall-service.d.ts +21 -3
- package/dist/services/deploy-upgrade-service.d.ts +35 -1
- package/dist/services/deployment-feed-locator.d.ts +15 -4
- package/dist/services/deployment-search-client.d.ts +5 -53
- package/dist/services/deployment-search.d.ts +58 -3
- package/dist/services/deployment-state.d.ts +84 -24
- package/dist/services/deployment-validation.d.ts +5 -0
- package/dist/services/emit-runtime-dependencies.d.ts +2 -1
- package/dist/services/feed-resolver.d.ts +6 -4
- package/dist/services/feed-selection.d.ts +47 -0
- package/dist/services/http-status.d.ts +2 -7
- package/dist/services/pack-command-service.d.ts +9 -0
- package/dist/services/pack-project-selection.d.ts +51 -0
- package/dist/services/pack-project.d.ts +26 -0
- package/dist/services/pack-service.d.ts +7 -3
- package/dist/services/package-search-client.d.ts +7 -0
- package/dist/services/packager-tool-resolver.d.ts +7 -1
- package/dist/services/packages-list-service.d.ts +1 -1
- package/dist/services/permanent-deletion-consent.d.ts +110 -0
- package/dist/services/pipeline-deploy-poll.d.ts +7 -0
- package/dist/services/prepare-solution-resources.d.ts +12 -2
- package/dist/services/project-contributions.d.ts +5 -4
- package/dist/services/search-failure.d.ts +9 -13
- package/dist/services/solution-packager-helpers.d.ts +5 -2
- package/dist/services/solution-path.d.ts +1 -1
- package/dist/services/uninstall-consent.d.ts +82 -0
- package/dist/ship-telemetry-myes7ak5.js +21 -0
- package/dist/solution-auth-aead70sw.js +11 -0
- package/dist/templates/AGENTS.md +125 -12
- package/dist/tool.js +27 -29
- package/dist/utils/deployment-errors.d.ts +9 -1
- package/package.json +2 -2
- package/dist/deploy-delete-service-w3e8x1kq.js +0 -22
- package/dist/feed-scope-failure-0j5byccb.js +0 -18
- package/dist/packager-tool-f2e9rzxk.js +0 -104
- package/dist/packager-tool-resolver-6zwhec62.js +0 -20
- package/dist/packager-tool-zdfn32bc.js +0 -4465
- package/dist/prepare-solution-resources-jpb5as2s.js +0 -25
- package/dist/project-contributions-6wpff2hm.js +0 -30
- package/dist/services/legacy-deployment-search-v3.d.ts +0 -23
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catchError
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-6ybywxxn.js";
|
|
4
4
|
import {
|
|
5
5
|
getFileSystem
|
|
6
|
-
} from "./packager-tool-
|
|
6
|
+
} from "./packager-tool-v1f5e8t9.js";
|
|
7
7
|
|
|
8
8
|
// src/services/solution-init-service.ts
|
|
9
9
|
var AGENTS_FILENAME = "AGENTS.md";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFileSystem
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-v1f5e8t9.js";
|
|
4
4
|
import {
|
|
5
5
|
__require
|
|
6
6
|
} from "./packager-tool-1de529jm.js";
|
|
@@ -131,6 +131,16 @@ var resolveIdentityType = (claims, authFlow, email) => {
|
|
|
131
131
|
}
|
|
132
132
|
return;
|
|
133
133
|
};
|
|
134
|
+
var resolveApplicationSubtype = (claims, authFlow) => {
|
|
135
|
+
switch (asString(claims?.sub_type)) {
|
|
136
|
+
case "service.external":
|
|
137
|
+
return "External";
|
|
138
|
+
case "service.internal":
|
|
139
|
+
return "Internal";
|
|
140
|
+
default:
|
|
141
|
+
return authFlow === "client_credentials" || authFlow === "federated_credentials" ? "External" : undefined;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
134
144
|
var looksLikeEmail = (value) => value?.includes("@") ?? false;
|
|
135
145
|
var pickEmail = (claims) => {
|
|
136
146
|
for (const candidate of [claims?.email, claims?.preferred_username]) {
|
|
@@ -172,6 +182,12 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
|
172
182
|
const clientId = asString(claims?.client_id);
|
|
173
183
|
if (clientId)
|
|
174
184
|
identity.clientId = clientId;
|
|
185
|
+
const subType = asString(claims?.sub_type);
|
|
186
|
+
if (subType)
|
|
187
|
+
identity.subType = subType;
|
|
188
|
+
const applicationSubtype = resolveApplicationSubtype(claims, authFlow);
|
|
189
|
+
if (applicationSubtype)
|
|
190
|
+
identity.applicationSubtype = applicationSubtype;
|
|
175
191
|
return identity;
|
|
176
192
|
};
|
|
177
193
|
var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
|
|
@@ -182,11 +198,79 @@ var AUTH_FILENAME = ".auth";
|
|
|
182
198
|
var DEFAULT_BASE_URL = "https://cloud.uipath.com";
|
|
183
199
|
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
184
200
|
|
|
201
|
+
// ../auth/src/authProfile.ts
|
|
202
|
+
var DEFAULT_AUTH_PROFILE = "default";
|
|
203
|
+
var PROFILE_DIR = "profiles";
|
|
204
|
+
var PROFILE_NAME_RE = /^[A-Za-z0-9._-]+$/;
|
|
205
|
+
var ACTIVE_AUTH_PROFILE_KEY = Symbol.for("@uipath/auth/ActiveAuthProfile");
|
|
206
|
+
var AUTH_PROFILE_STORAGE_KEY = Symbol.for("@uipath/auth/ProfileStorage");
|
|
207
|
+
var globalSlot = globalThis;
|
|
208
|
+
function isAuthProfileStorage(value) {
|
|
209
|
+
return value !== null && typeof value === "object" && "getStore" in value && "run" in value;
|
|
210
|
+
}
|
|
211
|
+
function createProfileStorage() {
|
|
212
|
+
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
213
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
214
|
+
return {
|
|
215
|
+
getStore: () => {
|
|
216
|
+
return;
|
|
217
|
+
},
|
|
218
|
+
run: (_store, fn) => fn()
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
return new mod.AsyncLocalStorage;
|
|
222
|
+
}
|
|
223
|
+
function getProfileStorage() {
|
|
224
|
+
const existing = globalSlot[AUTH_PROFILE_STORAGE_KEY];
|
|
225
|
+
if (isAuthProfileStorage(existing)) {
|
|
226
|
+
return existing;
|
|
227
|
+
}
|
|
228
|
+
const storage = createProfileStorage();
|
|
229
|
+
globalSlot[AUTH_PROFILE_STORAGE_KEY] = storage;
|
|
230
|
+
return storage;
|
|
231
|
+
}
|
|
232
|
+
var profileStorage = getProfileStorage();
|
|
233
|
+
|
|
234
|
+
class AuthProfileValidationError extends Error {
|
|
235
|
+
constructor(message) {
|
|
236
|
+
super(message);
|
|
237
|
+
this.name = "AuthProfileValidationError";
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function normalizeAuthProfileName(profile) {
|
|
241
|
+
if (profile === undefined || profile === DEFAULT_AUTH_PROFILE) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (profile.length === 0 || profile === "." || profile === ".." || !PROFILE_NAME_RE.test(profile)) {
|
|
245
|
+
throw new AuthProfileValidationError(`Invalid profile name "${profile}". Profile names may contain only letters, numbers, '.', '_', and '-'.`);
|
|
246
|
+
}
|
|
247
|
+
return profile;
|
|
248
|
+
}
|
|
249
|
+
function getActiveAuthProfile() {
|
|
250
|
+
const scopedState = profileStorage.getStore();
|
|
251
|
+
if (scopedState !== undefined) {
|
|
252
|
+
return scopedState.profile;
|
|
253
|
+
}
|
|
254
|
+
return globalSlot[ACTIVE_AUTH_PROFILE_KEY]?.profile;
|
|
255
|
+
}
|
|
256
|
+
function resolveAuthProfileFilePath(profile) {
|
|
257
|
+
const normalized = normalizeAuthProfileName(profile);
|
|
258
|
+
if (normalized === undefined) {
|
|
259
|
+
throw new AuthProfileValidationError(`"${DEFAULT_AUTH_PROFILE}" is the built-in profile and does not have a profile file path.`);
|
|
260
|
+
}
|
|
261
|
+
const fs = getFileSystem();
|
|
262
|
+
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, PROFILE_DIR, normalized, AUTH_FILENAME);
|
|
263
|
+
}
|
|
264
|
+
function getActiveAuthProfileFilePath() {
|
|
265
|
+
const profile = getActiveAuthProfile();
|
|
266
|
+
return profile ? resolveAuthProfileFilePath(profile) : undefined;
|
|
267
|
+
}
|
|
268
|
+
|
|
185
269
|
// ../auth/src/config.ts
|
|
186
270
|
var DEFAULT_CLIENT_ID = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00";
|
|
187
271
|
var AUTH_FILE_CONFIG_KEY = Symbol.for("@uipath/auth/AuthFileConfig");
|
|
188
|
-
var
|
|
189
|
-
var getAuthFileConfig = () =>
|
|
272
|
+
var globalSlot2 = globalThis;
|
|
273
|
+
var getAuthFileConfig = () => globalSlot2[AUTH_FILE_CONFIG_KEY] ?? {};
|
|
190
274
|
|
|
191
275
|
class InvalidBaseUrlError extends Error {
|
|
192
276
|
url;
|
|
@@ -257,22 +341,12 @@ var resolveConfigAsync = async ({
|
|
|
257
341
|
baseUrl = DEFAULT_BASE_URL;
|
|
258
342
|
}
|
|
259
343
|
baseUrl = normalizeAndValidateBaseUrl(baseUrl);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
clientId = fileAuth.clientId;
|
|
263
|
-
}
|
|
264
|
-
if (!clientId) {
|
|
265
|
-
clientId = DEFAULT_CLIENT_ID;
|
|
266
|
-
}
|
|
267
|
-
let clientSecret = customClientSecret;
|
|
268
|
-
if (!clientSecret && fileAuth.clientSecret) {
|
|
269
|
-
clientSecret = fileAuth.clientSecret;
|
|
270
|
-
}
|
|
271
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
344
|
+
const clientId = customClientId || DEFAULT_CLIENT_ID;
|
|
345
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(customClientSecret) || Boolean(customClientAssertion));
|
|
272
346
|
const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
273
347
|
return {
|
|
274
348
|
clientId,
|
|
275
|
-
clientSecret,
|
|
349
|
+
clientSecret: customClientSecret,
|
|
276
350
|
scopes,
|
|
277
351
|
baseUrl,
|
|
278
352
|
authorizationEndpoint: `${baseUrl}/identity_/connect/authorize`,
|
|
@@ -280,74 +354,6 @@ var resolveConfigAsync = async ({
|
|
|
280
354
|
};
|
|
281
355
|
};
|
|
282
356
|
|
|
283
|
-
// ../auth/src/authProfile.ts
|
|
284
|
-
var DEFAULT_AUTH_PROFILE = "default";
|
|
285
|
-
var PROFILE_DIR = "profiles";
|
|
286
|
-
var PROFILE_NAME_RE = /^[A-Za-z0-9._-]+$/;
|
|
287
|
-
var ACTIVE_AUTH_PROFILE_KEY = Symbol.for("@uipath/auth/ActiveAuthProfile");
|
|
288
|
-
var AUTH_PROFILE_STORAGE_KEY = Symbol.for("@uipath/auth/ProfileStorage");
|
|
289
|
-
var globalSlot2 = globalThis;
|
|
290
|
-
function isAuthProfileStorage(value) {
|
|
291
|
-
return value !== null && typeof value === "object" && "getStore" in value && "run" in value;
|
|
292
|
-
}
|
|
293
|
-
function createProfileStorage() {
|
|
294
|
-
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
295
|
-
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
296
|
-
return {
|
|
297
|
-
getStore: () => {
|
|
298
|
-
return;
|
|
299
|
-
},
|
|
300
|
-
run: (_store, fn) => fn()
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
return new mod.AsyncLocalStorage;
|
|
304
|
-
}
|
|
305
|
-
function getProfileStorage() {
|
|
306
|
-
const existing = globalSlot2[AUTH_PROFILE_STORAGE_KEY];
|
|
307
|
-
if (isAuthProfileStorage(existing)) {
|
|
308
|
-
return existing;
|
|
309
|
-
}
|
|
310
|
-
const storage = createProfileStorage();
|
|
311
|
-
globalSlot2[AUTH_PROFILE_STORAGE_KEY] = storage;
|
|
312
|
-
return storage;
|
|
313
|
-
}
|
|
314
|
-
var profileStorage = getProfileStorage();
|
|
315
|
-
|
|
316
|
-
class AuthProfileValidationError extends Error {
|
|
317
|
-
constructor(message) {
|
|
318
|
-
super(message);
|
|
319
|
-
this.name = "AuthProfileValidationError";
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
function normalizeAuthProfileName(profile) {
|
|
323
|
-
if (profile === undefined || profile === DEFAULT_AUTH_PROFILE) {
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
if (profile.length === 0 || profile === "." || profile === ".." || !PROFILE_NAME_RE.test(profile)) {
|
|
327
|
-
throw new AuthProfileValidationError(`Invalid profile name "${profile}". Profile names may contain only letters, numbers, '.', '_', and '-'.`);
|
|
328
|
-
}
|
|
329
|
-
return profile;
|
|
330
|
-
}
|
|
331
|
-
function getActiveAuthProfile() {
|
|
332
|
-
const scopedState = profileStorage.getStore();
|
|
333
|
-
if (scopedState !== undefined) {
|
|
334
|
-
return scopedState.profile;
|
|
335
|
-
}
|
|
336
|
-
return globalSlot2[ACTIVE_AUTH_PROFILE_KEY]?.profile;
|
|
337
|
-
}
|
|
338
|
-
function resolveAuthProfileFilePath(profile) {
|
|
339
|
-
const normalized = normalizeAuthProfileName(profile);
|
|
340
|
-
if (normalized === undefined) {
|
|
341
|
-
throw new AuthProfileValidationError(`"${DEFAULT_AUTH_PROFILE}" is the built-in profile and does not have a profile file path.`);
|
|
342
|
-
}
|
|
343
|
-
const fs = getFileSystem();
|
|
344
|
-
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, PROFILE_DIR, normalized, AUTH_FILENAME);
|
|
345
|
-
}
|
|
346
|
-
function getActiveAuthProfileFilePath() {
|
|
347
|
-
const profile = getActiveAuthProfile();
|
|
348
|
-
return profile ? resolveAuthProfileFilePath(profile) : undefined;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
357
|
// ../auth/src/envAuth.ts
|
|
352
358
|
var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
|
|
353
359
|
var ENFORCE_ROBOT_AUTH_VAR = "UIPATH_CLI_ENFORCE_ROBOT_AUTH";
|
|
@@ -636,6 +642,40 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
636
642
|
}
|
|
637
643
|
};
|
|
638
644
|
|
|
645
|
+
// ../auth/src/tenantSelection.ts
|
|
646
|
+
var LOGIN_STATUS_HINT = "Run 'uip login status' to see the organization the CLI is signed in to.";
|
|
647
|
+
var organizationHint = (organizationId) => `The request used '${organizationId}' as the organization. ${LOGIN_STATUS_HINT}`;
|
|
648
|
+
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
649
|
+
var describeNonJsonResponse = (organizationId, response, parseError) => {
|
|
650
|
+
if (response.redirected) {
|
|
651
|
+
return `Could not find organization '${organizationId}': the request was ` + `redirected to a sign-in page instead of the organization's tenant ` + `list. ${LOGIN_STATUS_HINT}`;
|
|
652
|
+
}
|
|
653
|
+
const contentType = response.headers.get("content-type") ?? "unknown";
|
|
654
|
+
return `The organization service returned a '${contentType}' response instead ` + `of JSON: ${parseError.message}. ${organizationHint(organizationId)}`;
|
|
655
|
+
};
|
|
656
|
+
var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId, signal) => {
|
|
657
|
+
const url = `${baseUrl}/${organizationId}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo`;
|
|
658
|
+
const response = await fetch(url, {
|
|
659
|
+
headers: {
|
|
660
|
+
Authorization: `Bearer ${accessToken}`
|
|
661
|
+
},
|
|
662
|
+
...signal ? { signal } : {}
|
|
663
|
+
});
|
|
664
|
+
if (!response.ok) {
|
|
665
|
+
if (response.status === 401) {
|
|
666
|
+
throw new Error(`Unauthorized: the access token was rejected, it was not ` + `issued for organization '${organizationId}', or ` + `'${organizationId}' was not accepted as an organization ` + `URL segment in this environment. ` + LOGIN_STATUS_HINT);
|
|
667
|
+
}
|
|
668
|
+
const errorText = await response.text();
|
|
669
|
+
const message = `Failed to get tenants and organizations: ${response.status} ${errorText}`;
|
|
670
|
+
throw new Error(IDENTIFIER_STATUSES.has(response.status) ? `${message}. ${organizationHint(organizationId)}` : message);
|
|
671
|
+
}
|
|
672
|
+
const [parseError, data] = await catchError(response.json());
|
|
673
|
+
if (parseError) {
|
|
674
|
+
throw new Error(describeNonJsonResponse(organizationId, response, parseError));
|
|
675
|
+
}
|
|
676
|
+
return data;
|
|
677
|
+
};
|
|
678
|
+
|
|
639
679
|
// ../auth/src/tokenRefresh.ts
|
|
640
680
|
var TOKEN_REFRESH_REAUTHENTICATE_MESSAGE = "Token refresh failed. Run 'uip login' to re-authenticate.";
|
|
641
681
|
|
|
@@ -848,6 +888,8 @@ var saveEnvFileAsync = async ({
|
|
|
848
888
|
};
|
|
849
889
|
|
|
850
890
|
// ../auth/src/loginStatus.ts
|
|
891
|
+
var defaultRobotTenantIdCache = new Map;
|
|
892
|
+
var ROBOT_TENANT_LOOKUP_TIMEOUT_MS = 5000;
|
|
851
893
|
var getLoginStatusAsync = async (options = {}) => {
|
|
852
894
|
return getLoginStatusWithDeps(options);
|
|
853
895
|
};
|
|
@@ -860,12 +902,20 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
860
902
|
refreshToken: refreshTokenFn = refreshAccessToken,
|
|
861
903
|
resolveConfig = resolveConfigAsync,
|
|
862
904
|
robotFallback = tryRobotClientFallback,
|
|
905
|
+
fetchTenantsAndOrgs = fetchTenantsAndOrganizations,
|
|
906
|
+
robotTenantIdCache = defaultRobotTenantIdCache,
|
|
907
|
+
robotTenantLookupTimeoutMs = ROBOT_TENANT_LOOKUP_TIMEOUT_MS,
|
|
863
908
|
loadBreaker = loadRefreshBreaker,
|
|
864
909
|
saveBreaker = saveRefreshBreaker,
|
|
865
910
|
clearBreaker = clearRefreshBreaker
|
|
866
911
|
} = deps;
|
|
912
|
+
const robotDeps = {
|
|
913
|
+
fetchTenantsAndOrgs,
|
|
914
|
+
cache: robotTenantIdCache,
|
|
915
|
+
lookupTimeoutMs: robotTenantLookupTimeoutMs
|
|
916
|
+
};
|
|
867
917
|
if (isRobotAuthEnforced()) {
|
|
868
|
-
return resolveRobotEnforcedStatus(robotFallback);
|
|
918
|
+
return resolveRobotEnforcedStatus(robotFallback, robotDeps);
|
|
869
919
|
}
|
|
870
920
|
if (isEnvAuthEnabled()) {
|
|
871
921
|
return readAuthFromEnv();
|
|
@@ -883,7 +933,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
883
933
|
hint: `No credentials found for profile "${activeProfile}". Run 'uip login --profile ${activeProfile}' to authenticate this profile.`
|
|
884
934
|
};
|
|
885
935
|
}
|
|
886
|
-
return resolveBorrowedRobotStatus(robotFallback);
|
|
936
|
+
return resolveBorrowedRobotStatus(robotFallback, robotDeps);
|
|
887
937
|
}
|
|
888
938
|
const loaded = await loadFileCredentials(loadEnvFile, absolutePath);
|
|
889
939
|
if ("status" in loaded) {
|
|
@@ -925,7 +975,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
925
975
|
}
|
|
926
976
|
return buildFileStatus(tokens, credentials, globalHint);
|
|
927
977
|
};
|
|
928
|
-
async function resolveRobotEnforcedStatus(robotFallback) {
|
|
978
|
+
async function resolveRobotEnforcedStatus(robotFallback, deps) {
|
|
929
979
|
if (isEnvAuthEnabled()) {
|
|
930
980
|
throw new EnvAuthConfigError(`${ENV_AUTH_ENABLE_VAR}=true and ${ENFORCE_ROBOT_AUTH_VAR}=true ` + `are mutually exclusive. Unset one of them and re-run.`);
|
|
931
981
|
}
|
|
@@ -936,11 +986,11 @@ async function resolveRobotEnforcedStatus(robotFallback) {
|
|
|
936
986
|
hint: `${ENFORCE_ROBOT_AUTH_VAR}=true but the UiPath Robot ` + `session is unavailable. Start and sign in to the Assistant, ` + `or unset ${ENFORCE_ROBOT_AUTH_VAR} to fall back to file or ` + `env-var authentication.`
|
|
937
987
|
};
|
|
938
988
|
}
|
|
939
|
-
return buildRobotStatus(robotCreds);
|
|
989
|
+
return buildRobotStatus(robotCreds, deps);
|
|
940
990
|
}
|
|
941
|
-
async function resolveBorrowedRobotStatus(robotFallback) {
|
|
991
|
+
async function resolveBorrowedRobotStatus(robotFallback, deps) {
|
|
942
992
|
const robotCreds = await robotFallback();
|
|
943
|
-
return robotCreds ? buildRobotStatus(robotCreds) : { loginStatus: "Not logged in" };
|
|
993
|
+
return robotCreds ? buildRobotStatus(robotCreds, deps) : { loginStatus: "Not logged in" };
|
|
944
994
|
}
|
|
945
995
|
async function loadFileCredentials(loadEnvFile, absolutePath) {
|
|
946
996
|
let credentials;
|
|
@@ -1075,9 +1125,10 @@ function identityFields(accessToken, credentials) {
|
|
|
1075
1125
|
...scopes ? { scopes } : {}
|
|
1076
1126
|
};
|
|
1077
1127
|
}
|
|
1078
|
-
function buildRobotStatus(robotCreds) {
|
|
1128
|
+
async function buildRobotStatus(robotCreds, deps) {
|
|
1079
1129
|
const identity = resolveSessionIdentity(robotCreds.accessToken);
|
|
1080
1130
|
const scopes = readTokenScopes(robotCreds.accessToken);
|
|
1131
|
+
const tenant = robotCreds.tenantId ? { tenantId: robotCreds.tenantId } : await resolveRobotTenantId(robotCreds, deps);
|
|
1081
1132
|
return {
|
|
1082
1133
|
loginStatus: "Logged in",
|
|
1083
1134
|
accessToken: robotCreds.accessToken,
|
|
@@ -1085,14 +1136,62 @@ function buildRobotStatus(robotCreds) {
|
|
|
1085
1136
|
organizationName: robotCreds.organizationName,
|
|
1086
1137
|
organizationId: robotCreds.organizationId,
|
|
1087
1138
|
tenantName: robotCreds.tenantName,
|
|
1088
|
-
tenantId:
|
|
1139
|
+
tenantId: tenant.tenantId,
|
|
1089
1140
|
issuer: robotCreds.issuer,
|
|
1090
1141
|
expiration: getTokenExpiration(robotCreds.accessToken),
|
|
1091
1142
|
source: "robot" /* Robot */,
|
|
1143
|
+
...tenant.hint ? { hint: tenant.hint } : {},
|
|
1092
1144
|
...identity ? { identity } : {},
|
|
1093
1145
|
...scopes ? { scopes } : {}
|
|
1094
1146
|
};
|
|
1095
1147
|
}
|
|
1148
|
+
async function resolveRobotTenantId(robotCreds, deps) {
|
|
1149
|
+
const { baseUrl, accessToken, tenantName } = robotCreds;
|
|
1150
|
+
const organization = robotCreds.organizationName ?? robotCreds.organizationId;
|
|
1151
|
+
if (!tenantName || !organization) {
|
|
1152
|
+
return {};
|
|
1153
|
+
}
|
|
1154
|
+
const key = `${baseUrl}|${organization}|${tenantName}|${accessToken}`;
|
|
1155
|
+
let pending = deps.cache.get(key);
|
|
1156
|
+
if (!pending) {
|
|
1157
|
+
pending = catchError(lookupRobotTenantId({ baseUrl, accessToken, organization, tenantName }, deps)).then(([error, resolution]) => {
|
|
1158
|
+
const settled = error ? { hint: tenantLookupFailureHint(tenantName, error.message) } : resolution;
|
|
1159
|
+
if (!settled.tenantId) {
|
|
1160
|
+
deps.cache.delete(key);
|
|
1161
|
+
}
|
|
1162
|
+
return settled;
|
|
1163
|
+
});
|
|
1164
|
+
deps.cache.set(key, pending);
|
|
1165
|
+
}
|
|
1166
|
+
return pending;
|
|
1167
|
+
}
|
|
1168
|
+
async function lookupRobotTenantId(target, deps) {
|
|
1169
|
+
const { baseUrl, accessToken, organization, tenantName } = target;
|
|
1170
|
+
const [error, data] = await catchError(deps.fetchTenantsAndOrgs(baseUrl, accessToken, organization, AbortSignal.timeout(deps.lookupTimeoutMs)));
|
|
1171
|
+
if (error) {
|
|
1172
|
+
const reason = error.name === "TimeoutError" ? `the tenant list did not answer within ${deps.lookupTimeoutMs} ms.` : error.message;
|
|
1173
|
+
return { hint: tenantLookupFailureHint(tenantName, reason) };
|
|
1174
|
+
}
|
|
1175
|
+
const rows = data?.tenants;
|
|
1176
|
+
const tenants = Array.isArray(rows) ? rows.filter((tenant) => typeof tenant?.id === "string" && typeof tenant?.name === "string") : [];
|
|
1177
|
+
const wantedName = decodePathSegment(tenantName);
|
|
1178
|
+
const wanted = wantedName.toLowerCase();
|
|
1179
|
+
const match = tenants.find((tenant) => tenant.name === wantedName) ?? tenants.find((tenant) => tenant.name.toLowerCase() === wanted);
|
|
1180
|
+
if (!match) {
|
|
1181
|
+
const names = tenants.map((tenant) => tenant.name).join(", ");
|
|
1182
|
+
return {
|
|
1183
|
+
hint: `The Robot session targets tenant '${tenantName}', but ` + `organization '${organization}' lists no tenant of that name` + `${names ? ` (available: ${names})` : ""}. Commands that need ` + `the tenant id will fail until it can be resolved.`
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
return { tenantId: match.id };
|
|
1187
|
+
}
|
|
1188
|
+
function tenantLookupFailureHint(tenantName, reason) {
|
|
1189
|
+
return `Could not resolve the id of tenant '${tenantName}' from the ` + `Robot session: ${reason} Commands that need the tenant id will ` + `fail until it can be resolved.`;
|
|
1190
|
+
}
|
|
1191
|
+
function decodePathSegment(segment) {
|
|
1192
|
+
const [error, decoded] = catchError(() => decodeURIComponent(segment));
|
|
1193
|
+
return error ? segment : decoded;
|
|
1194
|
+
}
|
|
1096
1195
|
var isFileNotFoundError = (error) => {
|
|
1097
1196
|
if (!(error instanceof Object))
|
|
1098
1197
|
return false;
|
|
@@ -1361,9 +1460,6 @@ var getAuthContext = async (options = {}) => {
|
|
|
1361
1460
|
identity: status.identity
|
|
1362
1461
|
};
|
|
1363
1462
|
};
|
|
1364
|
-
// ../auth/src/tenantSelection.ts
|
|
1365
|
-
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
1366
|
-
|
|
1367
1463
|
// ../auth/src/selectTenant.ts
|
|
1368
1464
|
var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
|
|
1369
1465
|
var INVALID_TENANT_CODE = "INVALID_TENANT";
|
|
@@ -1373,4 +1469,4 @@ var TENANT_SELECTION_CODES = new Set([
|
|
|
1373
1469
|
]);
|
|
1374
1470
|
export { resolveSessionIdentity, getLoginStatusAsync, getAuthContext };
|
|
1375
1471
|
|
|
1376
|
-
//# debugId=
|
|
1472
|
+
//# debugId=B7D33D7D0BE1555264756E2164756E21
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describeFeedResolutionFailureAsync,
|
|
3
3
|
resolveFeedScope
|
|
4
|
-
} from "./packager-tool-
|
|
4
|
+
} from "./packager-tool-rvt68c1t.js";
|
|
5
|
+
import {
|
|
6
|
+
RESULTS
|
|
7
|
+
} from "./packager-tool-tx834spe.js";
|
|
5
8
|
import {
|
|
6
|
-
RESULTS,
|
|
7
9
|
catchError
|
|
8
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-6ybywxxn.js";
|
|
9
11
|
|
|
10
12
|
// src/services/feed-scope-failure.ts
|
|
11
13
|
async function resolveFeedScopeOrFailureAsync(options, session) {
|
|
@@ -34,4 +36,4 @@ async function resolveFeedScopeOrFailureAsync(options, session) {
|
|
|
34
36
|
|
|
35
37
|
export { resolveFeedScopeOrFailureAsync };
|
|
36
38
|
|
|
37
|
-
//# debugId=
|
|
39
|
+
//# debugId=4BDA905396BEA1E364756E2164756E21
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError
|
|
3
|
+
} from "./packager-tool-6ybywxxn.js";
|
|
4
|
+
|
|
5
|
+
// src/services/governance-options.ts
|
|
6
|
+
var GOVERNANCE_OPTION_INSTRUCTIONS = "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.";
|
|
7
|
+
function validateGovernanceOptions(options) {
|
|
8
|
+
if (options.governanceFilePath?.trim() === "") {
|
|
9
|
+
return "--governance-file-path was given an empty value.";
|
|
10
|
+
}
|
|
11
|
+
if (options.governanceProduct !== undefined && options.automationOpsProfile !== undefined) {
|
|
12
|
+
return "governanceProduct and automationOpsProfile are aliases. Set only governanceProduct.";
|
|
13
|
+
}
|
|
14
|
+
if (options.automationOpsProfile?.trim() === "") {
|
|
15
|
+
return "--governance-product was given an empty value.";
|
|
16
|
+
}
|
|
17
|
+
if (options.governanceProduct?.trim() === "") {
|
|
18
|
+
return "--governance-product was given an empty value.";
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
var AUTOMATION_OPS_RULES_KEY = "embedded-rules-config-rules";
|
|
23
|
+
function detectGovernanceFileType(source) {
|
|
24
|
+
const [parseError, parsed] = catchError(() => JSON.parse(source));
|
|
25
|
+
if (parseError) {
|
|
26
|
+
return { kind: "unparseable" };
|
|
27
|
+
}
|
|
28
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
29
|
+
return { kind: "unparseable" };
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(parsed)) {
|
|
32
|
+
return { kind: "detected", fileType: "Studio" /* Studio */ };
|
|
33
|
+
}
|
|
34
|
+
const root = parsed;
|
|
35
|
+
const nested = root.data;
|
|
36
|
+
if (typeof nested === "object" && nested !== null && AUTOMATION_OPS_RULES_KEY in nested) {
|
|
37
|
+
return {
|
|
38
|
+
kind: "detected",
|
|
39
|
+
fileType: "AutomationOps" /* AutomationOps */
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (AUTOMATION_OPS_RULES_KEY in root) {
|
|
43
|
+
return { kind: "unwrapped-automation-ops" };
|
|
44
|
+
}
|
|
45
|
+
return { kind: "detected", fileType: "Studio" /* Studio */ };
|
|
46
|
+
}
|
|
47
|
+
function governanceFileUnreadableMessage(path) {
|
|
48
|
+
return `--governance-file-path could not read the governance policy file: ${path}`;
|
|
49
|
+
}
|
|
50
|
+
function governanceFileUnwrappedMessage(path) {
|
|
51
|
+
return "--governance-file-path was given the inner policy of an AutomationOps " + `export rather than the exported file: ${path}`;
|
|
52
|
+
}
|
|
53
|
+
function governanceFileUnparseableMessage(path) {
|
|
54
|
+
return `--governance-file-path is not a JSON governance policy file: ${path}`;
|
|
55
|
+
}
|
|
56
|
+
var GOVERNANCE_FILE_UNUSABLE_INSTRUCTIONS = "Pass a policy exported from AutomationOps, or a Studio rules-configuration file. " + "Check the path is correct and the file is readable JSON.";
|
|
57
|
+
async function resolveGovernanceFileTypeAsync(fs, governanceFilePath) {
|
|
58
|
+
const [readError, source] = await catchError(fs.readFile(governanceFilePath, "utf-8"));
|
|
59
|
+
if (readError || typeof source !== "string") {
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
message: governanceFileUnreadableMessage(governanceFilePath),
|
|
63
|
+
instructions: GOVERNANCE_FILE_UNUSABLE_INSTRUCTIONS
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const detection = detectGovernanceFileType(source);
|
|
67
|
+
if (detection.kind === "unparseable") {
|
|
68
|
+
return {
|
|
69
|
+
ok: false,
|
|
70
|
+
message: governanceFileUnparseableMessage(governanceFilePath),
|
|
71
|
+
instructions: GOVERNANCE_FILE_UNUSABLE_INSTRUCTIONS
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (detection.kind === "unwrapped-automation-ops") {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
message: governanceFileUnwrappedMessage(governanceFilePath),
|
|
78
|
+
instructions: "Export the policy from AutomationOps and pass that file as-is — " + "the analyzer reads the whole export, including the fields around " + "'data'. Re-wrap the policy under a 'data' key if you only kept its body."
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return { ok: true, fileType: detection.fileType };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { GOVERNANCE_OPTION_INSTRUCTIONS, validateGovernanceOptions, detectGovernanceFileType, governanceFileUnreadableMessage, governanceFileUnwrappedMessage, governanceFileUnparseableMessage, GOVERNANCE_FILE_UNUSABLE_INSTRUCTIONS, resolveGovernanceFileTypeAsync };
|
|
85
|
+
|
|
86
|
+
//# debugId=4D8C0578B7C33E4864756E2164756E21
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ensureProjectId,
|
|
10
10
|
toolsFactoryRepository,
|
|
11
11
|
writeOrBackfillOperateProjectId
|
|
12
|
-
} from "./packager-tool-
|
|
12
|
+
} from "./packager-tool-pbmqk39a.js";
|
|
13
13
|
|
|
14
14
|
// ../packager/packager-tool-connector/src/connector-tool.ts
|
|
15
15
|
class ConnectorTool extends ProjectTool {
|