@zaflun/lumio-protocol 0.9.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 +19 -0
- package/README.md +1 -1
- package/dist/index.d.ts +52 -42
- package/dist/index.js +44 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ 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
|
+
|
|
8
27
|
## 0.9.0
|
|
9
28
|
|
|
10
29
|
### Added
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm install @zaflun/lumio-protocol
|
|
|
10
10
|
|
|
11
11
|
## What's included
|
|
12
12
|
|
|
13
|
-
- **
|
|
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
|
package/dist/index.d.ts
CHANGED
|
@@ -283,7 +283,7 @@ declare const lumioMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
283
283
|
}, z.core.$strip>], "type">;
|
|
284
284
|
type LumioMessage = z.infer<typeof lumioMessageSchema>;
|
|
285
285
|
|
|
286
|
-
declare const LUMIO_EVENT_TYPES: readonly ["twitch:follower", "twitch:subscribe", "twitch:gift", "twitch:resub", "twitch:cheer", "twitch:raid", "twitch:reward", "twitch:reward_status", "twitch:reward_add", "twitch:reward_update", "twitch:reward_remove", "twitch:hype_train", "twitch:hype_train_end", "twitch:poll", "twitch:poll_end", "twitch:prediction", "twitch:prediction_lock", "twitch:prediction_end", "twitch:goal", "twitch:goal_end", "twitch:ad_break", "twitch:ban", "twitch:unban", "twitch:stream_online", "twitch:stream_offline", "twitch:stream_update", "youtube:subscribe", "youtube:member", "youtube:superchat", "youtube:supersticker", "youtube:gift_membership", "youtube:gift_membership_received", "youtube:poll", "youtube:stream_online", "youtube:stream_offline", "kick:follower", "kick:subscribe", "kick:resub", "kick:gift", "kick:kicks", "kick:reward", "kick:reward_status", "kick:stream_online", "kick:stream_offline", "kick:stream_update", "spotify:track", "spotify:play", "spotify:pause", "spotify:skip", "spotify:volume", "spotify:queue_add", "spotify:device", "spotify:playlist_add", "spotify:playlist_remove", "spotify:playlist_create", "spotify:playlist_edit", "spotify:playlist_delete", "streamelements:tip", "twitch:chat", "youtube:chat", "kick:chat", "chat:message"];
|
|
286
|
+
declare const LUMIO_EVENT_TYPES: readonly ["twitch:follower", "twitch:subscribe", "twitch:gift", "twitch:resub", "twitch:cheer", "twitch:raid", "twitch:reward", "twitch:reward_status", "twitch:reward_add", "twitch:reward_update", "twitch:reward_remove", "twitch:hype_train", "twitch:hype_train_end", "twitch:poll", "twitch:poll_end", "twitch:prediction", "twitch:prediction_lock", "twitch:prediction_end", "twitch:goal", "twitch:goal_end", "twitch:ad_break", "twitch:ban", "twitch:unban", "twitch:stream_online", "twitch:stream_offline", "twitch:stream_update", "youtube:subscribe", "youtube:member", "youtube:superchat", "youtube:supersticker", "youtube:gift_membership", "youtube:gift_membership_received", "youtube:poll", "youtube:stream_online", "youtube:stream_offline", "kick:follower", "kick:subscribe", "kick:resub", "kick:gift", "kick:kicks", "kick:reward", "kick:reward_status", "kick:stream_online", "kick:stream_offline", "kick:stream_update", "spotify:track", "spotify:play", "spotify:pause", "spotify:skip", "spotify:volume", "spotify:queue_add", "spotify:device", "spotify:playlist_add", "spotify:playlist_remove", "spotify:playlist_create", "spotify:playlist_edit", "spotify:playlist_delete", "streamelements:tip", "shopify:order", "shopify:order_paid", "shopify:product", "twitch:chat", "youtube:chat", "kick:chat", "chat:message"];
|
|
287
287
|
type LumioEventType = (typeof LUMIO_EVENT_TYPES)[number];
|
|
288
288
|
declare const lumioEventTypeSchema: z.ZodEnum<{
|
|
289
289
|
"twitch:follower": "twitch:follower";
|
|
@@ -344,6 +344,9 @@ declare const lumioEventTypeSchema: z.ZodEnum<{
|
|
|
344
344
|
"spotify:playlist_edit": "spotify:playlist_edit";
|
|
345
345
|
"spotify:playlist_delete": "spotify:playlist_delete";
|
|
346
346
|
"streamelements:tip": "streamelements:tip";
|
|
347
|
+
"shopify:order": "shopify:order";
|
|
348
|
+
"shopify:order_paid": "shopify:order_paid";
|
|
349
|
+
"shopify:product": "shopify:product";
|
|
347
350
|
"twitch:chat": "twitch:chat";
|
|
348
351
|
"youtube:chat": "youtube:chat";
|
|
349
352
|
"kick:chat": "kick:chat";
|
|
@@ -394,8 +397,8 @@ interface SoundStopEvent {
|
|
|
394
397
|
declare const STORAGE_SCOPES: readonly ["instance", "overlay", "account", "global"];
|
|
395
398
|
type StorageScope = (typeof STORAGE_SCOPES)[number];
|
|
396
399
|
declare const storageScopeSchema: z.ZodEnum<{
|
|
397
|
-
overlay: "overlay";
|
|
398
400
|
instance: "instance";
|
|
401
|
+
overlay: "overlay";
|
|
399
402
|
account: "account";
|
|
400
403
|
global: "global";
|
|
401
404
|
}>;
|
|
@@ -428,11 +431,8 @@ declare const chatMessagePayloadSchema: z.ZodObject<{
|
|
|
428
431
|
display_name: z.ZodNullable<z.ZodString>;
|
|
429
432
|
avatar_url: z.ZodNullable<z.ZodString>;
|
|
430
433
|
message: z.ZodString;
|
|
431
|
-
/** Platform-specific emote entries. */
|
|
432
434
|
emotes: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
433
|
-
/** Twitch GIF fragments `{ id, url, provider, alt }`; absent without a GIF. */
|
|
434
435
|
gifs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
435
|
-
/** Platform-specific badge entries. */
|
|
436
436
|
badges: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
437
437
|
color: z.ZodNullable<z.ZodString>;
|
|
438
438
|
is_mod: z.ZodBoolean;
|
|
@@ -453,11 +453,6 @@ declare const chatMessagePayloadSchema: z.ZodObject<{
|
|
|
453
453
|
source_channel: z.ZodOptional<z.ZodUnknown>;
|
|
454
454
|
announcement_color: z.ZodOptional<z.ZodUnknown>;
|
|
455
455
|
}, z.core.$loose>;
|
|
456
|
-
/**
|
|
457
|
-
* zod schema for the payload of every event type. `satisfies` makes a
|
|
458
|
-
* `LUMIO_EVENT_TYPES` entry without a schema (or a schema for a type that is
|
|
459
|
-
* not listed) a type error.
|
|
460
|
-
*/
|
|
461
456
|
declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
462
457
|
readonly "twitch:follower": z.ZodObject<{
|
|
463
458
|
followed_at: z.ZodString;
|
|
@@ -495,7 +490,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
495
490
|
message_id: z.ZodString;
|
|
496
491
|
notice_type: z.ZodString;
|
|
497
492
|
system_message: z.ZodString;
|
|
498
|
-
/** Emotes of `message`, normalised like chat-message emotes (ZAF-1306). */
|
|
499
493
|
emotes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
500
494
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
501
495
|
user_id: z.ZodString;
|
|
@@ -506,15 +500,11 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
506
500
|
broadcaster_user_name: z.ZodString;
|
|
507
501
|
}, z.core.$loose>;
|
|
508
502
|
readonly "twitch:gift": z.ZodObject<{
|
|
509
|
-
/** Sub tier (`1000`, `2000`, `3000`). */
|
|
510
503
|
tier: z.ZodOptional<z.ZodString>;
|
|
511
504
|
duration_months: z.ZodOptional<z.ZodNumber>;
|
|
512
|
-
/** Gifts in a community gift (`community_sub_gift`). */
|
|
513
505
|
total: z.ZodOptional<z.ZodNumber>;
|
|
514
|
-
/** The gifter's all-time gift count; `null` when anonymous. */
|
|
515
506
|
cumulative_total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
516
507
|
community_gift_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
517
|
-
/** Set for a single gift (`sub_gift`), absent for a community gift. */
|
|
518
508
|
recipient_user_id: z.ZodOptional<z.ZodString>;
|
|
519
509
|
recipient_user_login: z.ZodOptional<z.ZodString>;
|
|
520
510
|
recipient_user_name: z.ZodOptional<z.ZodString>;
|
|
@@ -535,7 +525,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
535
525
|
message_id: z.ZodString;
|
|
536
526
|
notice_type: z.ZodString;
|
|
537
527
|
system_message: z.ZodString;
|
|
538
|
-
/** Emotes of `message`, normalised like chat-message emotes (ZAF-1306). */
|
|
539
528
|
emotes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
540
529
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
541
530
|
user_id: z.ZodString;
|
|
@@ -579,7 +568,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
579
568
|
message_id: z.ZodString;
|
|
580
569
|
notice_type: z.ZodString;
|
|
581
570
|
system_message: z.ZodString;
|
|
582
|
-
/** Emotes of `message`, normalised like chat-message emotes (ZAF-1306). */
|
|
583
571
|
emotes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
584
572
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
585
573
|
user_id: z.ZodString;
|
|
@@ -596,9 +584,7 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
596
584
|
is_anonymous: z.ZodBoolean;
|
|
597
585
|
bits: z.ZodNumber;
|
|
598
586
|
message: z.ZodString;
|
|
599
|
-
/** Cheermote entries for the cheer words in `message` (`kind: "cheermote"`). */
|
|
600
587
|
emotes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
601
|
-
/** The cheermote for the total, when the channel's cheermotes loaded. */
|
|
602
588
|
cheermote: z.ZodOptional<z.ZodUnknown>;
|
|
603
589
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
604
590
|
broadcaster_user_id: z.ZodString;
|
|
@@ -607,7 +593,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
607
593
|
}, z.core.$loose>;
|
|
608
594
|
readonly "twitch:raid": z.ZodObject<{
|
|
609
595
|
displayName: z.ZodOptional<z.ZodString>;
|
|
610
|
-
/** The raider's channel info from Helix, when it loaded. */
|
|
611
596
|
title: z.ZodOptional<z.ZodString>;
|
|
612
597
|
category: z.ZodOptional<z.ZodString>;
|
|
613
598
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -967,9 +952,7 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
967
952
|
requester_user_id: z.ZodString;
|
|
968
953
|
requester_user_login: z.ZodString;
|
|
969
954
|
requester_user_name: z.ZodString;
|
|
970
|
-
/** Seconds; Twitch's own sample payload sends it as a string. */
|
|
971
955
|
duration_seconds: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
972
|
-
/** Twitch's own sample payload sends it as a string. */
|
|
973
956
|
is_automatic: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>;
|
|
974
957
|
started_at: z.ZodString;
|
|
975
958
|
broadcaster_user_id: z.ZodString;
|
|
@@ -1008,7 +991,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1008
991
|
id: z.ZodString;
|
|
1009
992
|
type: z.ZodString;
|
|
1010
993
|
started_at: z.ZodString;
|
|
1011
|
-
/** Channel info from Helix, when it loaded. */
|
|
1012
994
|
title: z.ZodOptional<z.ZodString>;
|
|
1013
995
|
category: z.ZodOptional<z.ZodString>;
|
|
1014
996
|
broadcaster_user_id: z.ZodString;
|
|
@@ -1016,7 +998,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1016
998
|
broadcaster_user_name: z.ZodString;
|
|
1017
999
|
}, z.core.$loose>;
|
|
1018
1000
|
readonly "twitch:stream_offline": z.ZodObject<{
|
|
1019
|
-
/** Set when the stream's start is known. */
|
|
1020
1001
|
started_at: z.ZodOptional<z.ZodString>;
|
|
1021
1002
|
duration_seconds: z.ZodOptional<z.ZodNumber>;
|
|
1022
1003
|
broadcaster_user_id: z.ZodString;
|
|
@@ -1030,7 +1011,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1030
1011
|
category_name: z.ZodString;
|
|
1031
1012
|
content_classification_labels: z.ZodArray<z.ZodString>;
|
|
1032
1013
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1033
|
-
/** Diff against the previous channel info, when it was known. */
|
|
1034
1014
|
title_changed: z.ZodOptional<z.ZodBoolean>;
|
|
1035
1015
|
category_changed: z.ZodOptional<z.ZodBoolean>;
|
|
1036
1016
|
language_changed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1236,13 +1216,11 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1236
1216
|
is_anonymous: z.ZodOptional<z.ZodBoolean>;
|
|
1237
1217
|
identity: z.ZodOptional<z.ZodUnknown>;
|
|
1238
1218
|
}, z.core.$loose>>;
|
|
1239
|
-
/** Usernames of `giftees`. */
|
|
1240
1219
|
giftRecipients: z.ZodArray<z.ZodString>;
|
|
1241
1220
|
giftCount: z.ZodNumber;
|
|
1242
1221
|
total: z.ZodNumber;
|
|
1243
1222
|
isGift: z.ZodBoolean;
|
|
1244
1223
|
is_gift: z.ZodBoolean;
|
|
1245
|
-
/** The first giftee. */
|
|
1246
1224
|
recipient_user_id: z.ZodOptional<z.ZodString>;
|
|
1247
1225
|
recipient_user_login: z.ZodOptional<z.ZodString>;
|
|
1248
1226
|
recipient_user_name: z.ZodOptional<z.ZodString>;
|
|
@@ -1422,7 +1400,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1422
1400
|
has_mature_content: z.ZodBoolean;
|
|
1423
1401
|
category_id: z.ZodString;
|
|
1424
1402
|
category_name: z.ZodString;
|
|
1425
|
-
/** Diff against the previous stream info, when it was known. */
|
|
1426
1403
|
title_changed: z.ZodOptional<z.ZodBoolean>;
|
|
1427
1404
|
category_changed: z.ZodOptional<z.ZodBoolean>;
|
|
1428
1405
|
language_changed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1456,7 +1433,6 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1456
1433
|
name: z.ZodNullable<z.ZodString>;
|
|
1457
1434
|
uri: z.ZodString;
|
|
1458
1435
|
}, z.core.$loose>>;
|
|
1459
|
-
/** The Lumio user whose action caused the change; `null` when it came from Spotify. */
|
|
1460
1436
|
triggered_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1461
1437
|
}, z.core.$loose>;
|
|
1462
1438
|
readonly "spotify:play": z.ZodObject<{
|
|
@@ -1552,6 +1528,51 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1552
1528
|
avatar: z.ZodOptional<z.ZodString>;
|
|
1553
1529
|
}, z.core.$loose>;
|
|
1554
1530
|
}, z.core.$loose>;
|
|
1531
|
+
readonly "shopify:order": z.ZodObject<{
|
|
1532
|
+
shop: z.ZodOptional<z.ZodObject<{
|
|
1533
|
+
domain: z.ZodString;
|
|
1534
|
+
label: z.ZodString;
|
|
1535
|
+
}, z.core.$loose>>;
|
|
1536
|
+
order_number: z.ZodNullable<z.ZodNumber>;
|
|
1537
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1538
|
+
financial_status: z.ZodNullable<z.ZodString>;
|
|
1539
|
+
total_price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1540
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1541
|
+
line_items: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1542
|
+
title: z.ZodNullable<z.ZodString>;
|
|
1543
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
1544
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1545
|
+
}, z.core.$loose>>>>;
|
|
1546
|
+
customer_display: z.ZodOptional<z.ZodString>;
|
|
1547
|
+
}, z.core.$loose>;
|
|
1548
|
+
readonly "shopify:order_paid": z.ZodObject<{
|
|
1549
|
+
shop: z.ZodOptional<z.ZodObject<{
|
|
1550
|
+
domain: z.ZodString;
|
|
1551
|
+
label: z.ZodString;
|
|
1552
|
+
}, z.core.$loose>>;
|
|
1553
|
+
order_number: z.ZodNullable<z.ZodNumber>;
|
|
1554
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1555
|
+
financial_status: z.ZodNullable<z.ZodString>;
|
|
1556
|
+
total_price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1557
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1558
|
+
line_items: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1559
|
+
title: z.ZodNullable<z.ZodString>;
|
|
1560
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
1561
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1562
|
+
}, z.core.$loose>>>>;
|
|
1563
|
+
customer_display: z.ZodOptional<z.ZodString>;
|
|
1564
|
+
}, z.core.$loose>;
|
|
1565
|
+
readonly "shopify:product": z.ZodObject<{
|
|
1566
|
+
shop: z.ZodOptional<z.ZodObject<{
|
|
1567
|
+
domain: z.ZodString;
|
|
1568
|
+
label: z.ZodString;
|
|
1569
|
+
}, z.core.$loose>>;
|
|
1570
|
+
title: z.ZodNullable<z.ZodString>;
|
|
1571
|
+
vendor: z.ZodNullable<z.ZodString>;
|
|
1572
|
+
product_type: z.ZodNullable<z.ZodString>;
|
|
1573
|
+
handle: z.ZodNullable<z.ZodString>;
|
|
1574
|
+
image_url: z.ZodNullable<z.ZodString>;
|
|
1575
|
+
}, z.core.$loose>;
|
|
1555
1576
|
readonly "twitch:chat": z.ZodObject<{
|
|
1556
1577
|
account_id: z.ZodString;
|
|
1557
1578
|
platform: z.ZodString;
|
|
@@ -1561,11 +1582,8 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1561
1582
|
display_name: z.ZodNullable<z.ZodString>;
|
|
1562
1583
|
avatar_url: z.ZodNullable<z.ZodString>;
|
|
1563
1584
|
message: z.ZodString;
|
|
1564
|
-
/** Platform-specific emote entries. */
|
|
1565
1585
|
emotes: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1566
|
-
/** Twitch GIF fragments `{ id, url, provider, alt }`; absent without a GIF. */
|
|
1567
1586
|
gifs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
1568
|
-
/** Platform-specific badge entries. */
|
|
1569
1587
|
badges: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1570
1588
|
color: z.ZodNullable<z.ZodString>;
|
|
1571
1589
|
is_mod: z.ZodBoolean;
|
|
@@ -1595,11 +1613,8 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1595
1613
|
display_name: z.ZodNullable<z.ZodString>;
|
|
1596
1614
|
avatar_url: z.ZodNullable<z.ZodString>;
|
|
1597
1615
|
message: z.ZodString;
|
|
1598
|
-
/** Platform-specific emote entries. */
|
|
1599
1616
|
emotes: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1600
|
-
/** Twitch GIF fragments `{ id, url, provider, alt }`; absent without a GIF. */
|
|
1601
1617
|
gifs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
1602
|
-
/** Platform-specific badge entries. */
|
|
1603
1618
|
badges: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1604
1619
|
color: z.ZodNullable<z.ZodString>;
|
|
1605
1620
|
is_mod: z.ZodBoolean;
|
|
@@ -1629,11 +1644,8 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1629
1644
|
display_name: z.ZodNullable<z.ZodString>;
|
|
1630
1645
|
avatar_url: z.ZodNullable<z.ZodString>;
|
|
1631
1646
|
message: z.ZodString;
|
|
1632
|
-
/** Platform-specific emote entries. */
|
|
1633
1647
|
emotes: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1634
|
-
/** Twitch GIF fragments `{ id, url, provider, alt }`; absent without a GIF. */
|
|
1635
1648
|
gifs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
1636
|
-
/** Platform-specific badge entries. */
|
|
1637
1649
|
badges: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1638
1650
|
color: z.ZodNullable<z.ZodString>;
|
|
1639
1651
|
is_mod: z.ZodBoolean;
|
|
@@ -1663,11 +1675,8 @@ declare const LUMIO_EVENT_PAYLOAD_SCHEMAS: {
|
|
|
1663
1675
|
display_name: z.ZodNullable<z.ZodString>;
|
|
1664
1676
|
avatar_url: z.ZodNullable<z.ZodString>;
|
|
1665
1677
|
message: z.ZodString;
|
|
1666
|
-
/** Platform-specific emote entries. */
|
|
1667
1678
|
emotes: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1668
|
-
/** Twitch GIF fragments `{ id, url, provider, alt }`; absent without a GIF. */
|
|
1669
1679
|
gifs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
1670
|
-
/** Platform-specific badge entries. */
|
|
1671
1680
|
badges: z.ZodNullable<z.ZodArray<z.ZodUnknown>>;
|
|
1672
1681
|
color: z.ZodNullable<z.ZodString>;
|
|
1673
1682
|
is_mod: z.ZodBoolean;
|
|
@@ -1912,4 +1921,5 @@ declare const REALTIME_LIMITS: {
|
|
|
1912
1921
|
readonly MAX_BYTES_PER_MINUTE: number;
|
|
1913
1922
|
};
|
|
1914
1923
|
|
|
1915
|
-
export { ACTION_EXECUTE_ERRORS, ACTION_TYPES,
|
|
1924
|
+
export { ACTION_EXECUTE_ERRORS, ACTION_TYPES, HOST_METHODS, LUMIO_COMPONENT_TYPES, LUMIO_EVENT_PAYLOAD_SCHEMAS, LUMIO_EVENT_TYPES, MESSAGE_TYPES, REALTIME_LIMITS, SERVER_FUNCTION_ERRORS, STORAGE_SCOPES, WORKER_METHODS, actionMessageSchema, chatMessagePayloadSchema, configUpdateMessageSchema, errorMessageSchema, eventMessageSchema, extensionConfigSchema, initMessageSchema, lumioActionTypeSchema, lumioEventPayloadSchema, lumioEventTypeSchema, lumioMessageSchema, nodeConfigRequestMessageSchema, nodeConfigUpdateMessageSchema, parseLumioEventPayload, readyMessageSchema, storageScopeSchema, storageUpdateMessageSchema, themeBorderRadiusSchema, themeChangeMessageSchema, themeColorsSchema, themeFontsSchema, themeSchema };
|
|
1925
|
+
export type { ActionExecuteErrorCode, ActionExecuteParams, ActionExecuteResult, ActionMessage, ChatMessagePayload, ConfigUpdateMessage, ErrorMessage, EventCallbackParams, EventMessage, EventPlatformParams, ExtensionConfig, InitMessage, JsonRpcMessage, JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, LifecycleDestroyParams, LifecycleInitParams, LumioActionType, LumioComponentNode, LumioComponentType, LumioEventPayload, LumioEventPayloadMap, LumioEventType, LumioMessage, MessageType, ModerationLogPayload, NodeConfigRequestMessage, NodeConfigUpdateMessage, ReadyMessage, ServerFunctionErrorCode, ServerMutationParams, ServerQueryParams, ServerRealtimeParams, Sound, SoundGetListParams, SoundPlayEvent, SoundPlayParams, SoundStopEvent, SoundStopParams, StorageGetParams, StorageScope, StorageSetParams, StorageUpdateMessage, StorageUpdateParams, Theme, ThemeBorderRadius, ThemeChangeMessage, ThemeChangeParams, ThemeColors, ThemeFonts, UiKeyframesParams, UiReadyParams, UiRenderParams };
|
package/dist/index.js
CHANGED
|
@@ -186,6 +186,11 @@ var LUMIO_EVENT_TYPES = [
|
|
|
186
186
|
"spotify:playlist_delete",
|
|
187
187
|
// StreamElements
|
|
188
188
|
"streamelements:tip",
|
|
189
|
+
// Shopify — order and product webhooks of the account's connected stores.
|
|
190
|
+
// Every payload names its store in `shop` (ZAF-3288).
|
|
191
|
+
"shopify:order",
|
|
192
|
+
"shopify:order_paid",
|
|
193
|
+
"shopify:product",
|
|
189
194
|
// Chat (per-platform)
|
|
190
195
|
"twitch:chat",
|
|
191
196
|
"youtube:chat",
|
|
@@ -462,6 +467,33 @@ var youtubeAuthor = {
|
|
|
462
467
|
displayName: str,
|
|
463
468
|
avatarUrl: str
|
|
464
469
|
};
|
|
470
|
+
var shopifyShop = {
|
|
471
|
+
shop: z3.looseObject({ domain: str, label: str }).optional()
|
|
472
|
+
};
|
|
473
|
+
var shopifyOrder = z3.looseObject({
|
|
474
|
+
order_number: num.nullable(),
|
|
475
|
+
/** Shopify's order name, e.g. `#1042`. */
|
|
476
|
+
name: nullableStr,
|
|
477
|
+
financial_status: nullableStr,
|
|
478
|
+
/** Only when the store shows prices. */
|
|
479
|
+
total_price: nullableStr.optional(),
|
|
480
|
+
currency: nullableStr.optional(),
|
|
481
|
+
/** Only when the store shows items; `price` per line only when it also shows prices. */
|
|
482
|
+
line_items: z3.array(
|
|
483
|
+
z3.looseObject({
|
|
484
|
+
title: nullableStr,
|
|
485
|
+
quantity: num.nullable(),
|
|
486
|
+
price: nullableStr.optional()
|
|
487
|
+
})
|
|
488
|
+
).nullable().optional(),
|
|
489
|
+
/**
|
|
490
|
+
* The buyer label the buyer consented to, in the form the store chose.
|
|
491
|
+
* Absent without consent or when a blocklist hid it. Untrusted buyer text:
|
|
492
|
+
* render it as text, never as HTML.
|
|
493
|
+
*/
|
|
494
|
+
customer_display: str.optional(),
|
|
495
|
+
...shopifyShop
|
|
496
|
+
});
|
|
465
497
|
var LUMIO_EVENT_PAYLOAD_SCHEMAS = {
|
|
466
498
|
// Twitch
|
|
467
499
|
"twitch:follower": z3.looseObject({
|
|
@@ -860,6 +892,18 @@ var LUMIO_EVENT_PAYLOAD_SCHEMAS = {
|
|
|
860
892
|
avatar: str.optional()
|
|
861
893
|
})
|
|
862
894
|
}),
|
|
895
|
+
// Shopify
|
|
896
|
+
"shopify:order": shopifyOrder,
|
|
897
|
+
"shopify:order_paid": shopifyOrder,
|
|
898
|
+
"shopify:product": z3.looseObject({
|
|
899
|
+
title: nullableStr,
|
|
900
|
+
vendor: nullableStr,
|
|
901
|
+
product_type: nullableStr,
|
|
902
|
+
handle: nullableStr,
|
|
903
|
+
/** The product's first image. */
|
|
904
|
+
image_url: nullableStr,
|
|
905
|
+
...shopifyShop
|
|
906
|
+
}),
|
|
863
907
|
// Chat
|
|
864
908
|
"twitch:chat": chatMessagePayloadSchema,
|
|
865
909
|
"youtube:chat": chatMessagePayloadSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zaflun/lumio-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Wire-format types for Lumio extension iframe-to-host communication",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"CHANGELOG.md"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"zod": "^4.
|
|
26
|
+
"zod": "^4.6.7"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"typescript": "^6.0.2",
|
|
30
|
-
"tsup": "^
|
|
30
|
+
"tsup": "^9.0.0"
|
|
31
31
|
},
|
|
32
32
|
"author": {
|
|
33
33
|
"name": "zaflun",
|