@uipath/codedapp-tool 1.203.0 → 1.203.1-preview.259

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/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./packager-tool-y6tpn2q8.js";
5
+ } from "./packager-tool-qngjmgjk.js";
6
6
  import {
7
7
  Command
8
8
  } from "./packager-tool-pwx9dvyr.js";
@@ -20623,7 +20623,7 @@ var package_default = {
20623
20623
  name: "@uipath/codedapp-tool",
20624
20624
  author: "UiPath",
20625
20625
  license: "SEE LICENSE IN LICENSE.txt",
20626
- version: "1.203.0",
20626
+ version: "1.203.1-preview.259",
20627
20627
  description: "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
20628
20628
  keywords: [
20629
20629
  "cli-tool",
@@ -21348,6 +21348,11 @@ var AUTH_CONSTANTS = {
21348
21348
  "UIPATH_TENANT_ID",
21349
21349
  "UIPATH_ACCESS_TOKEN"
21350
21350
  ],
21351
+ PATH_NAME_CHECK: [
21352
+ "UIPATH_BASE_URL",
21353
+ "UIPATH_ORG_ID",
21354
+ "UIPATH_ACCESS_TOKEN"
21355
+ ],
21351
21356
  DELETE: [
21352
21357
  "UIPATH_BASE_URL",
21353
21358
  "UIPATH_ORG_ID",
@@ -21406,6 +21411,7 @@ var ACTION_SCHEMA_CONSTANTS = {
21406
21411
  ACTION_SCHEMA_FILENAME: "action-schema.json"
21407
21412
  };
21408
21413
  var DEFAULT_APP_VERSION = "1.0.0";
21414
+ var MAX_CODED_APP_NAME_LENGTH = 64;
21409
21415
  // src/constants/messages.ts
21410
21416
  var MESSAGES = {
21411
21417
  ERRORS: {
@@ -21418,6 +21424,7 @@ var MESSAGES = {
21418
21424
  ACCESS_DENIED: "Access denied. You may not have permission to access this tenant/organization",
21419
21425
  API_ENDPOINT_NOT_FOUND: "API endpoint not found. Please check your UIPATH_BASE_URL configuration",
21420
21426
  APPS_SERVICE_APP_TOKEN_HINT: "The UiPath Apps service rejected this external application's token: it is missing the Apps.Read and Apps.Write scopes. Grant them to the external application (Admin > External Applications), then add them to 'uip login --scope'.",
21427
+ APPS_SERVICE_APP_TOKEN_READ_HINT: "The UiPath Apps service rejected this external application's token: it is missing the Apps.Read scope. Grant it to the external application (Admin > External Applications), then add it to 'uip login --scope'.",
21421
21428
  SERVER_ERROR: "Server error occurred. Please try again later or contact UiPath support",
21422
21429
  SERVICES_UNAVAILABLE: "UiPath services are temporarily unavailable. Please try again later",
21423
21430
  RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Please wait and try again",
@@ -21437,7 +21444,6 @@ var MESSAGES = {
21437
21444
  APP_UPGRADE_FAILED: "❌ App upgrade failed",
21438
21445
  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.",
21439
21446
  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.',
21440
- APP_NAME_ALREADY_EXISTS: "❌ This app name is already deployed in this folder. Please choose a different name.",
21441
21447
  DEPLOY_VERSION_NOT_FOUND: "❌ Could not determine deploy version from the server. Please re-run publish first.",
21442
21448
  DEPLOYMENT_ID_NOT_FOUND: "❌ Could not find deployment ID for the app",
21443
21449
  ALL_REGISTERED_PORTS_IN_USE: "All registered ports are in use",
@@ -21604,6 +21610,7 @@ var MESSAGES = {
21604
21610
  },
21605
21611
  VALIDATIONS: {
21606
21612
  APP_NAME_REQUIRED: "App name is required",
21613
+ PATH_NAME_REQUIRED: "A path name must contain at least one letter or digit",
21607
21614
  APP_NAME_INVALID_CHARS: "App name can only contain lowercase letters, numbers, and hyphens (-). Please remove invalid special characters and try again.",
21608
21615
  PACKAGE_NAME_REQUIRED: "Package name is required",
21609
21616
  MISSING_REQUIRED_CONFIG: "❌ Missing required configuration:",
@@ -21618,6 +21625,7 @@ var MESSAGES = {
21618
21625
  CLIENT_CREDENTIALS_AUTH: "client credentials authentication",
21619
21626
  APP_DEPLOYMENT: "app deployment",
21620
21627
  DEPLOYED_APP_LOOKUP: "deployed app lookup",
21628
+ PATH_NAME_CHECK: "path name check",
21621
21629
  DEPLOYED_APP_DELETION: "deployed app deletion",
21622
21630
  APP_UPGRADE: "app upgrade",
21623
21631
  CODED_APP_REGISTRATION: "coded app registration",
@@ -21629,6 +21637,8 @@ var MESSAGES = {
21629
21637
  var MESSAGE_BUILDERS = {
21630
21638
  APP_NAME_SANITIZED: (original, sanitized) => `⚠️ App name "${original}" contains invalid characters. Using sanitized name: "${sanitized}"`,
21631
21639
  APP_NAME_TOO_LONG: (name, length, maxLength) => `App name '${name}' is ${length} characters; limit is ${maxLength}. Use --name with a shorter app name and try again.`,
21640
+ PATH_NAME_TOO_LONG: (pathName, length, maxLength) => `Path name '${pathName}' is ${length} characters; limit is ${maxLength}. Pass a shorter --path-name.`,
21641
+ PATH_NAME_TAKEN: (pathName) => `❌ Path name '${pathName}' is already taken in this organization. Pass a different --path-name. To check whether a path name is free, run 'uip codedapp validate --path-name <name>'.`,
21632
21642
  SDK_CONFIG_CREATED: (configPath) => `⚠️ uipath.json not found — created at ${configPath} with empty values.`
21633
21643
  };
21634
21644
  var getHttpErrorMessage = (status, context) => {
@@ -21789,7 +21799,11 @@ function buildAppUrl(params) {
21789
21799
  }
21790
21800
 
21791
21801
  // src/utils/error-handler.ts
21792
- var APPS_SCOPE_PREFIX = "Apps.";
21802
+ var APPS_SCOPE = "Apps";
21803
+ var APPS_SCOPE_PREFIX = `${APPS_SCOPE}.`;
21804
+ function isAppsScope(scope) {
21805
+ return scope === APPS_SCOPE || scope.startsWith(APPS_SCOPE_PREFIX);
21806
+ }
21793
21807
  function appsServiceHint(status, appsServiceToken) {
21794
21808
  if (status !== 401 || !appsServiceToken)
21795
21809
  return;
@@ -21797,7 +21811,7 @@ function appsServiceHint(status, appsServiceToken) {
21797
21811
  return;
21798
21812
  }
21799
21813
  const scopes = readTokenScopes(appsServiceToken) ?? [];
21800
- if (scopes.some((scope) => scope.startsWith(APPS_SCOPE_PREFIX))) {
21814
+ if (scopes.some(isAppsScope)) {
21801
21815
  return;
21802
21816
  }
21803
21817
  return MESSAGES.ERRORS.APPS_SERVICE_APP_TOKEN_HINT;
@@ -21815,14 +21829,17 @@ HTTP ${response.status}: ${MESSAGES.ERRORS.NO_ERROR_DETAILS}`;
21815
21829
  }
21816
21830
  return fullMessage;
21817
21831
  }
21818
- async function handleHttpError(response, context, appsServiceToken) {
21832
+ async function createHttpError(response, context, appsServiceToken) {
21819
21833
  const errorMessage = await createHttpErrorMessage(response, context, appsServiceToken);
21820
21834
  const error = new Error(errorMessage);
21821
21835
  if (appsServiceHint(response.status, appsServiceToken)) {
21822
21836
  const errorCode = "permission_denied";
21823
21837
  Object.assign(error, { errorCode });
21824
21838
  }
21825
- throw error;
21839
+ return error;
21840
+ }
21841
+ async function handleHttpError(response, context, appsServiceToken) {
21842
+ throw await createHttpError(response, context, appsServiceToken);
21826
21843
  }
21827
21844
 
21828
21845
  // src/services/deployed-apps.ts
@@ -21862,6 +21879,22 @@ async function deleteDeployedAppById(envConfig, deployedAppId, errorContext = ME
21862
21879
  routingCacheWarning: response.headers.get("x-jamjam-warning") ?? undefined
21863
21880
  };
21864
21881
  }
21882
+ async function checkPathName(pathName, envConfig, errorContext = MESSAGES.ERROR_CONTEXT.PATH_NAME_CHECK) {
21883
+ const endpoint = API_ENDPOINTS.CHECK_APP_NAME_UNIQUE.replace("{appName}", encodeURIComponent(pathName));
21884
+ const url = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${endpoint}`, BASIC_ORIGIN_QUERY_PARAMS);
21885
+ const response = await fetch(url, {
21886
+ method: "GET",
21887
+ headers: createHeaders({
21888
+ bearerToken: envConfig.accessToken
21889
+ })
21890
+ });
21891
+ if (!response.ok) {
21892
+ const error = await createHttpError(response, errorContext, envConfig.accessToken);
21893
+ throw Object.assign(error, { status: response.status });
21894
+ }
21895
+ const data = await response.json();
21896
+ return { available: data.isUnique, occupiedBy: data.occupiedBy ?? null };
21897
+ }
21865
21898
 
21866
21899
  // src/utils/env-config.ts
21867
21900
  var ENV_CONFIG = AUTH_CONSTANTS.ENV_CONFIG;
@@ -28798,27 +28831,15 @@ async function getPublishedAppWithRetry(appNames, envConfig, version, onRetry) {
28798
28831
  function sleep(delayMs) {
28799
28832
  return new Promise((resolve) => setTimeout(resolve, delayMs));
28800
28833
  }
28801
- var MAX_CODED_APP_NAME_LENGTH = 32;
28802
28834
  function validateAppNameLength(name) {
28803
28835
  if (name.length <= MAX_CODED_APP_NAME_LENGTH)
28804
28836
  return;
28805
28837
  throw new Error(MESSAGE_BUILDERS.APP_NAME_TOO_LONG(name, name.length, MAX_CODED_APP_NAME_LENGTH));
28806
28838
  }
28807
28839
  async function checkAppNameUniqueness(appName, envConfig) {
28808
- const endpoint = API_ENDPOINTS.CHECK_APP_NAME_UNIQUE.replace("{appName}", encodeURIComponent(appName));
28809
- const url = appendQueryParams(`${envConfig.baseUrl}/${envConfig.orgId}${endpoint}`, BASIC_ORIGIN_QUERY_PARAMS);
28810
- const response = await fetch(url, {
28811
- method: "GET",
28812
- headers: createHeaders({
28813
- bearerToken: envConfig.accessToken
28814
- })
28815
- });
28816
- if (!response.ok) {
28817
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
28818
- }
28819
- const data = await response.json();
28820
- if (!data.isUnique) {
28821
- throw new Error(MESSAGES.ERRORS.APP_NAME_ALREADY_EXISTS);
28840
+ const { available } = await checkPathName(appName, envConfig, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
28841
+ if (!available) {
28842
+ throw new Error(MESSAGE_BUILDERS.PATH_NAME_TAKEN(appName));
28822
28843
  }
28823
28844
  }
28824
28845
  async function deployNewApp(appName, routingName, systemName, deployVersion, envConfig, tags, clientId) {
@@ -29460,7 +29481,7 @@ var package_default2 = {
29460
29481
  name: "@uipath/solution-sdk",
29461
29482
  author: "UiPath",
29462
29483
  license: "SEE LICENSE IN LICENSE.txt",
29463
- version: "1.203.0",
29484
+ version: "1.203.0-preview.259",
29464
29485
  repository: {
29465
29486
  type: "git",
29466
29487
  url: "https://github.com/UiPath/cli.git",
@@ -33936,6 +33957,155 @@ var registerPushCommand = (program) => {
33936
33957
  });
33937
33958
  };
33938
33959
 
33960
+ // src/actions/validate.ts
33961
+ async function executeValidatePathName(options) {
33962
+ const logger2 = options.logger ?? {
33963
+ log: (msg) => logger.info(msg)
33964
+ };
33965
+ const { sanitized: pathName, isModified } = sanitizeAppName(options.pathName);
33966
+ if (!pathName) {
33967
+ throw new Error(MESSAGES.VALIDATIONS.PATH_NAME_REQUIRED);
33968
+ }
33969
+ if (pathName.length > MAX_CODED_APP_NAME_LENGTH) {
33970
+ throw new Error(MESSAGE_BUILDERS.PATH_NAME_TOO_LONG(pathName, pathName.length, MAX_CODED_APP_NAME_LENGTH));
33971
+ }
33972
+ if (isModified) {
33973
+ logger2.log(source_default.yellow(MESSAGE_BUILDERS.APP_NAME_SANITIZED(options.pathName, pathName)));
33974
+ }
33975
+ const envConfig = getEnvironmentConfig(AUTH_CONSTANTS.REQUIRED_ENV_VARS.PATH_NAME_CHECK, logger2, {
33976
+ baseUrl: options.baseUrl,
33977
+ orgId: options.orgId,
33978
+ orgName: options.orgName,
33979
+ accessToken: options.accessToken
33980
+ });
33981
+ if (!envConfig)
33982
+ throw new ConfigurationError("Missing required configuration");
33983
+ const { available, occupiedBy } = await checkPathName(pathName, envConfig, MESSAGES.ERROR_CONTEXT.PATH_NAME_CHECK);
33984
+ return { pathName, available, occupiedBy };
33985
+ }
33986
+
33987
+ // src/commands/validate.ts
33988
+ var VALIDATE_EXAMPLES = [
33989
+ {
33990
+ Description: "Ask whether a path name is still free",
33991
+ Command: "uip codedapp validate --path-name my-app",
33992
+ Output: {
33993
+ Code: "CodedAppPathNameChecked",
33994
+ Data: {
33995
+ PathName: "my-app",
33996
+ Available: true,
33997
+ OccupiedBy: null
33998
+ }
33999
+ }
34000
+ },
34001
+ {
34002
+ Description: "A taken name also names the app sitting on it",
34003
+ Command: "uip codedapp validate --path-name my-app",
34004
+ Output: {
34005
+ Code: "CodedAppPathNameChecked",
34006
+ Data: {
34007
+ PathName: "my-app",
34008
+ Available: false,
34009
+ OccupiedBy: {
34010
+ Id: "6f1c2b4a-0000-0000-0000-000000000001",
34011
+ DeploymentTitle: "My App",
34012
+ Title: "My App package title",
34013
+ SystemName: "my-app_abc123",
34014
+ SemVersion: "1.2.0",
34015
+ DeployVersion: 3,
34016
+ DeploymentDescription: "Expense approvals",
34017
+ IsLatestVersion: true,
34018
+ IsAppPublic: false,
34019
+ DateDeployed: "2026-09-18T10:12:04.000Z",
34020
+ DeploymentFolder: {
34021
+ Key: "3f8b1d22-…",
34022
+ DisplayName: "Shared"
34023
+ },
34024
+ IsResourceActivated: true,
34025
+ RoutingName: "my-app"
34026
+ }
34027
+ }
34028
+ }
34029
+ }
34030
+ ];
34031
+ function parsePathNameOption(raw) {
34032
+ const { sanitized } = sanitizeAppName(raw);
34033
+ if (!sanitized) {
34034
+ throw new InvalidArgumentError(MESSAGES.VALIDATIONS.PATH_NAME_REQUIRED);
34035
+ }
34036
+ if (sanitized.length > MAX_CODED_APP_NAME_LENGTH) {
34037
+ throw new InvalidArgumentError(MESSAGE_BUILDERS.PATH_NAME_TOO_LONG(sanitized, sanitized.length, MAX_CODED_APP_NAME_LENGTH));
34038
+ }
34039
+ return raw;
34040
+ }
34041
+ function instructionsForFailure2(errorCode) {
34042
+ if (errorCode === "permission_denied") {
34043
+ return "Grant the account Apps or Apps.Read on the organization, then run the command again.";
34044
+ }
34045
+ if (errorCode === "authentication_required") {
34046
+ return "Run 'uip login' to re-authenticate — the session is invalid or expired.";
34047
+ }
34048
+ if (errorCode === "invalid_argument") {
34049
+ return "Pass a --path-name containing at least one letter or digit.";
34050
+ }
34051
+ if (errorCode === "server_error") {
34052
+ return "The service could not answer. Retry in a moment — the name is neither confirmed free nor confirmed taken.";
34053
+ }
34054
+ return "Check the connection settings, then run the command again.";
34055
+ }
34056
+ async function reportCheckFailure(error2) {
34057
+ if (isConfigurationError(error2)) {
34058
+ OutputFormatter.error({
34059
+ Result: error2.result,
34060
+ ErrorCode: error2.errorCode,
34061
+ Message: "Missing or invalid connection settings for checking a path name",
34062
+ Instructions: "Run 'uip login', or pass --base-url, --access-token and either --org-id or --org-name. The values that failed are named above.",
34063
+ Retry: error2.retry
34064
+ });
34065
+ processContext.exit(EXIT_CODES[error2.result] ?? 1);
34066
+ return;
34067
+ }
34068
+ const details = await extractErrorDetails(error2);
34069
+ const carriedCode = carriedErrorCode(error2);
34070
+ OutputFormatter.error({
34071
+ Result: details.result,
34072
+ ErrorCode: carriedCode ?? details.errorCode,
34073
+ Message: `Could not check the path name: ${details.message}`,
34074
+ Instructions: carriedCode === "permission_denied" ? MESSAGES.ERRORS.APPS_SERVICE_APP_TOKEN_READ_HINT : instructionsForFailure2(details.errorCode),
34075
+ Retry: details.retry
34076
+ });
34077
+ processContext.exit(EXIT_CODES[details.result] ?? 1);
34078
+ }
34079
+ var registerValidateCommand = (program) => {
34080
+ 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) => {
34081
+ const logger2 = {
34082
+ log: (msg) => getOutputSink().writeErr(`${msg}
34083
+ `)
34084
+ };
34085
+ const [error2, result] = await catchError(executeValidatePathName({
34086
+ pathName: options.pathName,
34087
+ baseUrl: options.baseUrl,
34088
+ orgId: options.orgId,
34089
+ orgName: options.orgName,
34090
+ accessToken: options.accessToken,
34091
+ logger: logger2
34092
+ }));
34093
+ if (error2) {
34094
+ await reportCheckFailure(error2);
34095
+ return;
34096
+ }
34097
+ if (!result.available && result.occupiedBy === null) {
34098
+ getOutputSink().writeErr(`${source_default.yellow(`⚠️ '${result.pathName}' is taken, but the app holding it could not be determined.`)}
34099
+ `);
34100
+ }
34101
+ OutputFormatter.success({
34102
+ Result: RESULTS.Success,
34103
+ Code: "CodedAppPathNameChecked",
34104
+ Data: result
34105
+ });
34106
+ });
34107
+ };
34108
+
33939
34109
  // src/utils/resolve-credentials.ts
33940
34110
  function setEnvIfPresent(envVar, value) {
33941
34111
  if (value) {
@@ -33981,8 +34151,9 @@ var registerCommands = async (program) => {
33981
34151
  registerPublishCommand(program);
33982
34152
  registerDeployCommand(program);
33983
34153
  registerDeleteCommand(program);
34154
+ registerValidateCommand(program);
33984
34155
  };
33985
34156
 
33986
34157
  export { metadata, registerCommands };
33987
34158
 
33988
- //# debugId=C0684B14899A2BEC64756E2164756E21
34159
+ //# debugId=AE32E0C65D75321F64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./packager-tool-y6tpn2q8.js";
4
+ } from "./packager-tool-qngjmgjk.js";
5
5
  import"./packager-tool-pwx9dvyr.js";
6
6
  import"./packager-tool-s4qh4pdq.js";
7
7
  import"./packager-tool-8cpdcx34.js";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/codedapp-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.203.0",
5
+ "version": "1.203.1-preview.259",
6
6
  "description": "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
7
7
  "keywords": [
8
8
  "cli-tool",
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "registry": "https://registry.npmjs.org/"
31
31
  },
32
- "gitHead": "dd3817d6673bc6c4ec409e86bdbf3db8037dbd0b"
32
+ "gitHead": "043de000926dc890fcc4980e020fa6cfba71f127"
33
33
  }