@zaflun/lumio-protocol 0.6.0 → 0.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,100 @@ 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.10.0
9
+
10
+ ### Added
11
+
12
+ - **Shopify event types** — `shopify:order`, `shopify:order_paid` and
13
+ `shopify:product` in `LUMIO_EVENT_TYPES`, with payload schemas. Every
14
+ Shopify payload names its store in `shop { domain, label }`; `label` is the
15
+ store's label in Lumio when the event arrived. `shop` is optional: events
16
+ stored before stores carried it have none. Order payloads carry
17
+ `total_price` / `currency` and `line_items` only as the store's settings
18
+ allow, and `customer_display` only with the buyer's consent (untrusted
19
+ buyer text). Golden fixtures in `fixtures/events/shopify/`.
20
+
21
+ ### Changed
22
+
23
+ - **zod `^4.6.7`** — the `zod` dependency range moves up from `^4.3.6`.
24
+ - **Built with tsup 9** — the type declarations emit `export type { … }`
25
+ instead of `export { type … }`; the exported types are unchanged.
26
+
27
+ ## 0.9.0
28
+
29
+ ### Added
30
+
31
+ - **Typed event payloads** — `LUMIO_EVENT_PAYLOAD_SCHEMAS` holds one zod
32
+ schema per `LUMIO_EVENT_TYPES` entry for the `data` of an `event.platform`
33
+ notification (the backend's event `raw`; a `ChatMessageInput` for the chat
34
+ types). `LumioEventPayloadMap` / `LumioEventPayload<K>` are the inferred
35
+ types, `ChatMessagePayload` and `ModerationLogPayload` the shared ones.
36
+ `lumioEventPayloadSchema(type)` and `parseLumioEventPayload(type, data)`
37
+ validate a payload. The map is checked with `satisfies` against
38
+ `LumioEventType`, so a new event type without a schema fails typecheck. The
39
+ shapes follow the golden fixtures the backend exports to `fixtures/events/`.
40
+ Object schemas are loose: fields the backend adds later are kept, typed
41
+ `unknown`. The wire format is unchanged.
42
+
43
+ ### Changed
44
+
45
+ - **`twitch:gift_sub` is now `twitch:gift`** in `LUMIO_EVENT_TYPES`. The
46
+ backend has always emitted gifted subs as `twitch:gift`, so no event ever
47
+ matched `twitch:gift_sub`. Replace the type in `useLumioEvent()` calls and
48
+ `event()` triggers. Breaking.
49
+
50
+ ## 0.8.0
51
+
52
+ ### Added
53
+
54
+ - **`SERVER_FUNCTION_ERRORS`** — the JSON-RPC error codes a host answers a
55
+ failed `server.query` / `server.mutation` with (`INVALID_REQUEST`,
56
+ `UNAVAILABLE`, `DENIED`, `UNKNOWN_FUNCTION`, `INVALID_PARAMS`, `FAILED`),
57
+ and the `ServerFunctionErrorCode` type. `ServerQueryParams` /
58
+ `ServerMutationParams` document their results: `server.query` resolves with
59
+ the rows, `server.mutation` with the written row or `null`. Additive.
60
+ - **`server.realtime`** — `HOST_METHODS.SERVER_REALTIME` (`"server.realtime"`)
61
+ is the host → worker notification that carries a message a handler of the
62
+ install pushed with `ctx.realtime.push(topic, payload)`, with
63
+ `ServerRealtimeParams` (`{ topic; payload }`). `REALTIME_LIMITS` holds the
64
+ push rules (`TOPIC_PATTERN`, `MAX_PAYLOAD_BYTES` 16 KiB,
65
+ `MAX_PUSHES_PER_INVOCATION` 32, `MAX_PUSHES_PER_MINUTE` 300 and
66
+ `MAX_BYTES_PER_MINUTE` 1 MiB per install). Additive.
67
+
68
+ ### Removed
69
+
70
+ - **`interactive` target** — `LifecycleInitParams["target"]` and the
71
+ `extensionConfigSchema` `target` enum accept only `editor` and `layer`. No
72
+ host ever rendered an `interactive` surface; viewers interact through chat
73
+ commands and channel point rewards (`twitch:reward`, `kick:reward`) that a
74
+ bot-module handler turns into `ctx.realtime.push`, received with
75
+ `server.realtime`.
76
+
77
+ **Breaking for consumers** that pass or `switch` over `"interactive"`. Drop
78
+ that arm; an init message carrying `target: "interactive"` now fails
79
+ validation.
80
+
81
+ ## 0.7.0
82
+
83
+ ### Added
84
+
85
+ - **`action.execute`** — `WORKER_METHODS.ACTION_EXECUTE` (`"action.execute"`)
86
+ is the worker → host request `useLumioAction()` sends, with
87
+ `ActionExecuteParams` (`{ action: LumioActionType; params }`) and
88
+ `ActionExecuteResult` (`{ data }`). `ACTION_EXECUTE_ERRORS` lists the
89
+ JSON-RPC error codes a host answers a failed action with (`INVALID_REQUEST`,
90
+ `UNAVAILABLE`, `DENIED`, `UNKNOWN_ACTION`, `INVALID_PARAMS`, `FAILED`).
91
+ Additive.
92
+ - **Twitch reward lifecycle event types** — `twitch:reward_status`,
93
+ `twitch:reward_add`, `twitch:reward_update` and `twitch:reward_remove` are in
94
+ `LUMIO_EVENT_TYPES`, `LumioEventType` and the `lumioEventTypeSchema` Zod enum.
95
+ `twitch:reward_status` is a redemption's status change (`fulfilled` /
96
+ `canceled`) with the same shape as `twitch:reward`. `twitch:reward_add` /
97
+ `_update` / `_remove` fire when the streamer creates, changes or deletes a
98
+ channel-point reward on Twitch and carry the Twitch custom-reward object; they
99
+ are delivered live only (`broadcast_only`) and never appear in the event
100
+ history. Additive.
101
+
8
102
  ## 0.6.0
9
103
 
10
104
  ### Added
package/README.md CHANGED
@@ -10,7 +10,7 @@ npm install @zaflun/lumio-protocol
10
10
 
11
11
  ## What's included
12
12
 
13
- - **54 Event Types** — Twitch, YouTube, Kick, Spotify, StreamElements, Chat
13
+ - **65 Event Types** — Twitch, YouTube, Kick, Spotify, StreamElements, Shopify, Chat
14
14
  - **21 Action Types** — Chat, OBS, Spotify, Events, Overlay
15
15
  - **Message Schemas** — JSON-RPC 2.0 wire format (Zod validated)
16
16
  - **30 Component Types** — `LumioComponentNode` for serialized UI trees