2022-06-22 13:31:41 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
2022-06-22 14:55:43 +02:00
|
|
|
import { roleSchema } from './role-schema';
|
2022-06-22 13:31:41 +02:00
|
|
|
|
|
|
|
export const tokenUserSchema = {
|
|
|
|
$id: '#/components/schemas/tokenUserSchema',
|
|
|
|
type: 'object',
|
|
|
|
additionalProperties: false,
|
2022-06-22 15:37:26 +02:00
|
|
|
required: ['id', 'name', 'email', 'token', 'createdBy', 'role'],
|
2022-06-22 13:31:41 +02:00
|
|
|
properties: {
|
2022-06-22 15:37:26 +02:00
|
|
|
id: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
email: {
|
2022-06-22 13:31:41 +02:00
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
token: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2022-06-22 15:37:26 +02:00
|
|
|
createdBy: {
|
|
|
|
type: 'string',
|
|
|
|
nullable: true,
|
|
|
|
},
|
2022-06-22 13:31:41 +02:00
|
|
|
role: {
|
2022-06-22 14:55:43 +02:00
|
|
|
$ref: '#/components/schemas/roleSchema',
|
2022-06-22 13:31:41 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
2022-06-22 14:55:43 +02:00
|
|
|
roleSchema,
|
2022-06-22 13:31:41 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type TokenUserSchema = FromSchema<typeof tokenUserSchema>;
|