diff --git a/src/lib/openapi/spec/event-schema.ts b/src/lib/openapi/spec/event-schema.ts new file mode 100644 index 0000000000..8c05317e0d --- /dev/null +++ b/src/lib/openapi/spec/event-schema.ts @@ -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;