1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-21 13:47:39 +02:00
unleash.unleash/src/lib/openapi/spec/token-user-schema.ts
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

50 lines
1.4 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
import { roleSchema } from './role-schema';
export const tokenUserSchema = {
$id: '#/components/schemas/tokenUserSchema',
type: 'object',
additionalProperties: false,
description: 'A user identified by a token',
required: ['id', 'email', 'token', 'createdBy', 'role'],
properties: {
id: {
type: 'integer',
description: 'The user id',
example: 7,
},
name: {
description: 'The name of the user',
type: 'string',
example: 'Test McTest',
},
email: {
description: 'The email of the user',
type: 'string',
example: 'test@example.com',
},
token: {
description: 'A token uniquely identifying a user',
type: 'string',
example: 'user:xyzrandomstring',
},
createdBy: {
description:
'A username or email identifying which user created this token',
type: 'string',
nullable: true,
example: 'admin@example.com',
},
role: {
$ref: '#/components/schemas/roleSchema',
},
},
components: {
schemas: {
roleSchema,
},
},
} as const;
export type TokenUserSchema = FromSchema<typeof tokenUserSchema>;