nyanimedb/modules/frontend/src/auth/services/AuthService.ts
2025-11-23 04:03:27 +03:00

58 lines
1.5 KiB
TypeScript

/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class AuthService {
/**
* Sign up a new user
* @param requestBody
* @returns any Sign-up result
* @throws ApiError
*/
public static postAuthSignUp(
requestBody: {
nickname: string;
pass: string;
},
): CancelablePromise<{
success?: boolean;
error?: string | null;
user_id?: string | null;
}> {
return __request(OpenAPI, {
method: 'POST',
url: '/auth/sign-up',
body: requestBody,
mediaType: 'application/json',
});
}
/**
* Sign in a user and return JWT
* @param requestBody
* @returns any Sign-in result with JWT
* @throws ApiError
*/
public static postAuthSignIn(
requestBody: {
nickname: string;
pass: string;
},
): CancelablePromise<{
success?: boolean;
error?: string | null;
user_id?: string | null;
}> {
return __request(OpenAPI, {
method: 'POST',
url: '/auth/sign-in',
body: requestBody,
mediaType: 'application/json',
errors: {
401: `Access denied due to invalid credentials`,
},
});
}
}