@uipath/codedapp-tool 1.203.0-preview.212 → 1.204.0-preview.211
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/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
- package/dist/{index-6zef5vcv.js → index-1k95y97e.js} +432 -95
- package/dist/{index-8yrjtchg.js → index-gqak49gg.js} +6 -3
- package/dist/index.js +10 -9
- package/dist/{node-strategy-bpshtz02.js → node-strategy-gc4sg6a2.js} +6 -4
- package/dist/{packager-tool-qyctya2j.js → packager-tool-0v3s8r01.js} +2 -30
- package/dist/{packager-tool-shwgy5p6.js → packager-tool-7qmpp7hj.js} +701 -12638
- package/dist/packager-tool-qa9gftnj.js +31 -0
- package/dist/{packager-tool-bvm4jqr1.js → packager-tool-qc7sff2j.js} +27 -10
- package/dist/{packager-tool-9vm3cnxj.js → packager-tool-svx5btc4.js} +425 -125
- package/dist/packager-tool-vxegnq74.js +340 -0
- package/dist/{packager-tool-f1ptyxe1.js → packager-tool-w5fry52f.js} +2436 -484
- package/dist/packager-tool.js +4 -3
- package/dist/tool.js +8 -7
- package/package.json +2 -2
- package/dist/packager-tool-aybzcdfg.js +0 -1514
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
+
findNearestParentUipxFile,
|
|
3
|
+
tryRegisterProjectInParentSolution
|
|
4
|
+
} from "./packager-tool-vxegnq74.js";
|
|
5
|
+
import {
|
|
6
|
+
getLoginStatusAsync
|
|
7
|
+
} from "./packager-tool-qc7sff2j.js";
|
|
8
|
+
import {
|
|
9
|
+
ACTION_SCHEMA_FILE_NAME,
|
|
10
|
+
WEBAPP_MANIFEST_FILE_NAME,
|
|
11
|
+
WebAppToolFactory,
|
|
12
|
+
parseActionSchema
|
|
13
|
+
} from "./packager-tool-7qmpp7hj.js";
|
|
14
|
+
import {
|
|
15
|
+
CommandDimensions,
|
|
2
16
|
ConfigurationError,
|
|
3
17
|
EXIT_CODES,
|
|
4
18
|
InvalidArgumentError,
|
|
5
19
|
Option,
|
|
6
20
|
OutputFormatter,
|
|
7
21
|
RESULTS,
|
|
22
|
+
ShipDimensions,
|
|
8
23
|
canPrompt,
|
|
9
24
|
catchError,
|
|
10
25
|
describeConnectivityError,
|
|
11
26
|
extractErrorDetails,
|
|
12
|
-
findNearestParentUipxFile,
|
|
13
27
|
getOutputSink,
|
|
14
28
|
getSdkUserAgentToken,
|
|
15
29
|
installSdkUserAgentHeader,
|
|
@@ -20,21 +34,12 @@ import {
|
|
|
20
34
|
processContext,
|
|
21
35
|
registerPackageMetadataOptions,
|
|
22
36
|
requireConfirmation,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from "./packager-tool-
|
|
26
|
-
import {
|
|
27
|
-
getLoginStatusAsync
|
|
28
|
-
} from "./packager-tool-bvm4jqr1.js";
|
|
37
|
+
telemetry,
|
|
38
|
+
trackShipSucceeded
|
|
39
|
+
} from "./packager-tool-w5fry52f.js";
|
|
29
40
|
import {
|
|
30
41
|
getFileSystem
|
|
31
|
-
} from "./packager-tool-
|
|
32
|
-
import {
|
|
33
|
-
ACTION_SCHEMA_FILE_NAME,
|
|
34
|
-
WEBAPP_MANIFEST_FILE_NAME,
|
|
35
|
-
WebAppToolFactory,
|
|
36
|
-
parseActionSchema
|
|
37
|
-
} from "./packager-tool-shwgy5p6.js";
|
|
42
|
+
} from "./packager-tool-0v3s8r01.js";
|
|
38
43
|
import {
|
|
39
44
|
__commonJS,
|
|
40
45
|
__export,
|
|
@@ -20618,7 +20623,7 @@ var package_default = {
|
|
|
20618
20623
|
name: "@uipath/codedapp-tool",
|
|
20619
20624
|
author: "UiPath",
|
|
20620
20625
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
20621
|
-
version: "1.
|
|
20626
|
+
version: "1.204.0-preview.211",
|
|
20622
20627
|
description: "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
|
|
20623
20628
|
keywords: [
|
|
20624
20629
|
"cli-tool",
|
|
@@ -21170,6 +21175,7 @@ var API_ENDPOINTS = {
|
|
|
21170
21175
|
STUDIO_WEB_DELETE_ITEM: "/studio_/backend/api/Project/{projectId}/FileOperations/Delete/{itemId}",
|
|
21171
21176
|
STUDIO_WEB_LOCK: "/studio_/backend/api/Project/{projectId}/Lock",
|
|
21172
21177
|
STUDIO_WEB_LOCKS_CONFIGURATION: "/studio_/backend/api/Locks/Configuration",
|
|
21178
|
+
STUDIO_WEB_LOCKS_ROOT: "/studio_/backend/api/Locks",
|
|
21173
21179
|
STUDIO_WEB_LOCKS_KEY: "/studio_/backend/api/Locks/{lockKey}",
|
|
21174
21180
|
STUDIO_WEB_PROJECT: "/studio_/backend/api/Project/{projectId}",
|
|
21175
21181
|
STUDIO_WEB_CREATE_FILE: "/studio_/backend/api/Project/{projectId}/FileOperations/File",
|
|
@@ -21179,6 +21185,7 @@ var API_ENDPOINTS = {
|
|
|
21179
21185
|
CONNECTIONS_RETRIEVE: "/orchestrator_/odata/Connections('{connectionKey}')",
|
|
21180
21186
|
STUDIO_WEB_CREATE_REFERENCED_RESOURCE: "/studio_/backend/api/resourcebuilder/solutions/{solutionId}/resources/reference",
|
|
21181
21187
|
DEPLOYED_APPS: "/apps_/default/api/v1/default/models/deployed/apps",
|
|
21188
|
+
DEPLOYED_CODED_APP: "/apps_/default/api/v1/default/models/deployed/codedapps/{packageName}",
|
|
21182
21189
|
DEPLOY_APP: "/apps_/default/api/v1/default/models/{systemName}/publish/versions/{deployVersion}/deploy",
|
|
21183
21190
|
EDIT_DEPLOYED_APP: "/apps_/default/api/v1/default/models/deployed/apps/{appId}",
|
|
21184
21191
|
PUBLISHED_APPS: "/apps_/default/api/v1/default/models/tenants/{tenantId}/publish/apps",
|
|
@@ -21342,6 +21349,11 @@ var AUTH_CONSTANTS = {
|
|
|
21342
21349
|
"UIPATH_TENANT_ID",
|
|
21343
21350
|
"UIPATH_ACCESS_TOKEN"
|
|
21344
21351
|
],
|
|
21352
|
+
PATH_NAME_CHECK: [
|
|
21353
|
+
"UIPATH_BASE_URL",
|
|
21354
|
+
"UIPATH_ORG_ID",
|
|
21355
|
+
"UIPATH_ACCESS_TOKEN"
|
|
21356
|
+
],
|
|
21345
21357
|
DELETE: [
|
|
21346
21358
|
"UIPATH_BASE_URL",
|
|
21347
21359
|
"UIPATH_ORG_ID",
|
|
@@ -21587,7 +21599,6 @@ var MESSAGES = {
|
|
|
21587
21599
|
REAUTH_QUESTION: "Do you want to re-authenticate?",
|
|
21588
21600
|
COMPLETE_AUTH_IN_BROWSER: "Please complete the authentication in your browser",
|
|
21589
21601
|
BROWSER_FALLBACK_INSTRUCTION: "If the browser didn't open automatically, visit:",
|
|
21590
|
-
REUSE_CLIENT_ID: "Do you want UiPath to create a new OAuth client during deployment or reuse existing from uipath.json? (Y = create new, N = reuse existing clientId)",
|
|
21591
21602
|
ENTER_SCOPES: "Enter the required scopes for your app (e.g., OR.Execution OR.Folders), please refer https://uipath.github.io/uipath-typescript/oauth-scopes/ for details"
|
|
21592
21603
|
},
|
|
21593
21604
|
HELP: {
|
|
@@ -21596,6 +21607,7 @@ var MESSAGES = {
|
|
|
21596
21607
|
},
|
|
21597
21608
|
VALIDATIONS: {
|
|
21598
21609
|
APP_NAME_REQUIRED: "App name is required",
|
|
21610
|
+
PATH_NAME_REQUIRED: "A path name must contain at least one letter or digit",
|
|
21599
21611
|
APP_NAME_INVALID_CHARS: "App name can only contain lowercase letters, numbers, and hyphens (-). Please remove invalid special characters and try again.",
|
|
21600
21612
|
PACKAGE_NAME_REQUIRED: "Package name is required",
|
|
21601
21613
|
MISSING_REQUIRED_CONFIG: "❌ Missing required configuration:",
|
|
@@ -21610,6 +21622,7 @@ var MESSAGES = {
|
|
|
21610
21622
|
CLIENT_CREDENTIALS_AUTH: "client credentials authentication",
|
|
21611
21623
|
APP_DEPLOYMENT: "app deployment",
|
|
21612
21624
|
DEPLOYED_APP_LOOKUP: "deployed app lookup",
|
|
21625
|
+
PATH_NAME_CHECK: "path name check",
|
|
21613
21626
|
DEPLOYED_APP_DELETION: "deployed app deletion",
|
|
21614
21627
|
APP_UPGRADE: "app upgrade",
|
|
21615
21628
|
CODED_APP_REGISTRATION: "coded app registration",
|
|
@@ -21833,6 +21846,22 @@ async function deleteDeployedAppById(envConfig, deployedAppId, errorContext = ME
|
|
|
21833
21846
|
routingCacheWarning: response.headers.get("x-jamjam-warning") ?? undefined
|
|
21834
21847
|
};
|
|
21835
21848
|
}
|
|
21849
|
+
async function checkPathName(pathName, envConfig, errorContext = MESSAGES.ERROR_CONTEXT.PATH_NAME_CHECK) {
|
|
21850
|
+
const endpoint = API_ENDPOINTS.CHECK_APP_NAME_UNIQUE.replace("{appName}", encodeURIComponent(pathName));
|
|
21851
|
+
const url = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${endpoint}`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
21852
|
+
const response = await fetch(url, {
|
|
21853
|
+
method: "GET",
|
|
21854
|
+
headers: createHeaders({
|
|
21855
|
+
bearerToken: envConfig.accessToken
|
|
21856
|
+
})
|
|
21857
|
+
});
|
|
21858
|
+
if (!response.ok) {
|
|
21859
|
+
const message = await createHttpErrorMessage(response, errorContext);
|
|
21860
|
+
throw Object.assign(new Error(message), { status: response.status });
|
|
21861
|
+
}
|
|
21862
|
+
const data = await response.json();
|
|
21863
|
+
return { available: data.isUnique, occupiedBy: data.occupiedBy ?? null };
|
|
21864
|
+
}
|
|
21836
21865
|
|
|
21837
21866
|
// src/utils/env-config.ts
|
|
21838
21867
|
var ENV_CONFIG = AUTH_CONSTANTS.ENV_CONFIG;
|
|
@@ -28488,20 +28517,24 @@ class CliTelemetryClient {
|
|
|
28488
28517
|
}
|
|
28489
28518
|
return CliTelemetryClient.instance;
|
|
28490
28519
|
}
|
|
28491
|
-
track(eventName,
|
|
28492
|
-
|
|
28520
|
+
track(eventName, extraAttributes = {}) {
|
|
28521
|
+
try {
|
|
28522
|
+
telemetry.trackEvent(eventName, extraAttributes);
|
|
28523
|
+
} catch (error2) {
|
|
28524
|
+
logger.debug(`[telemetry] ${eventName} dropped: ${String(error2)}`);
|
|
28525
|
+
}
|
|
28493
28526
|
}
|
|
28494
28527
|
}
|
|
28495
28528
|
var cliTelemetryClient = CliTelemetryClient.getInstance();
|
|
28496
28529
|
// src/telemetry/telemetry-events.ts
|
|
28497
28530
|
var CodedAppTelemetryEvents = {
|
|
28498
28531
|
Push: "Cli.Push",
|
|
28499
|
-
PushApiFailure: "Cli.
|
|
28500
|
-
PushFolderCreateConflict: "Cli.
|
|
28501
|
-
PushMetadataRemoteLoadFailed: "Cli.
|
|
28532
|
+
PushApiFailure: "Cli.PushApiFailure",
|
|
28533
|
+
PushFolderCreateConflict: "Cli.PushFolderCreateConflict",
|
|
28534
|
+
PushMetadataRemoteLoadFailed: "Cli.PushMetadataRemoteLoadFailed",
|
|
28502
28535
|
Pull: "Cli.Pull",
|
|
28503
|
-
PullFailed: "Cli.
|
|
28504
|
-
PullCompleted: "Cli.
|
|
28536
|
+
PullFailed: "Cli.PullFailed",
|
|
28537
|
+
PullCompleted: "Cli.PullCompleted",
|
|
28505
28538
|
Pack: "Cli.Pack",
|
|
28506
28539
|
Publish: "Cli.Publish",
|
|
28507
28540
|
Deploy: "Cli.Deploy"
|
|
@@ -28550,8 +28583,13 @@ function isPersonalFolder(folder) {
|
|
|
28550
28583
|
function matchesWorkspace(folder, personalWorkspace) {
|
|
28551
28584
|
return personalWorkspace ? isPersonalFolder(folder) : !isPersonalFolder(folder);
|
|
28552
28585
|
}
|
|
28553
|
-
|
|
28554
|
-
|
|
28586
|
+
function sameFolderKey(a, b) {
|
|
28587
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
28588
|
+
}
|
|
28589
|
+
var FOLDER_PAGE_SIZE = 100;
|
|
28590
|
+
var FOLDER_PAGE_LIMIT = 100;
|
|
28591
|
+
async function fetchFolderPage(baseUrl, accessToken, orgId, tenantName, skip) {
|
|
28592
|
+
const url = `${baseUrl}/${orgId}/${tenantName}/orchestrator_/api/Folders/GetAllForCurrentUser?take=${FOLDER_PAGE_SIZE}&skip=${skip}`;
|
|
28555
28593
|
const response = await fetch(url, {
|
|
28556
28594
|
headers: createHeaders({ bearerToken: accessToken })
|
|
28557
28595
|
});
|
|
@@ -28560,12 +28598,34 @@ async function fetchFolders(baseUrl, accessToken, orgId, tenantName) {
|
|
|
28560
28598
|
}
|
|
28561
28599
|
const data = await response.json();
|
|
28562
28600
|
const items = data.PageItems ?? data.value ?? [];
|
|
28563
|
-
|
|
28564
|
-
|
|
28565
|
-
|
|
28566
|
-
|
|
28567
|
-
|
|
28568
|
-
|
|
28601
|
+
const count = data.Count ?? data.count;
|
|
28602
|
+
return {
|
|
28603
|
+
folders: items.map((item) => ({
|
|
28604
|
+
key: String(item.Key ?? item.key ?? ""),
|
|
28605
|
+
displayName: String(item.DisplayName ?? item.displayName ?? ""),
|
|
28606
|
+
fullyQualifiedName: String(item.FullyQualifiedName ?? item.fullyQualifiedName ?? ""),
|
|
28607
|
+
folderType: String(item.FolderType ?? item.folderType ?? "")
|
|
28608
|
+
})),
|
|
28609
|
+
total: typeof count === "number" ? count : null
|
|
28610
|
+
};
|
|
28611
|
+
}
|
|
28612
|
+
async function fetchFolders(baseUrl, accessToken, orgId, tenantName, stopEarly) {
|
|
28613
|
+
const all = [];
|
|
28614
|
+
for (let page = 0;page < FOLDER_PAGE_LIMIT; page++) {
|
|
28615
|
+
const { folders, total } = await fetchFolderPage(baseUrl, accessToken, orgId, tenantName, all.length);
|
|
28616
|
+
all.push(...folders);
|
|
28617
|
+
if (stopEarly?.(all))
|
|
28618
|
+
break;
|
|
28619
|
+
if (folders.length === 0)
|
|
28620
|
+
break;
|
|
28621
|
+
if (total !== null) {
|
|
28622
|
+
if (all.length >= total)
|
|
28623
|
+
break;
|
|
28624
|
+
} else if (folders.length < FOLDER_PAGE_SIZE) {
|
|
28625
|
+
break;
|
|
28626
|
+
}
|
|
28627
|
+
}
|
|
28628
|
+
return all;
|
|
28569
28629
|
}
|
|
28570
28630
|
async function promptFolderSelection(folders, logger2, personalWorkspace) {
|
|
28571
28631
|
const filtered = personalWorkspace === undefined ? folders : folders.filter((f) => matchesWorkspace(f, personalWorkspace));
|
|
@@ -28612,13 +28672,12 @@ async function promptFolderSelection(folders, logger2, personalWorkspace) {
|
|
|
28612
28672
|
return selection;
|
|
28613
28673
|
}
|
|
28614
28674
|
async function validateExplicitFolderKey(folderKey, personalWorkspace, baseUrl, accessToken, orgId, tenantName) {
|
|
28615
|
-
const [fetchErr, folders] = await catchError(fetchFolders(baseUrl, accessToken, orgId, tenantName));
|
|
28675
|
+
const [fetchErr, folders] = await catchError(fetchFolders(baseUrl, accessToken, orgId, tenantName, (gathered) => gathered.some((f) => sameFolderKey(f.key, folderKey))));
|
|
28616
28676
|
if (fetchErr)
|
|
28617
28677
|
return;
|
|
28618
|
-
const match = folders.find((f) => f.key
|
|
28619
|
-
if (!match)
|
|
28620
|
-
|
|
28621
|
-
}
|
|
28678
|
+
const match = folders.find((f) => sameFolderKey(f.key, folderKey));
|
|
28679
|
+
if (!match)
|
|
28680
|
+
return;
|
|
28622
28681
|
if (!matchesWorkspace(match, personalWorkspace)) {
|
|
28623
28682
|
const folderKind = isPersonalFolder(match) ? "a Personal Workspace" : "a shared tenant";
|
|
28624
28683
|
const publishedAs = personalWorkspace ? "into your Personal Workspace" : "into the tenant feed";
|
|
@@ -28655,13 +28714,28 @@ async function ensureFolderKey(logger2, explicitFolderKey, personalWorkspace) {
|
|
|
28655
28714
|
}
|
|
28656
28715
|
|
|
28657
28716
|
// src/actions/deploy.ts
|
|
28717
|
+
function asWarnings(value) {
|
|
28718
|
+
if (!Array.isArray(value))
|
|
28719
|
+
return [];
|
|
28720
|
+
return value.filter((warning2) => typeof warning2 === "string" && warning2.trim().length > 0);
|
|
28721
|
+
}
|
|
28722
|
+
async function readResponseWarnings(response) {
|
|
28723
|
+
const [, body] = await catchError(response.json());
|
|
28724
|
+
return asWarnings(body?.warnings);
|
|
28725
|
+
}
|
|
28726
|
+
function logPlatformWarnings(warnings, logger2) {
|
|
28727
|
+
for (const warning2 of warnings) {
|
|
28728
|
+
logger2.log(source_default.yellow(`⚠️ ${warning2}`));
|
|
28729
|
+
}
|
|
28730
|
+
}
|
|
28658
28731
|
var PUBLISHED_APP_LOOKUP_RETRY_DELAYS_MS = [1000, 2000, 4000, 8000];
|
|
28659
|
-
|
|
28660
|
-
|
|
28661
|
-
|
|
28732
|
+
var HTTP_NOT_FOUND = 404;
|
|
28733
|
+
async function getDeployedApp(appName, envConfig, legacyAppName) {
|
|
28734
|
+
const packageNames = [
|
|
28735
|
+
...new Set([appName, legacyAppName].filter((name) => Boolean(name)))
|
|
28662
28736
|
];
|
|
28663
|
-
for (const
|
|
28664
|
-
const url = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${API_ENDPOINTS.
|
|
28737
|
+
for (const packageName of packageNames) {
|
|
28738
|
+
const url = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${API_ENDPOINTS.DEPLOYED_CODED_APP.replace("{packageName}", encodeURIComponent(packageName))}`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
28665
28739
|
const response = await fetch(url, {
|
|
28666
28740
|
method: "GET",
|
|
28667
28741
|
headers: createHeaders({
|
|
@@ -28670,12 +28744,11 @@ async function getDeployedApp(appName, displayTitle, envConfig, legacyAppName) {
|
|
|
28670
28744
|
folderKey: envConfig.folderKey
|
|
28671
28745
|
})
|
|
28672
28746
|
});
|
|
28747
|
+
if (response.status === HTTP_NOT_FOUND)
|
|
28748
|
+
continue;
|
|
28673
28749
|
if (!response.ok)
|
|
28674
28750
|
await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
|
|
28675
|
-
|
|
28676
|
-
const match = data.value.find((app) => searchTerms.includes(app.title));
|
|
28677
|
-
if (match)
|
|
28678
|
-
return match;
|
|
28751
|
+
return await response.json();
|
|
28679
28752
|
}
|
|
28680
28753
|
return null;
|
|
28681
28754
|
}
|
|
@@ -28687,6 +28760,19 @@ async function getPublishedApp(appNames, envConfig, version) {
|
|
|
28687
28760
|
}
|
|
28688
28761
|
return null;
|
|
28689
28762
|
}
|
|
28763
|
+
function pickNewestLineage(apps) {
|
|
28764
|
+
let newest = null;
|
|
28765
|
+
for (const app of apps) {
|
|
28766
|
+
if (!newest || (app.deployVersion ?? 0) > (newest.deployVersion ?? 0))
|
|
28767
|
+
newest = app;
|
|
28768
|
+
}
|
|
28769
|
+
return newest;
|
|
28770
|
+
}
|
|
28771
|
+
function orderedSystemNamesNewestFirst(matches) {
|
|
28772
|
+
return [
|
|
28773
|
+
...new Set([...matches].sort((a, b) => (b.deployVersion ?? 0) - (a.deployVersion ?? 0)).map((app) => app.systemName))
|
|
28774
|
+
];
|
|
28775
|
+
}
|
|
28690
28776
|
async function getPublishedAppByName(appName, envConfig, version) {
|
|
28691
28777
|
const endpoint = API_ENDPOINTS.PUBLISHED_APPS.replace("{tenantId}", envConfig.tenantId);
|
|
28692
28778
|
const url = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${endpoint}?searchText=${encodeURIComponent(appName)}&folderFeedType=tenant`, BASIC_ORIGIN_QUERY_PARAMS);
|
|
@@ -28705,11 +28791,18 @@ async function getPublishedAppByName(appName, envConfig, version) {
|
|
|
28705
28791
|
if (matches.length === 0)
|
|
28706
28792
|
return null;
|
|
28707
28793
|
if (version) {
|
|
28708
|
-
const
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28794
|
+
const directHits = matches.filter((app) => app.definition?.codedAppMetadata?.packageVersion === version);
|
|
28795
|
+
const newestDirectHit = pickNewestLineage(directHits);
|
|
28796
|
+
if (newestDirectHit)
|
|
28797
|
+
return newestDirectHit;
|
|
28798
|
+
const systemNames = orderedSystemNamesNewestFirst(matches);
|
|
28799
|
+
for (const systemName of systemNames) {
|
|
28800
|
+
const allVersions = await getAllPublishedVersions(systemName, envConfig);
|
|
28801
|
+
const hit = allVersions.find((app) => app.definition?.codedAppMetadata?.packageVersion === version);
|
|
28802
|
+
if (hit)
|
|
28803
|
+
return hit;
|
|
28804
|
+
}
|
|
28805
|
+
return null;
|
|
28713
28806
|
}
|
|
28714
28807
|
return matches.find((app) => app.latestInFeed === true) ?? matches.reduce((latest, app) => (app.deployVersion ?? 0) > (latest.deployVersion ?? 0) ? app : latest);
|
|
28715
28808
|
}
|
|
@@ -28750,19 +28843,8 @@ function validateAppNameLength(name) {
|
|
|
28750
28843
|
throw new Error(MESSAGE_BUILDERS.APP_NAME_TOO_LONG(name, name.length, MAX_CODED_APP_NAME_LENGTH));
|
|
28751
28844
|
}
|
|
28752
28845
|
async function checkAppNameUniqueness(appName, envConfig) {
|
|
28753
|
-
const
|
|
28754
|
-
|
|
28755
|
-
const response = await fetch(url, {
|
|
28756
|
-
method: "GET",
|
|
28757
|
-
headers: createHeaders({
|
|
28758
|
-
bearerToken: envConfig.accessToken
|
|
28759
|
-
})
|
|
28760
|
-
});
|
|
28761
|
-
if (!response.ok) {
|
|
28762
|
-
await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
|
|
28763
|
-
}
|
|
28764
|
-
const data = await response.json();
|
|
28765
|
-
if (!data.isUnique) {
|
|
28846
|
+
const { available } = await checkPathName(appName, envConfig, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
|
|
28847
|
+
if (!available) {
|
|
28766
28848
|
throw new Error(MESSAGES.ERRORS.APP_NAME_ALREADY_EXISTS);
|
|
28767
28849
|
}
|
|
28768
28850
|
}
|
|
@@ -28788,7 +28870,10 @@ async function deployNewApp(appName, routingName, systemName, deployVersion, env
|
|
|
28788
28870
|
if (!response.ok)
|
|
28789
28871
|
await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
|
|
28790
28872
|
const data = await response.json();
|
|
28791
|
-
return
|
|
28873
|
+
return {
|
|
28874
|
+
id: data.id,
|
|
28875
|
+
warnings: asWarnings(data.warnings)
|
|
28876
|
+
};
|
|
28792
28877
|
}
|
|
28793
28878
|
var UPGRADE_VERIFY_POLL_INTERVAL_MS = 5000;
|
|
28794
28879
|
var UPGRADE_VERIFY_DEADLINE_MS = 180000;
|
|
@@ -28836,7 +28921,7 @@ async function waitForUpgradeToLand(params) {
|
|
|
28836
28921
|
for (let poll = 0;poll < maxPolls; poll++) {
|
|
28837
28922
|
if (poll > 0)
|
|
28838
28923
|
await sleep(UPGRADE_VERIFY_POLL_INTERVAL_MS);
|
|
28839
|
-
const [lookupError, deployedApp] = await catchError(getDeployedApp(params.appName, params.
|
|
28924
|
+
const [lookupError, deployedApp] = await catchError(getDeployedApp(params.appName, params.envConfig, params.legacyAppName));
|
|
28840
28925
|
if (lookupError) {
|
|
28841
28926
|
consecutiveLookupFailures++;
|
|
28842
28927
|
if (consecutiveLookupFailures >= UPGRADE_VERIFY_MAX_CONSECUTIVE_LOOKUP_FAILURES) {
|
|
@@ -28855,17 +28940,18 @@ async function upgradeApp(params) {
|
|
|
28855
28940
|
const outcomeIsVerifiable = params.deployVersion !== params.previousDeployVersion;
|
|
28856
28941
|
if (requestError) {
|
|
28857
28942
|
if (outcomeIsVerifiable && await waitForUpgradeToLand(params)) {
|
|
28858
|
-
return;
|
|
28943
|
+
return [];
|
|
28859
28944
|
}
|
|
28860
28945
|
throw requestError;
|
|
28861
28946
|
}
|
|
28862
28947
|
if (response.ok)
|
|
28863
|
-
return;
|
|
28948
|
+
return await readResponseWarnings(response);
|
|
28864
28949
|
if (outcomeIsVerifiable && isAmbiguousGatewayStatus(response.status)) {
|
|
28865
28950
|
if (await waitForUpgradeToLand(params))
|
|
28866
|
-
return;
|
|
28951
|
+
return [];
|
|
28867
28952
|
}
|
|
28868
28953
|
await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_UPGRADE);
|
|
28954
|
+
return [];
|
|
28869
28955
|
}
|
|
28870
28956
|
async function updateAppConfig(update, logger2) {
|
|
28871
28957
|
const fsys = getFileSystem();
|
|
@@ -28953,7 +29039,7 @@ async function executeDeploy(options) {
|
|
|
28953
29039
|
validateAppNameLength(routingName);
|
|
28954
29040
|
let spinner = ora(MESSAGES.INFO.CHECKING_DEPLOYMENT_STATUS).start();
|
|
28955
29041
|
const [deployError, deployResult] = await catchError((async () => {
|
|
28956
|
-
const deployedApp = await getDeployedApp(appName,
|
|
29042
|
+
const deployedApp = await getDeployedApp(appName, envConfig, legacyAppName);
|
|
28957
29043
|
let operationResult;
|
|
28958
29044
|
if (deployedApp) {
|
|
28959
29045
|
spinner.text = MESSAGES.INFO.UPGRADING_APP;
|
|
@@ -28969,10 +29055,9 @@ async function executeDeploy(options) {
|
|
|
28969
29055
|
spinner.fail(source_default.red(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND));
|
|
28970
29056
|
throw new Error(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND);
|
|
28971
29057
|
}
|
|
28972
|
-
await upgradeApp({
|
|
29058
|
+
const upgradeWarnings = await upgradeApp({
|
|
28973
29059
|
appId: deployedApp.id,
|
|
28974
29060
|
appName,
|
|
28975
|
-
displayTitle,
|
|
28976
29061
|
currentDeploymentTitle: deployedApp.deploymentTitle,
|
|
28977
29062
|
deploymentTitleOverride,
|
|
28978
29063
|
legacyAppName,
|
|
@@ -28985,6 +29070,7 @@ async function executeDeploy(options) {
|
|
|
28985
29070
|
logger: logger2
|
|
28986
29071
|
});
|
|
28987
29072
|
spinner.succeed(source_default.green(MESSAGES.SUCCESS.APP_UPGRADED_SUCCESS));
|
|
29073
|
+
logPlatformWarnings(upgradeWarnings, logger2);
|
|
28988
29074
|
const appConfig3 = await loadAppConfig(logger2);
|
|
28989
29075
|
const version = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? deployedApp.semVersion;
|
|
28990
29076
|
operationResult = {
|
|
@@ -28995,7 +29081,7 @@ async function executeDeploy(options) {
|
|
|
28995
29081
|
operation: "upgrade"
|
|
28996
29082
|
};
|
|
28997
29083
|
cliTelemetryClient.track(CodedAppTelemetryEvents.Deploy, {
|
|
28998
|
-
|
|
29084
|
+
Operation: "upgrade"
|
|
28999
29085
|
});
|
|
29000
29086
|
} else {
|
|
29001
29087
|
spinner.text = MESSAGES.INFO.CHECKING_APP_NAME_UNIQUENESS;
|
|
@@ -29014,8 +29100,9 @@ async function executeDeploy(options) {
|
|
|
29014
29100
|
spinner.fail(source_default.red(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND));
|
|
29015
29101
|
throw new Error(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND);
|
|
29016
29102
|
}
|
|
29017
|
-
const deploymentId = await deployNewApp(displayTitle, routingName, publishedApp.systemName, publishedApp.deployVersion, envConfig, options.tags, options.clientId);
|
|
29103
|
+
const { id: deploymentId, warnings: deployWarnings } = await deployNewApp(displayTitle, routingName, publishedApp.systemName, publishedApp.deployVersion, envConfig, options.tags, options.clientId);
|
|
29018
29104
|
spinner.succeed(source_default.green(MESSAGES.SUCCESS.APP_DEPLOYED_SUCCESS));
|
|
29105
|
+
logPlatformWarnings(deployWarnings, logger2);
|
|
29019
29106
|
const appConfig3 = await loadAppConfig(logger2);
|
|
29020
29107
|
const version = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? "1.0.0";
|
|
29021
29108
|
operationResult = {
|
|
@@ -29026,7 +29113,7 @@ async function executeDeploy(options) {
|
|
|
29026
29113
|
operation: "deploy"
|
|
29027
29114
|
};
|
|
29028
29115
|
cliTelemetryClient.track(CodedAppTelemetryEvents.Deploy, {
|
|
29029
|
-
|
|
29116
|
+
Operation: "fresh_deploy"
|
|
29030
29117
|
});
|
|
29031
29118
|
}
|
|
29032
29119
|
const appConfig2 = await loadAppConfig(logger2);
|
|
@@ -29168,14 +29255,14 @@ var registerDeployCommand = (program) => {
|
|
|
29168
29255
|
});
|
|
29169
29256
|
if (result) {
|
|
29170
29257
|
trackShipSucceeded({
|
|
29171
|
-
|
|
29172
|
-
|
|
29173
|
-
|
|
29174
|
-
|
|
29175
|
-
|
|
29176
|
-
|
|
29177
|
-
|
|
29178
|
-
|
|
29258
|
+
[ShipDimensions.ShipKind]: "deploy",
|
|
29259
|
+
[ShipDimensions.Target]: "uipath_apps",
|
|
29260
|
+
[ShipDimensions.ProjectType]: "coded_app",
|
|
29261
|
+
[CommandDimensions.CommandName]: "uip codedapp deploy",
|
|
29262
|
+
[ShipDimensions.ArtifactCorrelationKey]: result.deploymentId ?? `${result.systemName}:${result.deployVersion}`,
|
|
29263
|
+
[ShipDimensions.DeploymentKey]: result.deploymentId,
|
|
29264
|
+
[ShipDimensions.PackageName]: result.systemName,
|
|
29265
|
+
[ShipDimensions.PackageVersion]: result.version
|
|
29179
29266
|
});
|
|
29180
29267
|
}
|
|
29181
29268
|
});
|
|
@@ -29405,7 +29492,7 @@ var package_default2 = {
|
|
|
29405
29492
|
name: "@uipath/solution-sdk",
|
|
29406
29493
|
author: "UiPath",
|
|
29407
29494
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
29408
|
-
version: "1.
|
|
29495
|
+
version: "1.204.0-preview.211",
|
|
29409
29496
|
repository: {
|
|
29410
29497
|
type: "git",
|
|
29411
29498
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -29456,7 +29543,7 @@ var package_default2 = {
|
|
|
29456
29543
|
"@uipath/common": "workspace:*",
|
|
29457
29544
|
"@uipath/filesystem": "workspace:*",
|
|
29458
29545
|
"@uipath/orchestrator-sdk": "workspace:*",
|
|
29459
|
-
"@uipath/resource-builder-sdk": "2025.11.0-
|
|
29546
|
+
"@uipath/resource-builder-sdk": "2025.11.0-alpha6004-4107",
|
|
29460
29547
|
"@uipath/solutionpackager-tool-core": "workspace:*",
|
|
29461
29548
|
"@uipath/studioweb-sdk": "workspace:*",
|
|
29462
29549
|
"@types/node": "^25.5.2",
|
|
@@ -29697,14 +29784,15 @@ var DEFAULT_EXCLUDED_DIR_NAMES = new Set([
|
|
|
29697
29784
|
"node_modules",
|
|
29698
29785
|
"__pycache__",
|
|
29699
29786
|
".git",
|
|
29700
|
-
".local"
|
|
29787
|
+
".local",
|
|
29788
|
+
".flow-sdk"
|
|
29701
29789
|
]);
|
|
29702
29790
|
// ../solution-sdk/src/project-debug-status.ts
|
|
29703
29791
|
var SUCCEEDED = "creationsucceeded";
|
|
29704
29792
|
var TERMINAL = new Set([SUCCEEDED, "creationfailed", "validationfailed"]);
|
|
29705
29793
|
// src/services/project-artifacts.ts
|
|
29706
29794
|
async function ensureProjectArtifacts(args) {
|
|
29707
|
-
const { addProjectArtifactsToSolutionAsync } = await import("./index-
|
|
29795
|
+
const { addProjectArtifactsToSolutionAsync } = await import("./index-1k95y97e.js");
|
|
29708
29796
|
return addProjectArtifactsToSolutionAsync(args);
|
|
29709
29797
|
}
|
|
29710
29798
|
|
|
@@ -30866,13 +30954,13 @@ var registerPublishCommand = (program) => {
|
|
|
30866
30954
|
});
|
|
30867
30955
|
if (result) {
|
|
30868
30956
|
trackShipSucceeded({
|
|
30869
|
-
|
|
30870
|
-
|
|
30871
|
-
|
|
30872
|
-
|
|
30873
|
-
|
|
30874
|
-
|
|
30875
|
-
|
|
30957
|
+
[ShipDimensions.ShipKind]: "publish",
|
|
30958
|
+
[ShipDimensions.Target]: result.personalWorkspace ? "personal_workspace_coded_app_feed" : "tenant_coded_app_feed",
|
|
30959
|
+
[ShipDimensions.ProjectType]: "coded_app",
|
|
30960
|
+
[CommandDimensions.CommandName]: "uip codedapp publish",
|
|
30961
|
+
[ShipDimensions.ArtifactCorrelationKey]: `${result.systemName}:${result.packageVersion}`,
|
|
30962
|
+
[ShipDimensions.PackageName]: result.packageName,
|
|
30963
|
+
[ShipDimensions.PackageVersion]: result.packageVersion
|
|
30876
30964
|
});
|
|
30877
30965
|
}
|
|
30878
30966
|
});
|
|
@@ -30937,9 +31025,9 @@ async function throwIfUnauthorized(response, context) {
|
|
|
30937
31025
|
}
|
|
30938
31026
|
function trackApiFailure(apiMethod, errorMessage, statusCode) {
|
|
30939
31027
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PushApiFailure, {
|
|
30940
|
-
|
|
30941
|
-
|
|
30942
|
-
...statusCode !== undefined && {
|
|
31028
|
+
ApiMethod: apiMethod,
|
|
31029
|
+
ErrorMessage: errorMessage.length > MAX_TELEMETRY_ERROR_LENGTH ? `${errorMessage.slice(0, MAX_TELEMETRY_ERROR_LENGTH)}...` : errorMessage,
|
|
31030
|
+
...statusCode !== undefined && { StatusCode: statusCode }
|
|
30943
31031
|
});
|
|
30944
31032
|
}
|
|
30945
31033
|
function throwProjectAccessError(projectId, apiMethod, statusCode) {
|
|
@@ -31817,8 +31905,8 @@ async function ensureFoldersCreated(config, plan, folderIdMap, setStructure, loc
|
|
|
31817
31905
|
const someFolderCreatesReturnedNull = results.some((r) => !r.id);
|
|
31818
31906
|
if (someFolderCreatesReturnedNull) {
|
|
31819
31907
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PushFolderCreateConflict, {
|
|
31820
|
-
|
|
31821
|
-
|
|
31908
|
+
Message: "One or more create folder returned null; refetching to resolve parent ids",
|
|
31909
|
+
Depth: String(depth)
|
|
31822
31910
|
});
|
|
31823
31911
|
const afterCreate2 = await refetchAndMergeFolderIds(config, folderIdMap, setStructure);
|
|
31824
31912
|
for (const { folder, folderName } of results) {
|
|
@@ -32177,16 +32265,50 @@ function extractLockKeys(locks) {
|
|
|
32177
32265
|
solutionLockKey: solution?.lockKey ?? null
|
|
32178
32266
|
};
|
|
32179
32267
|
}
|
|
32180
|
-
|
|
32181
|
-
|
|
32182
|
-
const
|
|
32268
|
+
var EMPTY_GUID = "00000000-0000-0000-0000-000000000000";
|
|
32269
|
+
function lockQuery(config, solutionId, extra = {}) {
|
|
32270
|
+
const base = { pId: config.projectId, ...extra };
|
|
32271
|
+
if (solutionId && solutionId !== EMPTY_GUID)
|
|
32272
|
+
base.sId = solutionId;
|
|
32273
|
+
return base;
|
|
32274
|
+
}
|
|
32275
|
+
async function getExistingProjectLock(config, solutionId) {
|
|
32276
|
+
const url = buildLocksUrl(config, API_ENDPOINTS.STUDIO_WEB_LOCKS_ROOT, lockQuery(config, solutionId));
|
|
32277
|
+
let response;
|
|
32278
|
+
try {
|
|
32279
|
+
response = await fetch(url, {
|
|
32280
|
+
method: "GET",
|
|
32281
|
+
headers: createHeaders({
|
|
32282
|
+
bearerToken: config.envConfig.accessToken,
|
|
32283
|
+
tenantId: config.envConfig.tenantId
|
|
32284
|
+
})
|
|
32285
|
+
});
|
|
32286
|
+
} catch {
|
|
32287
|
+
return null;
|
|
32288
|
+
}
|
|
32289
|
+
if (response.status === 204)
|
|
32290
|
+
return null;
|
|
32291
|
+
if (response.ok) {
|
|
32292
|
+
try {
|
|
32293
|
+
return await response.json();
|
|
32294
|
+
} catch {
|
|
32295
|
+
return null;
|
|
32296
|
+
}
|
|
32297
|
+
}
|
|
32298
|
+
await throwIfUnauthorized(response, MESSAGES.ERROR_CONTEXT.PUSH_ACQUIRE_LOCK);
|
|
32299
|
+
return null;
|
|
32300
|
+
}
|
|
32301
|
+
async function acquireServerLock(config, solutionId, seed) {
|
|
32302
|
+
const lockKey = seed?.lockKey ?? randomUUID2();
|
|
32303
|
+
const sharedOnly = seed?.sharedOnly ?? true;
|
|
32304
|
+
const url = buildLocksUrl(config, API_ENDPOINTS.STUDIO_WEB_LOCKS_KEY.replace("{lockKey}", encodeURIComponent(lockKey)), lockQuery(config, solutionId));
|
|
32183
32305
|
const response = await fetch(url, {
|
|
32184
32306
|
method: "PUT",
|
|
32185
32307
|
headers: createHeaders({
|
|
32186
32308
|
bearerToken: config.envConfig.accessToken,
|
|
32187
32309
|
tenantId: config.envConfig.tenantId
|
|
32188
32310
|
}),
|
|
32189
|
-
body: JSON.stringify({ sharedOnly
|
|
32311
|
+
body: JSON.stringify({ sharedOnly })
|
|
32190
32312
|
});
|
|
32191
32313
|
if (response.ok) {
|
|
32192
32314
|
const locks = await response.json();
|
|
@@ -32202,8 +32324,8 @@ async function acquireServerLock(config) {
|
|
|
32202
32324
|
trackApiFailure("acquireServerLock", errMsg, response.status);
|
|
32203
32325
|
throw new Error(errMsg);
|
|
32204
32326
|
}
|
|
32205
|
-
async function releaseServerLock(config, lockKey) {
|
|
32206
|
-
const url = buildLocksUrl(config, API_ENDPOINTS.STUDIO_WEB_LOCKS_KEY.replace("{lockKey}", encodeURIComponent(lockKey)),
|
|
32327
|
+
async function releaseServerLock(config, lockKey, solutionId, sharedOnly = true) {
|
|
32328
|
+
const url = buildLocksUrl(config, API_ENDPOINTS.STUDIO_WEB_LOCKS_KEY.replace("{lockKey}", encodeURIComponent(lockKey)), lockQuery(config, solutionId, { sharedOnly: String(sharedOnly) }));
|
|
32207
32329
|
const response = await fetch(url, {
|
|
32208
32330
|
method: "DELETE",
|
|
32209
32331
|
headers: createHeaders({
|
|
@@ -32229,25 +32351,61 @@ function clientDrivenProvider(config) {
|
|
|
32229
32351
|
}
|
|
32230
32352
|
};
|
|
32231
32353
|
}
|
|
32232
|
-
function serverDrivenProvider(config) {
|
|
32354
|
+
function serverDrivenProvider(config, solutionId) {
|
|
32355
|
+
let renewedFromExistingSession = false;
|
|
32356
|
+
let acquireSharedOnly = true;
|
|
32233
32357
|
return {
|
|
32234
|
-
retrieveLock: () =>
|
|
32358
|
+
retrieveLock: async () => {
|
|
32359
|
+
const existing = await getExistingProjectLock(config, solutionId);
|
|
32360
|
+
if (existing?.lockKey) {
|
|
32361
|
+
renewedFromExistingSession = true;
|
|
32362
|
+
acquireSharedOnly = existing.isShared ?? false;
|
|
32363
|
+
return acquireServerLock(config, solutionId, {
|
|
32364
|
+
lockKey: existing.lockKey,
|
|
32365
|
+
sharedOnly: acquireSharedOnly
|
|
32366
|
+
});
|
|
32367
|
+
}
|
|
32368
|
+
renewedFromExistingSession = false;
|
|
32369
|
+
acquireSharedOnly = true;
|
|
32370
|
+
return acquireServerLock(config, solutionId);
|
|
32371
|
+
},
|
|
32235
32372
|
releaseLock: async (info2) => {
|
|
32373
|
+
if (renewedFromExistingSession)
|
|
32374
|
+
return;
|
|
32236
32375
|
const keys = [];
|
|
32237
32376
|
if (info2.projectLockKey)
|
|
32238
32377
|
keys.push(info2.projectLockKey);
|
|
32239
32378
|
if (info2.solutionLockKey)
|
|
32240
32379
|
keys.push(info2.solutionLockKey);
|
|
32241
|
-
const results = await Promise.allSettled(keys.map((key) => releaseServerLock(config, key)));
|
|
32380
|
+
const results = await Promise.allSettled(keys.map((key) => releaseServerLock(config, key, solutionId, acquireSharedOnly)));
|
|
32242
32381
|
const failures = results.filter((r) => r.status === "rejected");
|
|
32243
32382
|
if (failures.length)
|
|
32244
32383
|
throw failures[0].reason;
|
|
32245
32384
|
}
|
|
32246
32385
|
};
|
|
32247
32386
|
}
|
|
32387
|
+
var solutionIdCache = new Map;
|
|
32388
|
+
function solutionIdCacheKey(config) {
|
|
32389
|
+
return `${config.envConfig.orgId}::${config.envConfig.tenantId}::${config.projectId}`;
|
|
32390
|
+
}
|
|
32391
|
+
async function resolveSolutionIdForLock(config) {
|
|
32392
|
+
const key = solutionIdCacheKey(config);
|
|
32393
|
+
const cached = solutionIdCache.get(key);
|
|
32394
|
+
if (cached)
|
|
32395
|
+
return cached;
|
|
32396
|
+
const promise = getSolutionId(config).then((id) => id || null).catch(() => {
|
|
32397
|
+
solutionIdCache.delete(key);
|
|
32398
|
+
return null;
|
|
32399
|
+
});
|
|
32400
|
+
solutionIdCache.set(key, promise);
|
|
32401
|
+
return promise;
|
|
32402
|
+
}
|
|
32248
32403
|
async function createLockProvider(config) {
|
|
32249
32404
|
const cfg = await getLockingConfiguration(config);
|
|
32250
|
-
|
|
32405
|
+
if (!cfg.serverDrivesLockingStrategies)
|
|
32406
|
+
return clientDrivenProvider(config);
|
|
32407
|
+
const solutionId = await resolveSolutionIdForLock(config);
|
|
32408
|
+
return serverDrivenProvider(config, solutionId);
|
|
32251
32409
|
}
|
|
32252
32410
|
|
|
32253
32411
|
// src/utils/jwt.ts
|
|
@@ -32385,7 +32543,7 @@ async function prepareMetadataFileForPlan(config, remoteFiles, downloadRemoteFil
|
|
|
32385
32543
|
const msg = remoteErr.message || String(remoteErr);
|
|
32386
32544
|
config.logger.log(source_default.gray(MESSAGES.ERRORS.PUSH_REMOTE_METADATA_LOAD_FALLBACK_PREFIX + msg + MESSAGES.ERRORS.PUSH_REMOTE_METADATA_LOAD_FALLBACK_SUFFIX));
|
|
32387
32545
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PushMetadataRemoteLoadFailed, {
|
|
32388
|
-
|
|
32546
|
+
ErrorMessage: msg.length > MAX_TELEMETRY_ERROR_LENGTH ? msg.slice(0, MAX_TELEMETRY_ERROR_LENGTH) + "..." : msg
|
|
32389
32547
|
});
|
|
32390
32548
|
metadata = createNewMetadataPayload(config);
|
|
32391
32549
|
isNewMetadata = true;
|
|
@@ -32977,16 +33135,16 @@ async function runPull(config, options) {
|
|
|
32977
33135
|
const { rootDir, logger: logger2 } = config;
|
|
32978
33136
|
if (!await fs.exists(rootDir)) {
|
|
32979
33137
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
32980
|
-
|
|
32981
|
-
|
|
33138
|
+
Reason: "target_dir_invalid",
|
|
33139
|
+
ErrorMessage: MESSAGES.ERRORS.PULL_TARGET_DIR_NOT_FOUND
|
|
32982
33140
|
});
|
|
32983
33141
|
throw new Error(MESSAGES.ERRORS.PULL_TARGET_DIR_NOT_FOUND);
|
|
32984
33142
|
}
|
|
32985
33143
|
const rootStats = await fs.stat(rootDir);
|
|
32986
33144
|
if (!rootStats?.isDirectory()) {
|
|
32987
33145
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
32988
|
-
|
|
32989
|
-
|
|
33146
|
+
Reason: "target_dir_invalid",
|
|
33147
|
+
ErrorMessage: MESSAGES.ERRORS.PULL_TARGET_DIR_NOT_DIRECTORY
|
|
32990
33148
|
});
|
|
32991
33149
|
throw new Error(MESSAGES.ERRORS.PULL_TARGET_DIR_NOT_DIRECTORY);
|
|
32992
33150
|
}
|
|
@@ -32995,8 +33153,8 @@ async function runPull(config, options) {
|
|
|
32995
33153
|
const hasFiles = structure.files.length > 0 || structure.folders.length > 0;
|
|
32996
33154
|
if (!structure.name && !hasFiles) {
|
|
32997
33155
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
32998
|
-
|
|
32999
|
-
|
|
33156
|
+
Reason: "project_not_found",
|
|
33157
|
+
ErrorMessage: MESSAGES.ERRORS.PULL_PROJECT_NOT_FOUND
|
|
33000
33158
|
});
|
|
33001
33159
|
throw new Error(MESSAGES.ERRORS.PULL_PROJECT_NOT_FOUND);
|
|
33002
33160
|
}
|
|
@@ -33007,8 +33165,8 @@ async function runPull(config, options) {
|
|
|
33007
33165
|
if (validationErr) {
|
|
33008
33166
|
const msg = validationErr.message || String(validationErr);
|
|
33009
33167
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
33010
|
-
|
|
33011
|
-
|
|
33168
|
+
Reason: "validation",
|
|
33169
|
+
ErrorMessage: msg.length > MAX_TELEMETRY_ERROR_LENGTH ? `${msg.slice(0, MAX_TELEMETRY_ERROR_LENGTH)}...` : msg
|
|
33012
33170
|
});
|
|
33013
33171
|
throw validationErr;
|
|
33014
33172
|
}
|
|
@@ -33069,7 +33227,7 @@ async function runPull(config, options) {
|
|
|
33069
33227
|
const proceed = await options.promptOverwrite(overwrites);
|
|
33070
33228
|
if (!proceed) {
|
|
33071
33229
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
33072
|
-
|
|
33230
|
+
Reason: "overwrite_aborted"
|
|
33073
33231
|
});
|
|
33074
33232
|
throw new Error(MESSAGES.ERRORS.PULL_OVERWRITE_DECLINED);
|
|
33075
33233
|
}
|
|
@@ -33082,7 +33240,7 @@ async function runPull(config, options) {
|
|
|
33082
33240
|
logger2.log(source_default.yellow(` ... and ${overwrites.length - PULL_OVERWRITE_LIST_MAX_DISPLAY} more.`));
|
|
33083
33241
|
}
|
|
33084
33242
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
33085
|
-
|
|
33243
|
+
Reason: "overwrite_conflicts"
|
|
33086
33244
|
});
|
|
33087
33245
|
throw new Error(MESSAGES.ERRORS.PULL_OVERWRITE_CONFLICTS);
|
|
33088
33246
|
}
|
|
@@ -33160,14 +33318,14 @@ async function runPull(config, options) {
|
|
|
33160
33318
|
if (failedPaths.length > 0) {
|
|
33161
33319
|
const msg = `${MESSAGES.ERRORS.PULL_FAILED_PREFIX}${failedPaths.length} file(s) failed to download.`;
|
|
33162
33320
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullFailed, {
|
|
33163
|
-
|
|
33164
|
-
|
|
33165
|
-
|
|
33321
|
+
Reason: "download_failed",
|
|
33322
|
+
ErrorMessage: msg.length > MAX_TELEMETRY_ERROR_LENGTH ? `${msg.slice(0, MAX_TELEMETRY_ERROR_LENGTH)}...` : msg,
|
|
33323
|
+
FailedCount: failedPaths.length
|
|
33166
33324
|
});
|
|
33167
33325
|
throw new Error(msg);
|
|
33168
33326
|
}
|
|
33169
33327
|
cliTelemetryClient.track(CodedAppTelemetryEvents.PullCompleted, {
|
|
33170
|
-
|
|
33328
|
+
FileCount: entries.length
|
|
33171
33329
|
});
|
|
33172
33330
|
logger2.log(source_default.gray(`[pull] Done. ${entries.length} file(s) synced.`));
|
|
33173
33331
|
}
|
|
@@ -33708,7 +33866,7 @@ async function promptCreateNewSolution(envConfig, logger2) {
|
|
|
33708
33866
|
async function persistProjectId(projectId, logger2) {
|
|
33709
33867
|
const fs = getFileSystem();
|
|
33710
33868
|
const [saveErr] = await catchError((async () => {
|
|
33711
|
-
const { saveEnvFileAsync } = await import("./index-
|
|
33869
|
+
const { saveEnvFileAsync } = await import("./index-gqak49gg.js");
|
|
33712
33870
|
const localEnvPath = fs.path.join(fs.env.cwd(), ".env");
|
|
33713
33871
|
await saveEnvFileAsync({
|
|
33714
33872
|
envPath: localEnvPath,
|
|
@@ -33864,6 +34022,147 @@ var registerPushCommand = (program) => {
|
|
|
33864
34022
|
});
|
|
33865
34023
|
};
|
|
33866
34024
|
|
|
34025
|
+
// src/actions/validate.ts
|
|
34026
|
+
async function executeValidatePathName(options) {
|
|
34027
|
+
const logger2 = options.logger ?? {
|
|
34028
|
+
log: (msg) => logger.info(msg)
|
|
34029
|
+
};
|
|
34030
|
+
const { sanitized: pathName, isModified } = sanitizeAppName(options.pathName);
|
|
34031
|
+
if (!pathName) {
|
|
34032
|
+
throw new Error(MESSAGES.VALIDATIONS.PATH_NAME_REQUIRED);
|
|
34033
|
+
}
|
|
34034
|
+
if (isModified) {
|
|
34035
|
+
logger2.log(source_default.yellow(MESSAGE_BUILDERS.APP_NAME_SANITIZED(options.pathName, pathName)));
|
|
34036
|
+
}
|
|
34037
|
+
const envConfig = getEnvironmentConfig(AUTH_CONSTANTS.REQUIRED_ENV_VARS.PATH_NAME_CHECK, logger2, {
|
|
34038
|
+
baseUrl: options.baseUrl,
|
|
34039
|
+
orgId: options.orgId,
|
|
34040
|
+
orgName: options.orgName,
|
|
34041
|
+
accessToken: options.accessToken
|
|
34042
|
+
});
|
|
34043
|
+
if (!envConfig)
|
|
34044
|
+
throw new ConfigurationError("Missing required configuration");
|
|
34045
|
+
const { available, occupiedBy } = await checkPathName(pathName, envConfig, MESSAGES.ERROR_CONTEXT.PATH_NAME_CHECK);
|
|
34046
|
+
return { pathName, available, occupiedBy };
|
|
34047
|
+
}
|
|
34048
|
+
|
|
34049
|
+
// src/commands/validate.ts
|
|
34050
|
+
var VALIDATE_EXAMPLES = [
|
|
34051
|
+
{
|
|
34052
|
+
Description: "Ask whether a path name is still free",
|
|
34053
|
+
Command: "uip codedapp validate --path-name my-app",
|
|
34054
|
+
Output: {
|
|
34055
|
+
Code: "CodedAppPathNameChecked",
|
|
34056
|
+
Data: {
|
|
34057
|
+
PathName: "my-app",
|
|
34058
|
+
Available: true,
|
|
34059
|
+
OccupiedBy: null
|
|
34060
|
+
}
|
|
34061
|
+
}
|
|
34062
|
+
},
|
|
34063
|
+
{
|
|
34064
|
+
Description: "A taken name also names the app sitting on it",
|
|
34065
|
+
Command: "uip codedapp validate --path-name my-app",
|
|
34066
|
+
Output: {
|
|
34067
|
+
Code: "CodedAppPathNameChecked",
|
|
34068
|
+
Data: {
|
|
34069
|
+
PathName: "my-app",
|
|
34070
|
+
Available: false,
|
|
34071
|
+
OccupiedBy: {
|
|
34072
|
+
Id: "6f1c2b4a-0000-0000-0000-000000000001",
|
|
34073
|
+
DeploymentTitle: "My App",
|
|
34074
|
+
Title: "My App package title",
|
|
34075
|
+
SystemName: "my-app_abc123",
|
|
34076
|
+
SemVersion: "1.2.0",
|
|
34077
|
+
DeployVersion: 3,
|
|
34078
|
+
DeploymentDescription: "Expense approvals",
|
|
34079
|
+
IsLatestVersion: true,
|
|
34080
|
+
IsAppPublic: false,
|
|
34081
|
+
DateDeployed: "2026-09-18T10:12:04.000Z",
|
|
34082
|
+
DeploymentFolder: {
|
|
34083
|
+
Key: "3f8b1d22-…",
|
|
34084
|
+
DisplayName: "Shared"
|
|
34085
|
+
},
|
|
34086
|
+
IsResourceActivated: true,
|
|
34087
|
+
RoutingName: "my-app"
|
|
34088
|
+
}
|
|
34089
|
+
}
|
|
34090
|
+
}
|
|
34091
|
+
}
|
|
34092
|
+
];
|
|
34093
|
+
function parsePathNameOption(raw) {
|
|
34094
|
+
if (!sanitizeAppName(raw).sanitized) {
|
|
34095
|
+
throw new InvalidArgumentError(MESSAGES.VALIDATIONS.PATH_NAME_REQUIRED);
|
|
34096
|
+
}
|
|
34097
|
+
return raw;
|
|
34098
|
+
}
|
|
34099
|
+
function instructionsForFailure2(errorCode) {
|
|
34100
|
+
if (errorCode === "permission_denied") {
|
|
34101
|
+
return "Grant the account Apps or Apps.Read on the organization, then run the command again.";
|
|
34102
|
+
}
|
|
34103
|
+
if (errorCode === "authentication_required") {
|
|
34104
|
+
return "Run 'uip login' to re-authenticate — the session is invalid or expired.";
|
|
34105
|
+
}
|
|
34106
|
+
if (errorCode === "invalid_argument") {
|
|
34107
|
+
return "Pass a --path-name containing at least one letter or digit.";
|
|
34108
|
+
}
|
|
34109
|
+
if (errorCode === "server_error") {
|
|
34110
|
+
return "The service could not answer. Retry in a moment — the name is neither confirmed free nor confirmed taken.";
|
|
34111
|
+
}
|
|
34112
|
+
return "Check the connection settings, then run the command again.";
|
|
34113
|
+
}
|
|
34114
|
+
async function reportCheckFailure(error2) {
|
|
34115
|
+
if (isConfigurationError(error2)) {
|
|
34116
|
+
OutputFormatter.error({
|
|
34117
|
+
Result: error2.result,
|
|
34118
|
+
ErrorCode: error2.errorCode,
|
|
34119
|
+
Message: "Missing or invalid connection settings for checking a path name",
|
|
34120
|
+
Instructions: "Run 'uip login', or pass --base-url, --access-token and either --org-id or --org-name. The values that failed are named above.",
|
|
34121
|
+
Retry: error2.retry
|
|
34122
|
+
});
|
|
34123
|
+
processContext.exit(EXIT_CODES[error2.result] ?? 1);
|
|
34124
|
+
return;
|
|
34125
|
+
}
|
|
34126
|
+
const details = await extractErrorDetails(error2);
|
|
34127
|
+
OutputFormatter.error({
|
|
34128
|
+
Result: details.result,
|
|
34129
|
+
ErrorCode: details.errorCode,
|
|
34130
|
+
Message: `Could not check the path name: ${details.message}`,
|
|
34131
|
+
Instructions: instructionsForFailure2(details.errorCode),
|
|
34132
|
+
Retry: details.retry
|
|
34133
|
+
});
|
|
34134
|
+
processContext.exit(EXIT_CODES[details.result] ?? 1);
|
|
34135
|
+
}
|
|
34136
|
+
var registerValidateCommand = (program) => {
|
|
34137
|
+
program.command("validate").description("Validate a coded app path name: whether it is free, and which app holds it").requiredOption("--path-name <name>", "App pathname to test (https://<org>.uipath.host/<path-name>)", parsePathNameOption).option("--base-url <url>", "UiPath base URL").option("--org-id <id>", "Organization ID").option("--org-name <name>", "Organization name").option("--access-token <token>", "Access token").examples(VALIDATE_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
34138
|
+
const logger2 = {
|
|
34139
|
+
log: (msg) => getOutputSink().writeErr(`${msg}
|
|
34140
|
+
`)
|
|
34141
|
+
};
|
|
34142
|
+
const [error2, result] = await catchError(executeValidatePathName({
|
|
34143
|
+
pathName: options.pathName,
|
|
34144
|
+
baseUrl: options.baseUrl,
|
|
34145
|
+
orgId: options.orgId,
|
|
34146
|
+
orgName: options.orgName,
|
|
34147
|
+
accessToken: options.accessToken,
|
|
34148
|
+
logger: logger2
|
|
34149
|
+
}));
|
|
34150
|
+
if (error2) {
|
|
34151
|
+
await reportCheckFailure(error2);
|
|
34152
|
+
return;
|
|
34153
|
+
}
|
|
34154
|
+
if (!result.available && result.occupiedBy === null) {
|
|
34155
|
+
getOutputSink().writeErr(`${source_default.yellow(`⚠️ '${result.pathName}' is taken, but the app holding it could not be determined.`)}
|
|
34156
|
+
`);
|
|
34157
|
+
}
|
|
34158
|
+
OutputFormatter.success({
|
|
34159
|
+
Result: RESULTS.Success,
|
|
34160
|
+
Code: "CodedAppPathNameChecked",
|
|
34161
|
+
Data: result
|
|
34162
|
+
});
|
|
34163
|
+
});
|
|
34164
|
+
};
|
|
34165
|
+
|
|
33867
34166
|
// src/utils/resolve-credentials.ts
|
|
33868
34167
|
function setEnvIfPresent(envVar, value) {
|
|
33869
34168
|
if (value) {
|
|
@@ -33909,8 +34208,9 @@ var registerCommands = async (program) => {
|
|
|
33909
34208
|
registerPublishCommand(program);
|
|
33910
34209
|
registerDeployCommand(program);
|
|
33911
34210
|
registerDeleteCommand(program);
|
|
34211
|
+
registerValidateCommand(program);
|
|
33912
34212
|
};
|
|
33913
34213
|
|
|
33914
34214
|
export { metadata, registerCommands };
|
|
33915
34215
|
|
|
33916
|
-
//# debugId=
|
|
34216
|
+
//# debugId=2682615503BA2D9864756E2164756E21
|