@kohost/api-client 7.9.0 → 7.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/lib/emergencyContacts.d.ts +27 -0
  2. package/dist/lib/index.d.ts +1 -1
  3. package/dist/lib/index.js.map +1 -1
  4. package/dist/lib/sosAudiences.d.ts +1 -1
  5. package/dist/lib/sosAudiences.js +1 -1
  6. package/dist/lib/sosAudiences.js.map +1 -1
  7. package/dist/models/announcement.js +5 -1
  8. package/dist/models/announcement.js.map +1 -1
  9. package/dist/models/sosEvent.js +2 -0
  10. package/dist/models/sosEvent.js.map +1 -1
  11. package/dist/schemas/announcement.d.ts +122 -6
  12. package/dist/schemas/announcement.js +126 -11
  13. package/dist/schemas/announcement.js.map +1 -1
  14. package/dist/schemas/definitions.d.ts +83 -1
  15. package/dist/schemas/definitions.js +40 -2
  16. package/dist/schemas/definitions.js.map +1 -1
  17. package/dist/schemas/sosEvent.d.ts +97 -2
  18. package/dist/schemas/sosEvent.js +92 -2
  19. package/dist/schemas/sosEvent.js.map +1 -1
  20. package/dist/useCases/addSOSEventNote.d.ts +36 -0
  21. package/dist/useCases/addSOSEventNote.js +47 -0
  22. package/dist/useCases/addSOSEventNote.js.map +1 -0
  23. package/dist/useCases/createAnnouncementPreset.d.ts +27 -0
  24. package/dist/useCases/createAnnouncementPreset.js +47 -0
  25. package/dist/useCases/createAnnouncementPreset.js.map +1 -0
  26. package/dist/useCases/deleteAnnouncementPreset.d.ts +36 -0
  27. package/dist/useCases/deleteAnnouncementPreset.js +47 -0
  28. package/dist/useCases/deleteAnnouncementPreset.js.map +1 -0
  29. package/dist/useCases/describeAnnouncement.d.ts +36 -0
  30. package/dist/useCases/describeAnnouncement.js +47 -0
  31. package/dist/useCases/describeAnnouncement.js.map +1 -0
  32. package/dist/useCases/exportSOSEventReport.d.ts +36 -0
  33. package/dist/useCases/exportSOSEventReport.js +47 -0
  34. package/dist/useCases/exportSOSEventReport.js.map +1 -0
  35. package/dist/useCases/fetchEmergencyContactPeople.d.ts +27 -0
  36. package/dist/useCases/fetchEmergencyContactPeople.js +47 -0
  37. package/dist/useCases/fetchEmergencyContactPeople.js.map +1 -0
  38. package/dist/useCases/index.d.ts +9 -0
  39. package/dist/useCases/index.js +19 -1
  40. package/dist/useCases/index.js.map +1 -1
  41. package/dist/useCases/listAnnouncements.d.ts +27 -0
  42. package/dist/useCases/listAnnouncements.js +47 -0
  43. package/dist/useCases/listAnnouncements.js.map +1 -0
  44. package/dist/useCases/previewSOSEventReport.d.ts +36 -0
  45. package/dist/useCases/previewSOSEventReport.js +47 -0
  46. package/dist/useCases/previewSOSEventReport.js.map +1 -0
  47. package/dist/useCases/updateAnnouncementPreset.d.ts +36 -0
  48. package/dist/useCases/updateAnnouncementPreset.js +47 -0
  49. package/dist/useCases/updateAnnouncementPreset.js.map +1 -0
  50. package/dist/validate.d.ts +0 -3
  51. package/package.json +1 -1
@@ -28,6 +28,13 @@ const PLATFORM_ROLE_NAMES = [
28
28
  "Agent",
29
29
  "User"
30
30
  ];
31
+ /**
32
+ * The people outside the platform a broadcast may name, sourced from the SIS
33
+ * roster. `students` is every system user the SIS marks as a Student;
34
+ * `parents` is everybody else on the roster — every emergency-contact
35
+ * relationship the source system carries, whatever it calls it.
36
+ */
37
+ const EXTERNAL_AUDIENCE_GROUPS = ["students", "parents"];
31
38
  const deliveryCountsNode = {
32
39
  type: "object",
33
40
  additionalProperties: false,
@@ -365,9 +372,18 @@ const defs = {
365
372
  }
366
373
  }
367
374
  },
375
+ external: {
376
+ type: "array",
377
+ uniqueItems: true,
378
+ description: "Which groups of the external SIS roster were included. Human-triggered sends only; an Automation can never set it.",
379
+ items: {
380
+ type: "string",
381
+ enum: EXTERNAL_AUDIENCE_GROUPS
382
+ }
383
+ },
368
384
  emergencyContacts: {
369
385
  type: "boolean",
370
- description: "Whether the external SIS emergency-contact roster was included. Human-triggered sends only; an Automation can never set it."
386
+ description: "Deprecated: superseded by `external`. A stored `true` reads as `external: [\"parents\"]`."
371
387
  },
