/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Generated by orval 🍺 * Do not edit manually. * API * API documentation for the starter-kit project in NestJS by BinarApps. The API allows management of users, sessions and offers various functions for logged in users. Contains examples of authentication, authorization, and CRUD for selected resources. * OpenAPI spec version: 1.0 */ import { useMutation } from '@tanstack/react-query' import type { MutationFunction, UseMutationOptions, UseMutationResult } from '@tanstack/react-query' import { customInstance } from '../../axios/custom-instance' import type { ErrorType, BodyType } from '../../axios/custom-instance' import type { AuthAppleLoginDto, AuthEntity, AuthFacebookLoginDto, AuthGoogleLoginDto, ErrorEntity, ErrorServerEntity, } from '../../types' type SecondParameter any> = Parameters[1] /** * Logs the user into the system using Google authentication * @summary Login with Google */ export const authGoogleControllerLogin = ( authGoogleLoginDto: BodyType, options?: SecondParameter, signal?: AbortSignal ) => { return customInstance( { url: `/api/v1/auth/google/login`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: authGoogleLoginDto, signal, }, options ) } export const getAuthGoogleControllerLoginMutationOptions = < TData = Awaited>, TError = ErrorType, TContext = unknown, >(options?: { mutation?: UseMutationOptions }, TContext> request?: SecondParameter }) => { const mutationKey = ['authGoogleControllerLogin'] const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined } const mutationFn: MutationFunction< Awaited>, { data: BodyType } > = (props) => { const { data } = props ?? {} return authGoogleControllerLogin(data, requestOptions) } return { mutationFn, ...mutationOptions } as UseMutationOptions< TData, TError, { data: BodyType }, TContext > } export type AuthGoogleControllerLoginMutationResult = NonNullable< Awaited> > export type AuthGoogleControllerLoginMutationBody = BodyType export type AuthGoogleControllerLoginMutationError = ErrorType /** * @summary Login with Google */ export const useAuthGoogleControllerLogin = < TData = Awaited>, TError = ErrorType, TContext = unknown, >(options?: { mutation?: UseMutationOptions }, TContext> request?: SecondParameter }): UseMutationResult }, TContext> => { const mutationOptions = getAuthGoogleControllerLoginMutationOptions(options) return useMutation(mutationOptions) } /** * Logs the user into the system using Facebook authentication * @summary Login with Facebook */ export const authFacebookControllerLogin = ( authFacebookLoginDto: BodyType, options?: SecondParameter, signal?: AbortSignal ) => { return customInstance( { url: `/api/v1/auth/facebook/login`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: authFacebookLoginDto, signal, }, options ) } export const getAuthFacebookControllerLoginMutationOptions = < TData = Awaited>, TError = ErrorType, TContext = unknown, >(options?: { mutation?: UseMutationOptions }, TContext> request?: SecondParameter }) => { const mutationKey = ['authFacebookControllerLogin'] const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined } const mutationFn: MutationFunction< Awaited>, { data: BodyType } > = (props) => { const { data } = props ?? {} return authFacebookControllerLogin(data, requestOptions) } return { mutationFn, ...mutationOptions } as UseMutationOptions< TData, TError, { data: BodyType }, TContext > } export type AuthFacebookControllerLoginMutationResult = NonNullable< Awaited> > export type AuthFacebookControllerLoginMutationBody = BodyType export type AuthFacebookControllerLoginMutationError = ErrorType /** * @summary Login with Facebook */ export const useAuthFacebookControllerLogin = < TData = Awaited>, TError = ErrorType, TContext = unknown, >(options?: { mutation?: UseMutationOptions }, TContext> request?: SecondParameter }): UseMutationResult }, TContext> => { const mutationOptions = getAuthFacebookControllerLoginMutationOptions(options) return useMutation(mutationOptions) } /** * Logs the user into the system using Apple authentication * @summary Login with Apple */ export const authAppleControllerLogin = ( authAppleLoginDto: BodyType, options?: SecondParameter, signal?: AbortSignal ) => { return customInstance( { url: `/api/v1/auth/apple/login`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: authAppleLoginDto, signal, }, options ) } export const getAuthAppleControllerLoginMutationOptions = < TData = Awaited>, TError = ErrorType, TContext = unknown, >(options?: { mutation?: UseMutationOptions }, TContext> request?: SecondParameter }) => { const mutationKey = ['authAppleControllerLogin'] const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined } const mutationFn: MutationFunction< Awaited>, { data: BodyType } > = (props) => { const { data } = props ?? {} return authAppleControllerLogin(data, requestOptions) } return { mutationFn, ...mutationOptions } as UseMutationOptions< TData, TError, { data: BodyType }, TContext > } export type AuthAppleControllerLoginMutationResult = NonNullable< Awaited> > export type AuthAppleControllerLoginMutationBody = BodyType export type AuthAppleControllerLoginMutationError = ErrorType /** * @summary Login with Apple */ export const useAuthAppleControllerLogin = < TData = Awaited>, TError = ErrorType, TContext = unknown, >(options?: { mutation?: UseMutationOptions }, TContext> request?: SecondParameter }): UseMutationResult }, TContext> => { const mutationOptions = getAuthAppleControllerLoginMutationOptions(options) return useMutation(mutationOptions) }