[schema] DaySentence: The sentence-opened event, an id and never text
This commit is contained in:
@@ -10,8 +10,9 @@
|
||||
import { Ajv, type ErrorObject, type ValidateFunction } from 'ajv';
|
||||
import careEvent from '../schemas/care-event.schema.json' with { type: 'json' };
|
||||
import hopeSentence from '../schemas/hope-sentence.schema.json' with { type: 'json' };
|
||||
import sentenceOpened from '../schemas/sentence-opened.schema.json' with { type: 'json' };
|
||||
import trace from '../schemas/trace.schema.json' with { type: 'json' };
|
||||
import type { CareEvent, HopeSentence, Trace } from './generated/index.js';
|
||||
import type { CareEvent, HopeSentence, SentenceOpened, Trace } from './generated/index.js';
|
||||
|
||||
export type SchemaResult<T> =
|
||||
| { readonly ok: true; readonly value: T }
|
||||
@@ -38,4 +39,5 @@ function describe(error: ErrorObject): string {
|
||||
|
||||
export const validateHopeSentence = wrap<HopeSentence>(ajv.compile(hopeSentence));
|
||||
export const validateCareEvent = wrap<CareEvent>(ajv.compile(careEvent));
|
||||
export const validateSentenceOpened = wrap<SentenceOpened>(ajv.compile(sentenceOpened));
|
||||
export const validateTrace = wrap<Trace>(ajv.compile(trace));
|
||||
|
||||
Reference in New Issue
Block a user