import { HTTPBody } from '@fastify-modular/route'; import { pito } from 'pito'; import { EventSystemPayload } from './event'; // ========================================================================== export const EmitEventParams = pito.Obj({ userId: pito.Num(), }); export type EmitEventParams = pito.Type; // ========================================================================== export const EmitEventInput = pito.Obj({ data: EventSystemPayload, }); export type EmitEventInput = pito.Type; // ========================================================================== export const EmitEventOption = pito.Obj({ }); export type EmitEventOption = pito.Type; // ========================================================================== // API : [Debug] export const EmitEvent = HTTPBody('POST', '/api/v1/user/emit-event/:userId', 'user') .params(EmitEventParams) .body(EmitEventInput) .query(EmitEventOption) .build(); // ==========================================================================