♻️ Refactor and tweaks, rename UserCreateOpen to UserRegister and others (#1143)

This commit is contained in:
Alejandra
2024-04-01 22:53:33 -05:00
committed by GitHub
parent aed4db7521
commit 4239d93ea6
45 changed files with 537 additions and 518 deletions

View File

@@ -18,8 +18,8 @@ export type { NewPassword } from './models/NewPassword';
export type { Token } from './models/Token';
export type { UpdatePassword } from './models/UpdatePassword';
export type { UserCreate } from './models/UserCreate';
export type { UserCreateOpen } from './models/UserCreateOpen';
export type { UserOut } from './models/UserOut';
export type { UserRegister } from './models/UserRegister';
export type { UsersOut } from './models/UsersOut';
export type { UserUpdate } from './models/UserUpdate';
export type { UserUpdateMe } from './models/UserUpdateMe';
@@ -36,8 +36,8 @@ export { $NewPassword } from './schemas/$NewPassword';
export { $Token } from './schemas/$Token';
export { $UpdatePassword } from './schemas/$UpdatePassword';
export { $UserCreate } from './schemas/$UserCreate';
export { $UserCreateOpen } from './schemas/$UserCreateOpen';
export { $UserOut } from './schemas/$UserOut';
export { $UserRegister } from './schemas/$UserRegister';
export { $UsersOut } from './schemas/$UsersOut';
export { $UserUpdate } from './schemas/$UserUpdate';
export { $UserUpdateMe } from './schemas/$UserUpdateMe';

View File

@@ -3,7 +3,7 @@
/* tslint:disable */
/* eslint-disable */
export type UserCreateOpen = {
export type UserRegister = {
email: string;
password: string;
full_name?: (string | null);

View File

@@ -5,40 +5,40 @@
export const $Body_login_login_access_token = {
properties: {
grant_type: {
type: 'any-of',
contains: [{
type: 'string',
pattern: 'password',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
pattern: 'password',
}, {
type: 'null',
}],
},
username: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
password: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
scope: {
type: 'string',
},
type: 'string',
},
client_id: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
client_secret: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,10 +5,10 @@
export const $HTTPValidationError = {
properties: {
detail: {
type: 'array',
contains: {
type: 'ValidationError',
},
},
type: 'array',
contains: {
type: 'ValidationError',
},
},
},
} as const;

View File

@@ -5,16 +5,16 @@
export const $ItemCreate = {
properties: {
title: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
description: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,24 +5,24 @@
export const $ItemOut = {
properties: {
title: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
description: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
id: {
type: 'number',
isRequired: true,
},
type: 'number',
isRequired: true,
},
owner_id: {
type: 'number',
isRequired: true,
},
type: 'number',
isRequired: true,
},
},
} as const;

View File

@@ -5,20 +5,20 @@
export const $ItemUpdate = {
properties: {
title: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
description: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,15 +5,15 @@
export const $ItemsOut = {
properties: {
data: {
type: 'array',
contains: {
type: 'ItemOut',
},
isRequired: true,
},
type: 'array',
contains: {
type: 'ItemOut',
},
isRequired: true,
},
count: {
type: 'number',
isRequired: true,
},
type: 'number',
isRequired: true,
},
},
} as const;

View File

@@ -5,8 +5,8 @@
export const $Message = {
properties: {
message: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
},
} as const;

View File

@@ -5,12 +5,12 @@
export const $NewPassword = {
properties: {
token: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
new_password: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
},
} as const;

View File

@@ -5,11 +5,11 @@
export const $Token = {
properties: {
access_token: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
token_type: {
type: 'string',
},
type: 'string',
},
},
} as const;

View File

@@ -5,12 +5,12 @@
export const $UpdatePassword = {
properties: {
current_password: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
new_password: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
},
} as const;

View File

@@ -5,26 +5,26 @@
export const $UserCreate = {
properties: {
email: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
is_active: {
type: 'boolean',
},
type: 'boolean',
},
is_superuser: {
type: 'boolean',
},
type: 'boolean',
},
full_name: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
password: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
},
} as const;

View File

