ReferenceEvents Catalog
Assistance — session démarrée
Auto-généré par
scripts/gen-events-catalog.tsdepuis le schéma Zod canonique danspackages/shared/src/events/widget-data-events.ts. Ne pas éditer ce fichier à la main — modifier la source puis relancerbun run gen:events.
Topic
assistance:session_started- Famille : Assistance
- Bloc d'origine : BLOC-09
- Discriminant :
kind: "assistance:session_started"
Description
Helena ouvre une session d'assistance technique ou administrative. Le widget tablette affiche un compteur discret.
Schéma JSON
{
"$ref": "#/definitions/assistance-session-started",
"definitions": {
"assistance-session-started": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "assistance:session_started"
},
"assistance_kind": {
"type": "string",
"enum": [
"technique",
"administrative"
]
},
"session_id": {
"type": "string",
"format": "uuid"
},
"initial_demand": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"started_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"kind",
"assistance_kind",
"session_id",
"initial_demand",
"started_at"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}Import TypeScript
import {
AssistanceSessionStartedEventSchema,
type AssistanceSessionStartedEvent,
} from "@kohami/shared";Parsing côté tablette
import { AssistanceSessionStartedEventSchema } from "@kohami/shared";
room.on(RoomEvent.DataReceived, (payload, _participant, _kind, topic) => {
if (topic !== "assistance:session_started") return;
const raw = new TextDecoder().decode(payload);
const event = AssistanceSessionStartedEventSchema.parse(JSON.parse(raw));
// ... handle event
});