ReferenceEvents Catalog
Appel sortant — démarré
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
outbound_call:started- Famille : OutboundCall
- Bloc d'origine : BLOC-09
- Discriminant :
kind: "outbound_call:started"
Description
Publié avant la tentative Twilio. Identifiants aidant masqués (aidant_name_masked, aidant_phone_masked — INV-T07b).
Schéma JSON
{
"$ref": "#/definitions/outbound-call-started",
"definitions": {
"outbound-call-started": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "outbound_call:started"
},
"call_id": {
"type": "string",
"format": "uuid"
},
"aidant_name_masked": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"aidant_phone_masked": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"reason": {
"type": "string",
"maxLength": 280
},
"started_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"kind",
"call_id",
"aidant_name_masked",
"aidant_phone_masked",
"started_at"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}Import TypeScript
import {
OutboundCallStartedEventSchema,
type OutboundCallStartedEvent,
} from "@kohami/shared";Parsing côté tablette
import { OutboundCallStartedEventSchema } from "@kohami/shared";
room.on(RoomEvent.DataReceived, (payload, _participant, _kind, topic) => {
if (topic !== "outbound_call:started") return;
const raw = new TextDecoder().decode(payload);
const event = OutboundCallStartedEventSchema.parse(JSON.parse(raw));
// ... handle event
});