/* tslint:disable */ /* eslint-disable */ /** * EMIL AuthService * The EMIL AuthService API description * * The version of the OpenAPI document: 1.0 * Contact: kontakt@emil.de * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { CreateOrgAndUserRequestDto } from '../models'; // @ts-ignore import { CreateOrgAndUserResponseClass } from '../models'; // @ts-ignore import { CreateUserRequestDto } from '../models'; // @ts-ignore import { CreateUserResponseClass } from '../models'; // @ts-ignore import { ForgotPasswordRequestDto } from '../models'; // @ts-ignore import { LoginBySamlRequestDto } from '../models'; // @ts-ignore import { LoginClass } from '../models'; // @ts-ignore import { LoginRequestDto } from '../models'; // @ts-ignore import { LogoutRequestDto } from '../models'; // @ts-ignore import { RefreshTokenDto } from '../models'; // @ts-ignore import { ResetPasswordRequestDto } from '../models'; // @ts-ignore import { VerifyOrgInvitationResponseClass } from '../models'; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; const FormData = require('form-data'); /** * AuthserviceApi - axios parameter creator * @export */ export const AuthserviceApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Register a new organization with appropriate hierarchy and create a user for that organization. * @summary Register Organization and User using invitation token * @param {CreateOrgAndUserRequestDto} createOrgAndUserRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrgAndUser: async (createOrgAndUserRequestDto: CreateOrgAndUserRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createOrgAndUserRequestDto' is not null or undefined assertParamExists('createOrgAndUser', 'createOrgAndUserRequestDto', createOrgAndUserRequestDto) const localVarPath = `/authservice/v1/create-org-and-user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createOrgAndUserRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Register a tenant user using the invite token sent to the tenant user\'s email address. * @summary Register tenant user after invite * @param {CreateUserRequestDto} createUserRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ createUser: async (createUserRequestDto: CreateUserRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createUserRequestDto' is not null or undefined assertParamExists('createUser', 'createUserRequestDto', createUserRequestDto) const localVarPath = `/authservice/v1/create-user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createUserRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Send a tenant user a reset-password token via email. * @summary Forgot password by tenant * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ forgotPassword: async (forgotPasswordRequestDto: ForgotPasswordRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'forgotPasswordRequestDto' is not null or undefined assertParamExists('forgotPassword', 'forgotPasswordRequestDto', forgotPasswordRequestDto) const localVarPath = `/authservice/v1/forgot-password`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(forgotPasswordRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get SAML login link configured for the tenant in cognito as well as tenant settings * @summary Get SAML login link for tenant * @param {string} tenantSlug * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSamlLoginLink: async (tenantSlug: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'tenantSlug' is not null or undefined assertParamExists('getSamlLoginLink', 'tenantSlug', tenantSlug) const localVarPath = `/authservice/v1/saml-login-link`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (tenantSlug !== undefined) { localVarQueryParameter['tenantSlug'] = tenantSlug; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get new access token, refresh token after successful login. * @summary Login by tenant * @param {LoginRequestDto} loginRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ login: async (loginRequestDto: LoginRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'loginRequestDto' is not null or undefined assertParamExists('login', 'loginRequestDto', loginRequestDto) const localVarPath = `/authservice/v1/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(loginRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist * @summary Login by SAML idp provider such as ADFS * @param {LoginBySamlRequestDto} loginBySamlRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ loginBySaml: async (loginBySamlRequestDto: LoginBySamlRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'loginBySamlRequestDto' is not null or undefined assertParamExists('loginBySaml', 'loginBySamlRequestDto', loginBySamlRequestDto) const localVarPath = `/authservice/v1/login/saml`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(loginBySamlRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Sign tenant user out. * @summary Logout tenant * @param {LogoutRequestDto} logoutRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ logout: async (logoutRequestDto: LogoutRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'logoutRequestDto' is not null or undefined assertParamExists('logout', 'logoutRequestDto', logoutRequestDto) const localVarPath = `/authservice/v1/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(logoutRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get new access token, new refresh token. * @summary Refresh token by tenant * @param {RefreshTokenDto} refreshTokenDto * @param {string} [cookie] HTTP only cookie that was sent during login * @param {*} [options] Override http request option. * @throws {RequiredError} */ refreshToken: async (refreshTokenDto: RefreshTokenDto, cookie?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'refreshTokenDto' is not null or undefined assertParamExists('refreshToken', 'refreshTokenDto', refreshTokenDto) const localVarPath = `/authservice/v1/refresh-token`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Change tenant user\'s password using the token provided by the reset password endpoint. * @summary Change password by tenant * @param {ResetPasswordRequestDto} resetPasswordRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ resetPassword: async (resetPasswordRequestDto: ResetPasswordRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'resetPasswordRequestDto' is not null or undefined assertParamExists('resetPassword', 'resetPasswordRequestDto', resetPasswordRequestDto) const localVarPath = `/authservice/v1/reset-password`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(resetPasswordRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Verify the invite sent to the tenant user via email. * @summary Verify tenant user\'s invite token * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyInvite: async (token: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('verifyInvite', 'token', token) const localVarPath = `/authservice/v1/verify-invite`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (token !== undefined) { localVarQueryParameter['token'] = token; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Verifies token and returns necessary data for signing up as an organization. * @summary Verify a organization\'s invitation token * @param {string} invitationToken * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyOrgInvitation: async (invitationToken: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'invitationToken' is not null or undefined assertParamExists('verifyOrgInvitation', 'invitationToken', invitationToken) const localVarPath = `/authservice/v1/verify-org-invitation`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (invitationToken !== undefined) { localVarQueryParameter['invitationToken'] = invitationToken; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Verify the reset password token that is sent by calling the \'forgot password\' endpoint. * @summary Verify tenant reset password token * @param {string} resetToken Tenant user\'s reset token. Reset token can be found in the email sent after \'forgot-password\' endpoint was called. * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyResetPasswordToken: async (resetToken: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'resetToken' is not null or undefined assertParamExists('verifyResetPasswordToken', 'resetToken', resetToken) const localVarPath = `/authservice/v1/verify-reset-password`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (resetToken !== undefined) { localVarQueryParameter['resetToken'] = resetToken; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AuthserviceApi - functional programming interface * @export */ export const AuthserviceApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AuthserviceApiAxiosParamCreator(configuration) return { /** * Register a new organization with appropriate hierarchy and create a user for that organization. * @summary Register Organization and User using invitation token * @param {CreateOrgAndUserRequestDto} createOrgAndUserRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createOrgAndUser(createOrgAndUserRequestDto: CreateOrgAndUserRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createOrgAndUser(createOrgAndUserRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Register a tenant user using the invite token sent to the tenant user\'s email address. * @summary Register tenant user after invite * @param {CreateUserRequestDto} createUserRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createUser(createUserRequestDto: CreateUserRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(createUserRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Send a tenant user a reset-password token via email. * @summary Forgot password by tenant * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.forgotPassword(forgotPasswordRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get SAML login link configured for the tenant in cognito as well as tenant settings * @summary Get SAML login link for tenant * @param {string} tenantSlug * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSamlLoginLink(tenantSlug: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSamlLoginLink(tenantSlug, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get new access token, refresh token after successful login. * @summary Login by tenant * @param {LoginRequestDto} loginRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async login(loginRequestDto: LoginRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.login(loginRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist * @summary Login by SAML idp provider such as ADFS * @param {LoginBySamlRequestDto} loginBySamlRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async loginBySaml(loginBySamlRequestDto: LoginBySamlRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginBySaml(loginBySamlRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Sign tenant user out. * @summary Logout tenant * @param {LogoutRequestDto} logoutRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async logout(logoutRequestDto: LogoutRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.logout(logoutRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get new access token, new refresh token. * @summary Refresh token by tenant * @param {RefreshTokenDto} refreshTokenDto * @param {string} [cookie] HTTP only cookie that was sent during login * @param {*} [options] Override http request option. * @throws {RequiredError} */ async refreshToken(refreshTokenDto: RefreshTokenDto, cookie?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(refreshTokenDto, cookie, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Change tenant user\'s password using the token provided by the reset password endpoint. * @summary Change password by tenant * @param {ResetPasswordRequestDto} resetPasswordRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async resetPassword(resetPasswordRequestDto: ResetPasswordRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resetPassword(resetPasswordRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Verify the invite sent to the tenant user via email. * @summary Verify tenant user\'s invite token * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async verifyInvite(token: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.verifyInvite(token, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Verifies token and returns necessary data for signing up as an organization. * @summary Verify a organization\'s invitation token * @param {string} invitationToken * @param {*} [options] Override http request option. * @throws {RequiredError} */ async verifyOrgInvitation(invitationToken: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.verifyOrgInvitation(invitationToken, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Verify the reset password token that is sent by calling the \'forgot password\' endpoint. * @summary Verify tenant reset password token * @param {string} resetToken Tenant user\'s reset token. Reset token can be found in the email sent after \'forgot-password\' endpoint was called. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async verifyResetPasswordToken(resetToken: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.verifyResetPasswordToken(resetToken, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * AuthserviceApi - factory interface * @export */ export const AuthserviceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AuthserviceApiFp(configuration) return { /** * Register a new organization with appropriate hierarchy and create a user for that organization. * @summary Register Organization and User using invitation token * @param {CreateOrgAndUserRequestDto} createOrgAndUserRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrgAndUser(createOrgAndUserRequestDto: CreateOrgAndUserRequestDto, options?: any): AxiosPromise { return localVarFp.createOrgAndUser(createOrgAndUserRequestDto, options).then((request) => request(axios, basePath)); }, /** * Register a tenant user using the invite token sent to the tenant user\'s email address. * @summary Register tenant user after invite * @param {CreateUserRequestDto} createUserRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ createUser(createUserRequestDto: CreateUserRequestDto, options?: any): AxiosPromise { return localVarFp.createUser(createUserRequestDto, options).then((request) => request(axios, basePath)); }, /** * Send a tenant user a reset-password token via email. * @summary Forgot password by tenant * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: any): AxiosPromise { return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then((request) => request(axios, basePath)); }, /** * Get SAML login link configured for the tenant in cognito as well as tenant settings * @summary Get SAML login link for tenant * @param {string} tenantSlug * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSamlLoginLink(tenantSlug: string, options?: any): AxiosPromise { return localVarFp.getSamlLoginLink(tenantSlug, options).then((request) => request(axios, basePath)); }, /** * Get new access token, refresh token after successful login. * @summary Login by tenant * @param {LoginRequestDto} loginRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ login(loginRequestDto: LoginRequestDto, options?: any): AxiosPromise { return localVarFp.login(loginRequestDto, options).then((request) => request(axios, basePath)); }, /** * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist * @summary Login by SAML idp provider such as ADFS * @param {LoginBySamlRequestDto} loginBySamlRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ loginBySaml(loginBySamlRequestDto: LoginBySamlRequestDto, options?: any): AxiosPromise { return localVarFp.loginBySaml(loginBySamlRequestDto, options).then((request) => request(axios, basePath)); }, /** * Sign tenant user out. * @summary Logout tenant * @param {LogoutRequestDto} logoutRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ logout(logoutRequestDto: LogoutRequestDto, options?: any): AxiosPromise { return localVarFp.logout(logoutRequestDto, options).then((request) => request(axios, basePath)); }, /** * Get new access token, new refresh token. * @summary Refresh token by tenant * @param {RefreshTokenDto} refreshTokenDto * @param {string} [cookie] HTTP only cookie that was sent during login * @param {*} [options] Override http request option. * @throws {RequiredError} */ refreshToken(refreshTokenDto: RefreshTokenDto, cookie?: string, options?: any): AxiosPromise { return localVarFp.refreshToken(refreshTokenDto, cookie, options).then((request) => request(axios, basePath)); }, /** * Change tenant user\'s password using the token provided by the reset password endpoint. * @summary Change password by tenant * @param {ResetPasswordRequestDto} resetPasswordRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ resetPassword(resetPasswordRequestDto: ResetPasswordRequestDto, options?: any): AxiosPromise { return localVarFp.resetPassword(resetPasswordRequestDto, options).then((request) => request(axios, basePath)); }, /** * Verify the invite sent to the tenant user via email. * @summary Verify tenant user\'s invite token * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyInvite(token: string, options?: any): AxiosPromise { return localVarFp.verifyInvite(token, options).then((request) => request(axios, basePath)); }, /** * Verifies token and returns necessary data for signing up as an organization. * @summary Verify a organization\'s invitation token * @param {string} invitationToken * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyOrgInvitation(invitationToken: string, options?: any): AxiosPromise { return localVarFp.verifyOrgInvitation(invitationToken, options).then((request) => request(axios, basePath)); }, /** * Verify the reset password token that is sent by calling the \'forgot password\' endpoint. * @summary Verify tenant reset password token * @param {string} resetToken Tenant user\'s reset token. Reset token can be found in the email sent after \'forgot-password\' endpoint was called. * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyResetPasswordToken(resetToken: string, options?: any): AxiosPromise { return localVarFp.verifyResetPasswordToken(resetToken, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createOrgAndUser operation in AuthserviceApi. * @export * @interface AuthserviceApiCreateOrgAndUserRequest */ export interface AuthserviceApiCreateOrgAndUserRequest { /** * * @type {CreateOrgAndUserRequestDto} * @memberof AuthserviceApiCreateOrgAndUser */ readonly createOrgAndUserRequestDto: CreateOrgAndUserRequestDto } /** * Request parameters for createUser operation in AuthserviceApi. * @export * @interface AuthserviceApiCreateUserRequest */ export interface AuthserviceApiCreateUserRequest { /** * * @type {CreateUserRequestDto} * @memberof AuthserviceApiCreateUser */ readonly createUserRequestDto: CreateUserRequestDto } /** * Request parameters for forgotPassword operation in AuthserviceApi. * @export * @interface AuthserviceApiForgotPasswordRequest */ export interface AuthserviceApiForgotPasswordRequest { /** * * @type {ForgotPasswordRequestDto} * @memberof AuthserviceApiForgotPassword */ readonly forgotPasswordRequestDto: ForgotPasswordRequestDto } /** * Request parameters for getSamlLoginLink operation in AuthserviceApi. * @export * @interface AuthserviceApiGetSamlLoginLinkRequest */ export interface AuthserviceApiGetSamlLoginLinkRequest { /** * * @type {string} * @memberof AuthserviceApiGetSamlLoginLink */ readonly tenantSlug: string } /** * Request parameters for login operation in AuthserviceApi. * @export * @interface AuthserviceApiLoginRequest */ export interface AuthserviceApiLoginRequest { /** * * @type {LoginRequestDto} * @memberof AuthserviceApiLogin */ readonly loginRequestDto: LoginRequestDto } /** * Request parameters for loginBySaml operation in AuthserviceApi. * @export * @interface AuthserviceApiLoginBySamlRequest */ export interface AuthserviceApiLoginBySamlRequest { /** * * @type {LoginBySamlRequestDto} * @memberof AuthserviceApiLoginBySaml */ readonly loginBySamlRequestDto: LoginBySamlRequestDto } /** * Request parameters for logout operation in AuthserviceApi. * @export * @interface AuthserviceApiLogoutRequest */ export interface AuthserviceApiLogoutRequest { /** * * @type {LogoutRequestDto} * @memberof AuthserviceApiLogout */ readonly logoutRequestDto: LogoutRequestDto } /** * Request parameters for refreshToken operation in AuthserviceApi. * @export * @interface AuthserviceApiRefreshTokenRequest */ export interface AuthserviceApiRefreshTokenRequest { /** * * @type {RefreshTokenDto} * @memberof AuthserviceApiRefreshToken */ readonly refreshTokenDto: RefreshTokenDto /** * HTTP only cookie that was sent during login * @type {string} * @memberof AuthserviceApiRefreshToken */ readonly cookie?: string } /** * Request parameters for resetPassword operation in AuthserviceApi. * @export * @interface AuthserviceApiResetPasswordRequest */ export interface AuthserviceApiResetPasswordRequest { /** * * @type {ResetPasswordRequestDto} * @memberof AuthserviceApiResetPassword */ readonly resetPasswordRequestDto: ResetPasswordRequestDto } /** * Request parameters for verifyInvite operation in AuthserviceApi. * @export * @interface AuthserviceApiVerifyInviteRequest */ export interface AuthserviceApiVerifyInviteRequest { /** * * @type {string} * @memberof AuthserviceApiVerifyInvite */ readonly token: string } /** * Request parameters for verifyOrgInvitation operation in AuthserviceApi. * @export * @interface AuthserviceApiVerifyOrgInvitationRequest */ export interface AuthserviceApiVerifyOrgInvitationRequest { /** * * @type {string} * @memberof AuthserviceApiVerifyOrgInvitation */ readonly invitationToken: string } /** * Request parameters for verifyResetPasswordToken operation in AuthserviceApi. * @export * @interface AuthserviceApiVerifyResetPasswordTokenRequest */ export interface AuthserviceApiVerifyResetPasswordTokenRequest { /** * Tenant user\'s reset token. Reset token can be found in the email sent after \'forgot-password\' endpoint was called. * @type {string} * @memberof AuthserviceApiVerifyResetPasswordToken */ readonly resetToken: string } /** * AuthserviceApi - object-oriented interface * @export * @class AuthserviceApi * @extends {BaseAPI} */ export class AuthserviceApi extends BaseAPI { /** * Register a new organization with appropriate hierarchy and create a user for that organization. * @summary Register Organization and User using invitation token * @param {AuthserviceApiCreateOrgAndUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public createOrgAndUser(requestParameters: AuthserviceApiCreateOrgAndUserRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).createOrgAndUser(requestParameters.createOrgAndUserRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Register a tenant user using the invite token sent to the tenant user\'s email address. * @summary Register tenant user after invite * @param {AuthserviceApiCreateUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public createUser(requestParameters: AuthserviceApiCreateUserRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).createUser(requestParameters.createUserRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Send a tenant user a reset-password token via email. * @summary Forgot password by tenant * @param {AuthserviceApiForgotPasswordRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public forgotPassword(requestParameters: AuthserviceApiForgotPasswordRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Get SAML login link configured for the tenant in cognito as well as tenant settings * @summary Get SAML login link for tenant * @param {AuthserviceApiGetSamlLoginLinkRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public getSamlLoginLink(requestParameters: AuthserviceApiGetSamlLoginLinkRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).getSamlLoginLink(requestParameters.tenantSlug, options).then((request) => request(this.axios, this.basePath)); } /** * Get new access token, refresh token after successful login. * @summary Login by tenant * @param {AuthserviceApiLoginRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public login(requestParameters: AuthserviceApiLoginRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).login(requestParameters.loginRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist * @summary Login by SAML idp provider such as ADFS * @param {AuthserviceApiLoginBySamlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public loginBySaml(requestParameters: AuthserviceApiLoginBySamlRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).loginBySaml(requestParameters.loginBySamlRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Sign tenant user out. * @summary Logout tenant * @param {AuthserviceApiLogoutRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public logout(requestParameters: AuthserviceApiLogoutRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).logout(requestParameters.logoutRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Get new access token, new refresh token. * @summary Refresh token by tenant * @param {AuthserviceApiRefreshTokenRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public refreshToken(requestParameters: AuthserviceApiRefreshTokenRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).refreshToken(requestParameters.refreshTokenDto, requestParameters.cookie, options).then((request) => request(this.axios, this.basePath)); } /** * Change tenant user\'s password using the token provided by the reset password endpoint. * @summary Change password by tenant * @param {AuthserviceApiResetPasswordRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public resetPassword(requestParameters: AuthserviceApiResetPasswordRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).resetPassword(requestParameters.resetPasswordRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * Verify the invite sent to the tenant user via email. * @summary Verify tenant user\'s invite token * @param {AuthserviceApiVerifyInviteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public verifyInvite(requestParameters: AuthserviceApiVerifyInviteRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).verifyInvite(requestParameters.token, options).then((request) => request(this.axios, this.basePath)); } /** * Verifies token and returns necessary data for signing up as an organization. * @summary Verify a organization\'s invitation token * @param {AuthserviceApiVerifyOrgInvitationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public verifyOrgInvitation(requestParameters: AuthserviceApiVerifyOrgInvitationRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).verifyOrgInvitation(requestParameters.invitationToken, options).then((request) => request(this.axios, this.basePath)); } /** * Verify the reset password token that is sent by calling the \'forgot password\' endpoint. * @summary Verify tenant reset password token * @param {AuthserviceApiVerifyResetPasswordTokenRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthserviceApi */ public verifyResetPasswordToken(requestParameters: AuthserviceApiVerifyResetPasswordTokenRequest, options?: AxiosRequestConfig) { return AuthserviceApiFp(this.configuration).verifyResetPasswordToken(requestParameters.resetToken, options).then((request) => request(this.axios, this.basePath)); } }