@uipath/integrationservice-sdk 1.200.0-preview.109 → 1.201.0-preview.115

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 +106 -19
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -430,6 +430,12 @@ var init_is_in_ssh = __esm(() => {
430
430
  });
431
431
 
432
432
  // ../../node_modules/open/index.js
433
+ var exports_open = {};
434
+ __export(exports_open, {
435
+ openApp: () => openApp,
436
+ default: () => open_default,
437
+ apps: () => apps
438
+ });
433
439
  import process8 from "node:process";
434
440
  import path from "node:path";
435
441
  import { fileURLToPath } from "node:url";
@@ -663,6 +669,21 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform, arch, tryEach
663
669
  ...options,
664
670
  target
665
671
  });
672
+ }, openApp = (name, options) => {
673
+ if (typeof name !== "string" && !Array.isArray(name)) {
674
+ throw new TypeError("Expected a valid `name`");
675
+ }
676
+ const { arguments: appArguments = [] } = options ?? {};
677
+ if (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {
678
+ throw new TypeError("Expected `appArguments` as Array type");
679
+ }
680
+ return baseOpen({
681
+ ...options,
682
+ app: {
683
+ name,
684
+ arguments: appArguments
685
+ }
686
+ });
666
687
  }, apps, open_default;
667
688
  var init_open = __esm(() => {
668
689
  init_wsl_utils();
@@ -742,7 +763,8 @@ class NodeFileSystem {
742
763
  };
743
764
  utils = {
744
765
  open: async (url) => {
745
- await open_default(url);
766
+ const { default: open2 } = await Promise.resolve().then(() => (init_open(), exports_open));
767
+ await open2(url);
746
768
  }
747
769
  };
748
770
  async readFile(path3, options) {
@@ -937,9 +959,7 @@ class NodeFileSystem {
937
959
  }
938
960
  }
939
961
  var LOCK_HEARTBEAT_MS = 5000, LOCK_STALE_MS = 15000, LOCK_MAX_WAIT_MS = 20000, LOCK_MAX_HOLD_MS = 60000, LOCK_RETRY_MIN_MS = 100, LOCK_RETRY_JITTER_MS = 200;
940
- var init_node = __esm(() => {
941
- init_open();
942
- });
962
+ var init_node = () => {};
943
963
  // ../filesystem/src/index.ts
944
964
  var fsInstance, getFileSystem = () => fsInstance;
945
965
  var init_src = __esm(() => {
@@ -947,10 +967,6 @@ var init_src = __esm(() => {
947
967
  init_node();
948
968
  fsInstance = new NodeFileSystem;
949
969
  });
950
- // ../auth/src/server.ts
951
- var init_server = __esm(() => {
952
- init_constants();
953
- });
954
970
 
955
971
  // ../../node_modules/rxjs/dist/cjs/internal/util/isFunction.js
956
972
  var require_isFunction = __commonJS((exports) => {
@@ -58527,7 +58543,7 @@ class TextApiResponse2 {
58527
58543
  var package_default = {
58528
58544
  name: "@uipath/integrationservice-sdk",
58529
58545
  license: "MIT",
58530
- version: "1.200.0-preview.109",
58546
+ version: "1.201.0-preview.115",
58531
58547
  repository: {
58532
58548
  type: "git",
58533
58549
  url: "https://github.com/UiPath/cli.git",
@@ -77743,6 +77759,67 @@ var getTokenExpiration = (accessToken) => {
77743
77759
  }
77744
77760
  };
77745
77761
 
77762
+ // ../auth/src/sessionIdentity.ts
77763
+ var parseAuthFlow = (value) => value === "authorization_code" || value === "client_credentials" || value === "federated_credentials" ? value : undefined;
77764
+ var decodeClaims = (accessToken) => {
77765
+ const [error, claims] = catchError(() => parseJWT(accessToken));
77766
+ return error ? undefined : claims;
77767
+ };
77768
+ var asString = (value) => typeof value === "string" && value.length > 0 ? value : undefined;
77769
+ var resolveIdentityType = (claims, authFlow, email) => {
77770
+ const subType = asString(claims?.sub_type);
77771
+ if (subType) {
77772
+ return subType.startsWith("service") ? "Application" : "User";
77773
+ }
77774
+ if (authFlow) {
77775
+ return authFlow === "authorization_code" ? "User" : "Application";
77776
+ }
77777
+ if (email)
77778
+ return "User";
77779
+ if (asString(claims?.client_id) && !asString(claims?.sub)) {
77780
+ return "Application";
77781
+ }
77782
+ return;
77783
+ };
77784
+ var looksLikeEmail = (value) => value?.includes("@") ?? false;
77785
+ var pickEmail = (claims) => {
77786
+ for (const candidate of [claims?.email, claims?.preferred_username]) {
77787
+ const value = asString(candidate);
77788
+ if (looksLikeEmail(value))
77789
+ return value;
77790
+ }
77791
+ return;
77792
+ };
77793
+ var pickName = (claims) => {
77794
+ const username = asString(claims?.preferred_username);
77795
+ return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
77796
+ };
77797
+ var resolveSessionIdentity = (accessToken, authFlow) => {
77798
+ const claims = accessToken ? decodeClaims(accessToken) : undefined;
77799
+ const email = pickEmail(claims);
77800
+ const type = resolveIdentityType(claims, authFlow, email);
77801
+ if (!type)
77802
+ return;
77803
+ const identity = { type };
77804
+ if (authFlow)
77805
+ identity.authFlow = authFlow;
77806
+ if (type === "User") {
77807
+ const userId = asString(claims?.sub);
77808
+ if (userId)
77809
+ identity.userId = userId;
77810
+ if (email)
77811
+ identity.userEmail = email;
77812
+ const name = pickName(claims);
77813
+ if (name)
77814
+ identity.userName = name;
77815
+ return identity;
77816
+ }
77817
+ const clientId = asString(claims?.client_id);
77818
+ if (clientId)
77819
+ identity.clientId = clientId;
77820
+ return identity;
77821
+ };
77822
+
77746
77823
  // ../auth/src/envAuth.ts
77747
77824
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
77748
77825
  var ENFORCE_ROBOT_AUTH_VAR = "UIPATH_CLI_ENFORCE_ROBOT_AUTH";
@@ -77792,6 +77869,7 @@ var readAuthFromEnv = () => {
77792
77869
  }
77793
77870
  const expiration = getTokenExpiration(accessToken);
77794
77871
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
77872
+ const identity = resolveSessionIdentity(accessToken);
77795
77873
  return {
77796
77874
  loginStatus,
77797
77875
  accessToken,
@@ -77801,7 +77879,8 @@ var readAuthFromEnv = () => {
77801
77879
  tenantName,
77802
77880
  tenantId,
77803
77881
  expiration,
77804
- source: "env" /* Env */
77882
+ source: "env-vars" /* EnvironmentVariables */,
77883
+ ...identity ? { identity } : {}
77805
77884
  };
77806
77885
  };
77807
77886
 
@@ -78054,6 +78133,9 @@ var refreshAccessToken = async ({
78054
78133
  return { accessToken: newAccessToken, refreshToken: newRefreshToken };
78055
78134
  };
78056
78135
 
78136
+ // ../auth/src/types.ts
78137
+ var AUTH_FLOW_ENV_VAR = "UIPATH_AUTH_FLOW";
78138
+
78057
78139
  // ../auth/src/utils/envFile.ts
78058
78140
  init_src();
78059
78141
  init_constants();
@@ -78421,7 +78503,8 @@ async function buildFileStatus(tokens, credentials, globalHint) {
78421
78503
  tenantName: credentials.UIPATH_TENANT_NAME,
78422
78504
  tenantId: credentials.UIPATH_TENANT_ID,
78423
78505
  expiration: tokens.expiration,
78424
- source: "file" /* File */,
78506
+ source: "saved-login" /* SavedLogin */,
78507
+ ...identityFields(tokens.accessToken, credentials),
78425
78508
  ...tokens.persistenceWarning ? { hint: tokens.persistenceWarning, persistenceFailed: true } : {},
78426
78509
  ...tokens.lockReleaseFailed ? { lockReleaseFailed: true } : {},
78427
78510
  ...tokens.tokenRefresh ? { tokenRefresh: tokens.tokenRefresh } : {}
@@ -78434,7 +78517,12 @@ async function buildFileStatus(tokens, credentials, globalHint) {
78434
78517
  }
78435
78518
  return result;
78436
78519
  }
78520
+ function identityFields(accessToken, credentials) {
78521
+ const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
78522
+ return identity ? { identity } : {};
78523
+ }
78437
78524
  function buildRobotStatus(robotCreds) {
78525
+ const identity = resolveSessionIdentity(robotCreds.accessToken);
78438
78526
  return {
78439
78527
  loginStatus: "Logged in",
78440
78528
  accessToken: robotCreds.accessToken,
@@ -78445,7 +78533,8 @@ function buildRobotStatus(robotCreds) {
78445
78533
  tenantId: robotCreds.tenantId,
78446
78534
  issuer: robotCreds.issuer,
78447
78535
  expiration: getTokenExpiration(robotCreds.accessToken),
78448
- source: "robot" /* Robot */
78536
+ source: "robot" /* Robot */,
78537
+ ...identity ? { identity } : {}
78449
78538
  };
78450
78539
  }
78451
78540
  var isFileNotFoundError = (error) => {
@@ -78496,7 +78585,8 @@ async function circuitBreakerShortCircuit(ctx) {
78496
78585
  tenantName: credentials.UIPATH_TENANT_NAME,
78497
78586
  tenantId: credentials.UIPATH_TENANT_ID,
78498
78587
  expiration,
78499
- source: "file" /* File */
78588
+ source: "saved-login" /* SavedLogin */,
78589
+ ...identityFields(accessToken, credentials)
78500
78590
  } : {},
78501
78591
  hint: globalHint ?? (tokenIsDead ? deadHint : backoffHint),
78502
78592
  refreshCircuitOpen: true,
@@ -78518,7 +78608,8 @@ async function lockAcquireFailureStatus(ctx, error) {
78518
78608
  tenantName: ctx.credentials.UIPATH_TENANT_NAME,
78519
78609
  tenantId: ctx.credentials.UIPATH_TENANT_ID,
78520
78610
  expiration: ctx.expiration,
78521
- source: "file" /* File */,
78611
+ source: "saved-login" /* SavedLogin */,
78612
+ ...identityFields(ctx.accessToken, ctx.credentials),
78522
78613
  hint: globalHint,
78523
78614
  tokenRefresh: {
78524
78615
  attempted: false,
@@ -78728,10 +78819,6 @@ var TENANT_SELECTION_CODES = new Set([
78728
78819
  ]);
78729
78820
  // ../auth/src/logout.ts
78730
78821
  init_src();
78731
-
78732
- // ../auth/src/index.ts
78733
- init_server();
78734
-
78735
78822
  // src/client-factory.ts
78736
78823
  var API_DOMAIN_MAP = new Map([
78737
78824
  [ConnectorsApi, "connections"],
@@ -81296,4 +81383,4 @@ export {
81296
81383
  AccessTokenResponseFromJSON
81297
81384
  };
81298
81385
 
81299
- //# debugId=30E76C049E8065D964756E2164756E21
81386
+ //# debugId=085B8825FAE298A164756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/integrationservice-sdk",
3
3
  "license": "MIT",
4
- "version": "1.200.0-preview.109",
4
+ "version": "1.201.0-preview.115",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/UiPath/cli.git",
@@ -30,5 +30,5 @@
30
30
  "dependencies": {
31
31
  "@uipath/integration-service-design-time": "0.19.3"
32
32
  },
33
- "gitHead": "fcc01cdae81bbd0c25d3d4fc287537a9d19d99f4"
33
+ "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
34
34
  }