diff --git a/Core/Client/src/data/apiClient.ts b/Core/Client/src/data/apiClient.ts new file mode 100644 index 0000000..099a364 --- /dev/null +++ b/Core/Client/src/data/apiClient.ts @@ -0,0 +1,1520 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ +import { + useMutation, + useQuery +} from '@tanstack/vue-query'; +import type { + DataTag, + MutationFunction, + QueryClient, + QueryFunction, + QueryKey, + UseMutationOptions, + UseMutationReturnType, + UseQueryOptions, + UseQueryReturnType +} from '@tanstack/vue-query'; + +import { + toValue, + unref +} from 'vue'; +import type { + MaybeRefOrGetter +} from 'vue'; + +import type { + AccessTokenResponse, + CardDto, + Claim, + ForgotPasswordRequest, + HttpValidationProblemDetails, + InfoRequest, + InfoResponse, + LoginRequest, + MapIdentityApiApiAuthConfirmEmailParams, + PostApiAuthLoginParams, + PostEamuseMParams, + PostEamuseParams, + RefreshRequest, + RegisterRequest, + ResendConfirmationEmailRequest, + ResetPasswordRequest, + TwoFactorRequest, + TwoFactorResponse, + ValidateCardRequest, + ValidateCardResponse +} from '../types/api'; + +export type postApiCardsValidateResponse200 = { + data: ValidateCardResponse + status: 200 +} + +export type postApiCardsValidateResponseSuccess = (postApiCardsValidateResponse200) & { + headers: Headers; +}; +; + +export type postApiCardsValidateResponse = (postApiCardsValidateResponseSuccess) + +export const getPostApiCardsValidateUrl = () => { + + + + + return `/api/cards/validate` +} + +export const postApiCardsValidate = async (validateCardRequest: ValidateCardRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiCardsValidateUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(validateCardRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiCardsValidateResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as postApiCardsValidateResponse +} + + + + + +export const getPostApiCardsValidateMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: ValidateCardRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: ValidateCardRequest}, TContext> => { + +const mutationKey = ['postApiCardsValidate']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: ValidateCardRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiCardsValidate(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiCardsValidateMutationResult = NonNullable>> + export type PostApiCardsValidateMutationBody = ValidateCardRequest + export type PostApiCardsValidateMutationError = unknown + + export const usePostApiCardsValidate = (options?: { mutation?:UseMutationOptions>, TError,{data: ValidateCardRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: ValidateCardRequest}, + TContext + > => { + return useMutation(getPostApiCardsValidateMutationOptions(options), queryClient); + } + +export type getApiCardsMyResponse200 = { + data: CardDto[] + status: 200 +} + +export type getApiCardsMyResponseSuccess = (getApiCardsMyResponse200) & { + headers: Headers; +}; +; + +export type getApiCardsMyResponse = (getApiCardsMyResponseSuccess) + +export const getGetApiCardsMyUrl = () => { + + + + + return `/api/cards/my` +} + +export const getApiCardsMy = async ( options?: RequestInit): Promise => { + + const res = await fetch(getGetApiCardsMyUrl(), + { + ...options, + method: 'GET' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: getApiCardsMyResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as getApiCardsMyResponse +} + + + + + +export const getGetApiCardsMyQueryKey = () => { + return [ + 'api','cards','my' + ] as const; + } + + +export const getGetApiCardsMyQueryOptions = >, TError = unknown>( options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} +) => { + +const {query: queryOptions, fetch: fetchOptions} = options ?? {}; + + const queryKey = getGetApiCardsMyQueryKey(); + + + + const queryFn: QueryFunction>> = ({ signal }) => getApiCardsMy({ signal, ...fetchOptions }); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type GetApiCardsMyQueryResult = NonNullable>> +export type GetApiCardsMyQueryError = unknown + + + +export function useGetApiCardsMy>, TError = unknown>( + options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} + , queryClient?: QueryClient + ): UseQueryReturnType & { queryKey: DataTag } { + + const queryOptions = getGetApiCardsMyQueryOptions(options) + + const query = useQuery(queryOptions, queryClient) as UseQueryReturnType & { queryKey: DataTag }; + + query.queryKey = unref(queryOptions).queryKey as DataTag; + + return query; +} + + + + + + + +export type getApiUserClaimsResponse200 = { + data: Claim[] + status: 200 +} + +export type getApiUserClaimsResponseSuccess = (getApiUserClaimsResponse200) & { + headers: Headers; +}; +; + +export type getApiUserClaimsResponse = (getApiUserClaimsResponseSuccess) + +export const getGetApiUserClaimsUrl = () => { + + + + + return `/api/user/claims` +} + +export const getApiUserClaims = async ( options?: RequestInit): Promise => { + + const res = await fetch(getGetApiUserClaimsUrl(), + { + ...options, + method: 'GET' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: getApiUserClaimsResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as getApiUserClaimsResponse +} + + + + + +export const getGetApiUserClaimsQueryKey = () => { + return [ + 'api','user','claims' + ] as const; + } + + +export const getGetApiUserClaimsQueryOptions = >, TError = unknown>( options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} +) => { + +const {query: queryOptions, fetch: fetchOptions} = options ?? {}; + + const queryKey = getGetApiUserClaimsQueryKey(); + + + + const queryFn: QueryFunction>> = ({ signal }) => getApiUserClaims({ signal, ...fetchOptions }); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type GetApiUserClaimsQueryResult = NonNullable>> +export type GetApiUserClaimsQueryError = unknown + + + +export function useGetApiUserClaims>, TError = unknown>( + options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} + , queryClient?: QueryClient + ): UseQueryReturnType & { queryKey: DataTag } { + + const queryOptions = getGetApiUserClaimsQueryOptions(options) + + const query = useQuery(queryOptions, queryClient) as UseQueryReturnType & { queryKey: DataTag }; + + query.queryKey = unref(queryOptions).queryKey as DataTag; + + return query; +} + + + + + + + +export type postApiAuthRegisterResponse200 = { + data: void + status: 200 +} + +export type postApiAuthRegisterResponse400 = { + data: HttpValidationProblemDetails + status: 400 +} + +export type postApiAuthRegisterResponseSuccess = (postApiAuthRegisterResponse200) & { + headers: Headers; +}; +export type postApiAuthRegisterResponseError = (postApiAuthRegisterResponse400) & { + headers: Headers; +}; + +export type postApiAuthRegisterResponse = (postApiAuthRegisterResponseSuccess | postApiAuthRegisterResponseError) + +export const getPostApiAuthRegisterUrl = () => { + + + + + return `/api/auth/register` +} + +export const postApiAuthRegister = async (registerRequest: RegisterRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthRegisterUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(registerRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthRegisterResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postApiAuthRegisterResponse +} + + + + + +export const getPostApiAuthRegisterMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: RegisterRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: RegisterRequest}, TContext> => { + +const mutationKey = ['postApiAuthRegister']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: RegisterRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthRegister(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthRegisterMutationResult = NonNullable>> + export type PostApiAuthRegisterMutationBody = RegisterRequest + export type PostApiAuthRegisterMutationError = HttpValidationProblemDetails + + export const usePostApiAuthRegister = (options?: { mutation?:UseMutationOptions>, TError,{data: RegisterRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: RegisterRequest}, + TContext + > => { + return useMutation(getPostApiAuthRegisterMutationOptions(options), queryClient); + } + +export type postApiAuthLoginResponse200 = { + data: AccessTokenResponse + status: 200 +} + +export type postApiAuthLoginResponseSuccess = (postApiAuthLoginResponse200) & { + headers: Headers; +}; +; + +export type postApiAuthLoginResponse = (postApiAuthLoginResponseSuccess) + +export const getPostApiAuthLoginUrl = (params?: PostApiAuthLoginParams,) => { + const normalizedParams = new URLSearchParams(); + + Object.entries(params || {}).forEach(([key, value]) => { + + if (value !== undefined) { + normalizedParams.append(key, value === null ? 'null' : String(value)) + } + }); + + const stringifiedParams = normalizedParams.toString(); + + return stringifiedParams.length > 0 ? `/api/auth/login?${stringifiedParams}` : `/api/auth/login` +} + +export const postApiAuthLogin = async (loginRequest: LoginRequest, + params?: PostApiAuthLoginParams, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthLoginUrl(params), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(loginRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthLoginResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as postApiAuthLoginResponse +} + + + + + +export const getPostApiAuthLoginMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: LoginRequest;params?: PostApiAuthLoginParams}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: LoginRequest;params?: PostApiAuthLoginParams}, TContext> => { + +const mutationKey = ['postApiAuthLogin']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: LoginRequest;params?: PostApiAuthLoginParams}> = (props) => { + const {data,params} = props ?? {}; + + return postApiAuthLogin(data,params,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthLoginMutationResult = NonNullable>> + export type PostApiAuthLoginMutationBody = LoginRequest + export type PostApiAuthLoginMutationError = unknown + + export const usePostApiAuthLogin = (options?: { mutation?:UseMutationOptions>, TError,{data: LoginRequest;params?: PostApiAuthLoginParams}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: LoginRequest;params?: PostApiAuthLoginParams}, + TContext + > => { + return useMutation(getPostApiAuthLoginMutationOptions(options), queryClient); + } + +export type postApiAuthRefreshResponse200 = { + data: AccessTokenResponse + status: 200 +} + +export type postApiAuthRefreshResponseSuccess = (postApiAuthRefreshResponse200) & { + headers: Headers; +}; +; + +export type postApiAuthRefreshResponse = (postApiAuthRefreshResponseSuccess) + +export const getPostApiAuthRefreshUrl = () => { + + + + + return `/api/auth/refresh` +} + +export const postApiAuthRefresh = async (refreshRequest: RefreshRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthRefreshUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(refreshRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthRefreshResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as postApiAuthRefreshResponse +} + + + + + +export const getPostApiAuthRefreshMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: RefreshRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: RefreshRequest}, TContext> => { + +const mutationKey = ['postApiAuthRefresh']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: RefreshRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthRefresh(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthRefreshMutationResult = NonNullable>> + export type PostApiAuthRefreshMutationBody = RefreshRequest + export type PostApiAuthRefreshMutationError = unknown + + export const usePostApiAuthRefresh = (options?: { mutation?:UseMutationOptions>, TError,{data: RefreshRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: RefreshRequest}, + TContext + > => { + return useMutation(getPostApiAuthRefreshMutationOptions(options), queryClient); + } + +export type mapIdentityApiApiAuthConfirmEmailResponse200 = { + data: void + status: 200 +} + +export type mapIdentityApiApiAuthConfirmEmailResponseSuccess = (mapIdentityApiApiAuthConfirmEmailResponse200) & { + headers: Headers; +}; +; + +export type mapIdentityApiApiAuthConfirmEmailResponse = (mapIdentityApiApiAuthConfirmEmailResponseSuccess) + +export const getMapIdentityApiApiAuthConfirmEmailUrl = (params: MapIdentityApiApiAuthConfirmEmailParams,) => { + const normalizedParams = new URLSearchParams(); + + Object.entries(params || {}).forEach(([key, value]) => { + + if (value !== undefined) { + normalizedParams.append(key, value === null ? 'null' : String(value)) + } + }); + + const stringifiedParams = normalizedParams.toString(); + + return stringifiedParams.length > 0 ? `/api/auth/confirmEmail?${stringifiedParams}` : `/api/auth/confirmEmail` +} + +export const mapIdentityApiApiAuthConfirmEmail = async (params: MapIdentityApiApiAuthConfirmEmailParams, options?: RequestInit): Promise => { + + const res = await fetch(getMapIdentityApiApiAuthConfirmEmailUrl(params), + { + ...options, + method: 'GET' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: mapIdentityApiApiAuthConfirmEmailResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as mapIdentityApiApiAuthConfirmEmailResponse +} + + + + + +export const getMapIdentityApiApiAuthConfirmEmailQueryKey = (params?: MaybeRefOrGetter,) => { + return [ + 'api','auth','confirmEmail', ...(params ? [params] : []) + ] as const; + } + + +export const getMapIdentityApiApiAuthConfirmEmailQueryOptions = >, TError = unknown>(params: MaybeRefOrGetter, options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} +) => { + +const {query: queryOptions, fetch: fetchOptions} = options ?? {}; + + const queryKey = getMapIdentityApiApiAuthConfirmEmailQueryKey(params); + + + + const queryFn: QueryFunction>> = ({ signal }) => mapIdentityApiApiAuthConfirmEmail(toValue(params), { signal, ...fetchOptions }); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type MapIdentityApiApiAuthConfirmEmailQueryResult = NonNullable>> +export type MapIdentityApiApiAuthConfirmEmailQueryError = unknown + + + +export function useMapIdentityApiApiAuthConfirmEmail>, TError = unknown>( + params: MaybeRefOrGetter, options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} + , queryClient?: QueryClient + ): UseQueryReturnType & { queryKey: DataTag } { + + const queryOptions = getMapIdentityApiApiAuthConfirmEmailQueryOptions(params,options) + + const query = useQuery(queryOptions, queryClient) as UseQueryReturnType & { queryKey: DataTag }; + + query.queryKey = unref(queryOptions).queryKey as DataTag; + + return query; +} + + + + + + + +export type postApiAuthResendConfirmationEmailResponse200 = { + data: void + status: 200 +} + +export type postApiAuthResendConfirmationEmailResponseSuccess = (postApiAuthResendConfirmationEmailResponse200) & { + headers: Headers; +}; +; + +export type postApiAuthResendConfirmationEmailResponse = (postApiAuthResendConfirmationEmailResponseSuccess) + +export const getPostApiAuthResendConfirmationEmailUrl = () => { + + + + + return `/api/auth/resendConfirmationEmail` +} + +export const postApiAuthResendConfirmationEmail = async (resendConfirmationEmailRequest: ResendConfirmationEmailRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthResendConfirmationEmailUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(resendConfirmationEmailRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthResendConfirmationEmailResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postApiAuthResendConfirmationEmailResponse +} + + + + + +export const getPostApiAuthResendConfirmationEmailMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: ResendConfirmationEmailRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: ResendConfirmationEmailRequest}, TContext> => { + +const mutationKey = ['postApiAuthResendConfirmationEmail']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: ResendConfirmationEmailRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthResendConfirmationEmail(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthResendConfirmationEmailMutationResult = NonNullable>> + export type PostApiAuthResendConfirmationEmailMutationBody = ResendConfirmationEmailRequest + export type PostApiAuthResendConfirmationEmailMutationError = unknown + + export const usePostApiAuthResendConfirmationEmail = (options?: { mutation?:UseMutationOptions>, TError,{data: ResendConfirmationEmailRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: ResendConfirmationEmailRequest}, + TContext + > => { + return useMutation(getPostApiAuthResendConfirmationEmailMutationOptions(options), queryClient); + } + +export type postApiAuthForgotPasswordResponse200 = { + data: void + status: 200 +} + +export type postApiAuthForgotPasswordResponse400 = { + data: HttpValidationProblemDetails + status: 400 +} + +export type postApiAuthForgotPasswordResponseSuccess = (postApiAuthForgotPasswordResponse200) & { + headers: Headers; +}; +export type postApiAuthForgotPasswordResponseError = (postApiAuthForgotPasswordResponse400) & { + headers: Headers; +}; + +export type postApiAuthForgotPasswordResponse = (postApiAuthForgotPasswordResponseSuccess | postApiAuthForgotPasswordResponseError) + +export const getPostApiAuthForgotPasswordUrl = () => { + + + + + return `/api/auth/forgotPassword` +} + +export const postApiAuthForgotPassword = async (forgotPasswordRequest: ForgotPasswordRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthForgotPasswordUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(forgotPasswordRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthForgotPasswordResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postApiAuthForgotPasswordResponse +} + + + + + +export const getPostApiAuthForgotPasswordMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: ForgotPasswordRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: ForgotPasswordRequest}, TContext> => { + +const mutationKey = ['postApiAuthForgotPassword']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: ForgotPasswordRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthForgotPassword(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthForgotPasswordMutationResult = NonNullable>> + export type PostApiAuthForgotPasswordMutationBody = ForgotPasswordRequest + export type PostApiAuthForgotPasswordMutationError = HttpValidationProblemDetails + + export const usePostApiAuthForgotPassword = (options?: { mutation?:UseMutationOptions>, TError,{data: ForgotPasswordRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: ForgotPasswordRequest}, + TContext + > => { + return useMutation(getPostApiAuthForgotPasswordMutationOptions(options), queryClient); + } + +export type postApiAuthResetPasswordResponse200 = { + data: void + status: 200 +} + +export type postApiAuthResetPasswordResponse400 = { + data: HttpValidationProblemDetails + status: 400 +} + +export type postApiAuthResetPasswordResponseSuccess = (postApiAuthResetPasswordResponse200) & { + headers: Headers; +}; +export type postApiAuthResetPasswordResponseError = (postApiAuthResetPasswordResponse400) & { + headers: Headers; +}; + +export type postApiAuthResetPasswordResponse = (postApiAuthResetPasswordResponseSuccess | postApiAuthResetPasswordResponseError) + +export const getPostApiAuthResetPasswordUrl = () => { + + + + + return `/api/auth/resetPassword` +} + +export const postApiAuthResetPassword = async (resetPasswordRequest: ResetPasswordRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthResetPasswordUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(resetPasswordRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthResetPasswordResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postApiAuthResetPasswordResponse +} + + + + + +export const getPostApiAuthResetPasswordMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: ResetPasswordRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: ResetPasswordRequest}, TContext> => { + +const mutationKey = ['postApiAuthResetPassword']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: ResetPasswordRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthResetPassword(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthResetPasswordMutationResult = NonNullable>> + export type PostApiAuthResetPasswordMutationBody = ResetPasswordRequest + export type PostApiAuthResetPasswordMutationError = HttpValidationProblemDetails + + export const usePostApiAuthResetPassword = (options?: { mutation?:UseMutationOptions>, TError,{data: ResetPasswordRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: ResetPasswordRequest}, + TContext + > => { + return useMutation(getPostApiAuthResetPasswordMutationOptions(options), queryClient); + } + +export type postApiAuthManage2faResponse200 = { + data: TwoFactorResponse + status: 200 +} + +export type postApiAuthManage2faResponse400 = { + data: HttpValidationProblemDetails + status: 400 +} + +export type postApiAuthManage2faResponse404 = { + data: void + status: 404 +} + +export type postApiAuthManage2faResponseSuccess = (postApiAuthManage2faResponse200) & { + headers: Headers; +}; +export type postApiAuthManage2faResponseError = (postApiAuthManage2faResponse400 | postApiAuthManage2faResponse404) & { + headers: Headers; +}; + +export type postApiAuthManage2faResponse = (postApiAuthManage2faResponseSuccess | postApiAuthManage2faResponseError) + +export const getPostApiAuthManage2faUrl = () => { + + + + + return `/api/auth/manage/2fa` +} + +export const postApiAuthManage2fa = async (twoFactorRequest: TwoFactorRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthManage2faUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(twoFactorRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthManage2faResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as postApiAuthManage2faResponse +} + + + + + +export const getPostApiAuthManage2faMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: TwoFactorRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: TwoFactorRequest}, TContext> => { + +const mutationKey = ['postApiAuthManage2fa']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: TwoFactorRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthManage2fa(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthManage2faMutationResult = NonNullable>> + export type PostApiAuthManage2faMutationBody = TwoFactorRequest + export type PostApiAuthManage2faMutationError = HttpValidationProblemDetails | void + + export const usePostApiAuthManage2fa = (options?: { mutation?:UseMutationOptions>, TError,{data: TwoFactorRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: TwoFactorRequest}, + TContext + > => { + return useMutation(getPostApiAuthManage2faMutationOptions(options), queryClient); + } + +export type getApiAuthManageInfoResponse200 = { + data: InfoResponse + status: 200 +} + +export type getApiAuthManageInfoResponse400 = { + data: HttpValidationProblemDetails + status: 400 +} + +export type getApiAuthManageInfoResponse404 = { + data: void + status: 404 +} + +export type getApiAuthManageInfoResponseSuccess = (getApiAuthManageInfoResponse200) & { + headers: Headers; +}; +export type getApiAuthManageInfoResponseError = (getApiAuthManageInfoResponse400 | getApiAuthManageInfoResponse404) & { + headers: Headers; +}; + +export type getApiAuthManageInfoResponse = (getApiAuthManageInfoResponseSuccess | getApiAuthManageInfoResponseError) + +export const getGetApiAuthManageInfoUrl = () => { + + + + + return `/api/auth/manage/info` +} + +export const getApiAuthManageInfo = async ( options?: RequestInit): Promise => { + + const res = await fetch(getGetApiAuthManageInfoUrl(), + { + ...options, + method: 'GET' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: getApiAuthManageInfoResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as getApiAuthManageInfoResponse +} + + + + + +export const getGetApiAuthManageInfoQueryKey = () => { + return [ + 'api','auth','manage','info' + ] as const; + } + + +export const getGetApiAuthManageInfoQueryOptions = >, TError = HttpValidationProblemDetails | void>( options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} +) => { + +const {query: queryOptions, fetch: fetchOptions} = options ?? {}; + + const queryKey = getGetApiAuthManageInfoQueryKey(); + + + + const queryFn: QueryFunction>> = ({ signal }) => getApiAuthManageInfo({ signal, ...fetchOptions }); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type GetApiAuthManageInfoQueryResult = NonNullable>> +export type GetApiAuthManageInfoQueryError = HttpValidationProblemDetails | void + + + +export function useGetApiAuthManageInfo>, TError = HttpValidationProblemDetails | void>( + options?: { query?:Partial>, TError, TData>>, fetch?: RequestInit} + , queryClient?: QueryClient + ): UseQueryReturnType & { queryKey: DataTag } { + + const queryOptions = getGetApiAuthManageInfoQueryOptions(options) + + const query = useQuery(queryOptions, queryClient) as UseQueryReturnType & { queryKey: DataTag }; + + query.queryKey = unref(queryOptions).queryKey as DataTag; + + return query; +} + + + + + + + +export type postApiAuthManageInfoResponse200 = { + data: InfoResponse + status: 200 +} + +export type postApiAuthManageInfoResponse400 = { + data: HttpValidationProblemDetails + status: 400 +} + +export type postApiAuthManageInfoResponse404 = { + data: void + status: 404 +} + +export type postApiAuthManageInfoResponseSuccess = (postApiAuthManageInfoResponse200) & { + headers: Headers; +}; +export type postApiAuthManageInfoResponseError = (postApiAuthManageInfoResponse400 | postApiAuthManageInfoResponse404) & { + headers: Headers; +}; + +export type postApiAuthManageInfoResponse = (postApiAuthManageInfoResponseSuccess | postApiAuthManageInfoResponseError) + +export const getPostApiAuthManageInfoUrl = () => { + + + + + return `/api/auth/manage/info` +} + +export const postApiAuthManageInfo = async (infoRequest: InfoRequest, options?: RequestInit): Promise => { + + const res = await fetch(getPostApiAuthManageInfoUrl(), + { + ...options, + method: 'POST', + headers: { 'Content-Type': 'application/json', ...options?.headers }, + body: JSON.stringify(infoRequest) + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postApiAuthManageInfoResponse['data'] = body ? JSON.parse(body) : {} + return { data, status: res.status, headers: res.headers } as postApiAuthManageInfoResponse +} + + + + + +export const getPostApiAuthManageInfoMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: InfoRequest}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{data: InfoRequest}, TContext> => { + +const mutationKey = ['postApiAuthManageInfo']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {data: InfoRequest}> = (props) => { + const {data} = props ?? {}; + + return postApiAuthManageInfo(data,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostApiAuthManageInfoMutationResult = NonNullable>> + export type PostApiAuthManageInfoMutationBody = InfoRequest + export type PostApiAuthManageInfoMutationError = HttpValidationProblemDetails | void + + export const usePostApiAuthManageInfo = (options?: { mutation?:UseMutationOptions>, TError,{data: InfoRequest}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {data: InfoRequest}, + TContext + > => { + return useMutation(getPostApiAuthManageInfoMutationOptions(options), queryClient); + } + +export type postEamuseModelModuleMethodResponse200 = { + data: void + status: 200 +} + +export type postEamuseModelModuleMethodResponseSuccess = (postEamuseModelModuleMethodResponse200) & { + headers: Headers; +}; +; + +export type postEamuseModelModuleMethodResponse = (postEamuseModelModuleMethodResponseSuccess) + +export const getPostEamuseModelModuleMethodUrl = (model: string, + module: string, + method: string,) => { + + + + + return `/eamuse/${model}/${module}/${method}` +} + +export const postEamuseModelModuleMethod = async (model: string, + module: string, + method: string, options?: RequestInit): Promise => { + + const res = await fetch(getPostEamuseModelModuleMethodUrl(model,module,method), + { + ...options, + method: 'POST' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postEamuseModelModuleMethodResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postEamuseModelModuleMethodResponse +} + + + + + +export const getPostEamuseModelModuleMethodMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{model: string;module: string;method: string}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{model: string;module: string;method: string}, TContext> => { + +const mutationKey = ['postEamuseModelModuleMethod']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {model: string;module: string;method: string}> = (props) => { + const {model,module,method} = props ?? {}; + + return postEamuseModelModuleMethod(model,module,method,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostEamuseModelModuleMethodMutationResult = NonNullable>> + + export type PostEamuseModelModuleMethodMutationError = unknown + + export const usePostEamuseModelModuleMethod = (options?: { mutation?:UseMutationOptions>, TError,{model: string;module: string;method: string}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {model: string;module: string;method: string}, + TContext + > => { + return useMutation(getPostEamuseModelModuleMethodMutationOptions(options), queryClient); + } + +export type postEamuseMResponse200 = { + data: void + status: 200 +} + +export type postEamuseMResponseSuccess = (postEamuseMResponse200) & { + headers: Headers; +}; +; + +export type postEamuseMResponse = (postEamuseMResponseSuccess) + +export const getPostEamuseMUrl = (m: string, + params: PostEamuseMParams,) => { + const normalizedParams = new URLSearchParams(); + + Object.entries(params || {}).forEach(([key, value]) => { + + if (value !== undefined) { + normalizedParams.append(key, value === null ? 'null' : String(value)) + } + }); + + const stringifiedParams = normalizedParams.toString(); + + return stringifiedParams.length > 0 ? `/eamuse/${m}?${stringifiedParams}` : `/eamuse/${m}` +} + +export const postEamuseM = async (m: string, + params: PostEamuseMParams, options?: RequestInit): Promise => { + + const res = await fetch(getPostEamuseMUrl(m,params), + { + ...options, + method: 'POST' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postEamuseMResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postEamuseMResponse +} + + + + + +export const getPostEamuseMMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{m: string;params: PostEamuseMParams}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{m: string;params: PostEamuseMParams}, TContext> => { + +const mutationKey = ['postEamuseM']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {m: string;params: PostEamuseMParams}> = (props) => { + const {m,params} = props ?? {}; + + return postEamuseM(m,params,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostEamuseMMutationResult = NonNullable>> + + export type PostEamuseMMutationError = unknown + + export const usePostEamuseM = (options?: { mutation?:UseMutationOptions>, TError,{m: string;params: PostEamuseMParams}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {m: string;params: PostEamuseMParams}, + TContext + > => { + return useMutation(getPostEamuseMMutationOptions(options), queryClient); + } + +export type postEamuseResponse200 = { + data: void + status: 200 +} + +export type postEamuseResponseSuccess = (postEamuseResponse200) & { + headers: Headers; +}; +; + +export type postEamuseResponse = (postEamuseResponseSuccess) + +export const getPostEamuseUrl = (params: PostEamuseParams,) => { + const normalizedParams = new URLSearchParams(); + + Object.entries(params || {}).forEach(([key, value]) => { + + if (value !== undefined) { + normalizedParams.append(key, value === null ? 'null' : String(value)) + } + }); + + const stringifiedParams = normalizedParams.toString(); + + return stringifiedParams.length > 0 ? `/eamuse?${stringifiedParams}` : `/eamuse` +} + +export const postEamuse = async (params: PostEamuseParams, options?: RequestInit): Promise => { + + const res = await fetch(getPostEamuseUrl(params), + { + ...options, + method: 'POST' + + + } +) + + + const body = [204, 205, 304].includes(res.status) ? null : await res.text(); + + const data: postEamuseResponse['data'] = body ? JSON.parse(body) : undefined + return { data, status: res.status, headers: res.headers } as postEamuseResponse +} + + + + + +export const getPostEamuseMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{params: PostEamuseParams}, TContext>, fetch?: RequestInit} +): UseMutationOptions>, TError,{params: PostEamuseParams}, TContext> => { + +const mutationKey = ['postEamuse']; +const {mutation: mutationOptions, fetch: fetchOptions} = options ? + options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? + options + : {...options, mutation: {...options.mutation, mutationKey}} + : {mutation: { mutationKey, }, fetch: undefined}; + + + + + const mutationFn: MutationFunction>, {params: PostEamuseParams}> = (props) => { + const {params} = props ?? {}; + + return postEamuse(params,fetchOptions) + } + + + + + + + return { mutationFn, ...mutationOptions }} + + export type PostEamuseMutationResult = NonNullable>> + + export type PostEamuseMutationError = unknown + + export const usePostEamuse = (options?: { mutation?:UseMutationOptions>, TError,{params: PostEamuseParams}, TContext>, fetch?: RequestInit} + , queryClient?: QueryClient): UseMutationReturnType< + Awaited>, + TError, + {params: PostEamuseParams}, + TContext + > => { + return useMutation(getPostEamuseMutationOptions(options), queryClient); + } diff --git a/Core/Client/src/data/graphqlClient.ts b/Core/Client/src/data/graphqlClient.ts new file mode 100644 index 0000000..709e1e0 --- /dev/null +++ b/Core/Client/src/data/graphqlClient.ts @@ -0,0 +1,100 @@ +import { + ApolloClient, + HttpLink, + InMemoryCache, + type InteropApolloQueryResult, + type OperationVariables, + type QueryOptions, +} from '@apollo/client/core'; +import { setContext } from '@apollo/client/link/context'; +import { useUserStore } from '@/store/userStore'; +import type { PageInfo } from '@/gql/graphql'; + +export class GraphQLClient { + public client: ApolloClient; + + constructor(baseUrl?: string) { + // Read the store fresh on every request rather than once at construction time — + // this client is built as a module-level singleton (see `graphqlClient` below), + // which runs before Pinia is installed, so `useUserStore()` can't be called here. + const authLink = setContext((_operation, prevContext) => { + const token = useUserStore().accessToken; + return { + headers: { + ...prevContext.headers, + Authorization: token ? `Bearer ${token}` : '', + }, + }; + }); + + const httpLink = new HttpLink({ + // Relative path, proxied to the backend by vite's dev server (see vite.config.ts) + // the same way the REST client's `/api` calls are — matches that pattern instead + // of relying on a VITE_API_URL env var that isn't defined anywhere in this project. + uri: baseUrl ?? '/graphql', + }); + + this.client = new ApolloClient({ + link: authLink.concat(httpLink), + cache: new InMemoryCache(), + }); + } + + public async fetchAllPaginated< + TQuery extends Record, + TQueryVariables extends OperationVariables = OperationVariables, + >(options: QueryOptions): Promise[]> { + const nodes: ExtractNode[] = []; + let hasNextPage = true; + let endCursor: PageInfo['endCursor'] | null = null; + + while (hasNextPage) { + const variables = { + ...options.variables, + ...(endCursor ? { after: endCursor } : {}), + }; + + const result: InteropApolloQueryResult = await this.client.query({ + ...options, + variables: variables as TQueryVariables, + }); + + const connection = GraphQLClient.extractConnection>(result.data as Record); + nodes.push(...connection.edges.map((edge) => edge.node)); + + hasNextPage = connection.pageInfo.hasNextPage; + endCursor = connection.pageInfo.endCursor; + } + + return nodes; + } + + private static extractConnection(data: Record): { + edges: Array<{ node: TNode }>; + pageInfo: PageInfo; + } { + const connection = Object.values(data).find( + (value): value is { edges: Array<{ node: TNode }>; pageInfo: PageInfo } => + value !== null && + typeof value === 'object' && + 'edges' in value && + Array.isArray((value as Record)['edges']), + ); + + if (!connection) throw new Error('No connection field found in query result'); + + return connection; + } +} + +type ExtractNode = { + [K in keyof TQuery]: TQuery[K] extends { edges?: Array<{ node: infer TNode }> | null } | null | undefined + ? TNode + : never; +}[keyof TQuery]; + +// Single shared instance for the whole app. Anything that needs the Apollo client +// outside of a component's `setup()` (main.ts's `provide` call, the one-off helpers in +// useGraphqlOnce.ts) imports this directly instead of going through Vue's `inject()`, +// which only resolves synchronously during setup. +export const graphqlClient = new GraphQLClient(); diff --git a/Core/Client/src/gql/graphql.ts b/Core/Client/src/gql/graphql.ts new file mode 100644 index 0000000..2a1e3e4 --- /dev/null +++ b/Core/Client/src/gql/graphql.ts @@ -0,0 +1,327 @@ +/** Internal type. DO NOT USE DIRECTLY. */ +type Exact = { [K in keyof T]: T[K] }; +/** Internal type. DO NOT USE DIRECTLY. */ +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +import gql from 'graphql-tag'; +import * as VueApolloComposable from '@vue/apollo-composable'; +import * as VueCompositionApi from 'vue'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type ReactiveFunction = () => TParam; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + DateTime: { input: Date; output: Date; } +}; + +/** Defines when a policy shall be executed. */ +export enum ApplyPolicy { + /** After the resolver was executed. */ + AFTER_RESOLVER = 'AFTER_RESOLVER', + /** Before the resolver was executed. */ + BEFORE_RESOLVER = 'BEFORE_RESOLVER', + /** The policy is applied in the validation step before the execution. */ + VALIDATION = 'VALIDATION' +} + +export type BooleanOperationFilterInput = { + eq?: InputMaybe; + neq?: InputMaybe; +}; + +/** The scope of a cache hint. */ +export enum CacheControlScope { + /** The value to cache is specific to a single user. */ + PRIVATE = 'PRIVATE', + /** The value to cache is not tied to a single user. */ + PUBLIC = 'PUBLIC' +} + +export type Card = { + __typename?: 'Card'; + id: Scalars['Int']['output']; + konamiId: Scalars['String']['output']; + rawId: Scalars['String']['output']; + user: User; + userId: Scalars['Int']['output']; +}; + +export type CardFilterInput = { + and?: InputMaybe>; + id?: InputMaybe; + konamiId?: InputMaybe; + or?: InputMaybe>; + rawId?: InputMaybe; + user?: InputMaybe; + userId?: InputMaybe; +}; + +export type CardSortInput = { + id?: InputMaybe; + konamiId?: InputMaybe; + rawId?: InputMaybe; + user?: InputMaybe; + userId?: InputMaybe; +}; + +export type DateTimeOperationFilterInput = { + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + in?: InputMaybe>>; + lt?: InputMaybe; + lte?: InputMaybe; + neq?: InputMaybe; + ngt?: InputMaybe; + ngte?: InputMaybe; + nin?: InputMaybe>>; + nlt?: InputMaybe; + nlte?: InputMaybe; +}; + +export type IntOperationFilterInput = { + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + in?: InputMaybe>>; + lt?: InputMaybe; + lte?: InputMaybe; + neq?: InputMaybe; + ngt?: InputMaybe; + ngte?: InputMaybe; + nin?: InputMaybe>>; + nlt?: InputMaybe; + nlte?: InputMaybe; +}; + +export type ListFilterInputTypeOfCardFilterInput = { + all?: InputMaybe; + any?: InputMaybe; + none?: InputMaybe; + some?: InputMaybe; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addCard: Array; +}; + + +export type MutationAddCardArgs = { + cardNumber: Scalars['String']['input']; +}; + +/** A connection to a list of items. */ +export type MyCardsConnection = { + __typename?: 'MyCardsConnection'; + /** A list of edges. */ + edges?: Maybe>; + /** A flattened list of the nodes. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** Identifies the total count of items in the connection. */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge in a connection. */ +export type MyCardsEdge = { + __typename?: 'MyCardsEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** The item at the end of the edge. */ + node: Card; +}; + +/** Information about pagination in a connection. */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** Indicates whether more edges exist following the set defined by the clients arguments. */ + hasNextPage: Scalars['Boolean']['output']; + /** Indicates whether more edges exist prior the set defined by the clients arguments. */ + hasPreviousPage: Scalars['Boolean']['output']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type Query = { + __typename?: 'Query'; + myCards?: Maybe; +}; + + +export type QueryMyCardsArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + order?: InputMaybe>; + where?: InputMaybe; +}; + +export enum SortEnumType { + ASC = 'ASC', + DESC = 'DESC' +} + +export type StringOperationFilterInput = { + and?: InputMaybe>; + contains?: InputMaybe; + endsWith?: InputMaybe; + eq?: InputMaybe; + in?: InputMaybe>>; + ncontains?: InputMaybe; + nendsWith?: InputMaybe; + neq?: InputMaybe; + nin?: InputMaybe>>; + nstartsWith?: InputMaybe; + or?: InputMaybe>; + startsWith?: InputMaybe; +}; + +export type User = { + __typename?: 'User'; + accessFailedCount: Scalars['Int']['output']; + cards: Array; + concurrencyStamp?: Maybe; + email?: Maybe; + emailConfirmed: Scalars['Boolean']['output']; + id: Scalars['Int']['output']; + lockoutEnabled: Scalars['Boolean']['output']; + lockoutEnd?: Maybe; + normalizedEmail?: Maybe; + normalizedUserName?: Maybe; + paseliAmount: Scalars['Int']['output']; + passwordHash?: Maybe; + phoneNumber?: Maybe; + phoneNumberConfirmed: Scalars['Boolean']['output']; + pin: Scalars['String']['output']; + securityStamp?: Maybe; + twoFactorEnabled: Scalars['Boolean']['output']; + userName?: Maybe; +}; + +export type UserFilterInput = { + accessFailedCount?: InputMaybe; + and?: InputMaybe>; + cards?: InputMaybe; + concurrencyStamp?: InputMaybe; + email?: InputMaybe; + emailConfirmed?: InputMaybe; + id?: InputMaybe; + lockoutEnabled?: InputMaybe; + lockoutEnd?: InputMaybe; + normalizedEmail?: InputMaybe; + normalizedUserName?: InputMaybe; + or?: InputMaybe>; + paseliAmount?: InputMaybe; + passwordHash?: InputMaybe; + phoneNumber?: InputMaybe; + phoneNumberConfirmed?: InputMaybe; + pin?: InputMaybe; + securityStamp?: InputMaybe; + twoFactorEnabled?: InputMaybe; + userName?: InputMaybe; +}; + +export type UserSortInput = { + accessFailedCount?: InputMaybe; + concurrencyStamp?: InputMaybe; + email?: InputMaybe; + emailConfirmed?: InputMaybe; + id?: InputMaybe; + lockoutEnabled?: InputMaybe; + lockoutEnd?: InputMaybe; + normalizedEmail?: InputMaybe; + normalizedUserName?: InputMaybe; + paseliAmount?: InputMaybe; + passwordHash?: InputMaybe; + phoneNumber?: InputMaybe; + phoneNumberConfirmed?: InputMaybe; + pin?: InputMaybe; + securityStamp?: InputMaybe; + twoFactorEnabled?: InputMaybe; + userName?: InputMaybe; +}; + +export type AddCardMutationVariables = Exact<{ + cardNumber: string; +}>; + + +export type AddCardMutation = { addCard: Array<{ konamiId: string, rawId: string }> }; + +export type GetMyCardsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetMyCardsQuery = { myCards: { edges: Array<{ node: { konamiId: string, rawId: string } }> | null } | null }; + + +export const AddCardDocument = gql` + mutation AddCard($cardNumber: String!) { + addCard(cardNumber: $cardNumber) { + konamiId + rawId + } +} + `; + +/** + * __useAddCardMutation__ + * + * To run a mutation, you first call `useAddCardMutation` within a Vue component and pass it any options that fit your needs. + * When your component renders, `useAddCardMutation` returns an object that includes: + * - A mutate function that you can call at any time to execute the mutation + * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return + * + * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; + * + * @example + * const { mutate, loading, error, onDone } = useAddCardMutation({ + * variables: { + * cardNumber: // value for 'cardNumber' + * }, + * }); + */ +export function useAddCardMutation(options: VueApolloComposable.UseMutationOptions | ReactiveFunction> = {}) { + return VueApolloComposable.useMutation(AddCardDocument, options); +} +export type AddCardMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn; +export const GetMyCardsDocument = gql` + query GetMyCards { + myCards { + edges { + node { + konamiId + rawId + } + } + } +} + `; + +/** + * __useGetMyCardsQuery__ + * + * To run a query within a Vue component, call `useGetMyCardsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetMyCardsQuery` returns an object from Apollo Client that contains result, loading and error properties + * you can use to render your UI. + * + * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options; + * + * @example + * const { result, loading, error } = useGetMyCardsQuery(); + */ +export function useGetMyCardsQuery(options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useQuery(GetMyCardsDocument, {}, options); +} +export function useGetMyCardsLazyQuery(options: VueApolloComposable.UseQueryOptions | VueCompositionApi.Ref> | ReactiveFunction> = {}) { + return VueApolloComposable.useLazyQuery(GetMyCardsDocument, {}, options); +} +export type GetMyCardsQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn; \ No newline at end of file diff --git a/Core/Client/src/graphql/mutations/addCard.graphql b/Core/Client/src/graphql/mutations/addCard.graphql new file mode 100644 index 0000000..a3b6c87 --- /dev/null +++ b/Core/Client/src/graphql/mutations/addCard.graphql @@ -0,0 +1,6 @@ +mutation AddCard($cardNumber: String!) { + addCard(cardNumber: $cardNumber) { + konamiId + rawId + } +} \ No newline at end of file diff --git a/Core/Client/src/graphql/queries/getMyCards.graphql b/Core/Client/src/graphql/queries/getMyCards.graphql new file mode 100644 index 0000000..454c39f --- /dev/null +++ b/Core/Client/src/graphql/queries/getMyCards.graphql @@ -0,0 +1,10 @@ +query GetMyCards { + myCards { + edges { + node { + konamiId + rawId + } + } + } +} \ No newline at end of file diff --git a/Core/Client/src/types/api/accessTokenResponse.ts b/Core/Client/src/types/api/accessTokenResponse.ts new file mode 100644 index 0000000..6b628bb --- /dev/null +++ b/Core/Client/src/types/api/accessTokenResponse.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface AccessTokenResponse { + /** @nullable */ + tokenType?: string | null; + accessToken: string; + /** @pattern ^-?(?:0|[1-9]\d*)$ */ + expiresIn: number | string; + refreshToken: string; +} diff --git a/Core/Client/src/types/api/cardDto.ts b/Core/Client/src/types/api/cardDto.ts new file mode 100644 index 0000000..55e4abc --- /dev/null +++ b/Core/Client/src/types/api/cardDto.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface CardDto { + /** @pattern ^-?(?:0|[1-9]\d*)$ */ + id?: number | string; + konamiId?: string; + rawId?: string; + /** @pattern ^-?(?:0|[1-9]\d*)$ */ + userId?: number | string; +} diff --git a/Core/Client/src/types/api/claim.ts b/Core/Client/src/types/api/claim.ts new file mode 100644 index 0000000..471cd33 --- /dev/null +++ b/Core/Client/src/types/api/claim.ts @@ -0,0 +1,24 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ +import type { ClaimProperties } from './claimProperties'; +import type { ClaimsIdentity } from './claimsIdentity'; + +export interface Claim { + /** @nullable */ + issuer?: string | null; + /** @nullable */ + originalIssuer?: string | null; + /** @nullable */ + properties?: ClaimProperties; + subject?: ClaimsIdentity; + /** @nullable */ + type?: string | null; + /** @nullable */ + value?: string | null; + /** @nullable */ + valueType?: string | null; +} diff --git a/Core/Client/src/types/api/claimProperties.ts b/Core/Client/src/types/api/claimProperties.ts new file mode 100644 index 0000000..e70415e --- /dev/null +++ b/Core/Client/src/types/api/claimProperties.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +/** + * @nullable + */ +export type ClaimProperties = null | {[key: string]: string}; diff --git a/Core/Client/src/types/api/claimsIdentity.ts b/Core/Client/src/types/api/claimsIdentity.ts new file mode 100644 index 0000000..febf7eb --- /dev/null +++ b/Core/Client/src/types/api/claimsIdentity.ts @@ -0,0 +1,25 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ +import type { Claim } from './claim'; + +export interface ClaimsIdentity { + /** @nullable */ + authenticationType?: string | null; + isAuthenticated?: boolean; + actor?: null | ClaimsIdentity; + bootstrapContext?: unknown; + /** @nullable */ + claims?: Claim[] | null; + /** @nullable */ + label?: string | null; + /** @nullable */ + name?: string | null; + /** @nullable */ + nameClaimType?: string | null; + /** @nullable */ + roleClaimType?: string | null; +} diff --git a/Core/Client/src/types/api/forgotPasswordRequest.ts b/Core/Client/src/types/api/forgotPasswordRequest.ts new file mode 100644 index 0000000..dd1dcd4 --- /dev/null +++ b/Core/Client/src/types/api/forgotPasswordRequest.ts @@ -0,0 +1,10 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface ForgotPasswordRequest { + email: string; +} diff --git a/Core/Client/src/types/api/httpValidationProblemDetails.ts b/Core/Client/src/types/api/httpValidationProblemDetails.ts new file mode 100644 index 0000000..3374688 --- /dev/null +++ b/Core/Client/src/types/api/httpValidationProblemDetails.ts @@ -0,0 +1,24 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ +import type { HttpValidationProblemDetailsErrors } from './httpValidationProblemDetailsErrors'; + +export interface HttpValidationProblemDetails { + /** @nullable */ + type?: string | null; + /** @nullable */ + title?: string | null; + /** + * @nullable + * @pattern ^-?(?:0|[1-9]\d*)$ + */ + status?: number | string | null; + /** @nullable */ + detail?: string | null; + /** @nullable */ + instance?: string | null; + errors?: HttpValidationProblemDetailsErrors; +} diff --git a/Core/Client/src/types/api/httpValidationProblemDetailsErrors.ts b/Core/Client/src/types/api/httpValidationProblemDetailsErrors.ts new file mode 100644 index 0000000..6fb471a --- /dev/null +++ b/Core/Client/src/types/api/httpValidationProblemDetailsErrors.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export type HttpValidationProblemDetailsErrors = {[key: string]: string[]}; diff --git a/Core/Client/src/types/api/index.ts b/Core/Client/src/types/api/index.ts new file mode 100644 index 0000000..735c07f --- /dev/null +++ b/Core/Client/src/types/api/index.ts @@ -0,0 +1,30 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export * from './accessTokenResponse'; +export * from './cardDto'; +export * from './claim'; +export * from './claimProperties'; +export * from './claimsIdentity'; +export * from './forgotPasswordRequest'; +export * from './httpValidationProblemDetails'; +export * from './httpValidationProblemDetailsErrors'; +export * from './infoRequest'; +export * from './infoResponse'; +export * from './loginRequest'; +export * from './mapIdentityApiApiAuthConfirmEmailParams'; +export * from './postApiAuthLoginParams'; +export * from './postEamuseMParams'; +export * from './postEamuseParams'; +export * from './refreshRequest'; +export * from './registerRequest'; +export * from './resendConfirmationEmailRequest'; +export * from './resetPasswordRequest'; +export * from './twoFactorRequest'; +export * from './twoFactorResponse'; +export * from './validateCardRequest'; +export * from './validateCardResponse'; diff --git a/Core/Client/src/types/api/infoRequest.ts b/Core/Client/src/types/api/infoRequest.ts new file mode 100644 index 0000000..3b75377 --- /dev/null +++ b/Core/Client/src/types/api/infoRequest.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface InfoRequest { + /** @nullable */ + newEmail?: string | null; + /** @nullable */ + newPassword?: string | null; + /** @nullable */ + oldPassword?: string | null; +} diff --git a/Core/Client/src/types/api/infoResponse.ts b/Core/Client/src/types/api/infoResponse.ts new file mode 100644 index 0000000..da6e152 --- /dev/null +++ b/Core/Client/src/types/api/infoResponse.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface InfoResponse { + email: string; + isEmailConfirmed: boolean; +} diff --git a/Core/Client/src/types/api/loginRequest.ts b/Core/Client/src/types/api/loginRequest.ts new file mode 100644 index 0000000..782cd1f --- /dev/null +++ b/Core/Client/src/types/api/loginRequest.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface LoginRequest { + email: string; + password: string; + /** @nullable */ + twoFactorCode?: string | null; + /** @nullable */ + twoFactorRecoveryCode?: string | null; +} diff --git a/Core/Client/src/types/api/mapIdentityApiApiAuthConfirmEmailParams.ts b/Core/Client/src/types/api/mapIdentityApiApiAuthConfirmEmailParams.ts new file mode 100644 index 0000000..b5e3b39 --- /dev/null +++ b/Core/Client/src/types/api/mapIdentityApiApiAuthConfirmEmailParams.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export type MapIdentityApiApiAuthConfirmEmailParams = { +userId: string; +code: string; +changedEmail?: string; +}; diff --git a/Core/Client/src/types/api/postApiAuthLoginParams.ts b/Core/Client/src/types/api/postApiAuthLoginParams.ts new file mode 100644 index 0000000..c3da51b --- /dev/null +++ b/Core/Client/src/types/api/postApiAuthLoginParams.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export type PostApiAuthLoginParams = { +useCookies?: boolean; +useSessionCookies?: boolean; +}; diff --git a/Core/Client/src/types/api/postEamuseMParams.ts b/Core/Client/src/types/api/postEamuseMParams.ts new file mode 100644 index 0000000..d54630d --- /dev/null +++ b/Core/Client/src/types/api/postEamuseMParams.ts @@ -0,0 +1,13 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export type PostEamuseMParams = { +model: string; +module?: string; +method?: string; +f?: string; +}; diff --git a/Core/Client/src/types/api/postEamuseParams.ts b/Core/Client/src/types/api/postEamuseParams.ts new file mode 100644 index 0000000..99443f7 --- /dev/null +++ b/Core/Client/src/types/api/postEamuseParams.ts @@ -0,0 +1,13 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export type PostEamuseParams = { +model: string; +module?: string; +method?: string; +f?: string; +}; diff --git a/Core/Client/src/types/api/refreshRequest.ts b/Core/Client/src/types/api/refreshRequest.ts new file mode 100644 index 0000000..ce2eab3 --- /dev/null +++ b/Core/Client/src/types/api/refreshRequest.ts @@ -0,0 +1,10 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface RefreshRequest { + refreshToken: string; +} diff --git a/Core/Client/src/types/api/registerRequest.ts b/Core/Client/src/types/api/registerRequest.ts new file mode 100644 index 0000000..ef56225 --- /dev/null +++ b/Core/Client/src/types/api/registerRequest.ts @@ -0,0 +1,14 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface RegisterRequest { + konamiId: string; + pin: string; + username: string; + email: string; + password: string; +} diff --git a/Core/Client/src/types/api/resendConfirmationEmailRequest.ts b/Core/Client/src/types/api/resendConfirmationEmailRequest.ts new file mode 100644 index 0000000..cb68379 --- /dev/null +++ b/Core/Client/src/types/api/resendConfirmationEmailRequest.ts @@ -0,0 +1,10 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface ResendConfirmationEmailRequest { + email: string; +} diff --git a/Core/Client/src/types/api/resetPasswordRequest.ts b/Core/Client/src/types/api/resetPasswordRequest.ts new file mode 100644 index 0000000..8ea88a1 --- /dev/null +++ b/Core/Client/src/types/api/resetPasswordRequest.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface ResetPasswordRequest { + email: string; + resetCode: string; + newPassword: string; +} diff --git a/Core/Client/src/types/api/twoFactorRequest.ts b/Core/Client/src/types/api/twoFactorRequest.ts new file mode 100644 index 0000000..9386fda --- /dev/null +++ b/Core/Client/src/types/api/twoFactorRequest.ts @@ -0,0 +1,16 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface TwoFactorRequest { + /** @nullable */ + enable?: boolean | null; + /** @nullable */ + twoFactorCode?: string | null; + resetSharedKey?: boolean; + resetRecoveryCodes?: boolean; + forgetMachine?: boolean; +} diff --git a/Core/Client/src/types/api/twoFactorResponse.ts b/Core/Client/src/types/api/twoFactorResponse.ts new file mode 100644 index 0000000..d11a13f --- /dev/null +++ b/Core/Client/src/types/api/twoFactorResponse.ts @@ -0,0 +1,16 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface TwoFactorResponse { + sharedKey: string; + /** @pattern ^-?(?:0|[1-9]\d*)$ */ + recoveryCodesLeft: number | string; + /** @nullable */ + recoveryCodes?: string[] | null; + isTwoFactorEnabled: boolean; + isMachineRemembered: boolean; +} diff --git a/Core/Client/src/types/api/validateCardRequest.ts b/Core/Client/src/types/api/validateCardRequest.ts new file mode 100644 index 0000000..57eae6f --- /dev/null +++ b/Core/Client/src/types/api/validateCardRequest.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface ValidateCardRequest { + cardId: string; + pin: string; +} diff --git a/Core/Client/src/types/api/validateCardResponse.ts b/Core/Client/src/types/api/validateCardResponse.ts new file mode 100644 index 0000000..967323a --- /dev/null +++ b/Core/Client/src/types/api/validateCardResponse.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v8.23.0 🍺 + * Do not edit manually. + * Server | v1 + * OpenAPI spec version: 1.0.0 + */ + +export interface ValidateCardResponse { + message: string; + success?: boolean; +}