1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

Feat: add initial event schema

This commit is contained in:
Thomas Heartman 2022-06-27 11:31:28 +02:00
parent 64082440d4
commit 4154747b10

View File

@ -0,0 +1,40 @@
import { FromSchema } from 'json-schema-to-ts';
export const eventSchema = {
$id: '#/components/schemas/eventSchema',
type: 'object',
additionalProperties: false,
required: ['id', 'createdAt', 'type', 'createdBy'],
properties: {
id: {
type: 'integer',
minimum: 1,
},
createdAt: {
type: 'string',
format: 'date-time',
},
type: {
type: 'string',
},
createdBy: {
type: 'string',
},
project: {
type: 'string',
},
featureName: {
type: 'string',
},
data: {},
preData: {},
tags: {
type: 'array',
items: {
$ref: '#/components/schemas/tagSchema',
},
},
},
} as const;
export type EventSchema = FromSchema<typeof eventSchema>;