@@ -1,24 +0,0 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $UserCreateOpen = {
properties: {
email: {
type: 'string',
isRequired: true,
},
password: {
type: 'string',
isRequired: true,
},
full_name: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,26 +5,26 @@
export const $UserOut = {
properties: {
email: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
is_active: {
type: 'boolean',
},
type: 'boolean',
},
is_superuser: {
type: 'boolean',
},
type: 'boolean',
},
full_name: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
id: {
type: 'number',
isRequired: true,
},
type: 'number',
isRequired: true,
},
},
} as const;

View File

@@ -0,0 +1,24 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $UserRegister = {
properties: {
email: {
type: 'string',
isRequired: true,
},
password: {
type: 'string',
isRequired: true,
},
full_name: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,34 +5,34 @@
export const $UserUpdate = {
properties: {
email: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
is_active: {
type: 'boolean',
},
type: 'boolean',
},
is_superuser: {
type: 'boolean',
},
type: 'boolean',
},
full_name: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
password: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,20 +5,20 @@
export const $UserUpdateMe = {
properties: {
full_name: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
email: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
},
} as const;

View File

@@ -5,15 +5,15 @@
export const $UsersOut = {
properties: {
data: {
type: 'array',
contains: {
type: 'UserOut',
},
isRequired: true,
},
type: 'array',
contains: {
type: 'UserOut',
},
isRequired: true,
},
count: {
type: 'number',
isRequired: true,
},
type: 'number',
isRequired: true,
},
},
} as const;

View File

@@ -5,24 +5,24 @@
export const $ValidationError = {
properties: {
loc: {
type: 'array',
contains: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'number',
}],
},
isRequired: true,
},
type: 'array',
contains: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'number',
}],
},
isRequired: true,
},
msg: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
type: {
type: 'string',
isRequired: true,
},
type: 'string',
isRequired: true,
},
},
} as const;

View File

@@ -21,12 +21,12 @@ export class ItemsService {
* @throws ApiError
*/
public static readItems({
skip,
limit = 100,
}: {
skip?: number,
limit?: number,
}): CancelablePromise<ItemsOut> {
skip,
limit = 100,
}: {
skip?: number,
limit?: number,
}): CancelablePromise<ItemsOut> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/items/',
@@ -47,10 +47,10 @@ limit?: number,
* @throws ApiError
*/
public static createItem({
requestBody,
}: {
requestBody: ItemCreate,
}): CancelablePromise<ItemOut> {
requestBody,
}: {
requestBody: ItemCreate,
}): CancelablePromise<ItemOut> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/items/',
@@ -69,10 +69,10 @@ requestBody: ItemCreate,
* @throws ApiError
*/
public static readItem({
id,
}: {
id: number,
}): CancelablePromise<ItemOut> {
id,
}: {
id: number,
}): CancelablePromise<ItemOut> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/items/{id}',
@@ -92,12 +92,12 @@ id: number,
* @throws ApiError
*/
public static updateItem({
id,
requestBody,
}: {
id: number,
requestBody: ItemUpdate,
}): CancelablePromise<ItemOut> {
id,
requestBody,
}: {
id: number,
requestBody: ItemUpdate,
}): CancelablePromise<ItemOut> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/items/{id}',
@@ -119,10 +119,10 @@ requestBody: ItemUpdate,
* @throws ApiError
*/
public static deleteItem({
id,
}: {
id: number,
}): CancelablePromise<Message> {
id,
}: {
id: number,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/items/{id}',

View File

@@ -21,10 +21,10 @@ export class LoginService {
* @throws ApiError
*/
public static loginAccessToken({
formData,
}: {
formData: Body_login_login_access_token,
}): CancelablePromise<Token> {
formData,
}: {
formData: Body_login_login_access_token,
}): CancelablePromise<Token> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/login/access-token',
@@ -56,10 +56,10 @@ formData: Body_login_login_access_token,
* @throws ApiError
*/
public static recoverPassword({
email,
}: {
email: string,
}): CancelablePromise<Message> {
email,
}: {
email: string,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/password-recovery/{email}',
@@ -79,10 +79,10 @@ email: string,
* @throws ApiError
*/
public static resetPassword({
requestBody,
}: {
requestBody: NewPassword,
}): CancelablePromise<Message> {
requestBody,
}: {
requestBody: NewPassword,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/reset-password/',
@@ -94,4 +94,27 @@ requestBody: NewPassword,
});
}
/**
* Recover Password Html Content
* HTML Content for Password Recovery
* @returns string Successful Response
* @throws ApiError
*/
public static recoverPasswordHtmlContent({
email,
}: {
email: string,
}): CancelablePromise<string> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/password-recovery-html-content/{email}',
path: {
'email': email,
},
errors: {
422: `Validation Error`,
},
});
}
}

