@leancodepl/kratos
Version:
Headless React components library for building Ory Kratos authentication flows
400 lines • 191 kB
TypeScript
/**
* Ory APIs
* # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages: | Language | Download SDK | Documentation | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart | [pub.dev](https://pub.dev/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md) | | .NET | [nuget.org](https://www.nuget.org/packages/Ory.Client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md) | | Elixir | [hex.pm](https://hex.pm/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md) | | Go | [github.com](https://github.com/ory/client-go) | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md) | | Java | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md) | | JavaScript | [npmjs.com](https://www.npmjs.com/package/@ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) | | PHP | [packagist.org](https://packagist.org/packages/ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md) | | Python | [pypi.org](https://pypi.org/project/ory-client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md) | | Ruby | [rubygems.org](https://rubygems.org/gems/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md) | | Rust | [crates.io](https://crates.io/crates/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md) |
*
* The version of the OpenAPI document: v1.20.10
* Contact: support@ory.sh
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type { CreateFedcmFlowResponse, DeleteMySessionsCount, FlowError, LoginFlow, LogoutFlow, PerformNativeLogoutBody, RecoveryFlow, RegistrationFlow, Session, SettingsFlow, SuccessfulNativeLogin, SuccessfulNativeRegistration, UpdateFedcmFlowBody, UpdateLoginFlowBody, UpdateRecoveryFlowBody, UpdateRegistrationFlowBody, UpdateSettingsFlowBody, UpdateVerificationFlowBody, VerificationFlow } from '../models/index';
export interface CreateBrowserLoginFlowRequest {
refresh?: boolean;
aal?: string;
returnTo?: string;
cookie?: string;
loginChallenge?: string;
organization?: string;
via?: string;
}
export interface CreateBrowserLogoutFlowRequest {
cookie?: string;
returnTo?: string;
}
export interface CreateBrowserRecoveryFlowRequest {
returnTo?: string;
}
export interface CreateBrowserRegistrationFlowRequest {
returnTo?: string;
loginChallenge?: string;
afterVerificationReturnTo?: string;
organization?: string;
}
export interface CreateBrowserSettingsFlowRequest {
returnTo?: string;
cookie?: string;
}
export interface CreateBrowserVerificationFlowRequest {
returnTo?: string;
}
export interface CreateNativeLoginFlowRequest {
refresh?: boolean;
aal?: string;
xSessionToken?: string;
returnSessionTokenExchangeCode?: boolean;
returnTo?: string;
organization?: string;
via?: string;
}
export interface CreateNativeRegistrationFlowRequest {
returnSessionTokenExchangeCode?: boolean;
returnTo?: string;
organization?: string;
}
export interface CreateNativeSettingsFlowRequest {
xSessionToken?: string;
}
export interface CreateNativeVerificationFlowRequest {
returnTo?: string;
}
export interface DisableMyOtherSessionsRequest {
xSessionToken?: string;
cookie?: string;
}
export interface DisableMySessionRequest {
id: string;
xSessionToken?: string;
cookie?: string;
}
export interface ExchangeSessionTokenRequest {
initCode: string;
returnToCode: string;
}
export interface GetFlowErrorRequest {
id: string;
}
export interface GetLoginFlowRequest {
id: string;
cookie?: string;
}
export interface GetRecoveryFlowRequest {
id: string;
cookie?: string;
}
export interface GetRegistrationFlowRequest {
id: string;
cookie?: string;
}
export interface GetSettingsFlowRequest {
id: string;
xSessionToken?: string;
cookie?: string;
}
export interface GetVerificationFlowRequest {
id: string;
cookie?: string;
}
export interface ListMySessionsRequest {
perPage?: number;
page?: number;
pageSize?: number;
pageToken?: string;
xSessionToken?: string;
cookie?: string;
}
export interface PerformNativeLogoutRequest {
performNativeLogoutBody: PerformNativeLogoutBody;
}
export interface ToSessionRequest {
xSessionToken?: string;
cookie?: string;
tokenizeAs?: string;
}
export interface UpdateFedcmFlowRequest {
updateFedcmFlowBody: UpdateFedcmFlowBody;
}
export interface UpdateLoginFlowRequest {
flow: string;
updateLoginFlowBody: UpdateLoginFlowBody;
xSessionToken?: string;
cookie?: string;
}
export interface UpdateLogoutFlowRequest {
token?: string;
returnTo?: string;
cookie?: string;
}
export interface UpdateRecoveryFlowRequest {
flow: string;
updateRecoveryFlowBody: UpdateRecoveryFlowBody;
token?: string;
cookie?: string;
}
export interface UpdateRegistrationFlowRequest {
flow: string;
updateRegistrationFlowBody: UpdateRegistrationFlowBody;
cookie?: string;
}
export interface UpdateSettingsFlowRequest {
flow: string;
updateSettingsFlowBody: UpdateSettingsFlowBody;
xSessionToken?: string;
cookie?: string;
}
export interface UpdateVerificationFlowRequest {
flow: string;
updateVerificationFlowBody: UpdateVerificationFlowBody;
token?: string;
cookie?: string;
}
/**
* FrontendApi - interface
*
* @export
* @interface FrontendApiInterface
*/
export interface FrontendApiInterface {
/**
* This endpoint initializes a browser-based user login flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `session_aal1_required`: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! The optional query parameter login_challenge is set when using Kratos with Hydra in an OAuth2 flow. See the oauth2_provider.url configuration option. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* @summary Create Login Flow for Browsers
* @param {boolean} [refresh] Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
* @param {string} [aal] Request a Specific AuthenticationMethod Assurance Level Use this parameter to upgrade an existing session\'s authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to \"upgrade\" the session\'s security by asking the user to perform TOTP / WebAuth/ ... you would set this to \"aal2\".
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {string} [cookie] HTTP Cookies When using the SDK in a browser app, on the server side you must include the HTTP Cookie Header sent by the client to your server here. This ensures that CSRF and session cookies are respected.
* @param {string} [loginChallenge] An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/login?login_challenge=abcde`).
* @param {string} [organization] An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.
* @param {string} [via] Via should contain the identity\'s credential the code should be sent to. Only relevant in aal2 flows. DEPRECATED: This field is deprecated. Please remove it from your requests. The user will now see a choice of MFA credentials to choose from to perform the second factor instead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createBrowserLoginFlowRaw(requestParameters: CreateBrowserLoginFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginFlow>>;
/**
* This endpoint initializes a browser-based user login flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `session_aal1_required`: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! The optional query parameter login_challenge is set when using Kratos with Hydra in an OAuth2 flow. See the oauth2_provider.url configuration option. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* Create Login Flow for Browsers
*/
createBrowserLoginFlow(requestParameters: CreateBrowserLoginFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginFlow>;
/**
* This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the `/self-service/logout/api` URL directly with the Ory Session Token. The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error. When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.
* @summary Create a Logout URL for Browsers
* @param {string} [cookie] HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request.
* @param {string} [returnTo] Return to URL The URL to which the browser should be redirected to after the logout has been performed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createBrowserLogoutFlowRaw(requestParameters: CreateBrowserLogoutFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LogoutFlow>>;
/**
* This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the `/self-service/logout/api` URL directly with the Ory Session Token. The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error. When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.
* Create a Logout URL for Browsers
*/
createBrowserLogoutFlow(requestParameters: CreateBrowserLogoutFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LogoutFlow>;
/**
* This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to `selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists, the browser is returned to the configured return URL. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects or a 400 bad request error if the user is already authenticated. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery).
* @summary Create Recovery Flow for Browsers
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createBrowserRecoveryFlowRaw(requestParameters: CreateBrowserRecoveryFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecoveryFlow>>;
/**
* This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to `selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists, the browser is returned to the configured return URL. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects or a 400 bad request error if the user is already authenticated. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery).
* Create Recovery Flow for Browsers
*/
createBrowserRecoveryFlow(requestParameters: CreateBrowserRecoveryFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecoveryFlow>;
/**
* This endpoint initializes a browser-based user registration flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.registration.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url`. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! If this endpoint is called via an AJAX request, the response contains the registration flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* @summary Create Registration Flow for Browsers
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {string} [loginChallenge] Ory OAuth 2.0 Login Challenge. If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/registration?login_challenge=abcde`). This feature is compatible with Ory Hydra when not running on the Ory Network.
* @param {string} [afterVerificationReturnTo] The URL to return the browser to after the verification flow was completed. After the registration flow is completed, the user will be sent a verification email. Upon completing the verification flow, this URL will be used to override the default `selfservice.flows.verification.after.default_redirect_to` value.
* @param {string} [organization] An optional organization ID that should be used to register this user. This parameter is only effective in the Ory Network.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createBrowserRegistrationFlowRaw(requestParameters: CreateBrowserRegistrationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RegistrationFlow>>;
/**
* This endpoint initializes a browser-based user registration flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.registration.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url`. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! If this endpoint is called via an AJAX request, the response contains the registration flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* Create Registration Flow for Browsers
*/
createBrowserRegistrationFlow(requestParameters: CreateBrowserRegistrationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RegistrationFlow>;
/**
* This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid user session was set, the browser will be redirected to the login endpoint. If this endpoint is called via an AJAX request, the response contains the settings flow without any redirects or a 401 forbidden error if no valid session was set. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor (happens automatically for server-side browser flows) or change the configuration. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `session_inactive`: No Ory Session was found - sign in a user first. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
* @summary Create Settings Flow for Browsers
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {string} [cookie] HTTP Cookies When using the SDK in a browser app, on the server side you must include the HTTP Cookie Header sent by the client to your server here. This ensures that CSRF and session cookies are respected.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createBrowserSettingsFlowRaw(requestParameters: CreateBrowserSettingsFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SettingsFlow>>;
/**
* This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid user session was set, the browser will be redirected to the login endpoint. If this endpoint is called via an AJAX request, the response contains the settings flow without any redirects or a 401 forbidden error if no valid session was set. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor (happens automatically for server-side browser flows) or change the configuration. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `session_inactive`: No Ory Session was found - sign in a user first. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
* Create Settings Flow for Browsers
*/
createBrowserSettingsFlow(requestParameters: CreateBrowserSettingsFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SettingsFlow>;
/**
* This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to `selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation).
* @summary Create Verification Flow for Browser Clients
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createBrowserVerificationFlowRaw(requestParameters: CreateBrowserVerificationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerificationFlow>>;
/**
* This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to `selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation).
* Create Verification Flow for Browser Clients
*/
createBrowserVerificationFlow(requestParameters: CreateBrowserVerificationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerificationFlow>;
/**
* This endpoint returns a list of all available FedCM providers. It is only supported on the Ory Network.
* @summary Get FedCM Parameters
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createFedcmFlowRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateFedcmFlowResponse>>;
/**
* This endpoint returns a list of all available FedCM providers. It is only supported on the Ory Network.
* Get FedCM Parameters
*/
createFedcmFlow(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateFedcmFlowResponse>;
/**
* This endpoint initiates a login flow for native apps that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `session_aal1_required`: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* @summary Create Login Flow for Native Apps
* @param {boolean} [refresh] Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
* @param {string} [aal] Request a Specific AuthenticationMethod Assurance Level Use this parameter to upgrade an existing session\'s authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to \"upgrade\" the session\'s security by asking the user to perform TOTP / WebAuth/ ... you would set this to \"aal2\".
* @param {string} [xSessionToken] The Session Token of the Identity performing the settings flow.
* @param {boolean} [returnSessionTokenExchangeCode] EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed.
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {string} [organization] An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.
* @param {string} [via] Via should contain the identity\'s credential the code should be sent to. Only relevant in aal2 flows. DEPRECATED: This field is deprecated. Please remove it from your requests. The user will now see a choice of MFA credentials to choose from to perform the second factor instead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createNativeLoginFlowRaw(requestParameters: CreateNativeLoginFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginFlow>>;
/**
* This endpoint initiates a login flow for native apps that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `session_aal1_required`: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* Create Login Flow for Native Apps
*/
createNativeLoginFlow(requestParameters: CreateNativeLoginFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginFlow>;
/**
* This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error. On an existing recovery flow, use the `getRecoveryFlow` API endpoint. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery).
* @summary Create Recovery Flow for Native Apps
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createNativeRecoveryFlowRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecoveryFlow>>;
/**
* This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error. On an existing recovery flow, use the `getRecoveryFlow` API endpoint. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery).
* Create Recovery Flow for Native Apps
*/
createNativeRecoveryFlow(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecoveryFlow>;
/**
* This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing registration flow call `/self-service/registration/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* @summary Create Registration Flow for Native Apps
* @param {boolean} [returnSessionTokenExchangeCode] EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed.
* @param {string} [returnTo] The URL to return the browser to after the flow was completed.
* @param {string} [organization] An optional organization ID that should be used to register this user. This parameter is only effective in the Ory Network.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createNativeRegistrationFlowRaw(requestParameters: CreateNativeRegistrationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RegistrationFlow>>;
/**
* This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing registration flow call `/self-service/registration/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
* Create Registration Flow for Native Apps
*/
createNativeRegistrationFlow(requestParameters: CreateNativeRegistrationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RegistrationFlow>;
/**
* This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK. To fetch an existing settings flow call `/self-service/settings/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor or change the configuration. In the case of an error, the `error.id` of the JSON response body can be one of: `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `session_inactive`: No Ory Session was found - sign in a user first. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
* @summary Create Settings Flow for Native Apps
* @param {string} [xSessionToken] The Session Token of the Identity performing the settings flow.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createNativeSettingsFlowRaw(requestParameters: CreateNativeSettingsFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SettingsFlow>>;
/**
* This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK. To fetch an existing settings flow call `/self-service/settings/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor or change the configuration. In the case of an error, the `error.id` of the JSON response body can be one of: `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `session_inactive`: No Ory Session was found - sign in a user first. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
* Create Settings Flow for Native Apps
*/
createNativeSettingsFlow(requestParameters: CreateNativeSettingsFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SettingsFlow>;
/**
* This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on. To fetch an existing verification flow call `/self-service/verification/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation).
* @summary Create Verification Flow for Native Apps
* @param {string} [returnTo] A URL contained in the return_to key of the verification flow. This piece of data has no effect on the actual logic of the flow and is purely informational.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
createNativeVerificationFlowRaw(requestParameters: CreateNativeVerificationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerificationFlow>>;
/**
* This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on. To fetch an existing verification flow call `/self-service/verification/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation).
* Create Verification Flow for Native Apps
*/
createNativeVerificationFlow(requestParameters: CreateNativeVerificationFlowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerificationFlow>;
/**
* Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted.
* @summary Disable my other sessions
* @param {string} [xSessionToken] Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
* @param {string} [cookie] Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: `ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==`. It is ok if more than one cookie are included here as all other cookies will be ignored.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
disableMyOtherSessionsRaw(requestParameters: DisableMyOtherSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteMySessionsCount>>;
/**
* Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted.
* Disable my other sessions
*/
disableMyOtherSessions(requestParameters: DisableMyOtherSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteMySessionsCount>;
/**
* Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.
* @summary Disable one of my sessions
* @param {string} id ID is the session\'s ID.
* @param {string} [xSessionToken] Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
* @param {string} [cookie] Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: `ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==`. It is ok if more than one cookie are included here as all other cookies will be ignored.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
disableMySessionRaw(requestParameters: DisableMySessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
/**
* Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.
* Disable one of my sessions
*/
disableMySession(requestParameters: DisableMySessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
/**
*
* @summary Exchange Session Token
* @param {string} initCode The part of the code return when initializing the flow.
* @param {string} returnToCode The part of the code returned by the return_to URL.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
exchangeSessionTokenRaw(requestParameters: ExchangeSessionTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessfulNativeLogin>>;
/**
* Exchange Session Token
*/
exchangeSessionToken(requestParameters: ExchangeSessionTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessfulNativeLogin>;
/**
* This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: `?id=stub:500` - returns a stub 500 (Internal Server Error) error. More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
* @summary Get User-Flow Errors
* @param {string} id Error is the error\'s ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FrontendApiInterface
*/
getFlowErrorRaw(requestParameters: GetFlowErrorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FlowError>>;
/**
* This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: `?id=stub:500` - returns a stub 500 (Internal Server Error) error. More information can be fou