mirror of
https://github.com/Unleash/unleash.git
synced 2026-10-14 00:10:28 +00:00
41 lines
1001 B
TypeScript
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>;
|