/** * service-api-http — h3 listener for kiosk-facing REST API. * * Serves pairing, bundle, and kiosk management endpoints. * Port 18081 behind Angie proxy. */ import * as av from "@anyvali/js"; import { BSBService, type BSBServiceConstructor, createConfigSchema, createEventSchemas, type Observable, } from "@bsb/base"; const ConfigSchema = av.object( { host: av.string().default("127.0.0.1"), port: av.int().min(1).max(65535).default(18081), codeTtlSeconds: av.int().min(60).max(3600).default(600), }, { unknownKeys: "strip" }, ); export const Config = createConfigSchema( { name: "service-api-http", description: "h3 HTTP server for kiosk-facing REST API.", tags: ["service", "http", "api", "kiosk"], }, ConfigSchema, ); export const EventSchemas = createEventSchemas({ emitEvents: {}, onEvents: {}, emitReturnableEvents: {}, onReturnableEvents: {}, emitBroadcast: {}, onBroadcast: {}, }); export class Plugin extends BSBService, typeof EventSchemas> { static override Config = Config; static override EventSchemas = EventSchemas; initBeforePlugins?: string[]; initAfterPlugins?: string[] = ["service-store"]; runBeforePlugins?: string[]; runAfterPlugins?: string[]; constructor(cfg: BSBServiceConstructor, typeof EventSchemas>) { super(cfg); } async init(_obs: Observable): Promise { // TODO: create h3 app, mount kiosk + pairing routes } async run(_obs: Observable): Promise {} async dispose(): Promise {} }