372
388
  users: {
373
389
  type: "array",
@@ -380,6 +396,27 @@ const defs = {
380
396
  description: "Send-time delivery counts per audience. Absent for an audience that was not sent to.",
381
397
  properties: {
382
398
  internal: deliveryCountsNode,
399
+ external: {
400
+ type: "object",
401
+ additionalProperties: false,
402
+ required: [
403
+ "recipients",
404
+ "sent",
405
+ "failed"
406
+ ],
407
+ properties: {
408
+ ...deliveryCountsNode.properties,
409
+ byChannel: {
410
+ type: "object",
411
+ additionalProperties: false,
412
+ description: "Per-channel counts, present only for the channels attempted.",
413
+ properties: {
414
+ sms: deliveryCountsNode,
415
+ email: deliveryCountsNode
416
+ }
417
+ }
418
+ }
419
+ },
383
420
  emergencyContacts: {
384
421
  type: "object",
385
422
  additionalProperties: false,
@@ -388,6 +425,7 @@ const defs = {
388
425
  "sent",
389
426
  "failed"
390
427
  ],
428
+ description: "Deprecated: superseded by `external`.",
391
429
  properties: {
392
430
  ...deliveryCountsNode.properties,
393
431
  byChannel: {
@@ -408,6 +446,6 @@ const defs = {
408
446
  }
409
447
  };
410
448
  //#endregion
411
- export { NOTIFICATION_CHANNELS, PLATFORM_ROLE_NAMES, TICKET_NOTIFICATION_EVENTS, defs as default, defs as definitionsSchema };
449
+ export { EXTERNAL_AUDIENCE_GROUPS, NOTIFICATION_CHANNELS, PLATFORM_ROLE_NAMES, TICKET_NOTIFICATION_EVENTS, defs as default, defs as definitionsSchema };
412
450
 
413
451
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","names":[],"sources":["../../.generated/schemas/definitions.ts"],"sourcesContent":["export const TICKET_NOTIFICATION_EVENTS = [\n \"ticketCreated\",\n \"ticketAssignedToMe\",\n \"addedAsCollaborator\",\n \"mentionedInTicket\",\n \"messageOnMyTicket\",\n \"ticketResolved\",\n \"ticketCreatedAsObserver\",\n \"messageAsObserver\",\n \"ticketResolvedAsObserver\",\n \"approvalRequested\",\n \"approvalDecided\",\n] as const;\n\nexport type TicketNotificationEvent =\n (typeof TICKET_NOTIFICATION_EVENTS)[number];\n\nexport const NOTIFICATION_CHANNELS = [\"email\", \"sms\", \"push\"] as const;\n\nexport type NotificationChannel = (typeof NOTIFICATION_CHANNELS)[number];\n\n/**\n * The platform roles an Audience may be selected by. The legacy `Guest` role a\n * permission entry may still carry is deliberately absent: nothing targets it.\n */\nexport const PLATFORM_ROLE_NAMES = [\n \"SuperAdmin\",\n \"Administrator\",\n \"Manager\",\n \"Agent\",\n \"User\",\n] as const;\n\nexport type PlatformRoleName = (typeof PLATFORM_ROLE_NAMES)[number];\n\nconst deliveryCountsNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n recipients: { type: \"integer\", minimum: 0 },\n sent: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n },\n} as const;\n\nconst defs = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"definitions.json\",\n title: \"Definitions\",\n definitions: {\n id: {\n type: \"string\",\n description: \"Identifier of the object.\",\n },\n systemId: {\n type: \"string\",\n description: \"Identifier of the object, directly related to the system.\",\n },\n systemData: {\n type: \"object\",\n },\n metadata: {\n type: \"object\",\n default: {},\n },\n date: {\n type: [\"string\", \"object\"],\n format: \"date-time\",\n },\n file: {\n type: \"object\",\n required: [\"name\", \"type\", \"data\"],\n properties: {\n name: {\n type: \"string\",\n description: \"Name of the file.\",\n },\n type: {\n type: \"string\",\n description: \"MIME type of the file (e.g. application/pdf).\",\n },\n data: {\n type: \"string\",\n description: \"Base64-encoded data of the file.\",\n },\n },\n },\n address: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n line1: {\n type: \"string\",\n },\n line2: {\n type: \"string\",\n },\n line3: {\n type: \"string\",\n },\n city: {\n type: \"string\",\n },\n state: {\n type: \"string\",\n },\n postalCode: {\n type: \"string\",\n },\n countryCode: {\n type: \"string\",\n minLength: 2,\n maxLength: 2,\n },\n },\n },\n driver: {\n type: \"string\",\n description: \"Driver used to communicate with the object.\",\n enum: [\n \"adlink\",\n \"apex-american-audio\",\n \"avigilon-alta\",\n \"aws-kinesis\",\n \"bacnet\",\n \"benq\",\n \"butler\",\n \"comelit\",\n \"cool-automation\",\n \"crestron\",\n \"dell\",\n \"digital-watchdog\",\n \"distech\",\n \"dmp\",\n \"doorbird\",\n \"dormakaba\",\n \"dsc\",\n \"dsc-itv2\",\n \"earbridge\",\n \"ecobee\",\n \"epson\",\n \"geovision-rs\",\n \"geovision-as-manager\",\n \"honeywell-vista\",\n \"honeywell-resideo\",\n \"igor\",\n \"inncom\",\n \"isapi\",\n \"kohost-k7\",\n \"kohost\",\n \"lapi\",\n \"lg\",\n \"lg-webos\",\n \"linortek\",\n \"lirc\",\n \"mews\",\n \"mht\",\n \"mobile-mule\",\n \"mock\",\n \"modbus\",\n \"napco\",\n \"newline\",\n \"obix\",\n \"one-roster\",\n \"onvif\",\n \"orchid-fusion\",\n \"paxton\",\n \"pdk\",\n \"pelican-wireless\",\n \"power-shades\",\n \"rachio\",\n \"rebrandly\",\n \"relay\",\n \"reolink\",\n \"rtsp\",\n \"salto\",\n \"salto-irn\",\n \"samsung\",\n \"se\",\n \"sendgrid\",\n \"singlewire\",\n \"smartboard\",\n \"sonifi\",\n \"stay-n-touch\",\n \"storable\",\n \"twilio\",\n \"unifi\",\n \"valcom\",\n \"veracross\",\n \"verkada\",\n \"vivotek\",\n \"vizio\",\n \"wisenet\",\n \"zkteco\",\n \"cloudflare-images\",\n \"cloudflare-stream\",\n \"insperia-privacy\",\n ],\n },\n type: {\n type: \"string\",\n enum: [\n \"alarm\",\n \"camera\",\n \"courtesy\",\n \"dimmer\",\n \"gateway\",\n \"lock\",\n \"mediaSource\",\n \"motionSensor\",\n \"switch\",\n \"thermostat\",\n \"windowCovering\",\n ],\n },\n name: {\n type: \"string\",\n },\n alerts: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"status\", \"message\"],\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n enum: [\n \"Battery\",\n \"Button\",\n \"Communication\",\n \"Config\",\n \"Cost\",\n \"Door Ajar\",\n \"Equipment\",\n \"Maintenance\",\n \"Motion\",\n \"Registration\",\n \"Temperature\",\n ],\n },\n status: {\n type: \"string\",\n enum: [\"Active\", \"Resolved\"],\n },\n message: {\n type: \"string\",\n },\n },\n },\n },\n supportedNotifications: {\n type: \"array\",\n uniqueItems: true,\n items: {\n enum: [\n \"button 1\",\n \"button 2\",\n \"button 3\",\n \"button 4\",\n \"button 5\",\n \"idle\",\n \"powerHasBeedApplied\",\n \"acMainsDisconnected\",\n \"acMainsReconnected\",\n \"replaceBattery\",\n \"replaceBatterySoon\",\n \"replaceBatteryNow\",\n \"batteryOk\",\n \"hardwareFailure\",\n \"softwareFailure\",\n \"hardwareFailureWithCode\",\n \"softwareFailureWithCode\",\n \"motionDetection\",\n \"airFilterNeedsCleaned\",\n \"airFilterNeedsReplaced\",\n \"smokeDetected\",\n \"outsideSafeTemperatureRange\",\n \"outsideSafeHumidityRange\",\n \"scheduleMaintenance\",\n \"doorAjar\",\n \"communicationFailure\",\n \"communicationOk\",\n \"burglarAlarm\",\n \"fireAlarm\",\n \"powerTrouble\",\n \"monitoringTrouble\",\n \"bellTrouble\",\n \"configIssue\",\n ],\n },\n },\n notification: {\n type: [\"object\", \"null\"],\n properties: {\n name: {\n type: \"string\",\n $ref: \"#/definitions/supportedNotifications/items\",\n },\n timestamp: {\n type: \"number\",\n minimum: 1655907956593,\n },\n description: {\n type: \"string\",\n },\n },\n },\n batteryLevel: {\n type: \"number\",\n minimum: 0,\n maximum: 100,\n },\n watts: {\n type: \"number\",\n minimum: 0,\n },\n revenue: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n name: {\n type: \"string\",\n },\n date: {\n type: \"string\",\n format: \"date-time\",\n },\n price: {\n type: \"number\",\n },\n tax: {\n type: [\"number\", \"null\"],\n },\n },\n },\n },\n ticketNotificationEvent: {\n type: \"string\",\n enum: TICKET_NOTIFICATION_EVENTS,\n },\n notificationChannel: {\n type: \"string\",\n enum: NOTIFICATION_CHANNELS,\n },\n deliveryCounts: deliveryCountsNode,\n audience: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Who a people-facing broadcast was directed at, as the sender expressed it, plus the snapshot it resolved to. One shape for Announcements, SOS broadcasts and Automation notifications.\",\n properties: {\n to: {\n type: \"object\",\n additionalProperties: false,\n description:\n 'The User selector, one kind at a time. Absent or empty selects nobody; everyone is only ever the explicit `id: [\"*\"]` wildcard.',\n properties: {\n id: {\n type: \"array\",\n description:\n \"Named User ids, or the single wildcard `*` meaning everyone in scope.\",\n items: { type: \"string\" },\n },\n roles: {\n type: \"array\",\n items: { type: \"string\", enum: PLATFORM_ROLE_NAMES },\n },\n departmentIds: {\n type: \"array\",\n items: { type: \"string\" },\n },\n },\n },\n emergencyContacts: {\n type: \"boolean\",\n description:\n \"Whether the external SIS emergency-contact roster was included. Human-triggered sends only; an Automation can never set it.\",\n },\n users: {\n type: \"array\",\n description:\n \"Snapshot of the User ids the selector resolved to at send time.\",\n items: { type: \"string\" },\n },\n delivery: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Send-time delivery counts per audience. Absent for an audience that was not sent to.\",\n properties: {\n internal: deliveryCountsNode,\n emergencyContacts: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n} as const;\n\nexport type ISODateString = ReturnType<Date[\"toISOString\"]>;\n\nexport { defs as definitionsSchema };\nexport default defs;\n"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ACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM,EACJ,MAAM,SACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU;KAAC;KAAQ;KAAU;IAAS;IACtC,YAAY;KACV,IAAI,EACF,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,MAAM;OACJ;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;MACF;KACF;KACA,QAAQ;MACN,MAAM;MACN,MAAM,CAAC,UAAU,UAAU;KAC7B;KACA,SAAS,EACP,MAAM,SACR;IACF;GACF;EACF;EACA,wBAAwB;GACtB,MAAM;GACN,aAAa;GACb,OAAO,EACL,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,EACF;EACF;EACA,cAAc;GACZ,MAAM,CAAC,UAAU,MAAM;GACvB,YAAY;IACV,MAAM;KACJ,MAAM;KACN,MAAM;IACR;IACA,WAAW;KACT,MAAM;KACN,SAAS;IACX;IACA,aAAa,EACX,MAAM,SACR;GACF;EACF;EACA,cAAc;GACZ,MAAM;GACN,SAAS;GACT,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,OAAO;IACL,MAAM;IACN,YAAY;KACV,IAAI,EACF,MAAM,mCACR;KACA,MAAM,EACJ,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,QAAQ;KACV;KACA,OAAO,EACL,MAAM,SACR;KACA,KAAK,EACH,MAAM,CAAC,UAAU,MAAM,EACzB;IACF;GACF;EACF;EACA,yBAAyB;GACvB,MAAM;GACN,MAAM;EACR;EACA,qBAAqB;GACnB,MAAM;GACN,MAAM;EACR;EACA,gBAAgB;EAChB,UAAU;GACR,MAAM;GACN,sBAAsB;GACtB,aACE;GACF,YAAY;IACV,IAAI;KACF,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,IAAI;OACF,MAAM;OACN,aACE;OACF,OAAO,EAAE,MAAM,SAAS;MAC1B;MACA,OAAO;OACL,MAAM;OACN,OAAO;QAAE,MAAM;QAAU,MAAM;OAAoB;MACrD;MACA,eAAe;OACb,MAAM;OACN,OAAO,EAAE,MAAM,SAAS;MAC1B;KACF;IACF;IACA,mBAAmB;KACjB,MAAM;KACN,aACE;IACJ;IACA,OAAO;KACL,MAAM;KACN,aACE;KACF,OAAO,EAAE,MAAM,SAAS;IAC1B;IACA,UAAU;KACR,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,UAAU;MACV,mBAAmB;OACjB,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;KACF;IACF;GACF;EACF;CACF;AACF"}
1
+ {"version":3,"file":"definitions.js","names":[],"sources":["../../.generated/schemas/definitions.ts"],"sourcesContent":["export const TICKET_NOTIFICATION_EVENTS = [\n \"ticketCreated\",\n \"ticketAssignedToMe\",\n \"addedAsCollaborator\",\n \"mentionedInTicket\",\n \"messageOnMyTicket\",\n \"ticketResolved\",\n \"ticketCreatedAsObserver\",\n \"messageAsObserver\",\n \"ticketResolvedAsObserver\",\n \"approvalRequested\",\n \"approvalDecided\",\n] as const;\n\nexport type TicketNotificationEvent =\n (typeof TICKET_NOTIFICATION_EVENTS)[number];\n\nexport const NOTIFICATION_CHANNELS = [\"email\", \"sms\", \"push\"] as const;\n\nexport type NotificationChannel = (typeof NOTIFICATION_CHANNELS)[number];\n\n/**\n * The platform roles an Audience may be selected by. The legacy `Guest` role a\n * permission entry may still carry is deliberately absent: nothing targets it.\n */\nexport const PLATFORM_ROLE_NAMES = [\n \"SuperAdmin\",\n \"Administrator\",\n \"Manager\",\n \"Agent\",\n \"User\",\n] as const;\n\nexport type PlatformRoleName = (typeof PLATFORM_ROLE_NAMES)[number];\n\n/**\n * The people outside the platform a broadcast may name, sourced from the SIS\n * roster. `students` is every system user the SIS marks as a Student;\n * `parents` is everybody else on the roster — every emergency-contact\n * relationship the source system carries, whatever it calls it.\n */\nexport const EXTERNAL_AUDIENCE_GROUPS = [\"students\", \"parents\"] as const;\n\nexport type ExternalAudienceGroup = (typeof EXTERNAL_AUDIENCE_GROUPS)[number];\n\nconst deliveryCountsNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n recipients: { type: \"integer\", minimum: 0 },\n sent: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n },\n} as const;\n\nconst defs = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"definitions.json\",\n title: \"Definitions\",\n definitions: {\n id: {\n type: \"string\",\n description: \"Identifier of the object.\",\n },\n systemId: {\n type: \"string\",\n description: \"Identifier of the object, directly related to the system.\",\n },\n systemData: {\n type: \"object\",\n },\n metadata: {\n type: \"object\",\n default: {},\n },\n date: {\n type: [\"string\", \"object\"],\n format: \"date-time\",\n },\n file: {\n type: \"object\",\n required: [\"name\", \"type\", \"data\"],\n properties: {\n name: {\n type: \"string\",\n description: \"Name of the file.\",\n },\n type: {\n type: \"string\",\n description: \"MIME type of the file (e.g. application/pdf).\",\n },\n data: {\n type: \"string\",\n description: \"Base64-encoded data of the file.\",\n },\n },\n },\n address: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n line1: {\n type: \"string\",\n },\n line2: {\n type: \"string\",\n },\n line3: {\n type: \"string\",\n },\n city: {\n type: \"string\",\n },\n state: {\n type: \"string\",\n },\n postalCode: {\n type: \"string\",\n },\n countryCode: {\n type: \"string\",\n minLength: 2,\n maxLength: 2,\n },\n },\n },\n driver: {\n type: \"string\",\n description: \"Driver used to communicate with the object.\",\n enum: [\n \"adlink\",\n \"apex-american-audio\",\n \"avigilon-alta\",\n \"aws-kinesis\",\n \"bacnet\",\n \"benq\",\n \"butler\",\n \"comelit\",\n \"cool-automation\",\n \"crestron\",\n \"dell\",\n \"digital-watchdog\",\n \"distech\",\n \"dmp\",\n \"doorbird\",\n \"dormakaba\",\n \"dsc\",\n \"dsc-itv2\",\n \"earbridge\",\n \"ecobee\",\n \"epson\",\n \"geovision-rs\",\n \"geovision-as-manager\",\n \"honeywell-vista\",\n \"honeywell-resideo\",\n \"igor\",\n \"inncom\",\n \"isapi\",\n \"kohost-k7\",\n \"kohost\",\n \"lapi\",\n \"lg\",\n \"lg-webos\",\n \"linortek\",\n \"lirc\",\n \"mews\",\n \"mht\",\n \"mobile-mule\",\n \"mock\",\n \"modbus\",\n \"napco\",\n \"newline\",\n \"obix\",\n \"one-roster\",\n \"onvif\",\n \"orchid-fusion\",\n \"paxton\",\n \"pdk\",\n \"pelican-wireless\",\n \"power-shades\",\n \"rachio\",\n \"rebrandly\",\n \"relay\",\n \"reolink\",\n \"rtsp\",\n \"salto\",\n \"salto-irn\",\n \"samsung\",\n \"se\",\n \"sendgrid\",\n \"singlewire\",\n \"smartboard\",\n \"sonifi\",\n \"stay-n-touch\",\n \"storable\",\n \"twilio\",\n \"unifi\",\n \"valcom\",\n \"veracross\",\n \"verkada\",\n \"vivotek\",\n \"vizio\",\n \"wisenet\",\n \"zkteco\",\n \"cloudflare-images\",\n \"cloudflare-stream\",\n \"insperia-privacy\",\n ],\n },\n type: {\n type: \"string\",\n enum: [\n \"alarm\",\n \"camera\",\n \"courtesy\",\n \"dimmer\",\n \"gateway\",\n \"lock\",\n \"mediaSource\",\n \"motionSensor\",\n \"switch\",\n \"thermostat\",\n \"windowCovering\",\n ],\n },\n name: {\n type: \"string\",\n },\n alerts: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"status\", \"message\"],\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n enum: [\n \"Battery\",\n \"Button\",\n \"Communication\",\n \"Config\",\n \"Cost\",\n \"Door Ajar\",\n \"Equipment\",\n \"Maintenance\",\n \"Motion\",\n \"Registration\",\n \"Temperature\",\n ],\n },\n status: {\n type: \"string\",\n enum: [\"Active\", \"Resolved\"],\n },\n message: {\n type: \"string\",\n },\n },\n },\n },\n supportedNotifications: {\n type: \"array\",\n uniqueItems: true,\n items: {\n enum: [\n \"button 1\",\n \"button 2\",\n \"button 3\",\n \"button 4\",\n \"button 5\",\n \"idle\",\n \"powerHasBeedApplied\",\n \"acMainsDisconnected\",\n \"acMainsReconnected\",\n \"replaceBattery\",\n \"replaceBatterySoon\",\n \"replaceBatteryNow\",\n \"batteryOk\",\n \"hardwareFailure\",\n \"softwareFailure\",\n \"hardwareFailureWithCode\",\n \"softwareFailureWithCode\",\n \"motionDetection\",\n \"airFilterNeedsCleaned\",\n \"airFilterNeedsReplaced\",\n \"smokeDetected\",\n \"outsideSafeTemperatureRange\",\n \"outsideSafeHumidityRange\",\n \"scheduleMaintenance\",\n \"doorAjar\",\n \"communicationFailure\",\n \"communicationOk\",\n \"burglarAlarm\",\n \"fireAlarm\",\n \"powerTrouble\",\n \"monitoringTrouble\",\n \"bellTrouble\",\n \"configIssue\",\n ],\n },\n },\n notification: {\n type: [\"object\", \"null\"],\n properties: {\n name: {\n type: \"string\",\n $ref: \"#/definitions/supportedNotifications/items\",\n },\n timestamp: {\n type: \"number\",\n minimum: 1655907956593,\n },\n description: {\n type: \"string\",\n },\n },\n },\n batteryLevel: {\n type: \"number\",\n minimum: 0,\n maximum: 100,\n },\n watts: {\n type: \"number\",\n minimum: 0,\n },\n revenue: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n name: {\n type: \"string\",\n },\n date: {\n type: \"string\",\n format: \"date-time\",\n },\n price: {\n type: \"number\",\n },\n tax: {\n type: [\"number\", \"null\"],\n },\n },\n },\n },\n ticketNotificationEvent: {\n type: \"string\",\n enum: TICKET_NOTIFICATION_EVENTS,\n },\n notificationChannel: {\n type: \"string\",\n enum: NOTIFICATION_CHANNELS,\n },\n deliveryCounts: deliveryCountsNode,\n audience: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Who a people-facing broadcast was directed at, as the sender expressed it, plus the snapshot it resolved to. One shape for Announcements, SOS broadcasts and Automation notifications.\",\n properties: {\n to: {\n type: \"object\",\n additionalProperties: false,\n description:\n 'The User selector, one kind at a time. Absent or empty selects nobody; everyone is only ever the explicit `id: [\"*\"]` wildcard.',\n properties: {\n id: {\n type: \"array\",\n description:\n \"Named User ids, or the single wildcard `*` meaning everyone in scope.\",\n items: { type: \"string\" },\n },\n roles: {\n type: \"array\",\n items: { type: \"string\", enum: PLATFORM_ROLE_NAMES },\n },\n departmentIds: {\n type: \"array\",\n items: { type: \"string\" },\n },\n },\n },\n external: {\n type: \"array\",\n uniqueItems: true,\n description:\n \"Which groups of the external SIS roster were included. Human-triggered sends only; an Automation can never set it.\",\n items: { type: \"string\", enum: EXTERNAL_AUDIENCE_GROUPS },\n },\n emergencyContacts: {\n type: \"boolean\",\n description:\n 'Deprecated: superseded by `external`. A stored `true` reads as `external: [\"parents\"]`.',\n },\n users: {\n type: \"array\",\n description:\n \"Snapshot of the User ids the selector resolved to at send time.\",\n items: { type: \"string\" },\n },\n delivery: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Send-time delivery counts per audience. Absent for an audience that was not sent to.\",\n properties: {\n internal: deliveryCountsNode,\n external: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n emergencyContacts: {\n type: \"object\",\n additionalProperties: false,\n required: [\"recipients\", \"sent\", \"failed\"],\n description: \"Deprecated: superseded by `external`.\",\n properties: {\n ...deliveryCountsNode.properties,\n byChannel: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Per-channel counts, present only for the channels attempted.\",\n properties: {\n sms: deliveryCountsNode,\n email: deliveryCountsNode,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n} as const;\n\nexport type ISODateString = ReturnType<Date[\"toISOString\"]>;\n\nexport { defs as definitionsSchema };\nexport default defs;\n"],"mappings":";AAAA,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAKA,MAAa,wBAAwB;CAAC;CAAS;CAAO;AAAM;;;;;AAQ5D,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,MAAa,2BAA2B,CAAC,YAAY,SAAS;AAI9D,MAAM,qBAAqB;CACzB,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAc;EAAQ;CAAQ;CACzC,YAAY;EACV,YAAY;GAAE,MAAM;GAAW,SAAS;EAAE;EAC1C,MAAM;GAAE,MAAM;GAAW,SAAS;EAAE;EACpC,QAAQ;GAAE,MAAM;GAAW,SAAS;EAAE;CACxC;AACF;AAEA,MAAM,OAAO;CACX,SAAS;CACT,KAAK;CACL,OAAO;CACP,aAAa;EACX,IAAI;GACF,MAAM;GACN,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,aAAa;EACf;EACA,YAAY,EACV,MAAM,SACR;EACA,UAAU;GACR,MAAM;GACN,SAAS,CAAC;EACZ;EACA,MAAM;GACJ,MAAM,CAAC,UAAU,QAAQ;GACzB,QAAQ;EACV;EACA,MAAM;GACJ,MAAM;GACN,UAAU;IAAC;IAAQ;IAAQ;GAAM;GACjC,YAAY;IACV,MAAM;KACJ,MAAM;KACN,aAAa;IACf;IACA,MAAM;KACJ,MAAM;KACN,aAAa;IACf;IACA,MAAM;KACJ,MAAM;KACN,aAAa;IACf;GACF;EACF;EACA,SAAS;GACP,MAAM;GACN,sBAAsB;GACtB,YAAY;IACV,IAAI,EACF,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,MAAM,EACJ,MAAM,SACR;IACA,OAAO,EACL,MAAM,SACR;IACA,YAAY,EACV,MAAM,SACR;IACA,aAAa;KACX,MAAM;KACN,WAAW;KACX,WAAW;IACb;GACF;EACF;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,MAAM,EACJ,MAAM,SACR;EACA,QAAQ;GACN,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU;KAAC;KAAQ;KAAU;IAAS;IACtC,YAAY;KACV,IAAI,EACF,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,MAAM;OACJ;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;MACF;KACF;KACA,QAAQ;MACN,MAAM;MACN,MAAM,CAAC,UAAU,UAAU;KAC7B;KACA,SAAS,EACP,MAAM,SACR;IACF;GACF;EACF;EACA,wBAAwB;GACtB,MAAM;GACN,aAAa;GACb,OAAO,EACL,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,EACF;EACF;EACA,cAAc;GACZ,MAAM,CAAC,UAAU,MAAM;GACvB,YAAY;IACV,MAAM;KACJ,MAAM;KACN,MAAM;IACR;IACA,WAAW;KACT,MAAM;KACN,SAAS;IACX;IACA,aAAa,EACX,MAAM,SACR;GACF;EACF;EACA,cAAc;GACZ,MAAM;GACN,SAAS;GACT,SAAS;EACX;EACA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,OAAO;IACL,MAAM;IACN,YAAY;KACV,IAAI,EACF,MAAM,mCACR;KACA,MAAM,EACJ,MAAM,SACR;KACA,MAAM;MACJ,MAAM;MACN,QAAQ;KACV;KACA,OAAO,EACL,MAAM,SACR;KACA,KAAK,EACH,MAAM,CAAC,UAAU,MAAM,EACzB;IACF;GACF;EACF;EACA,yBAAyB;GACvB,MAAM;GACN,MAAM;EACR;EACA,qBAAqB;GACnB,MAAM;GACN,MAAM;EACR;EACA,gBAAgB;EAChB,UAAU;GACR,MAAM;GACN,sBAAsB;GACtB,aACE;GACF,YAAY;IACV,IAAI;KACF,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,IAAI;OACF,MAAM;OACN,aACE;OACF,OAAO,EAAE,MAAM,SAAS;MAC1B;MACA,OAAO;OACL,MAAM;OACN,OAAO;QAAE,MAAM;QAAU,MAAM;OAAoB;MACrD;MACA,eAAe;OACb,MAAM;OACN,OAAO,EAAE,MAAM,SAAS;MAC1B;KACF;IACF;IACA,UAAU;KACR,MAAM;KACN,aAAa;KACb,aACE;KACF,OAAO;MAAE,MAAM;MAAU,MAAM;KAAyB;IAC1D;IACA,mBAAmB;KACjB,MAAM;KACN,aACE;IACJ;IACA,OAAO;KACL,MAAM;KACN,aACE;KACF,OAAO,EAAE,MAAM,SAAS;IAC1B;IACA,UAAU;KACR,MAAM;KACN,sBAAsB;KACtB,aACE;KACF,YAAY;MACV,UAAU;MACV,UAAU;OACR,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;MACA,mBAAmB;OACjB,MAAM;OACN,sBAAsB;OACtB,UAAU;QAAC;QAAc;QAAQ;OAAQ;OACzC,aAAa;OACb,YAAY;QACV,GAAG,mBAAmB;QACtB,WAAW;SACT,MAAM;SACN,sBAAsB;SACtB,aACE;SACF,YAAY;UACV,KAAK;UACL,OAAO;SACT;QACF;OACF;MACF;KACF;IACF;GACF;EACF;CACF;AACF"}
@@ -111,7 +111,39 @@ export declare const sosEventSchema: {
111
111
  };
112
112
  readonly audience: {
113
113
  readonly $ref: "definitions.json#/definitions/audience";
114
- readonly description: "Who this entry was directed at, and who it resolved to. `activation` and `final` entries always carry the everyone wildcard — neither is narrowable.";
114
+ readonly description: "Who this entry was directed at, and who it resolved to. `activation` entries always carry the everyone wildcard; `update` and `final` entries carry whatever the sender named — an empty selector reaches nobody.";
115
+ };
116
+ readonly channels: {
117
+ readonly type: "array";
118
+ readonly items: {
119
+ readonly type: "string";
120
+ readonly enum: readonly ["sms", "email"];
121
+ };
122
+ readonly description: "Personal channels the sender selected for this entry. Absent on entries recorded before channel selection existed, which sent over both.";
123
+ };
124
+ readonly surfaces: {
125
+ readonly type: "object";
126
+ readonly additionalProperties: false;
127
+ readonly required: readonly ["targets", "sent", "failed", "skipped"];
128
+ readonly description: "Rollup of the PA-surface dispatch, present when the entry named surfaces. `targets` is the devices the selectors resolved to; `skipped` counts drivers that cannot render content.";
129
+ readonly properties: {
130
+ readonly targets: {
131
+ readonly type: "integer";
132
+ readonly minimum: 0;
133
+ };
134
+ readonly sent: {
135
+ readonly type: "integer";
136
+ readonly minimum: 0;
137
+ };
138
+ readonly failed: {
139
+ readonly type: "integer";
140
+ readonly minimum: 0;
141
+ };
142
+ readonly skipped: {
143
+ readonly type: "integer";
144
+ readonly minimum: 0;
145
+ };
146
+ };
115
147
  };
116
148
  readonly deliveryStatus: {
117
149
  readonly type: "object";
@@ -163,7 +195,7 @@ export declare const sosEventSchema: {
163
195
  };
164
196
  };
165
197
  };
166
- readonly emergencyContacts: {
198
+ readonly external: {
167
199
  readonly type: "object";
168
200
  readonly additionalProperties: false;
169
201
  readonly description: "Per-channel live outcomes for one audience.";
@@ -290,6 +322,68 @@ export declare const sosEventSchema: {
290
322
  }];
291
323
  };
292
324
  };
325
+ readonly notes: {
326
+ readonly type: "array";
327
+ readonly default: readonly [];
328
+ readonly description: "Append-only, internal-only post-incident notes. Kept outside the timeline: a note is for the record, never something that was broadcast.";
329
+ readonly items: {
330
+ readonly type: "object";
331
+ readonly additionalProperties: false;
332
+ readonly required: readonly ["id", "text", "by", "at"];
333
+ readonly properties: {
334
+ readonly id: {
335
+ readonly type: "string";
336
+ readonly description: "Unique identifier for the note.";
337
+ };
338
+ readonly text: {
339
+ readonly type: "string";
340
+ readonly description: "Internal, plain-text note body. Never broadcast.";
341
+ };
342
+ readonly by: {
343
+ readonly type: readonly ["object", "null"];
344
+ readonly additionalProperties: false;
345
+ readonly required: readonly ["id", "discriminator"];
346
+ readonly properties: {
347
+ readonly id: {
348
+ readonly type: "string";
349
+ };
350
+ readonly discriminator: {
351
+ readonly type: "string";
352
+ readonly enum: readonly ["user", "device", "automation"];
353
+ };
354
+ };
355
+ readonly description: "Actor that wrote the note; null when unattributed.";
356
+ };
357
+ readonly at: {
358
+ readonly $ref: "definitions.json#/definitions/date";
359
+ readonly description: "When the note was recorded.";
360
+ };
361
+ };
362
+ };
363
+ };
364
+ readonly report: {
365
+ readonly type: "object";
366
+ readonly additionalProperties: false;
367
+ readonly required: readonly ["fileId", "url", "filename", "contentHash", "renderedAt"];
368
+ readonly description: "The most recently minted incident-report PDF, kept so a re-export of an unchanged, ended incident can reuse the file instead of rendering again. `contentHash` fingerprints the rendered content (excluding the generated-at stamp).";
369
+ readonly properties: {
370
+ readonly fileId: {
371
+ readonly type: "string";
372
+ };
373
+ readonly url: {
374
+ readonly type: "string";
375
+ };
376
+ readonly filename: {
377
+ readonly type: "string";
378
+ };
379
+ readonly contentHash: {
380
+ readonly type: "string";
381
+ };
382
+ readonly renderedAt: {
383
+ readonly $ref: "definitions.json#/definitions/date";
384
+ };
385
+ };
386
+ };
293
387
  readonly createdAt: {
294
388
  readonly $ref: "definitions.json#/definitions/date";
295
389
  readonly description: "When the SOS Event was created.";
@@ -307,6 +401,7 @@ export declare const sosEventSchema: {
307
401
  };
308
402
  export type SOSEventSchema = FromSchema<typeof sosEventSchema, {
309
403
  references: [typeof defs];
404
+ keepDefaultedPropertiesOptional: true;
310
405
  deserialize: [
311
406
  {
312
407
  pattern: {
@@ -86,7 +86,44 @@ const broadcastEntryNode = {
86
86
  },
87
87
  audience: {
88
88
  $ref: "definitions.json#/definitions/audience",
89
- description: "Who this entry was directed at, and who it resolved to. `activation` and `final` entries always carry the everyone wildcard — neither is narrowable."
89
+ description: "Who this entry was directed at, and who it resolved to. `activation` entries always carry the everyone wildcard; `update` and `final` entries carry whatever the sender named — an empty selector reaches nobody."
90
+ },
91
+ channels: {
92
+ type: "array",
93
+ items: {
94
+ type: "string",
95
+ enum: ["sms", "email"]
96
+ },
97
+ description: "Personal channels the sender selected for this entry. Absent on entries recorded before channel selection existed, which sent over both."
98
+ },
99
+ surfaces: {
100
+ type: "object",
101
+ additionalProperties: false,
102
+ required: [
103
+ "targets",
104
+ "sent",
105
+ "failed",
106
+ "skipped"
107
+ ],
108
+ description: "Rollup of the PA-surface dispatch, present when the entry named surfaces. `targets` is the devices the selectors resolved to; `skipped` counts drivers that cannot render content.",
109
+ properties: {
110
+ targets: {
111
+ type: "integer",
112
+ minimum: 0
113
+ },
114
+ sent: {
115
+ type: "integer",
116
+ minimum: 0
117
+ },
118
+ failed: {
119
+ type: "integer",
120
+ minimum: 0
121
+ },
122
+ skipped: {
123
+ type: "integer",
124
+ minimum: 0
125
+ }
126
+ }
90
127
  },
91
128
  deliveryStatus: {
92
129
  type: "object",
@@ -94,7 +131,7 @@ const broadcastEntryNode = {
94
131
  description: "Computed on demand by DescribeSOSEvent (not persisted): live per-audience, per-channel outcome counts grouped from the sms/email collections by appData.sosUpdateId × status. Absent on the returned event until at least one matching message exists; only audiences/channels with data are present.",
95
132
  properties: {
96
133
  internal: audienceDeliveryNode,
97
- emergencyContacts: audienceDeliveryNode
134
+ external: audienceDeliveryNode
98
135
  }
99
136
  }
100
137
  }
@@ -187,6 +224,34 @@ const automationRunEntryNode = {
187
224
  }
188
225
  }
189
226
  };
227
+ const noteNode = {
228
+ type: "object",
229
+ additionalProperties: false,
230
+ required: [
231
+ "id",
232
+ "text",
233
+ "by",
234
+ "at"
235
+ ],
236
+ properties: {
237
+ id: {
238
+ type: "string",
239
+ description: "Unique identifier for the note."
240
+ },
241
+ text: {
242
+ type: "string",
243
+ description: "Internal, plain-text note body. Never broadcast."
244
+ },
245
+ by: {
246
+ ...sosActorNode,
247
+ description: "Actor that wrote the note; null when unattributed."
248
+ },
249
+ at: {
250
+ $ref: "definitions.json#/definitions/date",
251
+ description: "When the note was recorded."
252
+ }
253
+ }
254
+ };
190
255
  const sosEventSchema = {
191
256
  $schema: "http://json-schema.org/draft-07/schema",
192
257
  $id: "sosEvent.json",
@@ -242,6 +307,31 @@ const sosEventSchema = {
242
307
  description: "Append-only timeline. The first entry is the `activation`; later entries are operator `update`s, automation runs, and a closing `final`.",
243
308
  items: { oneOf: [broadcastEntryNode, automationRunEntryNode] }
244
309
  },
310
+ notes: {
311
+ type: "array",
312
+ default: [],
313
+ description: "Append-only, internal-only post-incident notes. Kept outside the timeline: a note is for the record, never something that was broadcast.",
314
+ items: noteNode
315
+ },
316
+ report: {
317
+ type: "object",
318
+ additionalProperties: false,
319
+ required: [
320
+ "fileId",
321
+ "url",
322
+ "filename",
323
+ "contentHash",
324
+ "renderedAt"
325
+ ],
326
+ description: "The most recently minted incident-report PDF, kept so a re-export of an unchanged, ended incident can reuse the file instead of rendering again. `contentHash` fingerprints the rendered content (excluding the generated-at stamp).",
327
+ properties: {
328
+ fileId: { type: "string" },
329
+ url: { type: "string" },
330
+ filename: { type: "string" },
331
+ contentHash: { type: "string" },
332
+ renderedAt: { $ref: "definitions.json#/definitions/date" }
333
+ }
334
+ },
245
335
  createdAt: {
246
336
  $ref: "definitions.json#/definitions/date",
247
337
  description: "When the SOS Event was created."
@@ -1 +1 @@
1
- {"version":3,"file":"sosEvent.js","names":[],"sources":["../../.generated/schemas/sosEvent.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\n// Sub-node consts must not be exported: the model generator treats the first\n// export ending in \"Schema\" as the entity schema.\nconst sosActorNode = {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"id\", \"discriminator\"],\n properties: {\n id: { type: \"string\" },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"device\", \"automation\"],\n },\n },\n} as const;\n\n// Live outcome rollup for one channel. Buckets map the raw vendor statuses:\n// `sent` = accepted/in-flight but not yet terminal, `delivered` = terminal\n// success (delivered/read/opened/clicked), `failed` = terminal failure\n// (failed/undelivered/bounced/blocked). See deliveryOutcomeForStatus.\nconst deliveryOutcomeNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"sent\", \"delivered\", \"failed\"],\n properties: {\n sent: { type: \"integer\", minimum: 0 },\n delivered: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n },\n} as const;\n\nconst audienceDeliveryNode = {\n type: \"object\",\n additionalProperties: false,\n description: \"Per-channel live outcomes for one audience.\",\n properties: {\n sms: deliveryOutcomeNode,\n email: deliveryOutcomeNode,\n },\n} as const;\n\n// A timeline entry is a discriminated union on `type`, so `timeline.items` is\n// their `oneOf`. The branches are disjoint via the `type` enum plus\n// `additionalProperties: false`, so an entry validates against exactly one.\nconst broadcastEntryNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\", \"message\", \"by\", \"at\", \"audience\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Unique identifier for the timeline entry.\",\n },\n type: {\n type: \"string\",\n enum: [\"activation\", \"update\", \"final\"],\n description:\n \"`activation` opens the event, `update` is an interim message, `final` closes it.\",\n },\n message: {\n type: \"string\",\n description:\n \"The entry's message body. May be empty for entries that carry only audience/delivery intent.\",\n },\n by: {\n ...sosActorNode,\n description: \"Actor that authored the entry; null when unattributed.\",\n },\n at: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the entry was recorded.\",\n },\n audience: {\n $ref: \"definitions.json#/definitions/audience\",\n description:\n \"Who this entry was directed at, and who it resolved to. `activation` and `final` entries always carry the everyone wildcard — neither is narrowable.\",\n },\n deliveryStatus: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Computed on demand by DescribeSOSEvent (not persisted): live per-audience, per-channel outcome counts grouped from the sms/email collections by appData.sosUpdateId × status. Absent on the returned event until at least one matching message exists; only audiences/channels with data are present.\",\n properties: {\n internal: audienceDeliveryNode,\n emergencyContacts: audienceDeliveryNode,\n },\n },\n },\n} as const;\n\nconst automationRunActionNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"status\"],\n properties: {\n type: {\n type: \"string\",\n description: \"The use case the automation action invoked.\",\n },\n status: {\n type: \"string\",\n enum: [\"pending\", \"success\", \"failure\"],\n description:\n \"`pending` while the action is in flight; settles to `success` or `failure`.\",\n },\n error: {\n type: [\"string\", \"null\"],\n description: \"Failure message; absent when the action succeeded.\",\n },\n params: {\n type: \"object\",\n description:\n \"Pruned snapshot of the action's configured params (e.g. SetDevices device states, StartSOS type ids), enough to render a human summary of what the action did. Absent when the use case has no summarizable params.\",\n },\n },\n} as const;\n\nconst automationRunEntryNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\n \"id\",\n \"type\",\n \"at\",\n \"by\",\n \"automationName\",\n \"runId\",\n \"trigger\",\n \"actions\",\n ],\n properties: {\n id: {\n type: \"string\",\n description: \"Unique identifier for the timeline entry.\",\n },\n type: {\n type: \"string\",\n enum: [\"automationRun\"],\n description:\n \"Discriminator: an automation that ran in response to this SOS.\",\n },\n at: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the run started. The entry is stamped with pending actions up front and settled in place.\",\n },\n by: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\"],\n description:\n \"The Automation that ran. Its id is the automation's id — there is no separate automationId.\",\n properties: {\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"automation\"] },\n },\n },\n automationName: {\n type: \"string\",\n description:\n \"The automation's name snapshotted at run time, so a later rename or delete leaves the timeline readable.\",\n },\n runId: {\n type: \"string\",\n description:\n \"Groups this run's Activity records; one event matching several automations yields one runId each.\",\n },\n trigger: {\n type: \"string\",\n enum: [\"SOSActive\", \"SOSInactive\"],\n description: \"The SOS event type that matched the automation's trigger.\",\n },\n actions: {\n type: \"array\",\n default: [],\n description: \"Per-action outcome, in the automation's action order.\",\n items: automationRunActionNode,\n },\n },\n} as const;\n\nexport const sosEventSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"sosEvent.json\",\n title: \"SOS Event\",\n description:\n \"A durable record of a single SOS activation on a Property, with an append-only timeline of updates. Persists as audit history after the SOS is cleared.\",\n type: \"object\",\n required: [\"id\", \"type\", \"sosTypeIds\", \"activatedAt\", \"timeline\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n description: \"Unique identifier for the SOS Event.\",\n },\n type: {\n type: \"string\",\n enum: [\"sosEvent\"],\n default: \"sosEvent\",\n },\n propertyId: {\n type: \"string\",\n description:\n \"ID of the Property this SOS was raised on. Used as a per-document filter inside the org-scoped database.\",\n },\n sosTypeIds: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"The SOS Type ids this event was raised for.\",\n },\n activatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the SOS was raised.\",\n },\n activatedBy: {\n ...sosActorNode,\n description:\n \"Actor that raised the SOS (user, device, or automation); null when unattributed.\",\n },\n deactivatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the SOS was cleared. Absent while the event is active.\",\n },\n deactivatedBy: {\n ...sosActorNode,\n description:\n \"Actor that cleared the SOS; null when unattributed. Absent while the event is active.\",\n },\n timeline: {\n type: \"array\",\n default: [],\n description:\n \"Append-only timeline. The first entry is the `activation`; later entries are operator `update`s, automation runs, and a closing `final`.\",\n items: {\n oneOf: [broadcastEntryNode, automationRunEntryNode],\n },\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the SOS Event was created.\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the SOS Event was last modified.\",\n },\n deletedAt: {\n type: [\"string\", \"object\", \"null\"],\n format: \"date-time\",\n description: \"Soft-delete tombstone.\",\n },\n },\n} as const;\n\nexport type SOSEventSchema = FromSchema<\n typeof sosEventSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAKA,MAAM,eAAe;CACnB,MAAM,CAAC,UAAU,MAAM;CACvB,sBAAsB;CACtB,UAAU,CAAC,MAAM,eAAe;CAChC,YAAY;EACV,IAAI,EAAE,MAAM,SAAS;EACrB,eAAe;GACb,MAAM;GACN,MAAM;IAAC;IAAQ;IAAU;GAAY;EACvC;CACF;AACF;AAMA,MAAM,sBAAsB;CAC1B,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAQ;EAAa;CAAQ;CACxC,YAAY;EACV,MAAM;GAAE,MAAM;GAAW,SAAS;EAAE;EACpC,WAAW;GAAE,MAAM;GAAW,SAAS;EAAE;EACzC,QAAQ;GAAE,MAAM;GAAW,SAAS;EAAE;CACxC;AACF;AAEA,MAAM,uBAAuB;CAC3B,MAAM;CACN,sBAAsB;CACtB,aAAa;CACb,YAAY;EACV,KAAK;EACL,OAAO;CACT;AACF;AAKA,MAAM,qBAAqB;CACzB,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAM;EAAQ;EAAW;EAAM;EAAM;CAAU;CAC1D,YAAY;EACV,IAAI;GACF,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,MAAM;IAAC;IAAc;IAAU;GAAO;GACtC,aACE;EACJ;EACA,SAAS;GACP,MAAM;GACN,aACE;EACJ;EACA,IAAI;GACF,GAAG;GACH,aAAa;EACf;EACA,IAAI;GACF,MAAM;GACN,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,aACE;EACJ;EACA,gBAAgB;GACd,MAAM;GACN,sBAAsB;GACtB,aACE;GACF,YAAY;IACV,UAAU;IACV,mBAAmB;GACrB;EACF;CACF;AACF;AA6BA,MAAM,yBAAyB;CAC7B,MAAM;CACN,sBAAsB;CACtB,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;E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aAAa;EACf;EACA,aAAa;GACX,GAAG;GACH,aACE;EACJ;EACA,eAAe;GACb,MAAM;GACN,aACE;EACJ;EACA,eAAe;GACb,GAAG;GACH,aACE;EACJ;EACA,UAAU;GACR,MAAM;GACN,SAAS,CAAC;GACV,aACE;GACF,OAAO,EACL,OAAO,CAAC,oBAAoB,sBAAsB,EACpD;EACF;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;IAAC;IAAU;IAAU;GAAM;GACjC,QAAQ;GACR,aAAa;EACf;CACF;AACF"}
1
+ {"version":3,"file":"sosEvent.js","names":[],"sources":["../../.generated/schemas/sosEvent.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\n// Sub-node consts must not be exported: the model generator treats the first\n// export ending in \"Schema\" as the entity schema.\nconst sosActorNode = {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"id\", \"discriminator\"],\n properties: {\n id: { type: \"string\" },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"device\", \"automation\"],\n },\n },\n} as const;\n\n// Live outcome rollup for one channel. Buckets map the raw vendor statuses:\n// `sent` = accepted/in-flight but not yet terminal, `delivered` = terminal\n// success (delivered/read/opened/clicked), `failed` = terminal failure\n// (failed/undelivered/bounced/blocked). See deliveryOutcomeForStatus.\nconst deliveryOutcomeNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"sent\", \"delivered\", \"failed\"],\n properties: {\n sent: { type: \"integer\", minimum: 0 },\n delivered: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n },\n} as const;\n\nconst audienceDeliveryNode = {\n type: \"object\",\n additionalProperties: false,\n description: \"Per-channel live outcomes for one audience.\",\n properties: {\n sms: deliveryOutcomeNode,\n email: deliveryOutcomeNode,\n },\n} as const;\n\n// A timeline entry is a discriminated union on `type`, so `timeline.items` is\n// their `oneOf`. The branches are disjoint via the `type` enum plus\n// `additionalProperties: false`, so an entry validates against exactly one.\nconst broadcastEntryNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\", \"message\", \"by\", \"at\", \"audience\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Unique identifier for the timeline entry.\",\n },\n type: {\n type: \"string\",\n enum: [\"activation\", \"update\", \"final\"],\n description:\n \"`activation` opens the event, `update` is an interim message, `final` closes it.\",\n },\n message: {\n type: \"string\",\n description:\n \"The entry's message body. May be empty for entries that carry only audience/delivery intent.\",\n },\n by: {\n ...sosActorNode,\n description: \"Actor that authored the entry; null when unattributed.\",\n },\n at: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the entry was recorded.\",\n },\n audience: {\n $ref: \"definitions.json#/definitions/audience\",\n description:\n \"Who this entry was directed at, and who it resolved to. `activation` entries always carry the everyone wildcard; `update` and `final` entries carry whatever the sender named — an empty selector reaches nobody.\",\n },\n channels: {\n type: \"array\",\n items: { type: \"string\", enum: [\"sms\", \"email\"] },\n description:\n \"Personal channels the sender selected for this entry. Absent on entries recorded before channel selection existed, which sent over both.\",\n },\n surfaces: {\n type: \"object\",\n additionalProperties: false,\n required: [\"targets\", \"sent\", \"failed\", \"skipped\"],\n description:\n \"Rollup of the PA-surface dispatch, present when the entry named surfaces. `targets` is the devices the selectors resolved to; `skipped` counts drivers that cannot render content.\",\n properties: {\n targets: { type: \"integer\", minimum: 0 },\n sent: { type: \"integer\", minimum: 0 },\n failed: { type: \"integer\", minimum: 0 },\n skipped: { type: \"integer\", minimum: 0 },\n },\n },\n deliveryStatus: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"Computed on demand by DescribeSOSEvent (not persisted): live per-audience, per-channel outcome counts grouped from the sms/email collections by appData.sosUpdateId × status. Absent on the returned event until at least one matching message exists; only audiences/channels with data are present.\",\n properties: {\n internal: audienceDeliveryNode,\n external: audienceDeliveryNode,\n },\n },\n },\n} as const;\n\nconst automationRunActionNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"status\"],\n properties: {\n type: {\n type: \"string\",\n description: \"The use case the automation action invoked.\",\n },\n status: {\n type: \"string\",\n enum: [\"pending\", \"success\", \"failure\"],\n description:\n \"`pending` while the action is in flight; settles to `success` or `failure`.\",\n },\n error: {\n type: [\"string\", \"null\"],\n description: \"Failure message; absent when the action succeeded.\",\n },\n params: {\n type: \"object\",\n description:\n \"Pruned snapshot of the action's configured params (e.g. SetDevices device states, StartSOS type ids), enough to render a human summary of what the action did. Absent when the use case has no summarizable params.\",\n },\n },\n} as const;\n\nconst automationRunEntryNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\n \"id\",\n \"type\",\n \"at\",\n \"by\",\n \"automationName\",\n \"runId\",\n \"trigger\",\n \"actions\",\n ],\n properties: {\n id: {\n type: \"string\",\n description: \"Unique identifier for the timeline entry.\",\n },\n type: {\n type: \"string\",\n enum: [\"automationRun\"],\n description:\n \"Discriminator: an automation that ran in response to this SOS.\",\n },\n at: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the run started. The entry is stamped with pending actions up front and settled in place.\",\n },\n by: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\"],\n description:\n \"The Automation that ran. Its id is the automation's id — there is no separate automationId.\",\n properties: {\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"automation\"] },\n },\n },\n automationName: {\n type: \"string\",\n description:\n \"The automation's name snapshotted at run time, so a later rename or delete leaves the timeline readable.\",\n },\n runId: {\n type: \"string\",\n description:\n \"Groups this run's Activity records; one event matching several automations yields one runId each.\",\n },\n trigger: {\n type: \"string\",\n enum: [\"SOSActive\", \"SOSInactive\"],\n description: \"The SOS event type that matched the automation's trigger.\",\n },\n actions: {\n type: \"array\",\n default: [],\n description: \"Per-action outcome, in the automation's action order.\",\n items: automationRunActionNode,\n },\n },\n} as const;\n\nconst noteNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"text\", \"by\", \"at\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Unique identifier for the note.\",\n },\n text: {\n type: \"string\",\n description: \"Internal, plain-text note body. Never broadcast.\",\n },\n by: {\n ...sosActorNode,\n description: \"Actor that wrote the note; null when unattributed.\",\n },\n at: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the note was recorded.\",\n },\n },\n} as const;\n\nexport const sosEventSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"sosEvent.json\",\n title: \"SOS Event\",\n description:\n \"A durable record of a single SOS activation on a Property, with an append-only timeline of updates. Persists as audit history after the SOS is cleared.\",\n type: \"object\",\n required: [\"id\", \"type\", \"sosTypeIds\", \"activatedAt\", \"timeline\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n description: \"Unique identifier for the SOS Event.\",\n },\n type: {\n type: \"string\",\n enum: [\"sosEvent\"],\n default: \"sosEvent\",\n },\n propertyId: {\n type: \"string\",\n description:\n \"ID of the Property this SOS was raised on. Used as a per-document filter inside the org-scoped database.\",\n },\n sosTypeIds: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"The SOS Type ids this event was raised for.\",\n },\n activatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the SOS was raised.\",\n },\n activatedBy: {\n ...sosActorNode,\n description:\n \"Actor that raised the SOS (user, device, or automation); null when unattributed.\",\n },\n deactivatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the SOS was cleared. Absent while the event is active.\",\n },\n deactivatedBy: {\n ...sosActorNode,\n description:\n \"Actor that cleared the SOS; null when unattributed. Absent while the event is active.\",\n },\n timeline: {\n type: \"array\",\n default: [],\n description:\n \"Append-only timeline. The first entry is the `activation`; later entries are operator `update`s, automation runs, and a closing `final`.\",\n items: {\n oneOf: [broadcastEntryNode, automationRunEntryNode],\n },\n },\n notes: {\n type: \"array\",\n default: [],\n description:\n \"Append-only, internal-only post-incident notes. Kept outside the timeline: a note is for the record, never something that was broadcast.\",\n items: noteNode,\n },\n report: {\n type: \"object\",\n additionalProperties: false,\n required: [\"fileId\", \"url\", \"filename\", \"contentHash\", \"renderedAt\"],\n description:\n \"The most recently minted incident-report PDF, kept so a re-export of an unchanged, ended incident can reuse the file instead of rendering again. `contentHash` fingerprints the rendered content (excluding the generated-at stamp).\",\n properties: {\n fileId: { type: \"string\" },\n url: { type: \"string\" },\n filename: { type: \"string\" },\n contentHash: { type: \"string\" },\n renderedAt: { $ref: \"definitions.json#/definitions/date\" },\n },\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the SOS Event was created.\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the SOS Event was last modified.\",\n },\n deletedAt: {\n type: [\"string\", \"object\", \"null\"],\n format: \"date-time\",\n description: \"Soft-delete tombstone.\",\n },\n },\n} as const;\n\nexport type SOSEventSchema = FromSchema<\n typeof sosEventSchema,\n {\n references: [typeof defs];\n // `notes` carries `default: []` but is not required; keep it optional in\n // the type so pre-notes documents and writers that omit it still fit.\n keepDefaultedPropertiesOptional: true;\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAKA,MAAM,eAAe;CACnB,MAAM,CAAC,UAAU,MAAM;CACvB,sBAAsB;CACtB,UAAU,CAAC,MAAM,eAAe;CAChC,YAAY;EACV,IAAI,EAAE,MAAM,SAAS;EACrB,eAAe;GACb,MAAM;GACN,MAAM;IAAC;IAAQ;IAAU;GAAY;EACvC;CACF;AACF;AAMA,MAAM,sBAAsB;CAC1B,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAQ;EAAa;CAAQ;CACxC,YAAY;EACV,MAAM;GAAE,MAAM;GAAW,SAAS;EAAE;EACpC,WAAW;GAAE,MAAM;GAAW,SAAS;EAAE;EACzC,QAAQ;GAAE,MAAM;GAAW,SAAS;EAAE;CACxC;AACF;AAEA,MAAM,uBAAuB;CAC3B,MAAM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ACxB,aAAa;EACf;EACA,aAAa;GACX,MAAM;GACN,aAAa;EACf;EACA,aAAa;GACX,GAAG;GACH,aACE;EACJ;EACA,eAAe;GACb,MAAM;GACN,aACE;EACJ;EACA,eAAe;GACb,GAAG;GACH,aACE;EACJ;EACA,UAAU;GACR,MAAM;GACN,SAAS,CAAC;GACV,aACE;GACF,OAAO,EACL,OAAO,CAAC,oBAAoB,sBAAsB,EACpD;EACF;EACA,OAAO;GACL,MAAM;GACN,SAAS,CAAC;GACV,aACE;GACF,OAAO;EACT;EACA,QAAQ;GACN,MAAM;GACN,sBAAsB;GACtB,UAAU;IAAC;IAAU;IAAO;IAAY;IAAe;GAAY;GACnE,aACE;GACF,YAAY;IACV,QAAQ,EAAE,MAAM,SAAS;IACzB,KAAK,EAAE,MAAM,SAAS;IACtB,UAAU,EAAE,MAAM,SAAS;IAC3B,aAAa,EAAE,MAAM,SAAS;IAC9B,YAAY,EAAE,MAAM,qCAAqC;GAC3D;EACF;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;IAAC;IAAU;IAAU;GAAM;GACjC,QAAQ;GACR,aAAa;EACf;CACF;AACF"}
@@ -0,0 +1,36 @@
1
+ export interface AddSOSEventNoteCommandConfig {
2
+ data?: {
3
+ eventId: string;
4
+ [key: string]: unknown;
5
+ } | null;
6
+ headers?: Record<string, string> | null;
7
+ query?: Record<string, unknown> | null;
8
+ }
9
+ export interface AddSOSEventNoteCommandRequestConfig {
10
+ method: "post";
11
+ url: string;
12
+ data: {
13
+ eventId: string;
14
+ [key: string]: unknown;
15
+ } | null;
16
+ params: Record<string, unknown> | null;
17
+ headers: Record<string, string> | null;
18
+ [key: string]: unknown;
19
+ }
20
+ /**
21
+ *
22
+ */
23
+ export declare class AddSOSEventNoteCommand {
24
+ url: string;
25
+ data: {
26
+ eventId: string;
27
+ [key: string]: unknown;
28
+ } | null;
29
+ query: Record<string, unknown> | null;
30
+ headers: Record<string, string> | null;
31
+ config: AddSOSEventNoteCommandRequestConfig;
32
+ static params: readonly ["eventId"];
33
+ static url: string;
34
+ static method: "post";
35
+ constructor(commandConfig: AddSOSEventNoteCommandConfig, options?: Record<string, unknown>);
36
+ }
@@ -0,0 +1,47 @@
1
+ //#region .generated/useCases/addSOSEventNote.ts
2
+ /**
3
+ *
4
+ */
5
+ var AddSOSEventNoteCommand = class AddSOSEventNoteCommand {
6
+ url;
7
+ data;
8
+ query;
9
+ headers;
10
+ config;
11
+ static params = ["eventId"];
12
+ static url = "/sos/events/:eventId/notes";
13
+ static method = "post";
14
+ constructor(commandConfig, options = {}) {
15
+ const pathParams = AddSOSEventNoteCommand.params;
16
+ let { data, query, headers } = commandConfig ?? {};
17
+ if (typeof data === "undefined") data = null;
18
+ if (typeof query === "undefined") query = null;
19
+ if (typeof headers === "undefined") headers = null;
20
+ let url = AddSOSEventNoteCommand.url;
21
+ if (pathParams && data) for (const param of pathParams) {
22
+ const urlParam = ":" + param;
23
+ url = url.replace(urlParam, data[param]);
24
+ }
25
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
26
+ if (missingParams) {
27
+ const missing = missingParams.map((param) => param.replace(":", ""));
28
+ throw new Error("Missing parameters: " + missing.join(", "));
29
+ }
30
+ this.url = url;
31
+ this.data = data;
32
+ this.query = query;
33
+ this.headers = headers;
34
+ this.config = {
35
+ method: AddSOSEventNoteCommand.method,
36
+ url,
37
+ data,
38
+ params: query,
39
+ headers,
40
+ ...options
41
+ };
42
+ }
43
+ };
44
+ //#endregion
45
+ export { AddSOSEventNoteCommand };
46
+
47
+ //# sourceMappingURL=addSOSEventNote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addSOSEventNote.js","names":[],"sources":["../../.generated/useCases/addSOSEventNote.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nexport interface AddSOSEventNoteCommandConfig {\n data?: { eventId: string; [key: string]: unknown } | null;\n headers?: Record<string, string> | null;\n query?: Record<string, unknown> | null;\n}\n\nexport interface AddSOSEventNoteCommandRequestConfig {\n method: \"post\";\n url: string;\n data: { eventId: string; [key: string]: unknown } | null;\n params: Record<string, unknown> | null;\n headers: Record<string, string> | null;\n [key: string]: unknown;\n}\n\n/**\n * \n */\nexport class AddSOSEventNoteCommand {\n url: string;\n data: { eventId: string; [key: string]: unknown } | null;\n query: Record<string, unknown> | null;\n headers: Record<string, string> | null;\n config: AddSOSEventNoteCommandRequestConfig;\n\n static params = [\"eventId\"] as const;\n static url = \"/sos/events/:eventId/notes\";\n static method = \"post\" as const;\n\n constructor(commandConfig: AddSOSEventNoteCommandConfig, options: Record<string, unknown> = {}) {\n const pathParams = AddSOSEventNoteCommand.params;\n\n let { data, query, headers } = commandConfig ?? {};\n\n if (typeof data === \"undefined\") data = null;\n if (typeof query === \"undefined\") query = null;\n if (typeof headers === \"undefined\") headers = null;\n\n // Replace path parameters with values from data\n let url: string = AddSOSEventNoteCommand.url;\n\n if (pathParams && data) {\n for (const param of pathParams) {\n const urlParam = \":\" + param;\n url = url.replace(urlParam, (data as Record<string, string>)[param]);\n }\n }\n\n // Make sure all parameters have been replaced\n const missingParams = url.match(/:[a-zA-Z0-9]+/g);\n if (missingParams) {\n const missing = missingParams.map((param) => param.replace(\":\", \"\"));\n throw new Error(\"Missing parameters: \" + missing.join(\", \"));\n }\n\n this.url = url;\n this.data = data;\n this.query = query;\n this.headers = headers;\n\n this.config = {\n method: AddSOSEventNoteCommand.method,\n url: url,\n data: data,\n params: query,\n headers: headers,\n ...options,\n };\n }\n}\n"],"mappings":";;;;AAoBA,IAAa,yBAAb,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CAEA,OAAO,SAAS,CAAC,SAAS;CAC1B,OAAO,MAAM;CACb,OAAO,SAAS;CAEhB,YAAY,eAA6C,UAAmC,CAAC,GAAG;EAC9F,MAAM,aAAa,uBAAuB;EAE1C,IAAI,EAAE,MAAM,OAAO,YAAY,iBAAiB,CAAC;EAEjD,IAAI,OAAO,SAAS,aAAa,OAAO;EACxC,IAAI,OAAO,UAAU,aAAa,QAAQ;EAC1C,IAAI,OAAO,YAAY,aAAa,UAAU;EAG9C,IAAI,MAAc,uBAAuB;EAEzC,IAAI,cAAc,MAChB,KAAK,MAAM,SAAS,YAAY;GAC9B,MAAM,WAAW,MAAM;GACvB,MAAM,IAAI,QAAQ,UAAW,KAAgC,MAAM;EACrE;EAIF,MAAM,gBAAgB,IAAI,MAAM,gBAAgB;EAChD,IAAI,eAAe;GACjB,MAAM,UAAU,cAAc,KAAK,UAAU,MAAM,QAAQ,KAAK,EAAE,CAAC;GACnE,MAAM,IAAI,MAAM,yBAAyB,QAAQ,KAAK,IAAI,CAAC;EAC7D;EAEA,KAAK,MAAM;EACX,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,UAAU;EAEf,KAAK,SAAS;GACZ,QAAQ,uBAAuB;GAC1B;GACC;GACN,QAAQ;GACC;GACT,GAAG;EACL;CACF;AACF"}
@@ -0,0 +1,27 @@
1
+ export interface CreateAnnouncementPresetCommandConfig {
2
+ data?: Record<string, unknown> | unknown[] | null;
3
+ headers?: Record<string, string> | null;
4
+ query?: Record<string, unknown> | null;
5
+ }
6
+ export interface CreateAnnouncementPresetCommandRequestConfig {
7
+ method: "post";
8
+ url: string;
9
+ data: Record<string, unknown> | unknown[] | null;
10
+ params: Record<string, unknown> | null;
11
+ headers: Record<string, string> | null;
12
+ [key: string]: unknown;
13
+ }
14
+ /**
15
+ *
16
+ */
17
+ export declare class CreateAnnouncementPresetCommand {
18
+ url: string;
19
+ data: Record<string, unknown> | unknown[] | null;
20
+ query: Record<string, unknown> | null;
21
+ headers: Record<string, string> | null;
22
+ config: CreateAnnouncementPresetCommandRequestConfig;
23
+ static params: readonly [];
24
+ static url: string;
25
+ static method: "post";
26
+ constructor(commandConfig: CreateAnnouncementPresetCommandConfig, options?: Record<string, unknown>);
27
+ }
@@ -0,0 +1,47 @@
1
+ //#region .generated/useCases/createAnnouncementPreset.ts
2
+ /**
3
+ *
4
+ */
5
+ var CreateAnnouncementPresetCommand = class CreateAnnouncementPresetCommand {
6
+ url;
7
+ data;
8
+ query;
9
+ headers;
10
+ config;
11
+ static params = [];
12
+ static url = "/announcements/presets";
13
+ static method = "post";
14
+ constructor(commandConfig, options = {}) {
15
+ const pathParams = CreateAnnouncementPresetCommand.params;
16
+ let { data, query, headers } = commandConfig ?? {};
17
+ if (typeof data === "undefined") data = null;
18
+ if (typeof query === "undefined") query = null;
19
+ if (typeof headers === "undefined") headers = null;
20
+ let url = CreateAnnouncementPresetCommand.url;
21
+ if (pathParams && data) for (const param of pathParams) {
22
+ const urlParam = ":" + param;
23
+ url = url.replace(urlParam, data[param]);
24
+ }
25
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
26
+ if (missingParams) {
27
+ const missing = missingParams.map((param) => param.replace(":", ""));
28
+ throw new Error("Missing parameters: " + missing.join(", "));
29
+ }
30
+ this.url = url;
31
+ this.data = data;
32
+ this.query = query;
33
+ this.headers = headers;
34
+ this.config = {
35
+ method: CreateAnnouncementPresetCommand.method,
36
+ url,
37
+ data,
38
+ params: query,
39
+ headers,
40
+ ...options
41
+ };
42
+ }
43
+ };
44
+ //#endregion
45
+ export { CreateAnnouncementPresetCommand };
46
+
47
+ //# sourceMappingURL=createAnnouncementPreset.js.map