View File

@@ -5,8 +5,8 @@
import type { Message } from '../models/Message';
import type { UpdatePassword } from '../models/UpdatePassword';
import type { UserCreate } from '../models/UserCreate';
import type { UserCreateOpen } from '../models/UserCreateOpen';
import type { UserOut } from '../models/UserOut';
import type { UserRegister } from '../models/UserRegister';
import type { UsersOut } from '../models/UsersOut';
import type { UserUpdate } from '../models/UserUpdate';
import type { UserUpdateMe } from '../models/UserUpdateMe';
@@ -24,12 +24,12 @@ export class UsersService {
* @throws ApiError
*/
public static readUsers({
skip,
limit = 100,
}: {
skip?: number,
limit?: number,
}): CancelablePromise<UsersOut> {
skip,
limit = 100,
}: {
skip?: number,
limit?: number,
}): CancelablePromise<UsersOut> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/users/',
@@ -50,10 +50,10 @@ limit?: number,
* @throws ApiError
*/
public static createUser({
requestBody,
}: {
requestBody: UserCreate,
}): CancelablePromise<UserOut> {
requestBody,
}: {
requestBody: UserCreate,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/users/',
@@ -85,10 +85,10 @@ requestBody: UserCreate,
* @throws ApiError
*/
public static updateUserMe({
requestBody,
}: {
requestBody: UserUpdateMe,
}): CancelablePromise<UserOut> {
requestBody,
}: {
requestBody: UserUpdateMe,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/v1/users/me',
@@ -107,10 +107,10 @@ requestBody: UserUpdateMe,
* @throws ApiError
*/
public static updatePasswordMe({
requestBody,
}: {
requestBody: UpdatePassword,
}): CancelablePromise<Message> {
requestBody,
}: {
requestBody: UpdatePassword,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/v1/users/me/password',
@@ -123,19 +123,19 @@ requestBody: UpdatePassword,
}
/**
* Create User Open
* Register User
* Create new user without the need to be logged in.
* @returns UserOut Successful Response
* @throws ApiError
*/
public static createUserOpen({
requestBody,
}: {
requestBody: UserCreateOpen,
}): CancelablePromise<UserOut> {
public static registerUser({
requestBody,
}: {
requestBody: UserRegister,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/users/open',
url: '/api/v1/users/signup',
body: requestBody,
mediaType: 'application/json',
errors: {
@@ -151,10 +151,10 @@ requestBody: UserCreateOpen,
* @throws ApiError
*/
public static readUserById({
userId,
}: {
userId: number,
}): CancelablePromise<UserOut> {
userId,
}: {
userId: number,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/users/{user_id}',
@@ -174,12 +174,12 @@ userId: number,
* @throws ApiError
*/
public static updateUser({
userId,
requestBody,
}: {
userId: number,
requestBody: UserUpdate,
}): CancelablePromise<UserOut> {
userId,
requestBody,
}: {
userId: number,
requestBody: UserUpdate,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/v1/users/{user_id}',
@@ -201,10 +201,10 @@ requestBody: UserUpdate,
* @throws ApiError
*/
public static deleteUser({
userId,
}: {
userId: number,
}): CancelablePromise<Message> {
userId,
}: {
userId: number,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/users/{user_id}',

View File

@@ -10,28 +10,6 @@ import { request as __request } from '../core/request';
export class UtilsService {
/**
* Test Celery
* Test Celery worker.
* @returns Message Successful Response
* @throws ApiError
*/
public static testCelery({
requestBody,
}: {
requestBody: Message,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/utils/test-celery/',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Test Email
* Test emails.
@@ -39,10 +17,10 @@ requestBody: Message,
* @throws ApiError
*/
public static testEmail({
emailTo,
}: {
emailTo: string,
}): CancelablePromise<Message> {
emailTo,
}: {
emailTo: string,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/utils/test-email/',