@zaflun/lumio-protocol 0.6.0 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,81 @@ All notable changes to `@zaflun/lumio-protocol` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.9.0
9
+
10
+ ### Added
11
+
12
+ - **Typed event payloads** — `LUMIO_EVENT_PAYLOAD_SCHEMAS` holds one zod
13
+ schema per `LUMIO_EVENT_TYPES` entry for the `data` of an `event.platform`
14
+ notification (the backend's event `raw`; a `ChatMessageInput` for the chat
15
+ types). `LumioEventPayloadMap` / `LumioEventPayload<K>` are the inferred
16
+ types, `ChatMessagePayload` and `ModerationLogPayload` the shared ones.
17
+ `lumioEventPayloadSchema(type)` and `parseLumioEventPayload(type, data)`
18
+ validate a payload. The map is checked with `satisfies` against
19
+ `LumioEventType`, so a new event type without a schema fails typecheck. The
20
+ shapes follow the golden fixtures the backend exports to `fixtures/events/`.
21
+ Object schemas are loose: fields the backend adds later are kept, typed
22
+ `unknown`. The wire format is unchanged.
23
+
24
+ ### Changed
25
+
26
+ - **`twitch:gift_sub` is now `twitch:gift`** in `LUMIO_EVENT_TYPES`. The
27
+ backend has always emitted gifted subs as `twitch:gift`, so no event ever
28
+ matched `twitch:gift_sub`. Replace the type in `useLumioEvent()` calls and
29
+ `event()` triggers. Breaking.
30
+
31
+ ## 0.8.0
32
+
33
+ ### Added
34
+
35
+ - **`SERVER_FUNCTION_ERRORS`** — the JSON-RPC error codes a host answers a
36
+ failed `server.query` / `server.mutation` with (`INVALID_REQUEST`,
37
+ `UNAVAILABLE`, `DENIED`, `UNKNOWN_FUNCTION`, `INVALID_PARAMS`, `FAILED`),
38
+ and the `ServerFunctionErrorCode` type. `ServerQueryParams` /
39
+ `ServerMutationParams` document their results: `server.query` resolves with
40
+ the rows, `server.mutation` with the written row or `null`. Additive.
41
+ - **`server.realtime`** — `HOST_METHODS.SERVER_REALTIME` (`"server.realtime"`)
42
+ is the host → worker notification that carries a message a handler of the
43
+ install pushed with `ctx.realtime.push(topic, payload)`, with
44
+ `ServerRealtimeParams` (`{ topic; payload }`). `REALTIME_LIMITS` holds the
45
+ push rules (`TOPIC_PATTERN`, `MAX_PAYLOAD_BYTES` 16 KiB,
46
+ `MAX_PUSHES_PER_INVOCATION` 32, `MAX_PUSHES_PER_MINUTE` 300 and
47
+ `MAX_BYTES_PER_MINUTE` 1 MiB per install). Additive.
48
+
49
+ ### Removed
50
+
51
+ - **`interactive` target** — `LifecycleInitParams["target"]` and the
52
+ `extensionConfigSchema` `target` enum accept only `editor` and `layer`. No
53
+ host ever rendered an `interactive` surface; viewers interact through chat
54
+ commands and channel point rewards (`twitch:reward`, `kick:reward`) that a
55
+ bot-module handler turns into `ctx.realtime.push`, received with
56
+ `server.realtime`.
57
+
58
+ **Breaking for consumers** that pass or `switch` over `"interactive"`. Drop
59
+ that arm; an init message carrying `target: "interactive"` now fails
60
+ validation.
61
+
62
+ ## 0.7.0
63
+
64
+ ### Added
65
+
66
+ - **`action.execute`** — `WORKER_METHODS.ACTION_EXECUTE` (`"action.execute"`)
67
+ is the worker → host request `useLumioAction()` sends, with
68
+ `ActionExecuteParams` (`{ action: LumioActionType; params }`) and
69
+ `ActionExecuteResult` (`{ data }`). `ACTION_EXECUTE_ERRORS` lists the
70
+ JSON-RPC error codes a host answers a failed action with (`INVALID_REQUEST`,
71
+ `UNAVAILABLE`, `DENIED`, `UNKNOWN_ACTION`, `INVALID_PARAMS`, `FAILED`).
72
+ Additive.
73
+ - **Twitch reward lifecycle event types** — `twitch:reward_status`,
74
+ `twitch:reward_add`, `twitch:reward_update` and `twitch:reward_remove` are in
75
+ `LUMIO_EVENT_TYPES`, `LumioEventType` and the `lumioEventTypeSchema` Zod enum.
76
+ `twitch:reward_status` is a redemption's status change (`fulfilled` /
77
+ `canceled`) with the same shape as `twitch:reward`. `twitch:reward_add` /
78
+ `_update` / `_remove` fire when the streamer creates, changes or deletes a
79
+ channel-point reward on Twitch and carry the Twitch custom-reward object; they
80
+ are delivered live only (`broadcast_only`) and never appear in the event
81
+ history. Additive.
82
+
8
83
  ## 0.6.0
9
84
 
10
85
  ### Added