@strivacity/sdk-core 3.0.0-rc.0 → 3.0.0
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/CHANGELOG.md +23 -0
- package/README.md +384 -79
- package/dist/flows/EmbeddedFlow.cjs +1 -1
- package/dist/flows/EmbeddedFlow.cjs.map +1 -1
- package/dist/flows/EmbeddedFlow.d.ts +1 -1
- package/dist/flows/EmbeddedFlow.mjs +1 -1
- package/dist/flows/EmbeddedFlow.mjs.map +1 -1
- package/dist/flows/NativeFlow.cjs +1 -1
- package/dist/flows/NativeFlow.cjs.map +1 -1
- package/dist/flows/NativeFlow.d.ts +1 -1
- package/dist/flows/NativeFlow.mjs +1 -1
- package/dist/flows/NativeFlow.mjs.map +1 -1
- package/dist/handlers/BaseFlowHandler.cjs +2 -0
- package/dist/handlers/BaseFlowHandler.cjs.map +1 -0
- package/dist/{utils/NativeFlowHandler.d.ts → handlers/BaseFlowHandler.d.ts} +3 -12
- package/dist/handlers/BaseFlowHandler.mjs +2 -0
- package/dist/handlers/BaseFlowHandler.mjs.map +1 -0
- package/dist/handlers/EmbeddedFlowHandler.cjs +2 -0
- package/dist/handlers/EmbeddedFlowHandler.cjs.map +1 -0
- package/dist/{utils → handlers}/EmbeddedFlowHandler.d.ts +3 -35
- package/dist/handlers/EmbeddedFlowHandler.mjs +2 -0
- package/dist/handlers/EmbeddedFlowHandler.mjs.map +1 -0
- package/dist/handlers/NativeFlowHandler.cjs +2 -0
- package/dist/handlers/NativeFlowHandler.cjs.map +1 -0
- package/dist/handlers/NativeFlowHandler.d.ts +30 -0
- package/dist/handlers/NativeFlowHandler.mjs +2 -0
- package/dist/handlers/NativeFlowHandler.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +48 -56
- package/dist/types.mjs.map +1 -1
- package/package.json +7 -1
- package/dist/utils/EmbeddedFlowHandler.cjs +0 -2
- package/dist/utils/EmbeddedFlowHandler.cjs.map +0 -1
- package/dist/utils/EmbeddedFlowHandler.mjs +0 -2
- package/dist/utils/EmbeddedFlowHandler.mjs.map +0 -1
- package/dist/utils/NativeFlowHandler.cjs +0 -2
- package/dist/utils/NativeFlowHandler.cjs.map +0 -1
- package/dist/utils/NativeFlowHandler.mjs +0 -2
- package/dist/utils/NativeFlowHandler.mjs.map +0 -1
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../src/types.ts"],"sourcesContent":["/**\n * Makes properties of `T` required based on the keys provided in `K`.\n *\n * @template T - The type from which properties will be made required.\n * @template K - The keys of `T` that should be required.\n * @example\n * type MyType = { a?: string; b?: number; c?: boolean };\n * type RequiredAB = Mandatory<MyType, 'a' | 'b'>; // { a: string; b: number; c?: boolean }\n */\nexport type Mandatory<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;\n\n/**\n * A type representing a partial record of key-value pairs where keys are of type `K` and values are of type `T`.\n *\n * @template K - The type of the keys in the record.\n * @template T - The type of the values in the record.\n * @example\n * type StringMap = PartialRecord<string, string>; // { [key: string]: string | undefined }\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PartialRecord<K extends keyof any, T> = {\n\t[P in K]?: T;\n};\n\n// region SDK\n\n/**\n * List of supported response types.\n */\nexport const ResponseTypeList = ['code', 'id_token'] as const;\n/**\n * Type representing valid response types.\n */\nexport type ResponseType = (typeof ResponseTypeList)[number];\n\n/**\n * List of supported response modes.\n */\nexport const ResponseModeList = ['query', 'fragment'] as const;\n/**\n * Type representing valid response modes.\n */\nexport type ResponseMode = (typeof ResponseModeList)[number];\n\n/**\n * List of supported token endpoint authentication methods.\n */\nexport const TokenEndpointAuthMethodList = ['none'] as const;\n/**\n * Type representing valid token endpoint authentication methods.\n */\nexport type TokenEndpointAuthMethod = (typeof TokenEndpointAuthMethodList)[number];\n\n/**\n * List of supported grant types.\n */\nexport const GrantTypeList = ['authorization_code', 'refresh_token'] as const;\n/**\n * Type representing valid grant types.\n */\nexport type GrantType = (typeof GrantTypeList)[number];\n\n/**\n * List of supported algorithm types.\n */\nexport const AlgorithmTypeList = ['RS256'] as const;\n/**\n * Type representing valid algorithm types.\n */\nexport type AlgorithmType = (typeof AlgorithmTypeList)[number];\n\n/**\n * List of supported subject types.\n */\nexport const SubjectTypeList = ['public'] as const;\n/**\n * Type representing valid subject types.\n */\nexport type SubjectType = (typeof SubjectTypeList)[number];\n\n/**\n * List of supported prompt types.\n */\nexport const PromptTypeList = ['none', 'login', 'create'] as const;\n/**\n * Type representing valid prompt types.\n */\nexport type PromptType = (typeof PromptTypeList)[number];\n\n/**\n * List of supported fallback modes.\n */\nexport const FallbackModeTypeList = ['redirect', 'popup'] as const;\n/**\n * Type representing valid fallback modes.\n */\nexport type FallbackMode = (typeof FallbackModeTypeList)[number];\n\n/**\n * Represents a signing key used in cryptographic operations, such as signing JSON Web Tokens (JWTs).\n *\n * This type defines the key's properties, including its usage, type, identifier, algorithm, and key material.\n */\nexport type SigningKey = {\n\t/**\n\t * The intended use of the key. Common values include \"sig\" for signature and \"enc\" for encryption.\n\t *\n\t * @type {string}\n\t * @example 'sig'\n\t */\n\tuse: string;\n\n\t/**\n\t * The key type. For example, \"RSA\" for RSA keys or \"EC\" for Elliptic Curve keys.\n\t *\n\t * @type {string}\n\t * @example 'RSA'\n\t */\n\tkty: string;\n\n\t/**\n\t * A unique identifier for the key. This is used to distinguish the key from others.\n\t *\n\t * @type {string}\n\t * @example 'key-id-1234'\n\t */\n\tkid: string;\n\n\t/**\n\t * The algorithm used with the key. For example, \"RS256\" for RSA SHA-256.\n\t *\n\t * @type {AlgorithmType}\n\t * @example 'RS256'\n\t */\n\talg: AlgorithmType;\n\n\t/**\n\t * The modulus of the RSA key, encoded in base64url format. For RSA keys, this is a required property.\n\t *\n\t * @type {string}\n\t * @example 'base64url-encoded-modulus'\n\t */\n\tn: string;\n\n\t/**\n\t * The exponent of the RSA key, encoded in base64url format. For RSA keys, this is a required property.\n\t *\n\t * @type {string}\n\t * @example 'base64url-encoded-exponent'\n\t */\n\te: string;\n};\n\n/**\n * Represents the metadata options provided by an authorization server.\n *\n * This metadata includes information about the server's endpoints, supported features, and supported claims.\n */\nexport type MetadataOptions = {\n\t/**\n\t * The issuer of the tokens. This is the authorization server or entity that issues the tokens.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tissuer: string;\n\n\t/**\n\t * The URL of the authorization endpoint where authentication requests are sent.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/authorize'\n\t */\n\tauthorization_endpoint: string;\n\n\t/**\n\t * The URL of the token endpoint where tokens are exchanged.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/token'\n\t */\n\ttoken_endpoint: string;\n\n\t/**\n\t * The URL of the JSON Web Key Set (JWKS) endpoint where public keys are available.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/jwks'\n\t */\n\tjwks_uri: string;\n\n\t/**\n\t * The types of subjects that are supported by the authorization server.\n\t *\n\t * @type {Array<SubjectType>}\n\t * @example ['public']\n\t */\n\tsubject_types_supported: Array<SubjectType>;\n\n\t/**\n\t * The types of responses supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['code', 'id_token']\n\t */\n\tresponse_types_supported: Array<string>;\n\n\t/**\n\t * The claims supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['sub', 'name', 'email']\n\t */\n\tclaims_supported: Array<string>;\n\n\t/**\n\t * The grant types supported by the authorization server.\n\t *\n\t * @type {Array<GrantType>}\n\t * @example ['authorization_code', 'refresh_token']\n\t */\n\tgrant_types_supported: Array<GrantType>;\n\n\t/**\n\t * The response modes supported by the authorization server.\n\t *\n\t * @type {Array<ResponseMode>}\n\t * @example ['query', 'fragment']\n\t */\n\tresponse_modes_supported: Array<ResponseMode>;\n\n\t/**\n\t * The URL of the user info endpoint where user information can be retrieved.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/userinfo'\n\t */\n\tuserinfo_endpoint: string;\n\n\t/**\n\t * The scopes supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['openid', 'profile', 'email']\n\t */\n\tscopes_supported: Array<string>;\n\n\t/**\n\t * The authentication methods supported for token endpoint authentication.\n\t *\n\t * @type {Array<TokenEndpointAuthMethod>}\n\t * @example ['none']\n\t */\n\ttoken_endpoint_auth_methods_supported: Array<TokenEndpointAuthMethod>;\n\n\t/**\n\t * The algorithms supported for signing tokens used in the user info endpoint.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tuserinfo_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms supported for signing ID tokens.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tid_token_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms used to sign ID tokens in response.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tid_token_signed_response_alg: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms used to sign responses from the user info endpoint.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tuserinfo_signed_response_alg: Array<AlgorithmType>;\n\n\t/**\n\t * Indicates whether the request parameter is supported in requests.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequest_parameter_supported: boolean;\n\n\t/**\n\t * Indicates whether the request URI parameter is supported in requests.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequest_uri_parameter_supported: boolean;\n\n\t/**\n\t * Indicates whether request URI registration is required.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequire_request_uri_registration: boolean;\n\n\t/**\n\t * Indicates whether the claims parameter is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tclaims_parameter_supported: boolean;\n\n\t/**\n\t * The URL of the revocation endpoint for revoking tokens.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/revoke'\n\t */\n\trevocation_endpoint: string;\n\n\t/**\n\t * Indicates whether backchannel logout is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tbackchannel_logout_supported: boolean;\n\n\t/**\n\t * Indicates whether backchannel logout session support is provided.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tbackchannel_logout_session_supported: boolean;\n\n\t/**\n\t * Indicates whether frontchannel logout is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tfrontchannel_logout_supported: boolean;\n\n\t/**\n\t * Indicates whether frontchannel logout session support is provided.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tfrontchannel_logout_session_supported: boolean;\n\n\t/**\n\t * The URL of the endpoint where end-session requests can be sent.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/logout'\n\t */\n\tend_session_endpoint: string;\n\n\t/**\n\t * The algorithms supported for signing request objects.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\trequest_object_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The code challenge methods supported by the authorization server.\n\t *\n\t * @type {Array<'S256'>}\n\t * @example ['S256']\n\t */\n\tcode_challenge_methods_supported: Array<'S256'>;\n};\n\n/**\n * Represents the standard claims in a JSON Web Token (JWT).\n *\n * These claims are part of the payload in a JWT and convey information about the token, such as its issuer, subject, and expiration.\n */\nexport type JwtClaims = {\n\t/**\n\t * The issuer of the token. This typically represents the authorization server or entity that issued the JWT.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tiss?: string;\n\n\t/**\n\t * The subject of the token. This is the identifier for the entity the token represents, such as a user ID.\n\t *\n\t * @type {string}\n\t * @example 'user123'\n\t */\n\tsub?: string;\n\n\t/**\n\t * The audience for which the token is intended. This can be a single identifier or an array of identifiers.\n\t *\n\t * @type {string | Array<string>}\n\t * @example 'your-client-id' | ['client1', 'client2']\n\t */\n\taud?: string | Array<string>;\n\n\t/**\n\t * The expiration time of the token, expressed as a Unix timestamp (number of seconds since January 1, 1970).\n\t *\n\t * @type {number}\n\t * @example 1633024800\n\t */\n\texp?: number;\n\n\t/**\n\t * The not-before time of the token, expressed as a Unix timestamp. The token must not be accepted before this time.\n\t *\n\t * @type {number}\n\t * @example 1633021200\n\t */\n\tnbf?: number;\n\n\t/**\n\t * The issued-at time of the token, expressed as a Unix timestamp (number of seconds since January 1, 1970).\n\t *\n\t * @type {number}\n\t * @example 1633022400\n\t */\n\tiat?: number;\n\n\t/**\n\t * A unique identifier for the token. This can be used to prevent token replay attacks.\n\t *\n\t * @type {string}\n\t * @example 'unique-jwt-id-1234'\n\t */\n\tjti?: string;\n};\n\n/**\n * Represents the claims included in an ID token, extending standard JWT claims with additional properties specific to identity tokens.\n *\n * ID tokens are used to authenticate and provide identity information about the user.\n */\nexport type IdTokenClaims = Mandatory<JwtClaims, 'iss' | 'sub' | 'aud' | 'exp' | 'iat'> & {\n\t/**\n\t * The authentication time, indicating when the user was authenticated.\n\t *\n\t * @type {number}\n\t * @example 1633022400\n\t */\n\tauth_time?: number;\n\n\t/**\n\t * A nonce value used to associate a client session with an ID token, preventing replay attacks.\n\t *\n\t * @type {string}\n\t * @example 'nonce-value-1234'\n\t */\n\tnonce?: string;\n\n\t/**\n\t * The Authentication Context Class Reference, indicating the authentication methods used.\n\t *\n\t * @type {string}\n\t * @example '2'\n\t */\n\tacr?: string;\n\n\t/**\n\t * The Authentication Methods References, providing information about the authentication methods used.\n\t *\n\t * @type {unknown}\n\t */\n\tamr?: unknown;\n\n\t/**\n\t * Authorized party, the client that the ID token is intended for.\n\t *\n\t * @type {string}\n\t * @example 'client-id'\n\t */\n\tazp?: string;\n\n\t/**\n\t * Session ID for the user, which can be used to manage user sessions.\n\t *\n\t * @type {string}\n\t * @example 'session-id-1234'\n\t */\n\tsid?: string;\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n};\n\n/**\n * Options for configuring the SDK.\n */\nexport type SDKOptions = {\n\t/**\n\t * Specifies the mode of the SDK operation, either 'popup' or 'redirect'.\n\t *\n\t * @type {'popup' | 'redirect'}\n\t * @default 'redirect'\n\t */\n\tmode?: 'popup' | 'redirect' | 'native' | 'embedded';\n\n\t/**\n\t * The issuer of the tokens, typically the URL of the authorization server.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tissuer: string;\n\n\t/**\n\t * The client ID issued by the authorization server, used to identify the application.\n\t *\n\t * @type {string}\n\t * @example 'your-client-id'\n\t */\n\tclientId: string;\n\n\t/**\n\t * The URI to which the user will be redirected after authentication or authorization.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/callback'\n\t */\n\tredirectUri: string;\n\n\t/**\n\t * A list of scopes requested by the application, defining the access levels for the tokens.\n\t *\n\t * @type {Array<string>}\n\t * @default ['openid']\n\t * @example ['openid', 'profile']\n\t */\n\tscopes?: Array<string>;\n\n\t/**\n\t * The type of response expected from the authorization server.\n\t *\n\t * @type {ResponseType}\n\t * @default 'code'\n\t */\n\tresponseType?: ResponseType;\n\n\t/**\n\t * The mode in which the response is returned from the authorization server.\n\t *\n\t * @type {ResponseMode}\n\t * @default 'query'\n\t */\n\tresponseMode?: ResponseMode;\n\n\t/**\n\t * The name of the token in storage used to persist authentication information.\n\t *\n\t * @type {string}\n\t * @default 'sty.session'\n\t * @example 'accessToken'\n\t */\n\tstorageTokenName?: string;\n\n\t/**\n\t * The storage mechanism used to save and retrieve authentication information.\n\t *\n\t * @type {SDKStorageType}\n\t * @default LocalStorage\n\t */\n\tstorage?: SDKStorageType;\n\n\t/**\n\t * The HTTP client used for making requests to the authorization server.\n\t *\n\t * @type {SDKHttpClientType}\n\t * @default HttpClient\n\t */\n\thttpClient?: SDKHttpClientType;\n\n\t/**\n\t * The logging mechanism used for logging messages and errors.\n\t *\n\t * @type {SDKLoggingType}\n\t */\n\tlogging?: SDKLoggingType;\n\n\t/**\n\t * Handles the URL redirection to the specified target.\n\t * You can use this method to implement custom URL handling logic, such as opening a new window or navigating to a different page.\n\t *\n\t * @param {string} url - The URL to handle.\n\t * @param {Record<string, unknown>} params - Optional parameters for redirection.\n\t * @returns - A promise that resolves when the redirection is handled.\n\t */\n\turlHandler?: (url: string, params?: Record<string, unknown>) => Promise<unknown>;\n\n\t/**\n\t * Handles the callback from the authorization server after a successful authentication or authorization.\n\t * You can use this method to implement custom logic for processing the response from the authorization server.\n\t *\n\t * @param url - The URL containing the response from the authorization server.\n\t * @param responseMode - The mode in which the response is returned (e.g., 'query', 'fragment').\n\t * @returns - A promise that resolves when the callback is handled.\n\t */\n\tcallbackHandler?: (url: string, responseMode?: ResponseMode) => Promise<unknown>;\n};\n\n/**\n * Abstract class for SDK storage mechanisms.\n */\nexport abstract class SDKStorage {\n\t/**\n\t * Retrieves an item from the storage by key.\n\t *\n\t * @param {string} key - The key of the item to retrieve.\n\t * @returns {string | null} The value associated with the key, or `null` if not found.\n\t */\n\tabstract get(key: string): Promise<string | null>;\n\n\t/**\n\t * Deletes an item from the storage by key.\n\t *\n\t * @param {string} key - The key of the item to delete.\n\t */\n\tabstract delete(key: string): Promise<void>;\n\n\t/**\n\t * Sets an item in the storage with the specified key and value.\n\t *\n\t * @param {string} key - The key to associate with the value.\n\t * @param {string} value - The value to store.\n\t */\n\tabstract set(key: string, value: string): Promise<void>;\n}\n\nexport abstract class SDKLogging {\n\t/*\n\t * Identifier for the login session - can be used to provide additional context for log messages\n\t */\n\txEventId: string | undefined;\n\n\tabstract debug(message: string): void;\n\tabstract info(message: string): void;\n\tabstract warn(message: string): void;\n\tabstract error(message: string, error: Error): void;\n}\n\n/**\n * Abstract class for HTTP client used in the SDK.\n */\nexport abstract class SDKHttpClient {\n\tlogging?: SDKLogging;\n\n\t/**\n\t * Makes an HTTP request to the specified URL with optional options.\n\t * @param {string} url - The URL to which the request is sent.\n\t * @param {RequestInit} options - Optional request options, such as method, headers, body, etc.\n\t */\n\tabstract request<T>(url: string, options?: RequestInit): Promise<HttpClientResponse<T>>;\n}\n\n/**\n * Type representing a constructor function for SDKStorage.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKStorageType = new (...args: Array<any>) => SDKStorage;\n\n/**\n * Type representing a constructor function for SDKHttpClient.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKHttpClientType = new (...args: Array<any>) => SDKHttpClient;\n\n/**\n * Type representing a constructor function for SDKHttpClient.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKLoggingType = new (...args: Array<any>) => SDKLogging;\n\n/**\n * Http client response type.\n */\nexport type HttpClientResponse<T> = {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\treadonly url: string;\n\tjson(): Promise<T>;\n\ttext(): Promise<string>;\n};\n\n/**\n * A collection of functions used to handle various events that occur within the SDK.\n */\nexport type EventFunctions = {\n\t/**\n\t * Handler called when an access token has expired.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The expired access token.\n\t * @param {string | null} [params.refreshToken] - The refresh token associated with the access token, if available.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\taccessTokenExpired: (params: { accessToken: string; refreshToken?: string | null }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when the SDK is initialized.\n\t *\n\t * @returns {Promise<void> | void} A promise that resolves when the initialization is complete, or void if no asynchronous operation is needed.\n\t */\n\tinit: () => Promise<void> | void;\n\n\t/**\n\t * Handler called when a user has successfully logged in.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The access token obtained after login.\n\t * @param {string | null} [params.refreshToken] - The refresh token obtained after login, if available.\n\t * @param {IdTokenClaims} params.claims - The claims extracted from the ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\tloggedIn: (params: { accessToken: string; refreshToken?: string | null; claims: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when login has been initiated.\n\t *\n\t * @returns {Promise<void> | void} A promise that resolves when the login initiation process is complete, or void if no asynchronous operation is needed.\n\t */\n\tloginInitiated: () => Promise<void> | void;\n\n\t/**\n\t * Handler called when a logout request has been initiated.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.idToken - The ID token associated with the logout request.\n\t * @param {IdTokenClaims} params.claims - The claims associated with the ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the logout initiation process is complete, or void if no asynchronous operation is needed.\n\t */\n\tlogoutInitiated: (params: { idToken: string; claims: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a user session has been successfully loaded.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The access token associated with the loaded session.\n\t * @param {string | null} [params.refreshToken] - The refresh token associated with the session, if available.\n\t * @param {IdTokenClaims} params.claims - The claims associated with the ID token in the session.\n\t * @returns {Promise<void> | void} A promise that resolves when the session loading is complete, or void if no asynchronous operation is needed.\n\t */\n\tsessionLoaded: (params: { accessToken: string; refreshToken?: string | null; claims: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when an access token has been successfully refreshed.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The new access token obtained after the refresh.\n\t * @param {string} params.refreshToken - The refresh token used to obtain the new access token.\n\t * @param {IdTokenClaims} params.claims - The claims extracted from the new ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the token refresh is complete, or void if no asynchronous operation is needed.\n\t */\n\ttokenRefreshed: (params: { accessToken: string; refreshToken: string; claims: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token refresh operation fails.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.refreshToken - The refresh token that was used in the failed refresh operation.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRefreshFailed: (params: { refreshToken: string }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token has been successfully revoked.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.token - The token that was revoked.\n\t * @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was revoked.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRevoked: (params: { token: string; tokenTypeHint: 'refresh_token' | 'access_token' }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token revocation operation fails.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.token - The token that was attempted to be revoked.\n\t * @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was attempted to be revoked.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRevokeFailed: (params: { token: string; tokenTypeHint: 'refresh_token' | 'access_token' }) => Promise<void> | void;\n};\n\n// endregion\n\n// region Flows\n\n/**\n * Extra parameters that can be used in requests.\n */\n/**\n * Additional parameters that can be included in authentication or authorization requests.\n */\nexport type ExtraRequestArgs = {\n\t/**\n\t * Specifies the type of prompt to display to the user during authentication or authorization.\n\t *\n\t * @type {PromptType}\n\t * @example 'none' | 'login' | 'create'\n\t */\n\tprompt?: PromptType;\n\n\t/**\n\t * Provides a hint to the authorization server about the user's email or username.\n\t *\n\t * @type {string}\n\t * @example 'user@example.com'\n\t */\n\tloginHint?: string;\n\n\t/**\n\t * A list of values used to request specific authentication contexts or levels of assurance.\n\t *\n\t * This parameter allows requesting specific authentication contexts (e.g., multi-factor authentication)\n\t * or other criteria that the authorization server should consider when authenticating the user.\n\t *\n\t * @type {Array<string>}\n\t * @example ['urn:mace:incommon:iap:bronze', 'urn:mace:incommon:iap:silver']\n\t */\n\tacrValues?: Array<string>;\n\n\t/**\n\t * A list of locale codes to request specific language and regional preferences for the user interface.\n\t *\n\t * This parameter allows requesting the user interface to be presented in specific languages or regional formats.\n\t *\n\t * @type {Array<string>}\n\t * @example ['en-US', 'fr-CA']\n\t */\n\tuiLocales?: Array<string>;\n\n\t/**\n\t * A list of audience values to specify the intended recipients of the token.\n\t *\n\t * This parameter allows requesting that the issued token is intended for specific audiences.\n\t *\n\t * @type {Array<string>}\n\t * @example ['https://api.example.com', 'https://service.example.com']\n\t */\n\taudiences?: Array<string>;\n};\n\n/**\n * Params for configuring logout behavior.\n */\nexport type LogoutParams = {\n\t/**\n\t * The URI to redirect to after a successful logout.\n\t *\n\t * If specified, the user will be redirected to this URI upon completing the logout process.\n\t * This is often used to send users back to the main application or a custom post-logout page.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/home'\n\t */\n\tpostLogoutRedirectUri?: string;\n};\n\n/**\n * Parameters for redirect authentication flow.\n */\nexport type RedirectParams = ExtraRequestArgs & {\n\t/**\n\t * The method used to update the browser's location after authentication or authorization.\n\t *\n\t * Determines whether the new URL should replace the current URL in the history or be added to it.\n\t *\n\t * @type {'replace' | 'assign'}\n\t * @default 'assign'\n\t */\n\tlocationMethod?: 'replace' | 'assign';\n\n\t/**\n\t * The window in which the redirect should occur.\n\t *\n\t * Specifies whether the redirect should happen in the top-level window or the current window.\n\t *\n\t * @type {'top' | 'self'}\n\t * @default 'self'\n\t */\n\ttargetWindow?: 'top' | 'self';\n};\n\n/**\n * Features for customizing the popup window.\n */\nexport type PopupWindowFeatures = {\n\t/**\n\t * The horizontal position of the popup window relative to the left edge of the screen.\n\t *\n\t * @type {number}\n\t * @example 100\n\t */\n\tleft?: number;\n\n\t/**\n\t * The vertical position of the popup window relative to the top edge of the screen.\n\t *\n\t * @type {number}\n\t * @example 100\n\t */\n\ttop?: number;\n\n\t/**\n\t * The width of the popup window.\n\t *\n\t * @type {number}\n\t * @example 600\n\t */\n\twidth?: number;\n\n\t/**\n\t * The height of the popup window.\n\t *\n\t * @type {number}\n\t * @example 400\n\t */\n\theight?: number;\n\n\t/**\n\t * Whether the popup window should display a menubar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tmenubar?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display a toolbar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\ttoolbar?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display the address/location bar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tlocation?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display a status bar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tstatus?: boolean | string;\n\n\t/**\n\t * Whether the popup window should be resizable.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example false\n\t */\n\tresizable?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display scrollbars.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example false\n\t */\n\tscrollbars?: boolean | string;\n\n\t[key: string]: boolean | string | number | undefined;\n};\n\n/**\n * Parameters for popup authentication flow.\n */\nexport type PopupParams = ExtraRequestArgs & {\n\t/**\n\t * Configuration options for the popup window, including size, position, and other features.\n\t *\n\t * @type {PopupWindowFeatures}\n\t */\n\tpopupWindowFeatures?: PopupWindowFeatures;\n\n\t/**\n\t * The target of the popup window, which specifies where the popup should be opened.\n\t *\n\t * @type {string}\n\t * @example '_blank' | '_self' | '_parent' | '_top'\n\t */\n\tpopupWindowTarget?: string;\n\n\t/**\n\t * Whether to check the origin of messages received from the popup window.\n\t *\n\t * If set to `true`, the SDK will verify that messages received from the popup window originate from the expected domain.\n\t * This is a security measure to prevent malicious scripts from sending unauthorized messages to the application.\n\t *\n\t * @type {boolean}\n\t * @default true\n\t */\n\tcheckOrigin?: boolean;\n};\n\n/**\n * Parameters for native authentication flow.\n */\nexport type NativeParams = RedirectParams & { sdk?: string };\n\nexport declare const WidgetTypeList: readonly [\n\t'layout',\n\t'submit',\n\t'close',\n\t'static',\n\t'input',\n\t'checkbox',\n\t'password',\n\t'select',\n\t'multiSelect',\n\t'passcode',\n\t'date',\n\t'phone',\n\t'loading',\n\t'passkeyLogin',\n\t'passkeyEnroll',\n\t'webauthnLogin',\n\t'webauthnEnroll',\n];\nexport type WidgetType = (typeof WidgetTypeList)[number];\nexport declare const SelectOptionTypeList: readonly ['item', 'group'];\nexport type SelectOptionType = (typeof SelectOptionTypeList)[number];\nexport type BrandingData = {\n\tlogoUrl: string | null;\n\tbrandName: string | null;\n\tcopyright: string | null;\n\tprivacyPolicyUrl: string | null;\n\tsiteTermsUrl: string | null;\n};\nexport type CheckboxWidget = {\n\tid: string;\n\ttype: 'checkbox';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: boolean;\n\trender: {\n\t\ttype: 'checkboxHidden' | 'checkboxShown';\n\t\tlabelType: 'text' | 'html';\n\t};\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type DateWidget = {\n\tid: string;\n\ttype: 'date';\n\tlabel?: string;\n\tplaceholder?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\trender: {\n\t\ttype: 'native' | 'fieldSet';\n\t};\n\tvalidator?: {\n\t\tnotBefore?: string;\n\t\tnotAfter?: string;\n\t\trequired?: boolean;\n\t};\n};\nexport type InputWidget = {\n\tid: string;\n\ttype: 'input';\n\tlabel?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\treadonly?: boolean;\n\tautocomplete?: string;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tinputmode: any;\n\trender?: {\n\t\tautocompleteHint?: string;\n\t};\n\tvalidator?: {\n\t\trequired?: boolean;\n\t\tminLength?: number;\n\t\tmaxLength?: number;\n\t\tregex?: string;\n\t};\n};\nexport type PasscodeWidget = {\n\tid: string;\n\ttype: 'passcode';\n\tlabel?: string;\n\tvalidator?: {\n\t\tlength?: number;\n\t};\n};\nexport type PasswordWidget = {\n\tid: string;\n\ttype: 'password';\n\tlabel?: string;\n\tqualityIndicator?: boolean;\n\tvalidator?: {\n\t\tminLength?: number;\n\t\tmaxLength?: number;\n\t\tmaxNumericCharacterSequences?: number;\n\t\tmaxRepeatedCharacters?: number;\n\t\tmustContain?: Array<'UPPERCASE' | 'LOWERCASE' | 'NUMERIC' | 'SPECIAL'>;\n\t\trestrictedCharacters?: string;\n\t};\n};\nexport type PhoneWidget = {\n\tid: string;\n\ttype: 'phone';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type SelectWidgetOption = {\n\ttype: 'item';\n\tlabel?: string;\n\tvalue: string;\n};\nexport type SelectWidgetOptionGroup = {\n\ttype: 'group';\n\tlabel?: string;\n\toptions: Array<SelectWidgetOption>;\n};\nexport type SelectWidget = {\n\tid: string;\n\ttype: 'select';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalues?: Array<string>;\n\tplaceholder?: string;\n\trender: {\n\t\ttype: 'dropdown' | 'radio';\n\t};\n\toptions: Array<SelectWidgetOptionGroup | SelectWidgetOption>;\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type MultiSelectWidget = {\n\tid: string;\n\ttype: 'multiSelect';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalues?: Array<string>;\n\tplaceholder?: string;\n\trender: {\n\t\ttype: 'dropdown' | 'checkbox';\n\t};\n\toptions: Array<SelectWidgetOptionGroup | SelectWidgetOption>;\n\tvalidator?: {\n\t\tminSelectable?: number;\n\t\tmaxSelectable?: number;\n\t};\n};\nexport type StaticWidget = {\n\tid: string;\n\ttype: 'static';\n\tvalue: string;\n\trender: {\n\t\ttype: 'html' | 'text';\n\t};\n};\nexport type SubmitWidget = {\n\tid: string;\n\ttype: 'submit';\n\tlabel?: string;\n\trender: {\n\t\ttype: 'button' | 'link';\n\t\ttextColor?: string;\n\t\tbgColor?: string;\n\t\thint?: {\n\t\t\ticon?: string;\n\t\t\tvariant?: string;\n\t\t};\n\t};\n};\nexport type CloseWidget = {\n\tid: string;\n\ttype: 'close';\n\tlabel?: string;\n\trender: {\n\t\ttype: 'button' | 'link';\n\t\ttextColor?: string;\n\t\tbgColor?: string;\n\t\thint?: {\n\t\t\ticon?: string;\n\t\t\tvariant?: string;\n\t\t};\n\t};\n};\nexport type FormWidget = {\n\tid: string;\n\ttype: 'form';\n\twidgets: Array<\n\t\tCheckboxWidget | DateWidget | InputWidget | PasscodeWidget | PasswordWidget | PhoneWidget | SelectWidget | MultiSelectWidget | StaticWidget | SubmitWidget\n\t>;\n};\nexport type Widget = {\n\ttype: 'widget';\n\tformId: string;\n\twidgetId: string;\n};\nexport type LayoutWidget = {\n\ttype: 'vertical' | 'horizontal';\n\titems: Array<Widget | LayoutWidget>;\n};\nexport type PasskeyLoginWidget = {\n\tid: string;\n\tlabel?: string;\n\trender: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t\tnotification?: {\n\t\t\tcancelled?: string;\n\t\t};\n\t};\n\tassertionOptions: PublicKeyCredentialRequestOptions;\n};\nexport type PasskeyEnrollWidget = {\n\tid: string;\n\tlabel?: string;\n\trender: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t\tnotification?: {\n\t\t\tcancelled?: string;\n\t\t};\n\t};\n\tenrollOptions: PublicKeyCredentialCreationOptions;\n};\nexport type WebauthnLoginWidget = {\n\tid: string;\n\tlabel?: string;\n\tauthenticatorType: 'deviceBiometrics' | 'securityKey';\n\trender: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t\tnotification?: {\n\t\t\tcancelled?: string;\n\t\t};\n\t};\n\tassertionOptions: PublicKeyCredentialRequestOptions;\n};\nexport type WebauthnEnrollWidget = {\n\tid: string;\n\tlabel?: string;\n\tauthenticatorType: 'deviceBiometrics' | 'securityKey';\n\trender: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t\tnotification?: {\n\t\t\tcancelled?: string;\n\t\t};\n\t};\n\tenrollOptions: PublicKeyCredentialCreationOptions;\n};\nexport type LoginFlowMessage = {\n\ttype: string;\n\ttext: string;\n};\nexport type LoginFlowState = {\n\thostedUrl?: string;\n\tfinalizeUrl?: string;\n\tscreen?: string;\n\tbranding?: BrandingData;\n\tforms?: Array<FormWidget>;\n\tlayout?: LayoutWidget;\n\tmessages?: Record<string, Record<string, LoginFlowMessage>> & {\n\t\tglobal?: LoginFlowMessage;\n\t};\n};\nexport type AssertionPublicKeyCredential = PublicKeyCredential & {\n\tresponse: AuthenticatorAssertionResponse;\n};\nexport type AssertionCredentialData = {\n\tid: string;\n\ttype: string;\n\trawId: string;\n\tresponse: {\n\t\tclientDataJSON: string;\n\t\tauthenticatorData: string;\n\t\tsignature: string;\n\t\tuserHandle: string;\n\t};\n};\nexport type AttestationPublicKeyCredential = PublicKeyCredential & {\n\tresponse: AuthenticatorAttestationResponse;\n};\nexport type AttestationCredentialData = {\n\tid: string;\n\ttype: string;\n\trawId: string;\n\tauthenticatorAttachment: string | null;\n\tresponse: {\n\t\tclientDataJSON: string;\n\t\tattestationObject: string;\n\t\ttransports: Array<string>;\n\t};\n};\n\nexport declare class LanguageSelectorComponent extends HTMLElement {}\n\nexport declare class NotificationComponent extends HTMLElement {\n\tdevMode: boolean;\n}\n\nexport declare class LandingComponent extends HTMLElement {\n\tactiveBlock: string;\n\tbaseUrl: string;\n\tlazy: boolean;\n\tlang: string;\n\tdebug: boolean;\n\tinitialized?: boolean;\n}\n\nexport declare class LoginComponent extends HTMLElement {\n\tmode?: string;\n\tbaseUrl?: string;\n\tsessionId?: string;\n\tlazy: boolean;\n\tparams: ExtraRequestArgs;\n\tlang: string;\n\tdebug: boolean;\n\tinitialized?: boolean;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sty-language-selector': LanguageSelectorComponent;\n\t\t'sty-notifications': NotificationComponent;\n\t\t'sty-landing': LandingComponent;\n\t\t'sty-login': LoginComponent;\n\t}\n}\n\n// endregion\n"],"names":["ResponseTypeList","ResponseModeList","TokenEndpointAuthMethodList","GrantTypeList","AlgorithmTypeList","SubjectTypeList","PromptTypeList","FallbackModeTypeList","SDKStorage","SDKLogging","SDKHttpClient"],"mappings":"gFA6BO,MAAMA,EAAmB,CAAC,OAAQ,UAAU,EAStCC,EAAmB,CAAC,QAAS,UAAU,EASvCC,EAA8B,CAAC,MAAM,EASrCC,EAAgB,CAAC,qBAAsB,eAAe,EAStDC,EAAoB,CAAC,OAAO,EAS5BC,EAAkB,CAAC,QAAQ,EAS3BC,EAAiB,CAAC,OAAQ,QAAS,QAAQ,EAS3CC,EAAuB,CAAC,WAAY,OAAO,EAihBjD,MAAeC,CAAW,CAuBjC,CAEO,MAAeC,CAAW,CAIhC,QAMD,CAKO,MAAeC,CAAc,CACnC,OAQD"}
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../src/types.ts"],"sourcesContent":["import type { BaseFlow } from './flows/BaseFlow';\n\n/**\n * Makes properties of `T` required based on the keys provided in `K`.\n *\n * @template T - The type from which properties will be made required.\n * @template K - The keys of `T` that should be required.\n * @example\n * type MyType = { a?: string; b?: number; c?: boolean };\n * type RequiredAB = Mandatory<MyType, 'a' | 'b'>; // { a: string; b: number; c?: boolean }\n */\nexport type Mandatory<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;\n\n/**\n * A type representing a partial record of key-value pairs where keys are of type `K` and values are of type `T`.\n *\n * @template K - The type of the keys in the record.\n * @template T - The type of the values in the record.\n * @example\n * type StringMap = PartialRecord<string, string>; // { [key: string]: string | undefined }\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PartialRecord<K extends keyof any, T> = {\n\t[P in K]?: T;\n};\n\n// region SDK\n\n/**\n * List of supported response types.\n */\nexport const ResponseTypeList = ['code', 'id_token'] as const;\n/**\n * Type representing valid response types.\n */\nexport type ResponseType = (typeof ResponseTypeList)[number];\n\n/**\n * List of supported response modes.\n */\nexport const ResponseModeList = ['query', 'fragment'] as const;\n/**\n * Type representing valid response modes.\n */\nexport type ResponseMode = (typeof ResponseModeList)[number];\n\n/**\n * List of supported token endpoint authentication methods.\n */\nexport const TokenEndpointAuthMethodList = ['none'] as const;\n/**\n * Type representing valid token endpoint authentication methods.\n */\nexport type TokenEndpointAuthMethod = (typeof TokenEndpointAuthMethodList)[number];\n\n/**\n * List of supported grant types.\n */\nexport const GrantTypeList = ['authorization_code', 'refresh_token'] as const;\n/**\n * Type representing valid grant types.\n */\nexport type GrantType = (typeof GrantTypeList)[number];\n\n/**\n * List of supported algorithm types.\n */\nexport const AlgorithmTypeList = ['RS256'] as const;\n/**\n * Type representing valid algorithm types.\n */\nexport type AlgorithmType = (typeof AlgorithmTypeList)[number];\n\n/**\n * List of supported subject types.\n */\nexport const SubjectTypeList = ['public'] as const;\n/**\n * Type representing valid subject types.\n */\nexport type SubjectType = (typeof SubjectTypeList)[number];\n\n/**\n * List of supported prompt types.\n */\nexport const PromptTypeList = ['none', 'login', 'create'] as const;\n/**\n * Type representing valid prompt types.\n */\nexport type PromptType = (typeof PromptTypeList)[number];\n\n/**\n * List of supported fallback modes.\n */\nexport const FallbackModeTypeList = ['redirect', 'popup'] as const;\n/**\n * Type representing valid fallback modes.\n */\nexport type FallbackMode = (typeof FallbackModeTypeList)[number];\n\n/**\n * Represents a signing key used in cryptographic operations, such as signing JSON Web Tokens (JWTs).\n *\n * This type defines the key's properties, including its usage, type, identifier, algorithm, and key material.\n */\nexport type SigningKey = {\n\t/**\n\t * The intended use of the key. Common values include \"sig\" for signature and \"enc\" for encryption.\n\t *\n\t * @type {string}\n\t * @example 'sig'\n\t */\n\tuse: string;\n\n\t/**\n\t * The key type. For example, \"RSA\" for RSA keys or \"EC\" for Elliptic Curve keys.\n\t *\n\t * @type {string}\n\t * @example 'RSA'\n\t */\n\tkty: string;\n\n\t/**\n\t * A unique identifier for the key. This is used to distinguish the key from others.\n\t *\n\t * @type {string}\n\t * @example 'key-id-1234'\n\t */\n\tkid: string;\n\n\t/**\n\t * The algorithm used with the key. For example, \"RS256\" for RSA SHA-256.\n\t *\n\t * @type {AlgorithmType}\n\t * @example 'RS256'\n\t */\n\talg: AlgorithmType;\n\n\t/**\n\t * The modulus of the RSA key, encoded in base64url format. For RSA keys, this is a required property.\n\t *\n\t * @type {string}\n\t * @example 'base64url-encoded-modulus'\n\t */\n\tn: string;\n\n\t/**\n\t * The exponent of the RSA key, encoded in base64url format. For RSA keys, this is a required property.\n\t *\n\t * @type {string}\n\t * @example 'base64url-encoded-exponent'\n\t */\n\te: string;\n};\n\n/**\n * Represents the metadata options provided by an authorization server.\n *\n * This metadata includes information about the server's endpoints, supported features, and supported claims.\n */\nexport type MetadataOptions = {\n\t/**\n\t * The issuer of the tokens. This is the authorization server or entity that issues the tokens.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tissuer: string;\n\n\t/**\n\t * The URL of the authorization endpoint where authentication requests are sent.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/authorize'\n\t */\n\tauthorization_endpoint: string;\n\n\t/**\n\t * The URL of the token endpoint where tokens are exchanged.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/token'\n\t */\n\ttoken_endpoint: string;\n\n\t/**\n\t * The URL of the JSON Web Key Set (JWKS) endpoint where public keys are available.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/jwks'\n\t */\n\tjwks_uri: string;\n\n\t/**\n\t * The types of subjects that are supported by the authorization server.\n\t *\n\t * @type {Array<SubjectType>}\n\t * @example ['public']\n\t */\n\tsubject_types_supported: Array<SubjectType>;\n\n\t/**\n\t * The types of responses supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['code', 'id_token']\n\t */\n\tresponse_types_supported: Array<string>;\n\n\t/**\n\t * The claims supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['sub', 'name', 'email']\n\t */\n\tclaims_supported: Array<string>;\n\n\t/**\n\t * The grant types supported by the authorization server.\n\t *\n\t * @type {Array<GrantType>}\n\t * @example ['authorization_code', 'refresh_token']\n\t */\n\tgrant_types_supported: Array<GrantType>;\n\n\t/**\n\t * The response modes supported by the authorization server.\n\t *\n\t * @type {Array<ResponseMode>}\n\t * @example ['query', 'fragment']\n\t */\n\tresponse_modes_supported: Array<ResponseMode>;\n\n\t/**\n\t * The URL of the user info endpoint where user information can be retrieved.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/userinfo'\n\t */\n\tuserinfo_endpoint: string;\n\n\t/**\n\t * The scopes supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['openid', 'profile', 'email']\n\t */\n\tscopes_supported: Array<string>;\n\n\t/**\n\t * The authentication methods supported for token endpoint authentication.\n\t *\n\t * @type {Array<TokenEndpointAuthMethod>}\n\t * @example ['none']\n\t */\n\ttoken_endpoint_auth_methods_supported: Array<TokenEndpointAuthMethod>;\n\n\t/**\n\t * The algorithms supported for signing tokens used in the user info endpoint.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tuserinfo_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms supported for signing ID tokens.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tid_token_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms used to sign ID tokens in response.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tid_token_signed_response_alg: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms used to sign responses from the user info endpoint.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tuserinfo_signed_response_alg: Array<AlgorithmType>;\n\n\t/**\n\t * Indicates whether the request parameter is supported in requests.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequest_parameter_supported: boolean;\n\n\t/**\n\t * Indicates whether the request URI parameter is supported in requests.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequest_uri_parameter_supported: boolean;\n\n\t/**\n\t * Indicates whether request URI registration is required.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequire_request_uri_registration: boolean;\n\n\t/**\n\t * Indicates whether the claims parameter is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tclaims_parameter_supported: boolean;\n\n\t/**\n\t * The URL of the revocation endpoint for revoking tokens.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/revoke'\n\t */\n\trevocation_endpoint: string;\n\n\t/**\n\t * Indicates whether backchannel logout is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tbackchannel_logout_supported: boolean;\n\n\t/**\n\t * Indicates whether backchannel logout session support is provided.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tbackchannel_logout_session_supported: boolean;\n\n\t/**\n\t * Indicates whether frontchannel logout is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tfrontchannel_logout_supported: boolean;\n\n\t/**\n\t * Indicates whether frontchannel logout session support is provided.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tfrontchannel_logout_session_supported: boolean;\n\n\t/**\n\t * The URL of the endpoint where end-session requests can be sent.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/logout'\n\t */\n\tend_session_endpoint: string;\n\n\t/**\n\t * The algorithms supported for signing request objects.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\trequest_object_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The code challenge methods supported by the authorization server.\n\t *\n\t * @type {Array<'S256'>}\n\t * @example ['S256']\n\t */\n\tcode_challenge_methods_supported: Array<'S256'>;\n};\n\n/**\n * Represents the standard claims in a JSON Web Token (JWT).\n *\n * These claims are part of the payload in a JWT and convey information about the token, such as its issuer, subject, and expiration.\n */\nexport type JwtClaims = {\n\t/**\n\t * The issuer of the token. This typically represents the authorization server or entity that issued the JWT.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tiss?: string;\n\n\t/**\n\t * The subject of the token. This is the identifier for the entity the token represents, such as a user ID.\n\t *\n\t * @type {string}\n\t * @example 'user123'\n\t */\n\tsub?: string;\n\n\t/**\n\t * The audience for which the token is intended. This can be a single identifier or an array of identifiers.\n\t *\n\t * @type {string | Array<string>}\n\t * @example 'your-client-id' | ['client1', 'client2']\n\t */\n\taud?: string | Array<string>;\n\n\t/**\n\t * The expiration time of the token, expressed as a Unix timestamp (number of seconds since January 1, 1970).\n\t *\n\t * @type {number}\n\t * @example 1633024800\n\t */\n\texp?: number;\n\n\t/**\n\t * The not-before time of the token, expressed as a Unix timestamp. The token must not be accepted before this time.\n\t *\n\t * @type {number}\n\t * @example 1633021200\n\t */\n\tnbf?: number;\n\n\t/**\n\t * The issued-at time of the token, expressed as a Unix timestamp (number of seconds since January 1, 1970).\n\t *\n\t * @type {number}\n\t * @example 1633022400\n\t */\n\tiat?: number;\n\n\t/**\n\t * A unique identifier for the token. This can be used to prevent token replay attacks.\n\t *\n\t * @type {string}\n\t * @example 'unique-jwt-id-1234'\n\t */\n\tjti?: string;\n};\n\n/**\n * Represents the claims included in an ID token, extending standard JWT claims with additional properties specific to identity tokens.\n *\n * ID tokens are used to authenticate and provide identity information about the user.\n */\nexport type IdTokenClaims = Mandatory<JwtClaims, 'iss' | 'sub' | 'aud' | 'exp' | 'iat'> & {\n\t/**\n\t * The authentication time, indicating when the user was authenticated.\n\t *\n\t * @type {number}\n\t * @example 1633022400\n\t */\n\tauth_time?: number;\n\n\t/**\n\t * A nonce value used to associate a client session with an ID token, preventing replay attacks.\n\t *\n\t * @type {string}\n\t * @example 'nonce-value-1234'\n\t */\n\tnonce?: string;\n\n\t/**\n\t * The Authentication Context Class Reference, indicating the authentication methods used.\n\t *\n\t * @type {string}\n\t * @example '2'\n\t */\n\tacr?: string;\n\n\t/**\n\t * The Authentication Methods References, providing information about the authentication methods used.\n\t *\n\t * @type {unknown}\n\t */\n\tamr?: unknown;\n\n\t/**\n\t * Authorized party, the client that the ID token is intended for.\n\t *\n\t * @type {string}\n\t * @example 'client-id'\n\t */\n\tazp?: string;\n\n\t/**\n\t * Session ID for the user, which can be used to manage user sessions.\n\t *\n\t * @type {string}\n\t * @example 'session-id-1234'\n\t */\n\tsid?: string;\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n};\n\n/**\n * Options for configuring the SDK.\n */\nexport type SDKOptions = {\n\t/**\n\t * Specifies the mode of the SDK operation, either 'popup' or 'redirect'.\n\t *\n\t * @type {'popup' | 'redirect' | 'native' | 'embedded' | 'custom'}\n\t * @default 'redirect'\n\t */\n\tmode?: 'popup' | 'redirect' | 'native' | 'embedded' | 'custom';\n\n\t/**\n\t * The issuer of the tokens, typically the URL of the authorization server.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tissuer: string;\n\n\t/**\n\t * The client ID issued by the authorization server, used to identify the application.\n\t *\n\t * @type {string}\n\t * @example 'your-client-id'\n\t */\n\tclientId: string;\n\n\t/**\n\t * The URI to which the user will be redirected after authentication or authorization.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/callback'\n\t */\n\tredirectUri: string;\n\n\t/**\n\t * A list of scopes requested by the application, defining the access levels for the tokens.\n\t *\n\t * @type {Array<string>}\n\t * @default ['openid']\n\t * @example ['openid', 'profile']\n\t */\n\tscopes?: Array<string>;\n\n\t/**\n\t * The type of response expected from the authorization server.\n\t *\n\t * @type {ResponseType}\n\t * @default 'code'\n\t */\n\tresponseType?: ResponseType;\n\n\t/**\n\t * The mode in which the response is returned from the authorization server.\n\t *\n\t * @type {ResponseMode}\n\t * @default 'query'\n\t */\n\tresponseMode?: ResponseMode;\n\n\t/**\n\t * The name of the token in storage used to persist authentication information.\n\t *\n\t * @type {string}\n\t * @default 'sty.session'\n\t * @example 'accessToken'\n\t */\n\tstorageTokenName?: string;\n\n\t/**\n\t * The storage mechanism used to save and retrieve authentication information.\n\t *\n\t * @type {SDKStorageType}\n\t * @default LocalStorage\n\t */\n\tstorage?: SDKStorageType;\n\n\t/**\n\t * The HTTP client used for making requests to the authorization server.\n\t *\n\t * @type {SDKHttpClientType}\n\t * @default HttpClient\n\t */\n\thttpClient?: SDKHttpClientType;\n\n\t/**\n\t * The logging mechanism used for logging messages and errors.\n\t *\n\t * @type {SDKLoggingType}\n\t */\n\tlogging?: SDKLoggingType;\n\n\t/**\n\t * A custom flow handler that extends the BaseFlow class. This allows you to implement a custom authentication flow by providing your own handler.\n\t *\n\t * @type {FlowType}\n\t */\n\tcustomFlow?: FlowType;\n\n\t/**\n\t * Handles the URL redirection to the specified target.\n\t * You can use this method to implement custom URL handling logic, such as opening a new window or navigating to a different page.\n\t *\n\t * @param {string} url - The URL to handle.\n\t * @param {Record<string, unknown>} params - Optional parameters for redirection.\n\t * @returns - A promise that resolves when the redirection is handled.\n\t */\n\turlHandler?: (url: string, params?: Record<string, unknown>) => Promise<unknown>;\n\n\t/**\n\t * Handles the callback from the authorization server after a successful authentication or authorization.\n\t * You can use this method to implement custom logic for processing the response from the authorization server.\n\t *\n\t * @param url - The URL containing the response from the authorization server.\n\t * @param responseMode - The mode in which the response is returned (e.g., 'query', 'fragment').\n\t * @returns - A promise that resolves when the callback is handled.\n\t */\n\tcallbackHandler?: (url: string, responseMode?: ResponseMode) => Promise<unknown>;\n};\n\n/**\n * Abstract class for SDK storage mechanisms.\n */\nexport abstract class SDKStorage {\n\t/**\n\t * Retrieves an item from the storage by key.\n\t *\n\t * @param {string} key - The key of the item to retrieve.\n\t * @returns {string | null} The value associated with the key, or `null` if not found.\n\t */\n\tabstract get(key: string): Promise<string | null>;\n\n\t/**\n\t * Deletes an item from the storage by key.\n\t *\n\t * @param {string} key - The key of the item to delete.\n\t */\n\tabstract delete(key: string): Promise<void>;\n\n\t/**\n\t * Sets an item in the storage with the specified key and value.\n\t *\n\t * @param {string} key - The key to associate with the value.\n\t * @param {string} value - The value to store.\n\t */\n\tabstract set(key: string, value: string): Promise<void>;\n}\n\nexport abstract class SDKLogging {\n\t/*\n\t * Identifier for the login session - can be used to provide additional context for log messages\n\t */\n\txEventId: string | undefined;\n\n\tabstract debug(message: string): void;\n\tabstract info(message: string): void;\n\tabstract warn(message: string): void;\n\tabstract error(message: string, error: Error): void;\n}\n\n/**\n * Abstract class for HTTP client used in the SDK.\n */\nexport abstract class SDKHttpClient {\n\tlogging?: SDKLogging;\n\n\t/**\n\t * Makes an HTTP request to the specified URL with optional options.\n\t * @param {string} url - The URL to which the request is sent.\n\t * @param {RequestInit} options - Optional request options, such as method, headers, body, etc.\n\t */\n\tabstract request<T>(url: string, options?: RequestInit): Promise<HttpClientResponse<T>>;\n}\n\n/**\n * Type representing a constructor function for SDKStorage.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKStorageType = new (...args: Array<any>) => SDKStorage;\n\n/**\n * Type representing a constructor function for SDKHttpClient.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKHttpClientType = new (...args: Array<any>) => SDKHttpClient;\n\n/**\n * Type representing a constructor function for SDKHttpClient.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKLoggingType = new (...args: Array<any>) => SDKLogging;\n\n/**\n * Type representing a constructor function for a custom flow that extends BaseFlow.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type FlowType = new (...args: Array<any>) => BaseFlow;\n\n/**\n * Http client response type.\n */\nexport type HttpClientResponse<T> = {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\treadonly url: string;\n\tjson(): Promise<T>;\n\ttext(): Promise<string>;\n};\n\n/**\n * A collection of functions used to handle various events that occur within the SDK.\n */\nexport type EventFunctions = {\n\t/**\n\t * Handler called when an access token has expired.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The expired access token.\n\t * @param {string | null} [params.refreshToken] - The refresh token associated with the access token, if available.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\taccessTokenExpired: (params?: { accessToken?: string; refreshToken?: string | null }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when the SDK is initialized.\n\t *\n\t * @returns {Promise<void> | void} A promise that resolves when the initialization is complete, or void if no asynchronous operation is needed.\n\t */\n\tinit: () => Promise<void> | void;\n\n\t/**\n\t * Handler called when a user has successfully logged in.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The access token obtained after login.\n\t * @param {string | null} [params.refreshToken] - The refresh token obtained after login, if available.\n\t * @param {IdTokenClaims} params.claims - The claims extracted from the ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\tloggedIn: (params?: { accessToken?: string; refreshToken?: string | null; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when login has been initiated.\n\t *\n\t * @returns {Promise<void> | void} A promise that resolves when the login initiation process is complete, or void if no asynchronous operation is needed.\n\t */\n\tloginInitiated: () => Promise<void> | void;\n\n\t/**\n\t * Handler called when a logout request has been initiated.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.idToken - The ID token associated with the logout request.\n\t * @param {IdTokenClaims} params.claims - The claims associated with the ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the logout initiation process is complete, or void if no asynchronous operation is needed.\n\t */\n\tlogoutInitiated: (params?: { idToken?: string; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a user session has been successfully loaded.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The access token associated with the loaded session.\n\t * @param {string | null} [params.refreshToken] - The refresh token associated with the session, if available.\n\t * @param {IdTokenClaims} params.claims - The claims associated with the ID token in the session.\n\t * @returns {Promise<void> | void} A promise that resolves when the session loading is complete, or void if no asynchronous operation is needed.\n\t */\n\tsessionLoaded: (params?: { accessToken?: string; refreshToken?: string | null; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when an access token has been successfully refreshed.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The new access token obtained after the refresh.\n\t * @param {string} params.refreshToken - The refresh token used to obtain the new access token.\n\t * @param {IdTokenClaims} params.claims - The claims extracted from the new ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the token refresh is complete, or void if no asynchronous operation is needed.\n\t */\n\ttokenRefreshed: (params?: { accessToken?: string; refreshToken?: string; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token refresh operation fails.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.refreshToken - The refresh token that was used in the failed refresh operation.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRefreshFailed: (params?: { refreshToken?: string }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token has been successfully revoked.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.token - The token that was revoked.\n\t * @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was revoked.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRevoked: (params?: { token?: string; tokenTypeHint?: 'refresh_token' | 'access_token' }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token revocation operation fails.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.token - The token that was attempted to be revoked.\n\t * @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was attempted to be revoked.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRevokeFailed: (params?: { token?: string; tokenTypeHint?: 'refresh_token' | 'access_token' }) => Promise<void> | void;\n};\n\n// endregion\n\n// region Flows\n\n/**\n * Extra parameters that can be used in requests.\n */\n/**\n * Additional parameters that can be included in authentication or authorization requests.\n */\nexport type ExtraRequestArgs = {\n\t/**\n\t * Specifies the type of prompt to display to the user during authentication or authorization.\n\t *\n\t * @type {PromptType}\n\t * @example 'none' | 'login' | 'create'\n\t */\n\tprompt?: PromptType;\n\n\t/**\n\t * Provides a hint to the authorization server about the user's email or username.\n\t *\n\t * @type {string}\n\t * @example 'user@example.com'\n\t */\n\tloginHint?: string;\n\n\t/**\n\t * A list of values used to request specific authentication contexts or levels of assurance.\n\t *\n\t * This parameter allows requesting specific authentication contexts (e.g., multi-factor authentication)\n\t * or other criteria that the authorization server should consider when authenticating the user.\n\t *\n\t * @type {Array<string>}\n\t * @example ['urn:mace:incommon:iap:bronze', 'urn:mace:incommon:iap:silver']\n\t */\n\tacrValues?: Array<string>;\n\n\t/**\n\t * A list of locale codes to request specific language and regional preferences for the user interface.\n\t *\n\t * This parameter allows requesting the user interface to be presented in specific languages or regional formats.\n\t *\n\t * @type {Array<string>}\n\t * @example ['en-US', 'fr-CA']\n\t */\n\tuiLocales?: Array<string>;\n\n\t/**\n\t * A list of audience values to specify the intended recipients of the token.\n\t *\n\t * This parameter allows requesting that the issued token is intended for specific audiences.\n\t *\n\t * @type {Array<string>}\n\t * @example ['https://api.example.com', 'https://service.example.com']\n\t */\n\taudiences?: Array<string>;\n};\n\n/**\n * Params for configuring logout behavior.\n */\nexport type LogoutParams = {\n\t/**\n\t * The URI to redirect to after a successful logout.\n\t *\n\t * If specified, the user will be redirected to this URI upon completing the logout process.\n\t * This is often used to send users back to the main application or a custom post-logout page.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/home'\n\t */\n\tpostLogoutRedirectUri?: string;\n};\n\n/**\n * Parameters for redirect authentication flow.\n */\nexport type RedirectParams = ExtraRequestArgs & {\n\t/**\n\t * The method used to update the browser's location after authentication or authorization.\n\t *\n\t * Determines whether the new URL should replace the current URL in the history or be added to it.\n\t *\n\t * @type {'replace' | 'assign'}\n\t * @default 'assign'\n\t */\n\tlocationMethod?: 'replace' | 'assign';\n\n\t/**\n\t * The window in which the redirect should occur.\n\t *\n\t * Specifies whether the redirect should happen in the top-level window or the current window.\n\t *\n\t * @type {'top' | 'self'}\n\t * @default 'self'\n\t */\n\ttargetWindow?: 'top' | 'self';\n};\n\n/**\n * Features for customizing the popup window.\n */\nexport type PopupWindowFeatures = {\n\t/**\n\t * The horizontal position of the popup window relative to the left edge of the screen.\n\t *\n\t * @type {number}\n\t * @example 100\n\t */\n\tleft?: number;\n\n\t/**\n\t * The vertical position of the popup window relative to the top edge of the screen.\n\t *\n\t * @type {number}\n\t * @example 100\n\t */\n\ttop?: number;\n\n\t/**\n\t * The width of the popup window.\n\t *\n\t * @type {number}\n\t * @example 600\n\t */\n\twidth?: number;\n\n\t/**\n\t * The height of the popup window.\n\t *\n\t * @type {number}\n\t * @example 400\n\t */\n\theight?: number;\n\n\t/**\n\t * Whether the popup window should display a menubar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tmenubar?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display a toolbar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\ttoolbar?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display the address/location bar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tlocation?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display a status bar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tstatus?: boolean | string;\n\n\t/**\n\t * Whether the popup window should be resizable.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example false\n\t */\n\tresizable?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display scrollbars.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example false\n\t */\n\tscrollbars?: boolean | string;\n\n\t[key: string]: boolean | string | number | undefined;\n};\n\n/**\n * Parameters for popup authentication flow.\n */\nexport type PopupParams = ExtraRequestArgs & {\n\t/**\n\t * Configuration options for the popup window, including size, position, and other features.\n\t *\n\t * @type {PopupWindowFeatures}\n\t */\n\tpopupWindowFeatures?: PopupWindowFeatures;\n\n\t/**\n\t * The target of the popup window, which specifies where the popup should be opened.\n\t *\n\t * @type {string}\n\t * @example '_blank' | '_self' | '_parent' | '_top'\n\t */\n\tpopupWindowTarget?: string;\n\n\t/**\n\t * Whether to check the origin of messages received from the popup window.\n\t *\n\t * If set to `true`, the SDK will verify that messages received from the popup window originate from the expected domain.\n\t * This is a security measure to prevent malicious scripts from sending unauthorized messages to the application.\n\t *\n\t * @type {boolean}\n\t * @default true\n\t */\n\tcheckOrigin?: boolean;\n};\n\n/**\n * Parameters for native authentication flow.\n */\nexport type NativeParams = RedirectParams & { sdk?: string };\n\nexport declare const WidgetTypeList: readonly [\n\t'layout',\n\t'submit',\n\t'close',\n\t'static',\n\t'input',\n\t'checkbox',\n\t'password',\n\t'select',\n\t'multiSelect',\n\t'passcode',\n\t'date',\n\t'phone',\n\t'loading',\n\t'passkeyLogin',\n\t'passkeyEnroll',\n\t'webauthnLogin',\n\t'webauthnEnroll',\n];\nexport type WidgetType = (typeof WidgetTypeList)[number];\nexport declare const SelectOptionTypeList: readonly ['item', 'group'];\nexport type SelectOptionType = (typeof SelectOptionTypeList)[number];\nexport type BrandingData = {\n\tlogoUrl: string | null;\n\tbrandName: string | null;\n\tcopyright: string | null;\n\tprivacyPolicyUrl: string | null;\n\tsiteTermsUrl: string | null;\n};\nexport type CheckboxWidget = {\n\tid: string;\n\ttype: 'checkbox';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: boolean;\n\trender?: {\n\t\ttype: 'checkboxHidden' | 'checkboxShown';\n\t\tlabelType: 'text' | 'html';\n\t};\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type DateWidget = {\n\tid: string;\n\ttype: 'date';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\trender?: {\n\t\ttype: 'native' | 'fieldSet';\n\t};\n\tvalidator?: {\n\t\tnotBefore?: string;\n\t\tnotAfter?: string;\n\t\trequired?: boolean;\n\t};\n};\nexport type InputWidget = {\n\tid: string;\n\ttype: 'input';\n\tlabel?: string;\n\tvalue?: string;\n\treadonly?: boolean;\n\tautocomplete?: string;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tinputmode: any;\n\trender?: {\n\t\tautocompleteHint?: string;\n\t};\n\tvalidator?: {\n\t\trequired?: boolean;\n\t\tminLength?: number;\n\t\tmaxLength?: number;\n\t\tregex?: string;\n\t};\n};\nexport type PasscodeWidget = {\n\tid: string;\n\ttype: 'passcode';\n\tlabel?: string;\n\tvalidator?: {\n\t\tlength?: number;\n\t};\n};\nexport type PasswordWidget = {\n\tid: string;\n\ttype: 'password';\n\tlabel?: string;\n\tqualityIndicator?: boolean;\n\tvalidator?: {\n\t\tminLength?: number;\n\t\tmaxLength?: number;\n\t\tmaxNumericCharacterSequences?: number;\n\t\tmaxRepeatedCharacters?: number;\n\t\tmustContain?: Array<'UPPERCASE' | 'LOWERCASE' | 'NUMERIC' | 'SPECIAL'>;\n\t\trestrictedCharacters?: string;\n\t};\n};\nexport type PhoneWidget = {\n\tid: string;\n\ttype: 'phone';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type SelectWidgetOption = {\n\ttype: 'item';\n\tlabel?: string;\n\tvalue: string;\n};\nexport type SelectWidgetOptionGroup = {\n\ttype: 'group';\n\tlabel?: string;\n\toptions: Array<SelectWidgetOption>;\n};\nexport type SelectWidget = {\n\tid: string;\n\ttype: 'select';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\trender?: {\n\t\ttype: 'dropdown' | 'radio';\n\t};\n\toptions: Array<SelectWidgetOptionGroup | SelectWidgetOption>;\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type MultiSelectWidget = {\n\tid: string;\n\ttype: 'multiSelect';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: Array<string>;\n\toptions: Array<SelectWidgetOptionGroup | SelectWidgetOption>;\n\tvalidator?: {\n\t\tminSelectable?: number;\n\t\tmaxSelectable?: number;\n\t};\n};\nexport type StaticWidget = {\n\tid: string;\n\ttype: 'static';\n\tvalue: string;\n\trender?: {\n\t\ttype: 'html' | 'text';\n\t};\n};\nexport type SubmitWidget = {\n\tid: string;\n\ttype: 'submit';\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button' | 'link';\n\t\ttextColor?: string;\n\t\tbgColor?: string;\n\t\thint?: {\n\t\t\ticon?: string;\n\t\t\tvariant?: string;\n\t\t};\n\t};\n};\nexport type CloseWidget = {\n\tid: string;\n\ttype: 'close';\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button' | 'link';\n\t\ttextColor?: string;\n\t\tbgColor?: string;\n\t\thint?: {\n\t\t\ticon?: string;\n\t\t\tvariant?: string;\n\t\t};\n\t};\n};\nexport type FormWidget = {\n\tid: string;\n\ttype: 'form';\n\twidgets: Array<\n\t\tCheckboxWidget | DateWidget | InputWidget | PasscodeWidget | PasswordWidget | PhoneWidget | SelectWidget | MultiSelectWidget | StaticWidget | SubmitWidget\n\t>;\n};\nexport type Widget = {\n\ttype: 'widget';\n\tformId: string;\n\twidgetId: string;\n};\nexport type LayoutWidget = {\n\ttype: 'vertical' | 'horizontal';\n\titems: Array<Widget | LayoutWidget>;\n};\nexport type PasskeyLoginWidget = {\n\tid: string;\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tassertionOptions: PublicKeyCredentialRequestOptions;\n};\nexport type PasskeyEnrollWidget = {\n\tid: string;\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tenrollOptions: PublicKeyCredentialCreationOptions;\n};\nexport type WebauthnLoginWidget = {\n\tid: string;\n\tlabel?: string;\n\tauthenticatorType: 'deviceBiometrics' | 'securityKey';\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tassertionOptions: PublicKeyCredentialRequestOptions;\n};\nexport type WebauthnEnrollWidget = {\n\tid: string;\n\tlabel?: string;\n\tauthenticatorType: 'deviceBiometrics' | 'securityKey';\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tenrollOptions: PublicKeyCredentialCreationOptions;\n};\nexport type LoginFlowMessage = {\n\ttype: string;\n\ttext: string;\n};\nexport type LoginFlowState = {\n\thostedUrl?: string;\n\tfinalizeUrl?: string;\n\tscreen?: string;\n\tbranding?: BrandingData;\n\tforms?: Array<FormWidget>;\n\tlayout?: LayoutWidget;\n\tmessages?: Record<string, Record<string, LoginFlowMessage>> & {\n\t\tglobal?: LoginFlowMessage;\n\t};\n};\nexport type AssertionPublicKeyCredential = PublicKeyCredential & {\n\tresponse: AuthenticatorAssertionResponse;\n};\nexport type AssertionCredentialData = {\n\tid: string;\n\ttype: string;\n\trawId: string;\n\tresponse: {\n\t\tclientDataJSON: string;\n\t\tauthenticatorData: string;\n\t\tsignature: string;\n\t\tuserHandle: string;\n\t};\n};\nexport type AttestationPublicKeyCredential = PublicKeyCredential & {\n\tresponse: AuthenticatorAttestationResponse;\n};\nexport type AttestationCredentialData = {\n\tid: string;\n\ttype: string;\n\trawId: string;\n\tauthenticatorAttachment: string | null;\n\tresponse: {\n\t\tclientDataJSON: string;\n\t\tattestationObject: string;\n\t\ttransports: Array<string>;\n\t};\n};\n\nexport declare class LanguageSelectorComponent extends HTMLElement {}\n\nexport declare class NotificationComponent extends HTMLElement {\n\tdevMode: boolean;\n}\n\nexport declare class LandingComponent extends HTMLElement {\n\tactiveBlock: string;\n\tbaseUrl: string;\n\tlazy: boolean;\n\tlang: string;\n\tdebug: boolean;\n\tinitialized?: boolean;\n}\n\nexport declare class LoginComponent extends HTMLElement {\n\tmode?: string;\n\tbaseUrl?: string;\n\tsessionId?: string;\n\tlazy: boolean;\n\tparams: ExtraRequestArgs;\n\tlang: string;\n\tdebug: boolean;\n\tinitialized?: boolean;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sty-language-selector': LanguageSelectorComponent;\n\t\t'sty-notifications': NotificationComponent;\n\t\t'sty-landing': LandingComponent;\n\t\t'sty-login': LoginComponent;\n\t}\n}\n\n// endregion\n"],"names":["ResponseTypeList","ResponseModeList","TokenEndpointAuthMethodList","GrantTypeList","AlgorithmTypeList","SubjectTypeList","PromptTypeList","FallbackModeTypeList","SDKStorage","SDKLogging","SDKHttpClient"],"mappings":"gFA+BO,MAAMA,EAAmB,CAAC,OAAQ,UAAU,EAStCC,EAAmB,CAAC,QAAS,UAAU,EASvCC,EAA8B,CAAC,MAAM,EASrCC,EAAgB,CAAC,qBAAsB,eAAe,EAStDC,EAAoB,CAAC,OAAO,EAS5BC,EAAkB,CAAC,QAAQ,EAS3BC,EAAiB,CAAC,OAAQ,QAAS,QAAQ,EAS3CC,EAAuB,CAAC,WAAY,OAAO,EAwhBjD,MAAeC,CAAW,CAuBjC,CAEO,MAAeC,CAAW,CAIhC,QAMD,CAKO,MAAeC,CAAc,CACnC,OAQD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseFlow } from './flows/BaseFlow';
|
|
1
2
|
/**
|
|
2
3
|
* Makes properties of `T` required based on the keys provided in `K`.
|
|
3
4
|
*
|
|
@@ -447,10 +448,10 @@ export type SDKOptions = {
|
|
|
447
448
|
/**
|
|
448
449
|
* Specifies the mode of the SDK operation, either 'popup' or 'redirect'.
|
|
449
450
|
*
|
|
450
|
-
* @type {'popup' | 'redirect'}
|
|
451
|
+
* @type {'popup' | 'redirect' | 'native' | 'embedded' | 'custom'}
|
|
451
452
|
* @default 'redirect'
|
|
452
453
|
*/
|
|
453
|
-
mode?: 'popup' | 'redirect' | 'native' | 'embedded';
|
|
454
|
+
mode?: 'popup' | 'redirect' | 'native' | 'embedded' | 'custom';
|
|
454
455
|
/**
|
|
455
456
|
* The issuer of the tokens, typically the URL of the authorization server.
|
|
456
457
|
*
|
|
@@ -522,6 +523,12 @@ export type SDKOptions = {
|
|
|
522
523
|
* @type {SDKLoggingType}
|
|
523
524
|
*/
|
|
524
525
|
logging?: SDKLoggingType;
|
|
526
|
+
/**
|
|
527
|
+
* A custom flow handler that extends the BaseFlow class. This allows you to implement a custom authentication flow by providing your own handler.
|
|
528
|
+
*
|
|
529
|
+
* @type {FlowType}
|
|
530
|
+
*/
|
|
531
|
+
customFlow?: FlowType;
|
|
525
532
|
/**
|
|
526
533
|
* Handles the URL redirection to the specified target.
|
|
527
534
|
* You can use this method to implement custom URL handling logic, such as opening a new window or navigating to a different page.
|
|
@@ -597,6 +604,10 @@ export type SDKHttpClientType = new (...args: Array<any>) => SDKHttpClient;
|
|
|
597
604
|
* Type representing a constructor function for SDKHttpClient.
|
|
598
605
|
*/
|
|
599
606
|
export type SDKLoggingType = new (...args: Array<any>) => SDKLogging;
|
|
607
|
+
/**
|
|
608
|
+
* Type representing a constructor function for a custom flow that extends BaseFlow.
|
|
609
|
+
*/
|
|
610
|
+
export type FlowType = new (...args: Array<any>) => BaseFlow;
|
|
600
611
|
/**
|
|
601
612
|
* Http client response type.
|
|
602
613
|
*/
|
|
@@ -621,8 +632,8 @@ export type EventFunctions = {
|
|
|
621
632
|
* @param {string | null} [params.refreshToken] - The refresh token associated with the access token, if available.
|
|
622
633
|
* @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.
|
|
623
634
|
*/
|
|
624
|
-
accessTokenExpired: (params
|
|
625
|
-
accessToken
|
|
635
|
+
accessTokenExpired: (params?: {
|
|
636
|
+
accessToken?: string;
|
|
626
637
|
refreshToken?: string | null;
|
|
627
638
|
}) => Promise<void> | void;
|
|
628
639
|
/**
|
|
@@ -640,10 +651,10 @@ export type EventFunctions = {
|
|
|
640
651
|
* @param {IdTokenClaims} params.claims - The claims extracted from the ID token.
|
|
641
652
|
* @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.
|
|
642
653
|
*/
|
|
643
|
-
loggedIn: (params
|
|
644
|
-
accessToken
|
|
654
|
+
loggedIn: (params?: {
|
|
655
|
+
accessToken?: string;
|
|
645
656
|
refreshToken?: string | null;
|
|
646
|
-
claims
|
|
657
|
+
claims?: IdTokenClaims;
|
|
647
658
|
}) => Promise<void> | void;
|
|
648
659
|
/**
|
|
649
660
|
* Handler called when login has been initiated.
|
|
@@ -659,9 +670,9 @@ export type EventFunctions = {
|
|
|
659
670
|
* @param {IdTokenClaims} params.claims - The claims associated with the ID token.
|
|
660
671
|
* @returns {Promise<void> | void} A promise that resolves when the logout initiation process is complete, or void if no asynchronous operation is needed.
|
|
661
672
|
*/
|
|
662
|
-
logoutInitiated: (params
|
|
663
|
-
idToken
|
|
664
|
-
claims
|
|
673
|
+
logoutInitiated: (params?: {
|
|
674
|
+
idToken?: string;
|
|
675
|
+
claims?: IdTokenClaims;
|
|
665
676
|
}) => Promise<void> | void;
|
|
666
677
|
/**
|
|
667
678
|
* Handler called when a user session has been successfully loaded.
|
|
@@ -672,10 +683,10 @@ export type EventFunctions = {
|
|
|
672
683
|
* @param {IdTokenClaims} params.claims - The claims associated with the ID token in the session.
|
|
673
684
|
* @returns {Promise<void> | void} A promise that resolves when the session loading is complete, or void if no asynchronous operation is needed.
|
|
674
685
|
*/
|
|
675
|
-
sessionLoaded: (params
|
|
676
|
-
accessToken
|
|
686
|
+
sessionLoaded: (params?: {
|
|
687
|
+
accessToken?: string;
|
|
677
688
|
refreshToken?: string | null;
|
|
678
|
-
claims
|
|
689
|
+
claims?: IdTokenClaims;
|
|
679
690
|
}) => Promise<void> | void;
|
|
680
691
|
/**
|
|
681
692
|
* Handler called when an access token has been successfully refreshed.
|
|
@@ -686,10 +697,10 @@ export type EventFunctions = {
|
|
|
686
697
|
* @param {IdTokenClaims} params.claims - The claims extracted from the new ID token.
|
|
687
698
|
* @returns {Promise<void> | void} A promise that resolves when the token refresh is complete, or void if no asynchronous operation is needed.
|
|
688
699
|
*/
|
|
689
|
-
tokenRefreshed: (params
|
|
690
|
-
accessToken
|
|
691
|
-
refreshToken
|
|
692
|
-
claims
|
|
700
|
+
tokenRefreshed: (params?: {
|
|
701
|
+
accessToken?: string;
|
|
702
|
+
refreshToken?: string;
|
|
703
|
+
claims?: IdTokenClaims;
|
|
693
704
|
}) => Promise<void> | void;
|
|
694
705
|
/**
|
|
695
706
|
* Handler called when a token refresh operation fails.
|
|
@@ -698,8 +709,8 @@ export type EventFunctions = {
|
|
|
698
709
|
* @param {string} params.refreshToken - The refresh token that was used in the failed refresh operation.
|
|
699
710
|
* @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.
|
|
700
711
|
*/
|
|
701
|
-
tokenRefreshFailed: (params
|
|
702
|
-
refreshToken
|
|
712
|
+
tokenRefreshFailed: (params?: {
|
|
713
|
+
refreshToken?: string;
|
|
703
714
|
}) => Promise<void> | void;
|
|
704
715
|
/**
|
|
705
716
|
* Handler called when a token has been successfully revoked.
|
|
@@ -709,9 +720,9 @@ export type EventFunctions = {
|
|
|
709
720
|
* @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was revoked.
|
|
710
721
|
* @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.
|
|
711
722
|
*/
|
|
712
|
-
tokenRevoked: (params
|
|
713
|
-
token
|
|
714
|
-
tokenTypeHint
|
|
723
|
+
tokenRevoked: (params?: {
|
|
724
|
+
token?: string;
|
|
725
|
+
tokenTypeHint?: 'refresh_token' | 'access_token';
|
|
715
726
|
}) => Promise<void> | void;
|
|
716
727
|
/**
|
|
717
728
|
* Handler called when a token revocation operation fails.
|
|
@@ -721,9 +732,9 @@ export type EventFunctions = {
|
|
|
721
732
|
* @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was attempted to be revoked.
|
|
722
733
|
* @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.
|
|
723
734
|
*/
|
|
724
|
-
tokenRevokeFailed: (params
|
|
725
|
-
token
|
|
726
|
-
tokenTypeHint
|
|
735
|
+
tokenRevokeFailed: (params?: {
|
|
736
|
+
token?: string;
|
|
737
|
+
tokenTypeHint?: 'refresh_token' | 'access_token';
|
|
727
738
|
}) => Promise<void> | void;
|
|
728
739
|
};
|
|
729
740
|
/**
|
|
@@ -971,7 +982,7 @@ export type CheckboxWidget = {
|
|
|
971
982
|
label?: string;
|
|
972
983
|
readonly?: boolean;
|
|
973
984
|
value?: boolean;
|
|
974
|
-
render
|
|
985
|
+
render?: {
|
|
975
986
|
type: 'checkboxHidden' | 'checkboxShown';
|
|
976
987
|
labelType: 'text' | 'html';
|
|
977
988
|
};
|
|
@@ -983,10 +994,9 @@ export type DateWidget = {
|
|
|
983
994
|
id: string;
|
|
984
995
|
type: 'date';
|
|
985
996
|
label?: string;
|
|
986
|
-
placeholder?: string;
|
|
987
997
|
readonly?: boolean;
|
|
988
998
|
value?: string;
|
|
989
|
-
render
|
|
999
|
+
render?: {
|
|
990
1000
|
type: 'native' | 'fieldSet';
|
|
991
1001
|
};
|
|
992
1002
|
validator?: {
|
|
@@ -1000,7 +1010,6 @@ export type InputWidget = {
|
|
|
1000
1010
|
type: 'input';
|
|
1001
1011
|
label?: string;
|
|
1002
1012
|
value?: string;
|
|
1003
|
-
placeholder?: string;
|
|
1004
1013
|
readonly?: boolean;
|
|
1005
1014
|
autocomplete?: string;
|
|
1006
1015
|
inputmode: any;
|
|
@@ -1061,9 +1070,8 @@ export type SelectWidget = {
|
|
|
1061
1070
|
type: 'select';
|
|
1062
1071
|
label?: string;
|
|
1063
1072
|
readonly?: boolean;
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
render: {
|
|
1073
|
+
value?: string;
|
|
1074
|
+
render?: {
|
|
1067
1075
|
type: 'dropdown' | 'radio';
|
|
1068
1076
|
};
|
|
1069
1077
|
options: Array<SelectWidgetOptionGroup | SelectWidgetOption>;
|
|
@@ -1076,11 +1084,7 @@ export type MultiSelectWidget = {
|
|
|
1076
1084
|
type: 'multiSelect';
|
|
1077
1085
|
label?: string;
|
|
1078
1086
|
readonly?: boolean;
|
|
1079
|
-
|
|
1080
|
-
placeholder?: string;
|
|
1081
|
-
render: {
|
|
1082
|
-
type: 'dropdown' | 'checkbox';
|
|
1083
|
-
};
|
|
1087
|
+
value?: Array<string>;
|
|
1084
1088
|
options: Array<SelectWidgetOptionGroup | SelectWidgetOption>;
|
|
1085
1089
|
validator?: {
|
|
1086
1090
|
minSelectable?: number;
|
|
@@ -1091,7 +1095,7 @@ export type StaticWidget = {
|
|
|
1091
1095
|
id: string;
|
|
1092
1096
|
type: 'static';
|
|
1093
1097
|
value: string;
|
|
1094
|
-
render
|
|
1098
|
+
render?: {
|
|
1095
1099
|
type: 'html' | 'text';
|
|
1096
1100
|
};
|
|
1097
1101
|
};
|
|
@@ -1099,7 +1103,7 @@ export type SubmitWidget = {
|
|
|
1099
1103
|
id: string;
|
|
1100
1104
|
type: 'submit';
|
|
1101
1105
|
label?: string;
|
|
1102
|
-
render
|
|
1106
|
+
render?: {
|
|
1103
1107
|
type: 'button' | 'link';
|
|
1104
1108
|
textColor?: string;
|
|
1105
1109
|
bgColor?: string;
|
|
@@ -1113,7 +1117,7 @@ export type CloseWidget = {
|
|
|
1113
1117
|
id: string;
|
|
1114
1118
|
type: 'close';
|
|
1115
1119
|
label?: string;
|
|
1116
|
-
render
|
|
1120
|
+
render?: {
|
|
1117
1121
|
type: 'button' | 'link';
|
|
1118
1122
|
textColor?: string;
|
|
1119
1123
|
bgColor?: string;
|
|
@@ -1140,28 +1144,22 @@ export type LayoutWidget = {
|
|
|
1140
1144
|
export type PasskeyLoginWidget = {
|
|
1141
1145
|
id: string;
|
|
1142
1146
|
label?: string;
|
|
1143
|
-
render
|
|
1147
|
+
render?: {
|
|
1144
1148
|
type: 'button';
|
|
1145
1149
|
hint?: {
|
|
1146
1150
|
variant?: string;
|
|
1147
1151
|
};
|
|
1148
|
-
notification?: {
|
|
1149
|
-
cancelled?: string;
|
|
1150
|
-
};
|
|
1151
1152
|
};
|
|
1152
1153
|
assertionOptions: PublicKeyCredentialRequestOptions;
|
|
1153
1154
|
};
|
|
1154
1155
|
export type PasskeyEnrollWidget = {
|
|
1155
1156
|
id: string;
|
|
1156
1157
|
label?: string;
|
|
1157
|
-
render
|
|
1158
|
+
render?: {
|
|
1158
1159
|
type: 'button';
|
|
1159
1160
|
hint?: {
|
|
1160
1161
|
variant?: string;
|
|
1161
1162
|
};
|
|
1162
|
-
notification?: {
|
|
1163
|
-
cancelled?: string;
|
|
1164
|
-
};
|
|
1165
1163
|
};
|
|
1166
1164
|
enrollOptions: PublicKeyCredentialCreationOptions;
|
|
1167
1165
|
};
|
|
@@ -1169,14 +1167,11 @@ export type WebauthnLoginWidget = {
|
|
|
1169
1167
|
id: string;
|
|
1170
1168
|
label?: string;
|
|
1171
1169
|
authenticatorType: 'deviceBiometrics' | 'securityKey';
|
|
1172
|
-
render
|
|
1170
|
+
render?: {
|
|
1173
1171
|
type: 'button';
|
|
1174
1172
|
hint?: {
|
|
1175
1173
|
variant?: string;
|
|
1176
1174
|
};
|
|
1177
|
-
notification?: {
|
|
1178
|
-
cancelled?: string;
|
|
1179
|
-
};
|
|
1180
1175
|
};
|
|
1181
1176
|
assertionOptions: PublicKeyCredentialRequestOptions;
|
|
1182
1177
|
};
|
|
@@ -1184,14 +1179,11 @@ export type WebauthnEnrollWidget = {
|
|
|
1184
1179
|
id: string;
|
|
1185
1180
|
label?: string;
|
|
1186
1181
|
authenticatorType: 'deviceBiometrics' | 'securityKey';
|
|
1187
|
-
render
|
|
1182
|
+
render?: {
|
|
1188
1183
|
type: 'button';
|
|
1189
1184
|
hint?: {
|
|
1190
1185
|
variant?: string;
|
|
1191
1186
|
};
|
|
1192
|
-
notification?: {
|
|
1193
|
-
cancelled?: string;
|
|
1194
|
-
};
|
|
1195
1187
|
};
|
|
1196
1188
|
enrollOptions: PublicKeyCredentialCreationOptions;
|
|
1197
1189
|
};
|