From 4154747b10ac30b72e6a220004a984211ea53b92 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Mon, 27 Jun 2022 11:31:28 +0200 Subject: [PATCH] Feat: add initial event schema --- src/lib/openapi/spec/event-schema.ts | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/lib/openapi/spec/event-schema.ts 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;