import { FromSchema } from 'json-schema-to-ts'; import { ApiTokenType } from '../../types/models/api-token'; export const createApiTokenSchema = { $id: '#/components/schemas/createApiTokenSchema', type: 'object', required: ['username', 'type'], properties: { secret: { type: 'string', }, username: { type: 'string', }, type: { type: 'string', description: `${Object.values(ApiTokenType).join(', ')}.`, }, environment: { type: 'string', }, project: { type: 'string', }, projects: { type: 'array', items: { type: 'string', }, }, expiresAt: { type: 'string', format: 'date-time', nullable: true, }, }, components: {}, } as const; export type CreateApiTokenSchema = FromSchema;