Files
unleash/src/lib/openapi/spec/create-api-token-schema.ts
T

41 lines
1001 B
TypeScript

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<typeof createApiTokenSchema>;