✨ Include schemas in generated frontend client (#584)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"generate-client": "openapi --input ./openapi.json --useOptions --useUnionTypes --output ./src/client --client axios"
|
||||
"generate-client": "openapi --input ./openapi.json --useOptions --useUnionTypes --output ./src/client --client axios --exportSchemas true"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "1.6.2",
|
||||
|
@@ -22,6 +22,21 @@ export type { UserUpdate } from './models/UserUpdate';
|
||||
export type { UserUpdateMe } from './models/UserUpdateMe';
|
||||
export type { ValidationError } from './models/ValidationError';
|
||||
|
||||
export { $Body_login_login_access_token } from './schemas/$Body_login_login_access_token';
|
||||
export { $HTTPValidationError } from './schemas/$HTTPValidationError';
|
||||
export { $ItemCreate } from './schemas/$ItemCreate';
|
||||
export { $ItemOut } from './schemas/$ItemOut';
|
||||
export { $ItemUpdate } from './schemas/$ItemUpdate';
|
||||
export { $Message } from './schemas/$Message';
|
||||
export { $NewPassword } from './schemas/$NewPassword';
|
||||
export { $Token } from './schemas/$Token';
|
||||
export { $UserCreate } from './schemas/$UserCreate';
|
||||
export { $UserCreateOpen } from './schemas/$UserCreateOpen';
|
||||
export { $UserOut } from './schemas/$UserOut';
|
||||
export { $UserUpdate } from './schemas/$UserUpdate';
|
||||
export { $UserUpdateMe } from './schemas/$UserUpdateMe';
|
||||
export { $ValidationError } from './schemas/$ValidationError';
|
||||
|
||||
export { ItemsService } from './services/ItemsService';
|
||||
export { LoginService } from './services/LoginService';
|
||||
export { UsersService } from './services/UsersService';
|
||||
|
@@ -0,0 +1,29 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $Body_login_login_access_token = {
|
||||
properties: {
|
||||
grant_type: {
|
||||
type: 'string',
|
||||
pattern: 'password',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
scope: {
|
||||
type: 'string',
|
||||
},
|
||||
client_id: {
|
||||
type: 'string',
|
||||
},
|
||||
client_secret: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
14
src/new-frontend/src/client/schemas/$HTTPValidationError.ts
Normal file
14
src/new-frontend/src/client/schemas/$HTTPValidationError.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $HTTPValidationError = {
|
||||
properties: {
|
||||
detail: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'ValidationError',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
15
src/new-frontend/src/client/schemas/$ItemCreate.ts
Normal file
15
src/new-frontend/src/client/schemas/$ItemCreate.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $ItemCreate = {
|
||||
properties: {
|
||||
title: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
19
src/new-frontend/src/client/schemas/$ItemOut.ts
Normal file
19
src/new-frontend/src/client/schemas/$ItemOut.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $ItemOut = {
|
||||
properties: {
|
||||
title: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
14
src/new-frontend/src/client/schemas/$ItemUpdate.ts
Normal file
14
src/new-frontend/src/client/schemas/$ItemUpdate.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $ItemUpdate = {
|
||||
properties: {
|
||||
title: {
|
||||
type: 'string',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
12
src/new-frontend/src/client/schemas/$Message.ts
Normal file
12
src/new-frontend/src/client/schemas/$Message.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $Message = {
|
||||
properties: {
|
||||
message: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
16
src/new-frontend/src/client/schemas/$NewPassword.ts
Normal file
16
src/new-frontend/src/client/schemas/$NewPassword.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $NewPassword = {
|
||||
properties: {
|
||||
token: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
new_password: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
15
src/new-frontend/src/client/schemas/$Token.ts
Normal file
15
src/new-frontend/src/client/schemas/$Token.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $Token = {
|
||||
properties: {
|
||||
access_token: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
token_type: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
26
src/new-frontend/src/client/schemas/$UserCreate.ts
Normal file
26
src/new-frontend/src/client/schemas/$UserCreate.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $UserCreate = {
|
||||
properties: {
|
||||
email: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
format: 'email',
|
||||
},
|
||||
is_active: {
|
||||
type: 'boolean',
|
||||
},
|
||||
is_superuser: {
|
||||
type: 'boolean',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
20
src/new-frontend/src/client/schemas/$UserCreateOpen.ts
Normal file
20
src/new-frontend/src/client/schemas/$UserCreateOpen.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $UserCreateOpen = {
|
||||
properties: {
|
||||
email: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
format: 'email',
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
26
src/new-frontend/src/client/schemas/$UserOut.ts
Normal file
26
src/new-frontend/src/client/schemas/$UserOut.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $UserOut = {
|
||||
properties: {
|
||||
email: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
format: 'email',
|
||||
},
|
||||
is_active: {
|
||||
type: 'boolean',
|
||||
},
|
||||
is_superuser: {
|
||||
type: 'boolean',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
24
src/new-frontend/src/client/schemas/$UserUpdate.ts
Normal file
24
src/new-frontend/src/client/schemas/$UserUpdate.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $UserUpdate = {
|
||||
properties: {
|
||||
email: {
|
||||
type: 'string',
|
||||
format: 'email',
|
||||
},
|
||||
is_active: {
|
||||
type: 'boolean',
|
||||
},
|
||||
is_superuser: {
|
||||
type: 'boolean',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
18
src/new-frontend/src/client/schemas/$UserUpdateMe.ts
Normal file
18
src/new-frontend/src/client/schemas/$UserUpdateMe.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $UserUpdateMe = {
|
||||
properties: {
|
||||
password: {
|
||||
type: 'string',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
format: 'email',
|
||||
},
|
||||
},
|
||||
} as const;
|
28
src/new-frontend/src/client/schemas/$ValidationError.ts
Normal file
28
src/new-frontend/src/client/schemas/$ValidationError.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $ValidationError = {
|
||||
properties: {
|
||||
loc: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'any-of',
|
||||
contains: [{
|
||||
type: 'string',
|
||||
}, {
|
||||
type: 'number',
|
||||
}],
|
||||
},
|
||||
isRequired: true,
|
||||
},
|
||||
msg: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
Reference in New Issue
Block a user