@uipath/ixp-sdk 1.201.0-preview.133 → 1.202.0-preview.134

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.
Files changed (2) hide show
  1. package/dist/index.js +83 -55
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -402,9 +402,9 @@ var init_is_in_ssh = __esm(() => {
402
402
  // ../../node_modules/open/index.js
403
403
  var exports_open = {};
404
404
  __export(exports_open, {
405
- openApp: () => openApp,
405
+ apps: () => apps,
406
406
  default: () => open_default,
407
- apps: () => apps
407
+ openApp: () => openApp
408
408
  });
409
409
  import process8 from "node:process";
410
410
  import path from "node:path";
@@ -952,7 +952,7 @@ class InvalidBaseUrlError extends Error {
952
952
  super(`Invalid base URL: "${url}"
953
953
  ` + `Reason: ${reason}
954
954
 
955
- ` + `Expected format: an https:// URL, e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
955
+ ` + `Expected format: an https:// URL (or bare host — https:// is assumed), e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
956
956
  ` + `You can specify the URL via:
957
957
  ` + ` • --authority flag
958
958
  ` + ` • UIPATH_URL environment variable
@@ -973,10 +973,16 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
973
973
  while (baseUrl.endsWith("/")) {
974
974
  baseUrl = baseUrl.slice(0, -1);
975
975
  }
976
+ const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(baseUrl);
977
+ const [hostCandidate] = baseUrl.split(/[/?#]/, 1);
978
+ if (!hasScheme && hostCandidate.includes(".")) {
979
+ baseUrl = `https://${baseUrl}`;
980
+ }
976
981
  const resolvedBaseUrl = baseUrl;
977
982
  const [urlError, url] = catchError(() => new URL(resolvedBaseUrl));
978
983
  if (urlError) {
979
- throw new InvalidBaseUrlError(baseUrl, `Malformed URL. ${urlError instanceof Error ? urlError.message : "Unknown error"}`);
984
+ const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
985
+ throw new InvalidBaseUrlError(baseUrl, `Malformed URL.${shapeHint}`);
980
986
  }
981
987
  if (url.protocol !== "https:") {
982
988
  throw new InvalidBaseUrlError(baseUrl, `Authority must use https:// scheme, got ${url.protocol}//. OIDC token exchange requires TLS end-to-end.`);
@@ -1263,6 +1269,17 @@ var requireEnv = (name) => {
1263
1269
  }
1264
1270
  return value;
1265
1271
  };
1272
+ var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
1273
+ var resolveBaseUrl = (rawUrl, failureContext) => {
1274
+ const [baseUrlError, baseUrl] = catchError(() => normalizeAndValidateBaseUrl(rawUrl));
1275
+ if (baseUrlError) {
1276
+ if (baseUrlError instanceof InvalidBaseUrlError) {
1277
+ throw baseUrlError;
1278
+ }
1279
+ throw new EnvAuthConfigError(`${failureContext}: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
1280
+ }
1281
+ return baseUrl;
1282
+ };
1266
1283
  var readAuthFromEnv = () => {
1267
1284
  const accessToken = requireEnv(ENV_AUTH_VARS.token);
1268
1285
  const organizationName = requireEnv(ENV_AUTH_VARS.organizationName);
@@ -1271,19 +1288,29 @@ var readAuthFromEnv = () => {
1271
1288
  const tenantId = requireEnv(ENV_AUTH_VARS.tenantId);
1272
1289
  const [parseError, payload] = catchError(() => parseJWT(accessToken));
1273
1290
  if (parseError) {
1274
- throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a valid JWT: ` + `${parseError instanceof Error ? parseError.message : String(parseError)}`);
1291
+ const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
1292
+ const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
1293
+ if (!rawUrl) {
1294
+ throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
1295
+ }
1296
+ const baseUrl2 = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
1297
+ return {
1298
+ loginStatus: "Logged in",
1299
+ accessToken,
1300
+ baseUrl: baseUrl2,
1301
+ organizationName,
1302
+ organizationId,
1303
+ tenantName,
1304
+ tenantId,
1305
+ source: "env-vars" /* EnvironmentVariables */,
1306
+ hint: "Token is opaque (not a JWT) - expiration and identity cannot be " + "determined locally. Commands will fail with 401 once it is revoked or " + `expired. If this was meant to be a JWT instead of a PAT, note: ${parseErrorMessage}`
1307
+ };
1275
1308
  }
1276
1309
  const iss = payload.iss;
1277
1310
  if (typeof iss !== "string" || iss.length === 0) {
1278
1311
  throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
1279
1312
  }
1280
- const [baseUrlError, baseUrl] = catchError(() => normalizeAndValidateBaseUrl(iss));
1281
- if (baseUrlError) {
1282
- if (baseUrlError instanceof InvalidBaseUrlError) {
1283
- throw baseUrlError;
1284
- }
1285
- throw new EnvAuthConfigError(`Failed to derive server URL from token 'iss' claim: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
1286
- }
1313
+ const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
1287
1314
  const expiration = getTokenExpiration(accessToken);
1288
1315
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
1289
1316
  const identity = resolveSessionIdentity(accessToken);
@@ -2194,6 +2221,7 @@ init_constants();
2194
2221
 
2195
2222
  // ../auth/src/interactive.ts
2196
2223
  init_src();
2224
+ init_constants();
2197
2225
  // ../auth/src/tenantSelection.ts
2198
2226
  var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
2199
2227
 
@@ -2266,7 +2294,7 @@ function getSdkUserAgentToken(pkg) {
2266
2294
  var package_default = {
2267
2295
  name: "@uipath/ixp-sdk",
2268
2296
  license: "MIT",
2269
- version: "1.201.0-preview.133",
2297
+ version: "1.202.0-preview.134",
2270
2298
  description: "SDK for the UiPath IXP (Intelligent eXtraction Platform) API — projects, taxonomies, prompts, predictions, and model publishing.",
2271
2299
  repository: {
2272
2300
  type: "git",
@@ -2652,48 +2680,48 @@ async function updateFieldPrompts(config, projectName, updates) {
2652
2680
  }, "Failed to update field prompts");
2653
2681
  }
2654
2682
  export {
2655
- uploadDocument,
2656
- upgradeDeployment,
2657
- updateProjectTitle,
2658
- updateProjectPrompt,
2659
- updateGroupPrompts,
2660
- updateFieldPrompts,
2661
- updateDataTypeInstructions,
2662
- untagModel,
2663
- unpublishModel,
2664
- unconfirmLabelling,
2665
- suggestTaxonomy,
2666
- startCreateProject,
2667
- renameGroup,
2668
- renameField,
2669
- renameDataType,
2670
- publishModel,
2671
- markLabellingAsMissing,
2672
- listModels,
2673
- listIxpProjects,
2674
- listDocuments,
2675
- listDeployments,
2676
- importTaxonomy,
2677
- getProjectTaxonomy,
2678
- getProject,
2679
- getModelMetrics,
2680
- getDocumentPredictions,
2681
- getDeploymentTaxonomy,
2682
- downloadDocument,
2683
- deployModel,
2684
- deleteIxpProject,
2685
- deleteGroup,
2686
- deleteField,
2687
- deleteDocument,
2688
- deleteDataType,
2689
- createProject,
2690
- createIxpConfig,
2691
- createGroup,
2692
- createDataType,
2693
- confirmLabelling,
2694
- configureModel,
2683
+ addField,
2695
2684
  changeFieldType,
2696
- addField
2685
+ configureModel,
2686
+ confirmLabelling,
2687
+ createDataType,
2688
+ createGroup,
2689
+ createIxpConfig,
2690
+ createProject,
2691
+ deleteDataType,
2692
+ deleteDocument,
2693
+ deleteField,
2694
+ deleteGroup,
2695
+ deleteIxpProject,
2696
+ deployModel,
2697
+ downloadDocument,
2698
+ getDeploymentTaxonomy,
2699
+ getDocumentPredictions,
2700
+ getModelMetrics,
2701
+ getProject,
2702
+ getProjectTaxonomy,
2703
+ importTaxonomy,
2704
+ listDeployments,
2705
+ listDocuments,
2706
+ listIxpProjects,
2707
+ listModels,
2708
+ markLabellingAsMissing,
2709
+ publishModel,
2710
+ renameDataType,
2711
+ renameField,
2712
+ renameGroup,
2713
+ startCreateProject,
2714
+ suggestTaxonomy,
2715
+ unconfirmLabelling,
2716
+ unpublishModel,
2717
+ untagModel,
2718
+ updateDataTypeInstructions,
2719
+ updateFieldPrompts,
2720
+ updateGroupPrompts,
2721
+ updateProjectPrompt,
2722
+ updateProjectTitle,
2723
+ upgradeDeployment,
2724
+ uploadDocument
2697
2725
  };
2698
2726
 
2699
- //# debugId=C5F33E1EA8EBD79464756E2164756E21
2727
+ //# debugId=FC29AD725F827F0664756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/ixp-sdk",
3
3
  "license": "MIT",
4
- "version": "1.201.0-preview.133",
4
+ "version": "1.202.0-preview.134",
5
5
  "description": "SDK for the UiPath IXP (Intelligent eXtraction Platform) API — projects, taxonomies, prompts, predictions, and model publishing.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -24,5 +24,5 @@
24
24
  "files": [
25
25
  "dist"
26
26
  ],
27
- "gitHead": "7933378ad5276ac369900293a1447474dcec6826"
27
+ "gitHead": "a335728adbdb02f28308e4f55d8936d0b150444b"
28
28
  }