@uipath/auth 1.205.0-preview.277 → 1.206.0-preview.282

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.
@@ -32,7 +32,38 @@ export interface GetAuthContextOptions {
32
32
  */
33
33
  envFilePath?: string;
34
34
  }
35
- export declare const getAuthContext: (options?: GetAuthContextOptions) => Promise<AuthContext>;
35
+ /**
36
+ * The fields a `require*` option guarantees, typed as present so callers
37
+ * need no cast. A caller passing a plain `GetAuthContextOptions` value (not a
38
+ * literal) gets none of them, since its flags are not known to be `true`.
39
+ */
40
+ export type RequiredAuthFields<O extends GetAuthContextOptions> = (O extends {
41
+ requireOrganizationId: true;
42
+ } ? {
43
+ organizationId: string;
44
+ } : unknown) & (O extends {
45
+ requireOrganizationName: true;
46
+ } ? {
47
+ organizationName: string;
48
+ } : unknown) & (O extends {
49
+ requireTenantId: true;
50
+ } ? {
51
+ tenantId: string;
52
+ } : unknown) & (O extends {
53
+ requireTenantName: true;
54
+ } ? {
55
+ tenantName: string;
56
+ } : unknown);
57
+ type ExactAuthOptions<O extends GetAuthContextOptions> = O & Record<Exclude<keyof O, keyof GetAuthContextOptions>, never>;
58
+ /** A missing session or required session field, as distinct from a failed credential read. */
59
+ export declare class AuthContextUnavailableError extends Error {
60
+ readonly instructionContext: "auth" | "identity";
61
+ readonly sessionHint?: string | undefined;
62
+ readonly errorCode: "authentication_required";
63
+ readonly retry: "RetryWillNotFix";
64
+ constructor(message: string, instructionContext?: "auth" | "identity", sessionHint?: string | undefined);
65
+ }
66
+ export declare const getAuthContext: <O extends GetAuthContextOptions = GetAuthContextOptions>(options?: ExactAuthOptions<O>) => Promise<AuthContext & RequiredAuthFields<O>>;
36
67
  export interface AuthEnvResult {
37
68
  /** UiPath credential env vars to merge into a subprocess env. Empty when not logged in. */
38
69
  authEnv: Record<string, string>;
@@ -46,3 +77,4 @@ export interface AuthEnvResult {
46
77
  * empty `authEnv` when there is no usable login.
47
78
  */
48
79
  export declare const getAuthEnv: (options?: GetLoginStatusOptions) => Promise<AuthEnvResult>;
80
+ export {};
@@ -1,4 +1,10 @@
1
1
  export declare const DEFAULT_AUTH_PROFILE = "default";
2
+ /**
3
+ * The profile a `uip` started by another `uip` runs as, when its argv has no
4
+ * `--profile`. Set by the parent for its child processes (the builder SDK and
5
+ * the `uip` calls it makes); not a user setting.
6
+ */
7
+ export declare const INHERITED_AUTH_PROFILE_ENV = "UIPATH_CLI_INHERITED_PROFILE";
2
8
  export declare class AuthProfileValidationError extends Error {
3
9
  constructor(message: string);
4
10
  }
package/dist/envAuth.d.ts CHANGED
@@ -46,6 +46,8 @@ export declare const ENV_AUTH_VARS: {
46
46
  * the user can correct the CI setup without guessing.
47
47
  */
48
48
  export declare class EnvAuthConfigError extends Error {
49
+ readonly errorCode: "configuration_error";
50
+ readonly retry: "RetryWillNotFix";
49
51
  constructor(message: string);
50
52
  }
51
53
  /**
@@ -5,6 +5,7 @@ export { type AuthFileConfig, InvalidBaseUrlError, setAuthFileConfig, } from "./
5
5
  export * from "./loginStatus";
6
6
  export * from "./logout";
7
7
  export { type ApplicationSubtype, type IdentityType, parseAuthFlow, readTokenScopes, resolveSessionIdentity, type SessionIdentity, } from "./sessionIdentity";
8
+ export { BrowserAuthStrategy } from "./strategies/browser-strategy";
8
9
  export { fetchTenantsAndOrganizations, type Tenant, type TenantsAndOrganizations, } from "./tenantSelection";
9
10
  export * from "./tokenRefresh";
10
11
  export { AUTH_FLOW_ENV_VAR, type AuthFlow, type BaseCredentials, } from "./types";