@uipath/codedapp-tool 1.197.0 → 1.198.0-preview.81
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/tool.js +220 -49
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -38524,7 +38524,7 @@ function settlePromiseLike2(thenable) {
|
|
|
38524
38524
|
}
|
|
38525
38525
|
|
|
38526
38526
|
// ../auth/src/constants.ts
|
|
38527
|
-
var UIPATH_HOME_DIR = ".uipath", AUTH_FILENAME = ".auth", DEFAULT_BASE_URL = "https://cloud.uipath.com", DEFAULT_AUTH_TIMEOUT_MS2, DEFAULT_REDIRECT_URI = "http://localhost:8104/oidc/login";
|
|
38527
|
+
var UIPATH_HOME_DIR = ".uipath", AUTH_FILENAME = ".auth", DEFAULT_BASE_URL = "https://cloud.uipath.com", DEFAULT_AUTH_TIMEOUT_MS2, AUTH_CANCELLED_ERROR_CODE = "EAUTHCANCELLED", DEFAULT_REDIRECT_URI = "http://localhost:8104/oidc/login";
|
|
38528
38528
|
var init_constants = __esm(() => {
|
|
38529
38529
|
DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
|
|
38530
38530
|
});
|
|
@@ -58808,7 +58808,8 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
58808
58808
|
interactive,
|
|
58809
58809
|
onEvent,
|
|
58810
58810
|
timeoutMs,
|
|
58811
|
-
noBrowser
|
|
58811
|
+
noBrowser,
|
|
58812
|
+
signal
|
|
58812
58813
|
} = options;
|
|
58813
58814
|
const emit = (event) => {
|
|
58814
58815
|
if (!onEvent)
|
|
@@ -58850,6 +58851,7 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
58850
58851
|
organization,
|
|
58851
58852
|
timeoutMs,
|
|
58852
58853
|
noBrowser,
|
|
58854
|
+
signal,
|
|
58853
58855
|
onAuthUrl: noBrowser ? (url2) => deliverAuthUrl(url2) : undefined
|
|
58854
58856
|
});
|
|
58855
58857
|
return {
|
|
@@ -59171,7 +59173,8 @@ var escapeHtml2 = (value) => value.replace(/[&<>"']/g, (char) => {
|
|
|
59171
59173
|
var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT", startServer = async ({
|
|
59172
59174
|
redirectUri,
|
|
59173
59175
|
timeoutMs = DEFAULT_AUTH_TIMEOUT_MS2,
|
|
59174
|
-
onListening
|
|
59176
|
+
onListening,
|
|
59177
|
+
signal
|
|
59175
59178
|
}) => {
|
|
59176
59179
|
let http3;
|
|
59177
59180
|
try {
|
|
@@ -59239,8 +59242,24 @@ var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT", startServer = async ({
|
|
|
59239
59242
|
reject(new Error("No authorization code received"));
|
|
59240
59243
|
return;
|
|
59241
59244
|
});
|
|
59242
|
-
|
|
59245
|
+
let timeoutHandle;
|
|
59246
|
+
const onAbort = () => {
|
|
59247
|
+
clearTimeout(timeoutHandle);
|
|
59248
|
+
server.close();
|
|
59249
|
+
const err2 = new Error("Authentication cancelled");
|
|
59250
|
+
err2.code = AUTH_CANCELLED_ERROR_CODE;
|
|
59251
|
+
reject(err2);
|
|
59252
|
+
};
|
|
59253
|
+
if (signal) {
|
|
59254
|
+
if (signal.aborted) {
|
|
59255
|
+
onAbort();
|
|
59256
|
+
return;
|
|
59257
|
+
}
|
|
59258
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
59259
|
+
}
|
|
59260
|
+
timeoutHandle = setTimeout(() => {
|
|
59243
59261
|
server.close();
|
|
59262
|
+
signal?.removeEventListener("abort", onAbort);
|
|
59244
59263
|
const err2 = new Error("Authentication timeout");
|
|
59245
59264
|
err2.code = AUTH_TIMEOUT_ERROR_CODE;
|
|
59246
59265
|
reject(err2);
|
|
@@ -59248,6 +59267,7 @@ var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT", startServer = async ({
|
|
|
59248
59267
|
const bindHost = redirectUri.hostname === "localhost" ? "127.0.0.1" : redirectUri.hostname;
|
|
59249
59268
|
server.on("error", (err2) => {
|
|
59250
59269
|
clearTimeout(timeoutHandle);
|
|
59270
|
+
signal?.removeEventListener("abort", onAbort);
|
|
59251
59271
|
reject(err2);
|
|
59252
59272
|
});
|
|
59253
59273
|
server.listen(Number(redirectUri.port), bindHost, () => {
|
|
@@ -59261,6 +59281,7 @@ var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT", startServer = async ({
|
|
|
59261
59281
|
});
|
|
59262
59282
|
server.on("close", () => {
|
|
59263
59283
|
clearTimeout(timeoutHandle);
|
|
59284
|
+
signal?.removeEventListener("abort", onAbort);
|
|
59264
59285
|
});
|
|
59265
59286
|
});
|
|
59266
59287
|
};
|
|
@@ -59275,7 +59296,7 @@ __export(exports_browser_strategy, {
|
|
|
59275
59296
|
});
|
|
59276
59297
|
|
|
59277
59298
|
class BrowserAuthStrategy {
|
|
59278
|
-
async execute(url2, _redirectUri, expectedState,
|
|
59299
|
+
async execute(url2, _redirectUri, expectedState, opts) {
|
|
59279
59300
|
const global4 = getGlobalThis();
|
|
59280
59301
|
if (!global4?.window) {
|
|
59281
59302
|
throw new Error("Browser environment required for authentication");
|
|
@@ -59302,6 +59323,7 @@ class BrowserAuthStrategy {
|
|
|
59302
59323
|
` + "If using an ad blocker, you may need to temporarily disable it.");
|
|
59303
59324
|
}
|
|
59304
59325
|
return new Promise((resolve2, reject) => {
|
|
59326
|
+
let timer;
|
|
59305
59327
|
const messageHandler = (event) => {
|
|
59306
59328
|
if (event.data?.type === "UIP_AUTH_CODE" && event.data.code) {
|
|
59307
59329
|
if (event.data.state !== expectedState) {
|
|
@@ -59324,13 +59346,30 @@ class BrowserAuthStrategy {
|
|
|
59324
59346
|
};
|
|
59325
59347
|
const cleanup = () => {
|
|
59326
59348
|
global4.window?.removeEventListener?.("message", messageHandler);
|
|
59349
|
+
opts?.signal?.removeEventListener("abort", onAbort);
|
|
59327
59350
|
if (timer)
|
|
59328
59351
|
clearInterval(timer);
|
|
59329
59352
|
};
|
|
59353
|
+
const onAbort = () => {
|
|
59354
|
+
cleanup();
|
|
59355
|
+
const err2 = new Error(`Authentication was cancelled.
|
|
59356
|
+
|
|
59357
|
+
` + "The sign-in was cancelled before completing the login process. " + "Please try again and complete the authentication flow.");
|
|
59358
|
+
err2.code = AUTH_CANCELLED_ERROR_CODE;
|
|
59359
|
+
reject(err2);
|
|
59360
|
+
popup.close();
|
|
59361
|
+
};
|
|
59362
|
+
if (opts?.signal) {
|
|
59363
|
+
if (opts.signal.aborted) {
|
|
59364
|
+
onAbort();
|
|
59365
|
+
return;
|
|
59366
|
+
}
|
|
59367
|
+
opts.signal.addEventListener("abort", onAbort, { once: true });
|
|
59368
|
+
}
|
|
59330
59369
|
if (global4.window?.addEventListener) {
|
|
59331
59370
|
global4.window.addEventListener("message", messageHandler);
|
|
59332
59371
|
}
|
|
59333
|
-
|
|
59372
|
+
timer = setInterval(() => {
|
|
59334
59373
|
if (popup.closed) {
|
|
59335
59374
|
cleanup();
|
|
59336
59375
|
reject(new Error(`Authentication was cancelled.
|
|
@@ -59341,7 +59380,9 @@ class BrowserAuthStrategy {
|
|
|
59341
59380
|
});
|
|
59342
59381
|
}
|
|
59343
59382
|
}
|
|
59344
|
-
var init_browser_strategy = () => {
|
|
59383
|
+
var init_browser_strategy = __esm(() => {
|
|
59384
|
+
init_constants();
|
|
59385
|
+
});
|
|
59345
59386
|
|
|
59346
59387
|
// ../auth/src/strategies/node-strategy.ts
|
|
59347
59388
|
var exports_node_strategy = {};
|
|
@@ -59355,6 +59396,7 @@ class NodeAuthStrategy {
|
|
|
59355
59396
|
const callbackUrl = await startServer({
|
|
59356
59397
|
redirectUri,
|
|
59357
59398
|
timeoutMs: opts?.timeoutMs,
|
|
59399
|
+
signal: opts?.signal,
|
|
59358
59400
|
onListening: async () => {
|
|
59359
59401
|
let safeUrl = "";
|
|
59360
59402
|
for (const ch of url2) {
|
|
@@ -59460,7 +59502,8 @@ __export(exports_src, {
|
|
|
59460
59502
|
ClientCredentialsAuthenticationError: () => ClientCredentialsAuthenticationError,
|
|
59461
59503
|
AuthProfileValidationError: () => AuthProfileValidationError,
|
|
59462
59504
|
AUTH_TIMEOUT_ERROR_CODE: () => AUTH_TIMEOUT_ERROR_CODE,
|
|
59463
|
-
AUTH_FLOW_ENV_VAR: () => AUTH_FLOW_ENV_VAR
|
|
59505
|
+
AUTH_FLOW_ENV_VAR: () => AUTH_FLOW_ENV_VAR,
|
|
59506
|
+
AUTH_CANCELLED_ERROR_CODE: () => AUTH_CANCELLED_ERROR_CODE
|
|
59464
59507
|
});
|
|
59465
59508
|
var authenticate = async ({
|
|
59466
59509
|
baseUrl,
|
|
@@ -59471,7 +59514,8 @@ var authenticate = async ({
|
|
|
59471
59514
|
organization,
|
|
59472
59515
|
timeoutMs,
|
|
59473
59516
|
noBrowser,
|
|
59474
|
-
onAuthUrl
|
|
59517
|
+
onAuthUrl,
|
|
59518
|
+
signal
|
|
59475
59519
|
}) => {
|
|
59476
59520
|
const config3 = await resolveConfigAsync({
|
|
59477
59521
|
customAuthority: baseUrl,
|
|
@@ -59521,7 +59565,12 @@ var authenticate = async ({
|
|
|
59521
59565
|
const { NodeAuthStrategy: NodeAuthStrategy2 } = await Promise.resolve().then(() => (init_node_strategy(), exports_node_strategy));
|
|
59522
59566
|
strategy = new NodeAuthStrategy2;
|
|
59523
59567
|
}
|
|
59524
|
-
const code = await strategy.execute(authUrl, effectiveRedirectUriUrl, state, {
|
|
59568
|
+
const code = await strategy.execute(authUrl, effectiveRedirectUriUrl, state, {
|
|
59569
|
+
timeoutMs,
|
|
59570
|
+
noBrowser,
|
|
59571
|
+
onAuthUrl,
|
|
59572
|
+
signal
|
|
59573
|
+
});
|
|
59525
59574
|
return await exchangeCodeForTokens({
|
|
59526
59575
|
code,
|
|
59527
59576
|
codeVerifier: code_verifier,
|
|
@@ -59536,6 +59585,7 @@ var init_src2 = __esm(() => {
|
|
|
59536
59585
|
init_constants();
|
|
59537
59586
|
init_oidc();
|
|
59538
59587
|
init_config();
|
|
59588
|
+
init_constants();
|
|
59539
59589
|
init_envAuth();
|
|
59540
59590
|
init_refreshCircuitBreaker();
|
|
59541
59591
|
init_selectTenant();
|
|
@@ -59554,7 +59604,7 @@ var init_src2 = __esm(() => {
|
|
|
59554
59604
|
var package_default = {
|
|
59555
59605
|
name: "@uipath/codedapp-tool",
|
|
59556
59606
|
license: "MIT",
|
|
59557
|
-
version: "1.
|
|
59607
|
+
version: "1.198.0-preview.81",
|
|
59558
59608
|
description: "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
|
|
59559
59609
|
keywords: [
|
|
59560
59610
|
"cli-tool",
|
|
@@ -64655,6 +64705,7 @@ function getLogFilePath() {
|
|
|
64655
64705
|
// ../common/src/output-format-context.ts
|
|
64656
64706
|
var formatSlot = singleton("OutputFormat");
|
|
64657
64707
|
var formatExplicitSlot = singleton("OutputFormatExplicit");
|
|
64708
|
+
var helpRequestedSlot = singleton("HelpRequested");
|
|
64658
64709
|
var filterSlot = singleton("OutputFilter");
|
|
64659
64710
|
function getOutputFormat() {
|
|
64660
64711
|
return formatSlot.get("json");
|
|
@@ -65722,6 +65773,9 @@ var OutputFormatter;
|
|
|
65722
65773
|
if (opts?.warning) {
|
|
65723
65774
|
data.Warning = opts.warning;
|
|
65724
65775
|
}
|
|
65776
|
+
if (opts?.pagination) {
|
|
65777
|
+
data.Pagination = opts.pagination;
|
|
65778
|
+
}
|
|
65725
65779
|
success(data);
|
|
65726
65780
|
}
|
|
65727
65781
|
OutputFormatter.emitList = emitList;
|
|
@@ -66169,6 +66223,7 @@ var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
|
66169
66223
|
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
66170
66224
|
// ../common/src/interactivity-context.ts
|
|
66171
66225
|
var modeSlot = singleton("InteractivityMode");
|
|
66226
|
+
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
66172
66227
|
function getInteractivityMode() {
|
|
66173
66228
|
return modeSlot.get("auto") ?? "auto";
|
|
66174
66229
|
}
|
|
@@ -74397,6 +74452,7 @@ function ora(options) {
|
|
|
74397
74452
|
var API_ENDPOINTS = {
|
|
74398
74453
|
PUBLISH_CODED_APP: "/apps_/default/api/v1/default/models/apps/codedapp/publish",
|
|
74399
74454
|
UPLOAD_PACKAGE: "/orchestrator_/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage()",
|
|
74455
|
+
ORCH_CURRENT_USER_EXTENDED: "/orchestrator_/odata/Users/UiPath.Server.Configuration.OData.GetCurrentUserExtended",
|
|
74400
74456
|
STUDIO_WEB_STRUCTURE: "/studio_/backend/api/Project/{projectId}/FileOperations/Structure",
|
|
74401
74457
|
STUDIO_WEB_DOWNLOAD_FILE: "/studio_/backend/api/Project/{projectId}/FileOperations/File/{fileId}",
|
|
74402
74458
|
STUDIO_WEB_DELETE_ITEM: "/studio_/backend/api/Project/{projectId}/FileOperations/Delete/{itemId}",
|
|
@@ -74651,6 +74707,7 @@ var MESSAGES = {
|
|
|
74651
74707
|
FAILED_TO_FETCH_ORG_TENANT: "❌ Failed to fetch organization/tenant information",
|
|
74652
74708
|
APP_DEPLOYMENT_FAILED: "❌ App deployment failed",
|
|
74653
74709
|
APP_UPGRADE_FAILED: "❌ App upgrade failed",
|
|
74710
|
+
PERSONAL_WORKSPACE_FEED_MISSING: "❌ Could not resolve your Personal Workspace feed. Ensure Personal Workspaces are enabled for your account, or omit --personal-workspace to publish into the tenant feed.",
|
|
74654
74711
|
APP_NOT_PUBLISHED: '❌ App has not been published yet, or the published app is still being indexed. If publish just succeeded, wait a few seconds and rerun "uip codedapp deploy"; otherwise run "uip codedapp publish" first.',
|
|
74655
74712
|
APP_NAME_ALREADY_EXISTS: "❌ This app name is already deployed in this folder. Please choose a different name.",
|
|
74656
74713
|
DEPLOY_VERSION_NOT_FOUND: "❌ Could not determine deploy version from the server. Please re-run publish first.",
|
|
@@ -74759,6 +74816,7 @@ var MESSAGES = {
|
|
|
74759
74816
|
CREATING_NUPKG_PACKAGE: "Creating .nupkg package...",
|
|
74760
74817
|
PUBLISHING_PACKAGE: "Publishing package to UiPath Orchestrator...",
|
|
74761
74818
|
UPLOADING_PACKAGE: "Uploading package to Orchestrator...",
|
|
74819
|
+
RESOLVING_PERSONAL_WORKSPACE_FEED: "Resolving Personal Workspace feed...",
|
|
74762
74820
|
REGISTERING_CODED_APP: "Registering coded app...",
|
|
74763
74821
|
PACKAGE_ALREADY_EXISTS: "ℹ Package already exists in Orchestrator, proceeding to registration...",
|
|
74764
74822
|
FINDING_PORT: "Finding available port...",
|
|
@@ -74832,6 +74890,7 @@ var MESSAGES = {
|
|
|
74832
74890
|
},
|
|
74833
74891
|
ERROR_CONTEXT: {
|
|
74834
74892
|
PACKAGE_PUBLISHING: "package publishing",
|
|
74893
|
+
PERSONAL_WORKSPACE_LOOKUP: "Personal Workspace lookup",
|
|
74835
74894
|
CLIENT_CREDENTIALS_AUTH: "client credentials authentication",
|
|
74836
74895
|
APP_DEPLOYMENT: "app deployment",
|
|
74837
74896
|
APP_UPGRADE: "app upgrade",
|
|
@@ -89561,6 +89620,12 @@ async function handleHttpError(response, context) {
|
|
|
89561
89620
|
|
|
89562
89621
|
// src/utils/folder-selection.ts
|
|
89563
89622
|
var NON_INTERACTIVE_FOLDER_KEY_MESSAGE = "--folder-key is required when folder selection cannot be prompted in a non-interactive session. Run 'uip or folders list --output json' to find a folder key, then re-run with --folder-key <key>, or set UIPATH_FOLDER_KEY. Pass --interactive to enable prompts.";
|
|
89623
|
+
function isPersonalFolder(folder) {
|
|
89624
|
+
return folder.folderType === "Personal";
|
|
89625
|
+
}
|
|
89626
|
+
function matchesWorkspace(folder, personalWorkspace) {
|
|
89627
|
+
return personalWorkspace ? isPersonalFolder(folder) : !isPersonalFolder(folder);
|
|
89628
|
+
}
|
|
89564
89629
|
async function fetchFolders(baseUrl, accessToken, orgId, tenantName) {
|
|
89565
89630
|
const url2 = `${baseUrl}/${orgId}/${tenantName}/orchestrator_/api/Folders/GetAllForCurrentUser`;
|
|
89566
89631
|
const response = await fetch2(url2, {
|
|
@@ -89574,28 +89639,37 @@ async function fetchFolders(baseUrl, accessToken, orgId, tenantName) {
|
|
|
89574
89639
|
return items.map((item) => ({
|
|
89575
89640
|
key: String(item.Key ?? item.key ?? ""),
|
|
89576
89641
|
displayName: String(item.DisplayName ?? item.displayName ?? ""),
|
|
89577
|
-
fullyQualifiedName: String(item.FullyQualifiedName ?? item.fullyQualifiedName ?? "")
|
|
89642
|
+
fullyQualifiedName: String(item.FullyQualifiedName ?? item.fullyQualifiedName ?? ""),
|
|
89643
|
+
folderType: String(item.FolderType ?? item.folderType ?? "")
|
|
89578
89644
|
}));
|
|
89579
89645
|
}
|
|
89580
|
-
async function promptFolderSelection(folders, logger3) {
|
|
89581
|
-
|
|
89646
|
+
async function promptFolderSelection(folders, logger3, personalWorkspace) {
|
|
89647
|
+
const filtered = personalWorkspace === undefined ? folders : folders.filter((f3) => matchesWorkspace(f3, personalWorkspace));
|
|
89648
|
+
if (filtered.length === 0) {
|
|
89649
|
+
if (personalWorkspace === true) {
|
|
89650
|
+
throw new Error("No Personal Workspace folders are accessible. Enable Personal Workspaces for your account, or re-publish this app without --personal-workspace to target the tenant feed.");
|
|
89651
|
+
}
|
|
89652
|
+
if (personalWorkspace === false) {
|
|
89653
|
+
throw new Error("No shared tenant folders are accessible. Grant your account access to a tenant folder, or re-publish this app with --personal-workspace to target your Personal Workspace.");
|
|
89654
|
+
}
|
|
89582
89655
|
logger3.log(source_default.yellow("No folders found in this tenant."));
|
|
89583
89656
|
return null;
|
|
89584
89657
|
}
|
|
89585
|
-
if (
|
|
89586
|
-
logger3.log(source_default.green(`Only one folder available: ${
|
|
89587
|
-
return
|
|
89658
|
+
if (filtered.length === 1) {
|
|
89659
|
+
logger3.log(source_default.green(`Only one folder available: ${filtered[0].displayName}. Selected.`));
|
|
89660
|
+
return filtered[0].key;
|
|
89588
89661
|
}
|
|
89589
89662
|
if (!canPrompt()) {
|
|
89590
89663
|
throw new Error(NON_INTERACTIVE_FOLDER_KEY_MESSAGE);
|
|
89591
89664
|
}
|
|
89665
|
+
const promptMessage = personalWorkspace === true ? "Select a Personal Workspace folder:" : personalWorkspace === false ? "Select a shared folder:" : "Select a folder:";
|
|
89592
89666
|
const { selection } = await esm_default15.prompt([
|
|
89593
89667
|
{
|
|
89594
89668
|
type: "list",
|
|
89595
89669
|
name: "selection",
|
|
89596
|
-
message:
|
|
89670
|
+
message: promptMessage,
|
|
89597
89671
|
choices: [
|
|
89598
|
-
...
|
|
89672
|
+
...filtered.map((f3) => ({
|
|
89599
89673
|
name: `${f3.displayName} (${f3.fullyQualifiedName})`,
|
|
89600
89674
|
value: f3.key
|
|
89601
89675
|
})),
|
|
@@ -89607,23 +89681,41 @@ async function promptFolderSelection(folders, logger3) {
|
|
|
89607
89681
|
if (selection === "__skip__") {
|
|
89608
89682
|
return null;
|
|
89609
89683
|
}
|
|
89610
|
-
const selected =
|
|
89684
|
+
const selected = filtered.find((f3) => f3.key === selection);
|
|
89611
89685
|
if (selected) {
|
|
89612
89686
|
logger3.log(source_default.green(`Selected folder: ${selected.displayName}`));
|
|
89613
89687
|
}
|
|
89614
89688
|
return selection;
|
|
89615
89689
|
}
|
|
89616
|
-
async function
|
|
89617
|
-
|
|
89618
|
-
|
|
89690
|
+
async function validateExplicitFolderKey(folderKey, personalWorkspace, baseUrl, accessToken, orgId, tenantName) {
|
|
89691
|
+
const [fetchErr, folders] = await catchError(fetchFolders(baseUrl, accessToken, orgId, tenantName));
|
|
89692
|
+
if (fetchErr)
|
|
89619
89693
|
return;
|
|
89694
|
+
const match = folders.find((f3) => f3.key === folderKey);
|
|
89695
|
+
if (!match) {
|
|
89696
|
+
throw new Error(`Folder key '${folderKey}' was not found among folders accessible to your account. Re-check the key with 'uip or folders list --output json'.`);
|
|
89620
89697
|
}
|
|
89621
|
-
if (
|
|
89622
|
-
|
|
89698
|
+
if (!matchesWorkspace(match, personalWorkspace)) {
|
|
89699
|
+
const folderKind = isPersonalFolder(match) ? "a Personal Workspace" : "a shared tenant";
|
|
89700
|
+
const publishedAs = personalWorkspace ? "into your Personal Workspace" : "into the tenant feed";
|
|
89701
|
+
const fixHint = personalWorkspace ? "Pass a Personal Workspace folder key, or re-publish without --personal-workspace." : "Pass a shared folder key, or re-publish with --personal-workspace.";
|
|
89702
|
+
throw new Error(`Folder '${match.displayName}' (${match.fullyQualifiedName}) is ${folderKind} folder, but this app was published ${publishedAs}. ${fixHint}`);
|
|
89703
|
+
}
|
|
89704
|
+
}
|
|
89705
|
+
async function ensureFolderKey(logger3, explicitFolderKey, personalWorkspace) {
|
|
89623
89706
|
const baseUrl = process.env.UIPATH_BASE_URL;
|
|
89624
89707
|
const accessToken = process.env.UIPATH_ACCESS_TOKEN;
|
|
89625
89708
|
const orgId = process.env.UIPATH_ORG_ID;
|
|
89626
89709
|
const tenantName = process.env.UIPATH_TENANT_NAME;
|
|
89710
|
+
if (explicitFolderKey !== undefined) {
|
|
89711
|
+
if (personalWorkspace !== undefined && baseUrl && accessToken && orgId && tenantName) {
|
|
89712
|
+
await validateExplicitFolderKey(explicitFolderKey, personalWorkspace, baseUrl, accessToken, orgId, tenantName);
|
|
89713
|
+
}
|
|
89714
|
+
process.env.UIPATH_FOLDER_KEY = explicitFolderKey;
|
|
89715
|
+
return;
|
|
89716
|
+
}
|
|
89717
|
+
if (process.env.UIPATH_FOLDER_KEY)
|
|
89718
|
+
return;
|
|
89627
89719
|
if (!baseUrl || !accessToken || !orgId || !tenantName)
|
|
89628
89720
|
return;
|
|
89629
89721
|
const [fetchErr, folders] = await catchError(fetchFolders(baseUrl, accessToken, orgId, tenantName));
|
|
@@ -89632,7 +89724,7 @@ async function ensureFolderKey(logger3, explicitFolderKey) {
|
|
|
89632
89724
|
logger3.log(source_default.yellow("You can provide --folder-key manually or set UIPATH_FOLDER_KEY in your .env."));
|
|
89633
89725
|
return;
|
|
89634
89726
|
}
|
|
89635
|
-
const folderKey = await promptFolderSelection(folders, logger3);
|
|
89727
|
+
const folderKey = await promptFolderSelection(folders, logger3, personalWorkspace);
|
|
89636
89728
|
if (folderKey) {
|
|
89637
89729
|
process.env.UIPATH_FOLDER_KEY = folderKey;
|
|
89638
89730
|
}
|
|
@@ -89740,13 +89832,16 @@ async function checkAppNameUniqueness(appName, envConfig) {
|
|
|
89740
89832
|
throw new Error(MESSAGES.ERRORS.APP_NAME_ALREADY_EXISTS);
|
|
89741
89833
|
}
|
|
89742
89834
|
}
|
|
89743
|
-
async function deployNewApp(appName, routingName, systemName, deployVersion, envConfig, tags) {
|
|
89835
|
+
async function deployNewApp(appName, routingName, systemName, deployVersion, envConfig, tags, clientId) {
|
|
89744
89836
|
const endpoint = API_ENDPOINTS.DEPLOY_APP.replace("{systemName}", systemName).replace("{deployVersion}", String(deployVersion));
|
|
89745
89837
|
const url2 = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${endpoint}`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
89746
89838
|
const body = { title: appName, routingName };
|
|
89747
89839
|
if (tags?.length) {
|
|
89748
89840
|
body.tags = tags;
|
|
89749
89841
|
}
|
|
89842
|
+
if (clientId?.trim()) {
|
|
89843
|
+
body.clientId = clientId.trim();
|
|
89844
|
+
}
|
|
89750
89845
|
const response = await fetch2(url2, {
|
|
89751
89846
|
method: "POST",
|
|
89752
89847
|
headers: createHeaders({
|
|
@@ -89761,7 +89856,7 @@ async function deployNewApp(appName, routingName, systemName, deployVersion, env
|
|
|
89761
89856
|
const data = await response.json();
|
|
89762
89857
|
return data.id;
|
|
89763
89858
|
}
|
|
89764
|
-
async function upgradeApp(appId, title, version2, routingName, envConfig, tags) {
|
|
89859
|
+
async function upgradeApp(appId, title, version2, routingName, envConfig, tags, clientId) {
|
|
89765
89860
|
const url2 = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${API_ENDPOINTS.EDIT_DEPLOYED_APP.replace("{appId}", appId)}`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
89766
89861
|
const body = {
|
|
89767
89862
|
title,
|
|
@@ -89774,6 +89869,9 @@ async function upgradeApp(appId, title, version2, routingName, envConfig, tags)
|
|
|
89774
89869
|
if (tags?.length) {
|
|
89775
89870
|
body.tags = tags;
|
|
89776
89871
|
}
|
|
89872
|
+
if (clientId?.trim()) {
|
|
89873
|
+
body.clientId = clientId.trim();
|
|
89874
|
+
}
|
|
89777
89875
|
const response = await fetch2(url2, {
|
|
89778
89876
|
method: "PATCH",
|
|
89779
89877
|
headers: createHeaders({
|
|
@@ -89786,13 +89884,18 @@ async function upgradeApp(appId, title, version2, routingName, envConfig, tags)
|
|
|
89786
89884
|
if (!response.ok)
|
|
89787
89885
|
await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_UPGRADE);
|
|
89788
89886
|
}
|
|
89789
|
-
async function updateAppConfig(
|
|
89887
|
+
async function updateAppConfig(update, logger3) {
|
|
89790
89888
|
const fsys = getFileSystem();
|
|
89791
89889
|
const configDir = fsys.path.join(fsys.env.cwd(), AUTH_CONSTANTS.FILES.UIPATH_DIR);
|
|
89792
89890
|
const configPath = fsys.path.join(configDir, AUTH_CONSTANTS.FILES.APP_CONFIG);
|
|
89793
89891
|
const [error52] = await catchError((async () => {
|
|
89794
89892
|
const config2 = await loadAppConfig(logger3) ?? {};
|
|
89795
|
-
|
|
89893
|
+
if (update.deploymentId !== undefined) {
|
|
89894
|
+
config2.deploymentId = update.deploymentId;
|
|
89895
|
+
}
|
|
89896
|
+
if (update.appUrl !== undefined) {
|
|
89897
|
+
config2.appUrl = update.appUrl;
|
|
89898
|
+
}
|
|
89796
89899
|
config2.deployedAt = new Date().toISOString();
|
|
89797
89900
|
if (!await fsys.exists(configDir))
|
|
89798
89901
|
await fsys.mkdir(configDir);
|
|
@@ -89820,7 +89923,8 @@ async function executeDeploy(options) {
|
|
|
89820
89923
|
log: (msg) => logger.info(msg)
|
|
89821
89924
|
};
|
|
89822
89925
|
logger3.log(source_default.blue(MESSAGES.INFO.APP_DEPLOYMENT));
|
|
89823
|
-
await
|
|
89926
|
+
const savedConfig = await loadAppConfig(logger3);
|
|
89927
|
+
await ensureFolderKey(logger3, options.folderKey, savedConfig?.personalWorkspace);
|
|
89824
89928
|
const envConfig = getEnvironmentConfig(AUTH_CONSTANTS.REQUIRED_ENV_VARS.DEPLOY, logger3, {
|
|
89825
89929
|
baseUrl: options.baseUrl,
|
|
89826
89930
|
orgId: options.orgId,
|
|
@@ -89875,7 +89979,7 @@ async function executeDeploy(options) {
|
|
|
89875
89979
|
spinner.fail(source_default.red(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND));
|
|
89876
89980
|
throw new Error(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND);
|
|
89877
89981
|
}
|
|
89878
|
-
await upgradeApp(deployedApp.id, displayTitle, publishedApp.deployVersion, options.pathName ? routingName : undefined, envConfig, options.tags);
|
|
89982
|
+
await upgradeApp(deployedApp.id, displayTitle, publishedApp.deployVersion, options.pathName ? routingName : undefined, envConfig, options.tags, options.clientId);
|
|
89879
89983
|
spinner.succeed(source_default.green(MESSAGES.SUCCESS.APP_UPGRADED_SUCCESS));
|
|
89880
89984
|
const appConfig3 = await loadAppConfig(logger3);
|
|
89881
89985
|
const version2 = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? deployedApp.semVersion;
|
|
@@ -89906,9 +90010,8 @@ async function executeDeploy(options) {
|
|
|
89906
90010
|
spinner.fail(source_default.red(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND));
|
|
89907
90011
|
throw new Error(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND);
|
|
89908
90012
|
}
|
|
89909
|
-
const deploymentId = await deployNewApp(displayTitle, routingName, publishedApp.systemName, publishedApp.deployVersion, envConfig, options.tags);
|
|
90013
|
+
const deploymentId = await deployNewApp(displayTitle, routingName, publishedApp.systemName, publishedApp.deployVersion, envConfig, options.tags, options.clientId);
|
|
89910
90014
|
spinner.succeed(source_default.green(MESSAGES.SUCCESS.APP_DEPLOYED_SUCCESS));
|
|
89911
|
-
await updateAppConfig(deploymentId, logger3);
|
|
89912
90015
|
const appConfig3 = await loadAppConfig(logger3);
|
|
89913
90016
|
const version2 = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? "1.0.0";
|
|
89914
90017
|
operationResult = {
|
|
@@ -89925,6 +90028,10 @@ async function executeDeploy(options) {
|
|
|
89925
90028
|
const appConfig2 = await loadAppConfig(logger3);
|
|
89926
90029
|
const isActionApp = appConfig2?.appType === "Action" /* Action */;
|
|
89927
90030
|
const appUrl = isActionApp ? null : buildAppUrl(envConfig.baseUrl, envConfig.orgName, routingName);
|
|
90031
|
+
await updateAppConfig({
|
|
90032
|
+
deploymentId: operationResult.operation === "deploy" ? operationResult.deploymentId : undefined,
|
|
90033
|
+
appUrl
|
|
90034
|
+
}, logger3);
|
|
89928
90035
|
logDeployDetails(logger3, displayTitle, operationResult.version, appUrl);
|
|
89929
90036
|
return {
|
|
89930
90037
|
appName: displayTitle,
|
|
@@ -89980,6 +90087,16 @@ var DEPLOY_EXAMPLES = [
|
|
|
89980
90087
|
}
|
|
89981
90088
|
}
|
|
89982
90089
|
},
|
|
90090
|
+
{
|
|
90091
|
+
Description: "Deploy with a custom OAuth client",
|
|
90092
|
+
Command: 'uip codedapp deploy --name "MyApp" --client-id "my-oauth-client-id"',
|
|
90093
|
+
Output: {
|
|
90094
|
+
Code: "DeployCompleted",
|
|
90095
|
+
Data: {
|
|
90096
|
+
message: "App deployed successfully."
|
|
90097
|
+
}
|
|
90098
|
+
}
|
|
90099
|
+
},
|
|
89983
90100
|
{
|
|
89984
90101
|
Description: "Deploy the current coded app with system tags",
|
|
89985
90102
|
Command: 'uip codedapp deploy --name "MyApp" --tags governance',
|
|
@@ -89992,7 +90109,7 @@ var DEPLOY_EXAMPLES = [
|
|
|
89992
90109
|
}
|
|
89993
90110
|
];
|
|
89994
90111
|
var registerDeployCommand = (program2) => {
|
|
89995
|
-
program2.command("deploy").description("Deploy or upgrade app in UiPath").option("-n, --name <name>", "App name").option("--path-name <name>", "App pathname in the URL (https://<org>.uipath.host/<path-name>)").option("-v, --version <version>", "Target a specific published version").option("--base-url <url>", "UiPath base URL").option("--org-id <id>", "Organization ID").option("--org-name <name>", "Organization name").option("--tenant-id <id>", "Tenant ID").option("--folder-key <key>", "Folder key").option("--access-token <token>", "Access token").option("--tags <tags>", "Comma-separated categorization labels for the deployed app (e.g. governance,insights)").examples(DEPLOY_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
90112
|
+
program2.command("deploy").description("Deploy or upgrade app in UiPath").option("-n, --name <name>", "App name").option("--path-name <name>", "App pathname in the URL (https://<org>.uipath.host/<path-name>)").option("--client-id <id>", "OAuth client ID override (non-confidential/public client)").option("-v, --version <version>", "Target a specific published version").option("--base-url <url>", "UiPath base URL").option("--org-id <id>", "Organization ID").option("--org-name <name>", "Organization name").option("--tenant-id <id>", "Tenant ID").option("--folder-key <key>", "Folder key").option("--access-token <token>", "Access token").option("--tags <tags>", "Comma-separated categorization labels for the deployed app (e.g. governance,insights)").examples(DEPLOY_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
89996
90113
|
const logger3 = {
|
|
89997
90114
|
log: (msg) => getOutputSink().writeErr(`${msg}
|
|
89998
90115
|
`)
|
|
@@ -90001,6 +90118,7 @@ var registerDeployCommand = (program2) => {
|
|
|
90001
90118
|
const [error52, result] = await catchError(executeDeploy({
|
|
90002
90119
|
packageName: options.name,
|
|
90003
90120
|
pathName: options.pathName,
|
|
90121
|
+
clientId: options.clientId,
|
|
90004
90122
|
version: options.version,
|
|
90005
90123
|
baseUrl: options.baseUrl,
|
|
90006
90124
|
orgId: options.orgId,
|
|
@@ -90266,7 +90384,7 @@ function querystringSingleKey(key, value, keyPrefix = "") {
|
|
|
90266
90384
|
var package_default2 = {
|
|
90267
90385
|
name: "@uipath/solution-sdk",
|
|
90268
90386
|
license: "MIT",
|
|
90269
|
-
version: "1.
|
|
90387
|
+
version: "1.198.0-preview.81",
|
|
90270
90388
|
repository: {
|
|
90271
90389
|
type: "git",
|
|
90272
90390
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -93682,6 +93800,10 @@ class ProjectTool2 {
|
|
|
93682
93800
|
this.logger.info("Pack operation is a noop");
|
|
93683
93801
|
return ToolResult2.success();
|
|
93684
93802
|
}
|
|
93803
|
+
async cleanupAsync(_options, _cancellationToken) {
|
|
93804
|
+
this.logger.info("Cleanup operation is a noop");
|
|
93805
|
+
return ToolResult2.success();
|
|
93806
|
+
}
|
|
93685
93807
|
async getUiProjectAsync(projectPath) {
|
|
93686
93808
|
const filePath = Path2.join(projectPath, ProjectTool2.ProjectFileName);
|
|
93687
93809
|
if (!await this.fileSystem.exists(filePath)) {
|
|
@@ -93839,8 +93961,9 @@ class CodedAppStrategy {
|
|
|
93839
93961
|
const exists = await this.fileSystem.exists(fullBundlePath);
|
|
93840
93962
|
if (!exists) {
|
|
93841
93963
|
const message = ERROR_MESSAGES.BUNDLE_NOT_FOUND(fullBundlePath);
|
|
93842
|
-
|
|
93843
|
-
|
|
93964
|
+
const warnable = logger3;
|
|
93965
|
+
if (warnable?.warn) {
|
|
93966
|
+
warnable.warn(message);
|
|
93844
93967
|
} else {
|
|
93845
93968
|
logger3?.info(`Warning: ${message}`);
|
|
93846
93969
|
}
|
|
@@ -94903,7 +95026,25 @@ async function readDisplayName(uipathDir) {
|
|
|
94903
95026
|
return;
|
|
94904
95027
|
return parsed.displayName;
|
|
94905
95028
|
}
|
|
94906
|
-
async function
|
|
95029
|
+
async function getPersonalWorkspaceFeedId(envConfig) {
|
|
95030
|
+
const url2 = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}/${envConfig.tenantId}${API_ENDPOINTS.ORCH_CURRENT_USER_EXTENDED}`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
95031
|
+
const response = await fetch(url2, {
|
|
95032
|
+
method: "GET",
|
|
95033
|
+
headers: createHeaders({
|
|
95034
|
+
bearerToken: envConfig.accessToken,
|
|
95035
|
+
tenantId: envConfig.tenantId
|
|
95036
|
+
})
|
|
95037
|
+
});
|
|
95038
|
+
if (!response.ok) {
|
|
95039
|
+
await handleHttpError(response, MESSAGES.ERROR_CONTEXT.PERSONAL_WORKSPACE_LOOKUP);
|
|
95040
|
+
}
|
|
95041
|
+
const data = await response.json();
|
|
95042
|
+
if (!data.PersonalWorskpaceFeedId) {
|
|
95043
|
+
throw new Error(MESSAGES.ERRORS.PERSONAL_WORKSPACE_FEED_MISSING);
|
|
95044
|
+
}
|
|
95045
|
+
return data.PersonalWorskpaceFeedId;
|
|
95046
|
+
}
|
|
95047
|
+
async function uploadPackage(packagePath, envConfig, spinner, feedId) {
|
|
94907
95048
|
const fileContent = await getFileSystem().readFile(packagePath);
|
|
94908
95049
|
if (fileContent === null) {
|
|
94909
95050
|
throw new Error(`Package file not found: ${packagePath}`);
|
|
@@ -94913,7 +95054,10 @@ async function uploadPackage(packagePath, envConfig, spinner) {
|
|
|
94913
95054
|
});
|
|
94914
95055
|
const form = new FormData;
|
|
94915
95056
|
form.append("uploads[]", fileBlob, getFileSystem().path.basename(packagePath));
|
|
94916
|
-
const url2 = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}/${envConfig.tenantId}${API_ENDPOINTS.UPLOAD_PACKAGE}`,
|
|
95057
|
+
const url2 = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}/${envConfig.tenantId}${API_ENDPOINTS.UPLOAD_PACKAGE}`, {
|
|
95058
|
+
...BASIC_ORIGIN_QUERY_PARAMS,
|
|
95059
|
+
...feedId ? { feedId } : {}
|
|
95060
|
+
});
|
|
94917
95061
|
const response = await fetch(url2, {
|
|
94918
95062
|
method: "POST",
|
|
94919
95063
|
headers: {
|
|
@@ -94938,7 +95082,7 @@ async function uploadPackage(packagePath, envConfig, spinner) {
|
|
|
94938
95082
|
throw new Error(`${MESSAGES.ERRORS.PACKAGE_UPLOAD_FAILED} ${responseText}`);
|
|
94939
95083
|
}
|
|
94940
95084
|
}
|
|
94941
|
-
async function registerCodedApp(metadata, envConfig, isActionApp, logger3) {
|
|
95085
|
+
async function registerCodedApp(metadata, envConfig, isActionApp, feedId, logger3) {
|
|
94942
95086
|
const url2 = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${API_ENDPOINTS.PUBLISH_CODED_APP}`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
94943
95087
|
let actionSchema = {};
|
|
94944
95088
|
if (isActionApp) {
|
|
@@ -94957,6 +95101,9 @@ async function registerCodedApp(metadata, envConfig, isActionApp, logger3) {
|
|
|
94957
95101
|
title: metadata.displayName || metadata.packageName,
|
|
94958
95102
|
schema: actionSchema
|
|
94959
95103
|
};
|
|
95104
|
+
if (feedId) {
|
|
95105
|
+
payload.feedId = feedId;
|
|
95106
|
+
}
|
|
94960
95107
|
const response = await fetch(url2, {
|
|
94961
95108
|
method: "POST",
|
|
94962
95109
|
headers: createHeaders({
|
|
@@ -94970,6 +95117,21 @@ async function registerCodedApp(metadata, envConfig, isActionApp, logger3) {
|
|
|
94970
95117
|
}
|
|
94971
95118
|
return await response.json();
|
|
94972
95119
|
}
|
|
95120
|
+
async function resolvePersonalWorkspace(explicit) {
|
|
95121
|
+
if (explicit !== undefined)
|
|
95122
|
+
return explicit;
|
|
95123
|
+
if (!canPrompt())
|
|
95124
|
+
return false;
|
|
95125
|
+
const { useWorkspace } = await esm_default15.prompt([
|
|
95126
|
+
{
|
|
95127
|
+
type: "confirm",
|
|
95128
|
+
name: "useWorkspace",
|
|
95129
|
+
message: "Publish into your Personal Workspace feed instead of the tenant feed?",
|
|
95130
|
+
default: false
|
|
95131
|
+
}
|
|
95132
|
+
]);
|
|
95133
|
+
return useWorkspace;
|
|
95134
|
+
}
|
|
94973
95135
|
function findPackageByVersion(nupkgFiles, packageLookupNames, version2) {
|
|
94974
95136
|
return nupkgFiles.find((file2) => {
|
|
94975
95137
|
const packageFileName = getFileSystem().path.basename(file2);
|
|
@@ -95089,14 +95251,19 @@ function logPublishedDetails(metadata, registerResponse, logger3) {
|
|
|
95089
95251
|
logger3.log("");
|
|
95090
95252
|
logger3.log(source_default.blue(MESSAGES.INFO.PACKAGE_AVAILABLE));
|
|
95091
95253
|
}
|
|
95092
|
-
async function publishSelectedPackage(selectedPackage, uipathDir, envConfig, isActionApp, spinner, logger3) {
|
|
95254
|
+
async function publishSelectedPackage(selectedPackage, uipathDir, envConfig, isActionApp, personalWorkspace, spinner, logger3) {
|
|
95093
95255
|
const metadata = extractPackageMetadata(selectedPackage);
|
|
95094
95256
|
metadata.displayName = await readDisplayName(uipathDir);
|
|
95257
|
+
let feedId;
|
|
95258
|
+
if (personalWorkspace) {
|
|
95259
|
+
spinner.text = MESSAGES.INFO.RESOLVING_PERSONAL_WORKSPACE_FEED;
|
|
95260
|
+
feedId = await getPersonalWorkspaceFeedId(envConfig);
|
|
95261
|
+
}
|
|
95095
95262
|
spinner.text = MESSAGES.INFO.UPLOADING_PACKAGE;
|
|
95096
|
-
await uploadPackage(selectedPackage, envConfig, spinner);
|
|
95263
|
+
await uploadPackage(selectedPackage, envConfig, spinner, feedId);
|
|
95097
95264
|
spinner.succeed(source_default.green(MESSAGES.SUCCESS.PACKAGE_UPLOADED_SUCCESS));
|
|
95098
95265
|
spinner.start(MESSAGES.INFO.REGISTERING_CODED_APP);
|
|
95099
|
-
const registerResponse = await registerCodedApp(metadata, envConfig, isActionApp, logger3);
|
|
95266
|
+
const registerResponse = await registerCodedApp(metadata, envConfig, isActionApp, feedId, logger3);
|
|
95100
95267
|
spinner.succeed(source_default.green(MESSAGES.SUCCESS.CODED_APP_REGISTERED_SUCCESS));
|
|
95101
95268
|
const [saveError] = await catchError(saveAppConfig({
|
|
95102
95269
|
appName: metadata.packageName,
|
|
@@ -95105,7 +95272,8 @@ async function publishSelectedPackage(selectedPackage, uipathDir, envConfig, isA
|
|
|
95105
95272
|
systemName: registerResponse.definition.systemName,
|
|
95106
95273
|
appUrl: null,
|
|
95107
95274
|
registeredAt: new Date().toISOString(),
|
|
95108
|
-
appType: isActionApp ? "Action" /* Action */ : "Web" /* Web
|
|
95275
|
+
appType: isActionApp ? "Action" /* Action */ : "Web" /* Web */,
|
|
95276
|
+
personalWorkspace
|
|
95109
95277
|
}));
|
|
95110
95278
|
if (saveError) {
|
|
95111
95279
|
logger3.log(source_default.yellow(`${MESSAGES.ERRORS.FAILED_TO_SAVE_APP_CONFIG} ${saveError instanceof Error ? saveError.message : MESSAGES.ERRORS.UNKNOWN_ERROR}`));
|
|
@@ -95116,6 +95284,7 @@ async function publishSelectedPackage(selectedPackage, uipathDir, envConfig, isA
|
|
|
95116
95284
|
packageVersion: metadata.packageVersion,
|
|
95117
95285
|
systemName: registerResponse.definition.systemName,
|
|
95118
95286
|
deployVersion: registerResponse.deployVersion,
|
|
95287
|
+
personalWorkspace,
|
|
95119
95288
|
appType: isActionApp ? "Action" /* Action */ : "Web" /* Web */
|
|
95120
95289
|
};
|
|
95121
95290
|
}
|
|
@@ -95136,6 +95305,7 @@ async function executePublish(options) {
|
|
|
95136
95305
|
if (!envConfig)
|
|
95137
95306
|
throw new Error("Missing required configuration");
|
|
95138
95307
|
const isActionApp = options.type === "Action" /* Action */;
|
|
95308
|
+
const personalWorkspace = await resolvePersonalWorkspace(options.personalWorkspace);
|
|
95139
95309
|
const cwd = fs8.env.cwd();
|
|
95140
95310
|
const actionSchemaPath = fs8.path.join(cwd, ACTION_SCHEMA_CONSTANTS.ACTION_SCHEMA_FILENAME);
|
|
95141
95311
|
if (isActionApp && !await fs8.exists(actionSchemaPath)) {
|
|
@@ -95147,7 +95317,7 @@ async function executePublish(options) {
|
|
|
95147
95317
|
const [publishError, publishResult] = await catchError((async () => {
|
|
95148
95318
|
const nupkgFiles = await listNupkgFiles(uipathDir, spinner, logger3);
|
|
95149
95319
|
const selectedPackage = await selectPackage(nupkgFiles, packageLookupNames, packageName, options, spinner, logger3);
|
|
95150
|
-
return publishSelectedPackage(selectedPackage, uipathDir, envConfig, isActionApp, spinner, logger3);
|
|
95320
|
+
return publishSelectedPackage(selectedPackage, uipathDir, envConfig, isActionApp, personalWorkspace, spinner, logger3);
|
|
95151
95321
|
})());
|
|
95152
95322
|
if (publishError) {
|
|
95153
95323
|
if (spinner.isSpinning) {
|
|
@@ -95183,7 +95353,7 @@ var PUBLISH_EXAMPLES = [
|
|
|
95183
95353
|
}
|
|
95184
95354
|
];
|
|
95185
95355
|
var registerPublishCommand = (program2) => {
|
|
95186
|
-
program2.command("publish").description("Publish .nupkg to UiPath and register coded app").option("-n, --name <name>", "Package name (non-interactive)").option("-v, --version <version>", "Package version (requires --name)").option("-t, --type <type>", "App type (Web, Action)", parseAppType, "Web").option("--uipath-dir <dir>", "UiPath directory containing packages", "./.uipath").option("--base-url <url>", "UiPath base URL").option("--org-id <id>", "Organization ID").option("--tenant-id <id>", "Tenant ID").option("--tenant-name <name>", "Tenant name").option("--access-token <token>", "Access token").examples(PUBLISH_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
95356
|
+
program2.command("publish").description("Publish .nupkg to UiPath and register coded app").option("-n, --name <name>", "Package name (non-interactive)").option("-v, --version <version>", "Package version (requires --name)").option("-t, --type <type>", "App type (Web, Action)", parseAppType, "Web").option("--personal-workspace", "Publish the package into the current user's Personal Workspace feed instead of the tenant feed.").option("--uipath-dir <dir>", "UiPath directory containing packages", "./.uipath").option("--base-url <url>", "UiPath base URL").option("--org-id <id>", "Organization ID").option("--tenant-id <id>", "Tenant ID").option("--tenant-name <name>", "Tenant name").option("--access-token <token>", "Access token").examples(PUBLISH_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
95187
95357
|
const logger3 = {
|
|
95188
95358
|
log: (msg) => getOutputSink().writeErr(`${msg}
|
|
95189
95359
|
`)
|
|
@@ -95192,6 +95362,7 @@ var registerPublishCommand = (program2) => {
|
|
|
95192
95362
|
name: options.name,
|
|
95193
95363
|
version: options.version,
|
|
95194
95364
|
type: options.type,
|
|
95365
|
+
personalWorkspace: options.personalWorkspace,
|
|
95195
95366
|
uipathDir: options.uipathDir,
|
|
95196
95367
|
baseUrl: options.baseUrl,
|
|
95197
95368
|
orgId: options.orgId,
|
|
@@ -95217,7 +95388,7 @@ var registerPublishCommand = (program2) => {
|
|
|
95217
95388
|
if (result) {
|
|
95218
95389
|
trackShipSucceeded({
|
|
95219
95390
|
ship_kind: "publish",
|
|
95220
|
-
target: "tenant_coded_app_feed",
|
|
95391
|
+
target: result.personalWorkspace ? "personal_workspace_coded_app_feed" : "tenant_coded_app_feed",
|
|
95221
95392
|
project_type: "coded_app",
|
|
95222
95393
|
command_name: "uip.codedapp.publish",
|
|
95223
95394
|
artifact_correlation_key: `${result.systemName}:${result.packageVersion}`,
|
|
@@ -98155,4 +98326,4 @@ export {
|
|
|
98155
98326
|
metadata
|
|
98156
98327
|
};
|
|
98157
98328
|
|
|
98158
|
-
//# debugId=
|
|
98329
|
+
//# debugId=CC22EC9262980DE464756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/codedapp-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.198.0-preview.81",
|
|
5
5
|
"description": "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli-tool",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"registry": "https://registry.npmjs.org/"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d6a326ee051d553694b61f4923bcf1719d2e5110"
|
|
31
31
|
}
|