UNPKG

@passageidentity/passage-js

Version:

Passage Complete for Web - Build a full custom passwordless authentication experience in any modern web app with Passage by 1Password.

1,660 lines (1,596 loc) 124 kB
import { ErrorObject } from 'serialize-error'; import { ICreateCredentialFeatures } from '@passageidentity/webauthnutils'; import { IGetCredentialFeatures } from '@passageidentity/webauthnutils'; declare interface ActivateMagicLinkOperationRequest { appId: string; activateMagicLinkRequest: ActivateMagicLinkRequest; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ActivateMagicLinkRequest */ declare interface ActivateMagicLinkRequest { /** * * @type {string} * @memberof ActivateMagicLinkRequest */ magicLink: string; } declare interface ActivateOneTimePasscodeOperationRequest { appId: string; activateOneTimePasscodeRequest: ActivateOneTimePasscodeRequest; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ActivateOneTimePasscodeRequest */ declare interface ActivateOneTimePasscodeRequest { /** * * @type {string} * @memberof ActivateOneTimePasscodeRequest */ otp: string; /** * The ID of the one-time passcode. * @type {string} * @memberof ActivateOneTimePasscodeRequest */ otpId: string; } /** * * @export * @interface AddDeviceFinishRequest */ declare interface AddDeviceFinishRequest { /** * * @type {string} * @memberof AddDeviceFinishRequest */ handshakeId: string; /** * * @type {CredentialCreationResponse} * @memberof AddDeviceFinishRequest */ handshakeResponse: CredentialCreationResponse; /** * * @type {string} * @memberof AddDeviceFinishRequest */ userId: string; } /** * * @export * @interface AddDeviceStartResponse */ declare interface AddDeviceStartResponse { /** * * @type {CredentialCreationChallenge} * @memberof AddDeviceStartResponse */ handshake: CredentialCreationChallenge; /** * * @type {User} * @memberof AddDeviceStartResponse */ user?: User | null; } /** * * @export * @interface App */ declare interface App { /** * * @type {string} * @memberof App */ allowedIdentifier: string; /** * Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. * @type {string} * @memberof App * @deprecated */ authFallbackMethod: AppAuthFallbackMethodEnum; /** * Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. * @type {number} * @memberof App * @deprecated */ authFallbackMethodTtl: number; /** * * @type {AuthMethods} * @memberof App */ authMethods: AuthMethods; /** * * @type {string} * @memberof App */ authOrigin: string; /** * * @type {string} * @memberof App */ defaultLanguage: string; /** * * @type {ElementCustomization} * @memberof App */ elementCustomization: ElementCustomization; /** * * @type {ElementCustomization} * @memberof App */ elementCustomizationDark: ElementCustomization; /** * * @type {boolean} * @memberof App */ ephemeral: boolean; /** * * @type {string} * @memberof App */ id: string; /** * * @type {Layouts} * @memberof App */ layouts: Layouts; /** * * @type {string} * @memberof App */ loginUrl: string; /** * * @type {string} * @memberof App */ name: string; /** * * @type {boolean} * @memberof App */ passageBranding: boolean; /** * * @type {boolean} * @memberof App */ publicSignup: boolean; /** * * @type {boolean} * @memberof App */ profileManagement: boolean; /** * * @type {string} * @memberof App */ redirectUrl: string; /** * * @type {boolean} * @memberof App */ requireEmailVerification: boolean; /** * * @type {boolean} * @memberof App */ requireIdentifierVerification: boolean; /** * * @type {string} * @memberof App */ requiredIdentifier: string; /** * * @type {string} * @memberof App */ rsaPublicKey: string; /** * * @type {number} * @memberof App */ sessionTimeoutLength: number; /** * * @type {SocialConnections} * @memberof App */ socialConnections: SocialConnections; /** * * @type {Array<UserMetadataField>} * @memberof App */ userMetadataSchema: Array<UserMetadataField>; } /** * @export * @enum {string} */ export declare enum AppAuthFallbackMethodEnum { MagicLink = "magic_link", Otp = "otp", None = "none" } /** * @export * @enum {string} */ declare enum AppleOauth2CallbackDefaultDevErrorEnum { UserCancelledAuthorize = "user_cancelled_authorize" } declare interface AppleOauth2CallbackDefaultDevRequest { state: string; code?: string; idToken?: string; user?: string; error?: AppleOauth2CallbackDefaultDevErrorEnum; } /** * @export * @enum {string} */ declare enum AppleOauth2CallbackErrorEnum { UserCancelledAuthorize = "user_cancelled_authorize" } declare interface AppleOauth2CallbackRequest { appId: string; state: string; code?: string; idToken?: string; user?: string; error?: AppleOauth2CallbackErrorEnum; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AppleSocialConnection */ export declare interface AppleSocialConnection { /** * The external ID of the Social Connection. * @type {string} * @memberof AppleSocialConnection */ providerId: string; /** * * @type {Date} * @memberof AppleSocialConnection */ createdAt: Date; /** * * @type {Date} * @memberof AppleSocialConnection */ lastLoginAt: Date; /** * The email of connected social user. * @type {string} * @memberof AppleSocialConnection */ providerIdentifier: string; } /** * */ declare class AppsApi extends runtime.BaseAPI { /** * Get information about an application. * Get App */ getAppRaw(requestParameters: GetAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAppResponse>>; /** * Get information about an application. * Get App */ getApp(appId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAppResponse>; } declare type AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>; /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * selects the type of authentication that will be used in this WebAuthN flow request * @export * @enum {string} */ declare enum AuthenticatorAttachment_2 { Platform = "platform", CrossPlatform = "cross-platform", Any = "any" } export { AuthenticatorAttachment_2 as AuthenticatorAttachment } /** * Denotes what methods this app is allowed to use for authentication with configurations * @export * @interface AuthMethods */ export declare interface AuthMethods { /** * * @type {object} * @memberof AuthMethods */ passkeys?: object; /** * * @type {OtpAuthMethod} * @memberof AuthMethods */ otp?: OtpAuthMethod; /** * * @type {MagicLinkAuthMethod} * @memberof AuthMethods */ magicLink?: MagicLinkAuthMethod; } /** * * @export * @interface AuthResponse */ declare interface AuthResponse { /** * * @type {AuthResult} * @memberof AuthResponse */ authResult: AuthResult; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AuthResult */ export declare interface AuthResult { /** * * @type {string} * @memberof AuthResult */ authToken: string; /** * * @type {string} * @memberof AuthResult */ redirectUrl: string; /** * * @type {string} * @memberof AuthResult */ refreshToken?: string; /** * * @type {number} * @memberof AuthResult */ refreshTokenExpiration?: number; } /** * This is the base class for all generated API classes. */ declare class BaseAPI { protected configuration: Configuration; private static readonly jsonRegex; private middleware; constructor(configuration?: Configuration); withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T; withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T; withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T; /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param mime - MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ protected isJsonMime(mime: string | null | undefined): boolean; protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>; private createFetchParams; private fetchApi; /** * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ private clone; } /**@private */ export declare const captureEvent: (props: ICaptureEventProps) => Promise<void>; /**@private */ export declare interface CaptureEventBody { error?: Error | string; serializedError?: ErrorObject; message?: string; project: PassageSentryProject; release?: string; dsn?: string; environment?: string; version?: string; } /**@private */ export declare const cleanSentryConfig: (config: ISentryConfig) => ISentryConfig; declare class Configuration { private configuration; constructor(configuration?: ConfigurationParameters); set config(configuration: Configuration); get basePath(): string; get fetchApi(): FetchAPI | undefined; get middleware(): Middleware[]; get queryParamsStringify(): (params: HTTPQuery) => string; get username(): string | undefined; get password(): string | undefined; get apiKey(): ((name: string) => string | Promise<string>) | undefined; get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined; get headers(): HTTPHeaders | undefined; get credentials(): RequestCredentials | undefined; } declare interface ConfigurationParameters { basePath?: string; fetchApi?: FetchAPI; middleware?: Middleware[]; queryParamsStringify?: (params: HTTPQuery) => string; username?: string; password?: string; apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); headers?: HTTPHeaders; credentials?: RequestCredentials; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CreateUserParams */ export declare interface CreateUserParams { /** * * @type {string} * @memberof CreateUserParams */ identifier: string; /** * * @type {object} * @memberof CreateUserParams */ userMetadata?: object; } /** * * @export * @interface Credential */ declare interface Credential_2 { /** * The first time this webAuthn device was used to authenticate the user * @type {string} * @memberof Credential */ createdAt: string; /** * The CredID for this webAuthn device (encoded to match what is stored in psg_cred_obj) * @type {string} * @memberof Credential */ credId: string; /** * The friendly name for the webAuthn device used to authenticate * @type {string} * @memberof Credential */ friendlyName: string; /** * The ID of the webAuthn device used for authentication * @type {string} * @memberof Credential */ id: string; /** * The last time this webAuthn device was used to authenticate the user * @type {string} * @memberof Credential */ lastLoginAt: string; /** * * @type {WebAuthnType} * @memberof Credential */ type: WebAuthnType; /** * The last time this webAuthn device was updated * @type {string} * @memberof Credential */ updatedAt: string; /** * How many times this webAuthn device has been used to authenticate the user * @type {number} * @memberof Credential */ usageCount: number; /** * The UserID for this webAuthn device * @type {string} * @memberof Credential */ userId: string; /** * * @type {WebAuthnIcons} * @memberof Credential */ icons: WebAuthnIcons; } export { Credential_2 as Credential } /** * * @export * @interface CredentialCreation */ declare interface CredentialCreation { /** * * @type {CredentialCreationPublicKey} * @memberof CredentialCreation */ publicKey?: CredentialCreationPublicKey; } /** * * @export * @interface CredentialCreationChallenge */ declare interface CredentialCreationChallenge { /** * * @type {CredentialCreation} * @memberof CredentialCreationChallenge */ challenge: CredentialCreation; /** * * @type {string} * @memberof CredentialCreationChallenge */ id: string; } /** * * @export * @interface CredentialCreationPublicKey */ declare interface CredentialCreationPublicKey { /** * * @type {string} * @memberof CredentialCreationPublicKey */ attestation?: string; /** * * @type {CredentialCreationPublicKeyAuthenticatorSelection} * @memberof CredentialCreationPublicKey */ authenticatorSelection?: CredentialCreationPublicKeyAuthenticatorSelection; /** * * @type {string} * @memberof CredentialCreationPublicKey */ challenge?: string; /** * * @type {Array<CredentialCreationPublicKeyExcludeCredentialsInner>} * @memberof CredentialCreationPublicKey */ excludeCredentials?: Array<CredentialCreationPublicKeyExcludeCredentialsInner>; /** * * @type {object} * @memberof CredentialCreationPublicKey */ extensions?: object; /** * * @type {Array<CredentialCreationPublicKeyPubKeyCredParamsInner>} * @memberof CredentialCreationPublicKey */ pubKeyCredParams?: Array<CredentialCreationPublicKeyPubKeyCredParamsInner>; /** * * @type {CredentialCreationPublicKeyRp} * @memberof CredentialCreationPublicKey */ rp?: CredentialCreationPublicKeyRp; /** * * @type {number} * @memberof CredentialCreationPublicKey */ timeout?: number; /** * * @type {CredentialCreationPublicKeyUser} * @memberof CredentialCreationPublicKey */ user?: CredentialCreationPublicKeyUser; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CredentialCreationPublicKeyAuthenticatorSelection */ declare interface CredentialCreationPublicKeyAuthenticatorSelection { /** * AuthenticatorAttachment If this member is present, eligible authenticators are filtered to only * authenticators attached with the specified AuthenticatorAttachment enum. * @type {string} * @memberof CredentialCreationPublicKeyAuthenticatorSelection */ authenticatorAttachment?: string; /** * RequireResidentKey this member describes the Relying Party's requirements regarding resident * credentials. If the parameter is set to true, the authenticator MUST create a client-side-resident * public key credential source when creating a public key credential. * @type {boolean} * @memberof CredentialCreationPublicKeyAuthenticatorSelection */ requireResidentKey?: boolean; /** * ResidentKey this member describes the Relying Party's requirements regarding resident * credentials per Webauthn Level 2. * @type {string} * @memberof CredentialCreationPublicKeyAuthenticatorSelection */ residentKey?: string; /** * UserVerification This member describes the Relying Party's requirements regarding user verification for * the create() operation. Eligible authenticators are filtered to only those capable of satisfying this * requirement. * @type {string} * @memberof CredentialCreationPublicKeyAuthenticatorSelection */ userVerification?: string; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CredentialCreationPublicKeyExcludeCredentialsInner */ declare interface CredentialCreationPublicKeyExcludeCredentialsInner { /** * CredentialID The ID of a credential to allow/disallow. * @type {string} * @memberof CredentialCreationPublicKeyExcludeCredentialsInner */ id?: string; /** * The authenticator transports that can be used. * @type {Array<string>} * @memberof CredentialCreationPublicKeyExcludeCredentialsInner */ transports?: Array<string>; /** * The valid credential types. * @type {string} * @memberof CredentialCreationPublicKeyExcludeCredentialsInner */ type?: string; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CredentialCreationPublicKeyPubKeyCredParamsInner */ declare interface CredentialCreationPublicKeyPubKeyCredParamsInner { /** * * @type {number} * @memberof CredentialCreationPublicKeyPubKeyCredParamsInner */ alg?: number; /** * * @type {string} * @memberof CredentialCreationPublicKeyPubKeyCredParamsInner */ type?: string; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CredentialCreationPublicKeyRp */ declare interface CredentialCreationPublicKeyRp { /** * A serialized URL which resolves to an image associated with the entity. For example, * this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori * authenticated URL. Authenticators MUST accept and store a 128-byte minimum length for * an icon member’s value. Authenticators MAY ignore an icon member’s value if its length * is greater than 128 bytes. The URL’s scheme MAY be "data" to avoid fetches of the URL, * at the cost of needing more storage. * * Deprecated: this has been removed from the specification recommendations. * @type {string} * @memberof CredentialCreationPublicKeyRp */ icon?: string; /** * A unique identifier for the Relying Party entity, which sets the RP ID. * @type {string} * @memberof CredentialCreationPublicKeyRp */ id?: string; /** * A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: * * When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, * intended only for display. For example, "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". * * When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is * intended only for display, i.e., aiding the user in determining the difference between user accounts with similar * displayNames. For example, "alexm", "alex.p.mueller@example.com" or "+14255551234". * @type {string} * @memberof CredentialCreationPublicKeyRp */ name?: string; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CredentialCreationPublicKeyUser */ declare interface CredentialCreationPublicKeyUser { /** * A human-palatable name for the user account, intended only for display. * For example, "Alex P. Müller" or "田中 倫". The Relying Party SHOULD let * the user choose this, and SHOULD NOT restrict the choice more than necessary. * @type {string} * @memberof CredentialCreationPublicKeyUser */ displayName?: string; /** * A serialized URL which resolves to an image associated with the entity. For example, * this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori * authenticated URL. Authenticators MUST accept and store a 128-byte minimum length for * an icon member’s value. Authenticators MAY ignore an icon member’s value if its length * is greater than 128 bytes. The URL’s scheme MAY be "data" to avoid fetches of the URL, * at the cost of needing more storage. * * Deprecated: this has been removed from the specification recommendations. * @type {string} * @memberof CredentialCreationPublicKeyUser */ icon?: string; /** * ID is the user handle of the user account entity. To ensure secure operation, * authentication and authorization decisions MUST be made on the basis of this id * member, not the displayName nor name members. See Section 6.1 of * [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266). * @type {string} * @memberof CredentialCreationPublicKeyUser */ id?: string; /** * A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: * * When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, * intended only for display. For example, "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". * * When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is * intended only for display, i.e., aiding the user in determining the difference between user accounts with similar * displayNames. For example, "alexm", "alex.p.mueller@example.com" or "+14255551234". * @type {string} * @memberof CredentialCreationPublicKeyUser */ name?: string; } /** * * @export * @interface CredentialCreationResponse */ declare interface CredentialCreationResponse { /** * * @type {string} * @memberof CredentialCreationResponse */ authenticatorAttachment?: string; /** * * @type {object} * @memberof CredentialCreationResponse */ clientExtensionResults?: object; /** * ID is The credential's identifier. The requirements for the * identifier are distinct for each type of credential. It might * represent a username for username/password tuples, for example. * @type {string} * @memberof CredentialCreationResponse */ id?: string; /** * * @type {string} * @memberof CredentialCreationResponse */ rawId?: string; /** * * @type {CredentialCreationResponseResponse} * @memberof CredentialCreationResponse */ response?: CredentialCreationResponseResponse; /** * * @type {Array<string>} * @memberof CredentialCreationResponse */ transports?: Array<string>; /** * Type is the value of the object's interface object's [[type]] slot, * which specifies the credential type represented by this object. * This should be type "public-key" for Webauthn credentials. * @type {string} * @memberof CredentialCreationResponse */ type?: string; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CredentialCreationResponseResponse */ declare interface CredentialCreationResponseResponse { /** * AttestationObject is the byte slice version of attestationObject. * This attribute contains an attestation object, which is opaque to, and * cryptographically protected against tampering by, the client. The * attestation object contains both authenticator data and an attestation * statement. The former contains the AAGUID, a unique credential ID, and * the credential public key. The contents of the attestation statement are * determined by the attestation statement format used by the authenticator. * It also contains any additional information that the Relying Party's server * requires to validate the attestation statement, as well as to decode and * validate the authenticator data along with the JSON-serialized client data. * @type {string} * @memberof CredentialCreationResponseResponse */ attestationObject?: string; /** * From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson * This attribute contains a JSON serialization of the client data passed to the authenticator * by the client in its call to either create() or get(). * @type {string} * @memberof CredentialCreationResponseResponse */ clientDataJSON?: string; /** * * @type {Array<string>} * @memberof CredentialCreationResponseResponse */ transports?: Array<string>; } /** * * @export * @interface CurrentUser */ export declare interface CurrentUser { /** * When this user was created * @type {string} * @memberof CurrentUser */ createdAt: string; /** * The user's email * @type {string} * @memberof CurrentUser */ email: string; /** * Whether or not the user's email has been verified * @type {boolean} * @memberof CurrentUser */ emailVerified: boolean; /** * The user ID * @type {string} * @memberof CurrentUser */ id: string; /** * The last time this user logged in * @type {string} * @memberof CurrentUser */ lastLoginAt: string; /** * How many times the user has successfully logged in * @type {number} * @memberof CurrentUser */ loginCount: number; /** * The user's phone * @type {string} * @memberof CurrentUser */ phone: string; /** * Whether or not the user's phone has been verified * @type {boolean} * @memberof CurrentUser */ phoneVerified: boolean; /** * * @type {UserSocialConnections} * @memberof CurrentUser */ socialConnections: UserSocialConnections; /** * * @type {UserStatus} * @memberof CurrentUser */ status: UserStatus; /** * When this user was last updated * @type {string} * @memberof CurrentUser */ updatedAt: string; /** * * @type {object} * @memberof CurrentUser */ userMetadata: object | null; /** * Whether or not the user has authenticated via webAuthn before (if len(WebAuthnDevices) > 0) * @type {boolean} * @memberof CurrentUser */ webauthn: boolean; /** * The list of devices this user has authenticated with via webAuthn * @type {Array<Credential>} * @memberof CurrentUser */ webauthnDevices: Array<Credential_2>; /** * List of credential types that user has created * @type {Array<WebAuthnType>} * @memberof CurrentUser */ webauthnTypes: Array<WebAuthnType>; } /** * */ declare class CurrentuserApi extends runtime.BaseAPI { /** * Revoke a device by ID for the current user. User must be authenticated via a bearer token. * Revoke Device */ deleteCurrentuserDeviceRaw(requestParameters: DeleteCurrentuserDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>; /** * Revoke a device by ID for the current user. User must be authenticated via a bearer token. * Revoke Device */ deleteCurrentuserDevice(appId: string, deviceId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>; /** * Deletes a social connection for the current user. User must be authenticated via a bearer token. * Delete Social Connection */ deleteCurrentuserSocialConnectionRaw(requestParameters: DeleteCurrentuserSocialConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>; /** * Deletes a social connection for the current user. User must be authenticated via a bearer token. * Delete Social Connection */ deleteCurrentuserSocialConnection(appId: string, socialConnectionType: DeleteCurrentuserSocialConnectionSocialConnectionTypeEnum, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>; /** * Get information about a user that is currently authenticated via bearer token. * Get Current User */ getCurrentuserRaw(requestParameters: GetCurrentuserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CurrentUserResponse>>; /** * Get information about a user that is currently authenticated via bearer token. * Get Current User */ getCurrentuser(appId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CurrentUserResponse>; /** * List all WebAuthn devices for the authenticated user. User must be authenticated via bearer token. * List Devices */ getCurrentuserDevicesRaw(requestParameters: GetCurrentuserDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CurrentUserDevices>>; /** * List all WebAuthn devices for the authenticated user. User must be authenticated via bearer token. * List Devices */ getCurrentuserDevices(appId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CurrentUserDevices>; /** * Get the user-metadata for the current user. * Get user\'s metadata */ getCurrentuserMetadataRaw(requestParameters: GetCurrentuserMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserMetadataResponse>>; /** * Get the user-metadata for the current user. * Get user\'s metadata */ getCurrentuserMetadata(appId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserMetadataResponse>; /** * Gets social connections for the current user. User must be authenticated via a bearer token. * Get Social Connections */ getCurrentuserSocialConnectionsRaw(requestParameters: GetCurrentuserSocialConnectionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SocialConnectionsResponse>>; /** * Gets social connections for the current user. User must be authenticated via a bearer token. * Get Social Connections */ getCurrentuserSocialConnections(appId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SocialConnectionsResponse>; /** * Complete a WebAuthn add device operation for the current user. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns the created device for the user. User must be authenticated via a bearer token. * Finish WebAuthn Add Device */ postCurrentuserAddDeviceFinishRaw(requestParameters: PostCurrentuserAddDeviceFinishRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CurrentUserDevice>>; /** * Complete a WebAuthn add device operation for the current user. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns the created device for the user. User must be authenticated via a bearer token. * Finish WebAuthn Add Device */ postCurrentuserAddDeviceFinish(appId: string, addDeviceFinishRequest: AddDeviceFinishRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CurrentUserDevice>; /** * Initiate a WebAuthn add device operation for the current user. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. User must be authenticated via a bearer token. * Start WebAuthn Add Device */ postCurrentuserAddDeviceStartRaw(requestParameters: PostCurrentuserAddDeviceStartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AddDeviceStartResponse>>; /** * Initiate a WebAuthn add device operation for the current user. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. User must be authenticated via a bearer token. * Start WebAuthn Add Device */ postCurrentuserAddDeviceStart(appId: string, currentUserDevicesStartRequest?: CurrentUserDevicesStartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AddDeviceStartResponse>; /** * Update a device by ID for the current user. Currently the only field that can be updated is the friendly name. User must be authenticated via a bearer token. * Update Device */ updateCurrentuserDeviceRaw(requestParameters: UpdateCurrentuserDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CurrentUserDevice>>; /** * Update a device by ID for the current user. Currently the only field that can be updated is the friendly name. User must be authenticated via a bearer token. * Update Device */ updateCurrentuserDevice(appId: string, deviceId: string, updateDeviceRequest: UpdateDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CurrentUserDevice>; /** * Update the metadata for the current user. Only valid metadata fields are accepted. Invalid metadata fields that are present will abort the update. User must be authenticated via a bearer token. * Update user\'s metadata */ updateCurrentuserMetadataRaw(requestParameters: UpdateCurrentuserMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CurrentUserResponse>>; /** * Update the metadata for the current user. Only valid metadata fields are accepted. Invalid metadata fields that are present will abort the update. User must be authenticated via a bearer token. * Update user\'s metadata */ updateCurrentuserMetadata(appId: string, updateMetadataRequest: UpdateMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CurrentUserResponse>; /** * Initiate an email change for the authenticated user. An email change requires verification, so an email will be sent to the user which they must verify before the email change takes effect. * Change Email */ updateEmailCurrentuserRaw(requestParameters: UpdateEmailCurrentuserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MagicLinkResponse>>; /** * Initiate an email change for the authenticated user. An email change requires verification, so an email will be sent to the user which they must verify before the email change takes effect. * Change Email */ updateEmailCurrentuser(appId: string, updateUserEmailRequest: UpdateUserEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MagicLinkResponse>; /** * Initiate a phone number change for the authenticated user. An phone number change requires verification, so an SMS with a link will be sent to the user which they must verify before the phone number change takes effect. * Change Phone */ updatePhoneCurrentuserRaw(requestParameters: UpdatePhoneCurrentuserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MagicLinkResponse>>; /** * Initiate a phone number change for the authenticated user. An phone number change requires verification, so an SMS with a link will be sent to the user which they must verify before the phone number change takes effect. * Change Phone */ updatePhoneCurrentuser(appId: string, updateUserPhoneRequest: UpdateUserPhoneRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MagicLinkResponse>; } /** * * @export * @interface CurrentUserDevice */ declare interface CurrentUserDevice { /** * * @type {Credential} * @memberof CurrentUserDevice */ device: Credential_2; } /** * * @export * @interface CurrentUserDevices */ declare interface CurrentUserDevices { /** * * @type {Array<Credential>} * @memberof CurrentUserDevices */ devices: Array<Credential_2>; } /** * * @export * @interface CurrentUserDevicesStartRequest */ declare interface CurrentUserDevicesStartRequest { /** * * @type {AuthenticatorAttachment} * @memberof CurrentUserDevicesStartRequest */ authenticatorAttachment?: AuthenticatorAttachment_2; } /** * * @export * @interface CurrentUserResponse */ declare interface CurrentUserResponse { /** * * @type {CurrentUser} * @memberof CurrentUserResponse */ user: CurrentUser; } declare interface CurrentuserSocialLinkAccountRequest { appId: string; code: string; verifier: string; } declare interface DeleteCurrentuserDeviceRequest { appId: string; deviceId: string; } declare interface DeleteCurrentuserSocialConnectionRequest { appId: string; socialConnectionType: DeleteCurrentuserSocialConnectionSocialConnectionTypeEnum; } /** * @export * @enum {string} */ declare enum DeleteCurrentuserSocialConnectionSocialConnectionTypeEnum { Apple = "apple", Github = "github", Google = "google" } /** * * @export * @interface ElementCustomization */ export declare interface ElementCustomization { /** * Container background color in hex. * Default is `#ffffff` in light mode & `#383838` in dark mode. * * @type {string} * @memberof ElementCustomization */ passageContainerBackgroundColor?: string; /** * Maximum width of container (px) * @type {number} * @memberof ElementCustomization */ passageContainerMaxWidth?: number; /** * Input box background color in hex. * Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. * * @type {string} * @memberof ElementCustomization */ passageInputBoxBackgroundColor?: string; /** * Input box border radius (px) * @type {number} * @memberof ElementCustomization */ passageInputBoxBorderRadius?: number; /** * * @type {FontFamily} * @memberof ElementCustomization */ passageHeaderFontFamily?: FontFamily; /** * * @type {FontFamily} * @memberof ElementCustomization */ passageBodyFontFamily?: FontFamily; /** * Header text color in hex. * Default is `#222222` in light mode & `#f3f3f3` in dark mode. * * @type {string} * @memberof ElementCustomization */ passageHeaderTextColor?: string; /** * Body text color in hex. * Default is `#222222` in light mode & `#f3f3f3` in dark mode. * * @type {string} * @memberof ElementCustomization */ passageBodyTextColor?: string; /** * Primary button background colour (hex) * @type {string} * @memberof ElementCustomization */ passagePrimaryButtonBackgroundColor?: string; /** * Primary button font colour (hex) * @type {string} * @memberof ElementCustomization */ passagePrimaryButtonTextColor?: string; /** * Primary button background on hover (hex) * @type {string} * @memberof ElementCustomization */ passagePrimaryButtonHoverColor?: string; /** * Primary button border radius (px) * @type {number} * @memberof ElementCustomization */ passagePrimaryButtonBorderRadius?: number; /** * Primary button border color * @type {string} * @memberof ElementCustomization */ passagePrimaryButtonBorderColor?: string; /** * Primary button border width (px) * @type {number} * @memberof ElementCustomization */ passagePrimaryButtonBorderWidth?: number; /** * Secondary button background colour (hex) * @type {string} * @memberof ElementCustomization */ passageSecondaryButtonBackgroundColor?: string; /** * Secondary button font colour (hex) * @type {string} * @memberof ElementCustomization */ passageSecondaryButtonTextColor?: string; /** * Secondary button background on hover (hex) * @type {string} * @memberof ElementCustomization */ passageSecondaryButtonHoverColor?: string; /** * Secondary button border radius (px) * @type {number} * @memberof ElementCustomization */ passageSecondaryButtonBorderRadius?: number; /** * Secondary button border color * @type {string} * @memberof ElementCustomization */ passageSecondaryButtonBorderColor?: string; /** * Secondary button border width (px) * @type {number} * @memberof ElementCustomization */ passageSecondaryButtonBorderWidth?: number; } declare interface ErrorContext { fetch: FetchAPI; url: string; init: RequestInit; error: unknown; response?: Response; } declare interface ExchangeSocialIdTokenRequest { appId: string; idTokenRequest: IdTokenRequest; } declare interface ExchangeSocialTokenRequest { appId: string; code: string; verifier: string; } declare type FetchAPI = WindowOrWorkerGlobalScope['fetch']; declare interface FetchParams { url: string; init: RequestInit; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * Body font family * @export * @enum {string} */ declare enum FontFamily { Helvetica = "Helvetica", Arial = "Arial", ArialBlack = "Arial Black", Verdana = "Verdana", Tahoma = "Tahoma", TrebuchetMs = "Trebuchet MS", Impact = "Impact", GillSans = "Gill Sans", TimesNewRoman = "Times New Roman", Georgia = "Georgia", Palatino = "Palatino", Baskerville = "Baskerville", AndalMono = "Andal\u00E9 Mono", Courier = "Courier", Lucida = "Lucida", Monaco = "Monaco", BradleyHand = "Bradley Hand", BrushScriptMt = "Brush Script MT", Luminari = "Luminari", ComicSansMs = "Comic Sans MS" } declare type GeneratedApplicationFnSignature<APIResponse, Args extends any[] = any[]> = (appId: string, ...args: Args) => Promise<APIResponse>; declare interface GetAppRequest { appId: string; } /** * * @export * @interface GetAppResponse */ declare interface GetAppResponse { /** * * @type {App} * @memberof GetAppResponse */ app: App; } /** * @export * @enum {string} */ declare enum GetAuthorizeConnectionTypeEnum { Apple = "apple", Github = "github", Google = "google", Passage = "passage" } declare interface GetAuthorizeRequest { appId: string; redirectUri: string; codeChallenge: string; codeChallengeMethod: string; connectionType: GetAuthorizeConnectionTypeEnum; state?: string; } declare interface GetCurrentuserDevicesRequest { appId: string; } declare interface GetCurrentuserMetadataRequest { appId: string; } declare interface GetCurrentuserRequest { appId: string; } declare interface GetCurrentuserSocialConnectionsRequest { appId: string; } /** * Passage Authentication API * Passage\'s authentication API to enable passwordless authentication. * * The version of the OpenAPI document: 1 * Contact: support@passage.id * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually