@saebyn/glowing-telegram-types 0.9.1 → 0.9.7

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/types.ts +125 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saebyn/glowing-telegram-types",
3
3
  "license": "AGPL-3.0-only",
4
- "version": "0.9.1",
4
+ "version": "0.9.7",
5
5
  "main": "src/types.ts",
6
6
  "files": [
7
7
  "src/types.ts"
package/src/types.ts CHANGED
@@ -7,6 +7,105 @@ export interface AuthorizationURLResponse {
7
7
  url: string;
8
8
  }
9
9
 
10
+ export interface ChatSubscriptionStatusResponse {
11
+ /**
12
+ * Whether the user has any active chat subscriptions
13
+ */
14
+ has_active_subscription: boolean;
15
+ /**
16
+ * Array of active EventSub chat subscriptions for the user
17
+ */
18
+ subscriptions: EventSubSubscription[];
19
+ }
20
+
21
+ export interface EventSubSubscription {
22
+ /**
23
+ * The condition object for the subscription
24
+ */
25
+ condition: Condition;
26
+ /**
27
+ * When the subscription was created
28
+ */
29
+ created_at: string;
30
+ /**
31
+ * The subscription ID
32
+ */
33
+ id: string;
34
+ /**
35
+ * The status of the subscription
36
+ */
37
+ status: string;
38
+ /**
39
+ * The transport object for the subscription
40
+ */
41
+ transport: Transport;
42
+ /**
43
+ * The type of the subscription
44
+ */
45
+ type: string;
46
+ /**
47
+ * The version of the subscription
48
+ */
49
+ version: string;
50
+ }
51
+
52
+ /**
53
+ * The condition object for the subscription
54
+ */
55
+ export interface Condition {
56
+ /**
57
+ * The ID of the broadcaster user
58
+ */
59
+ broadcaster_user_id?: string;
60
+ [property: string]: unknown;
61
+ }
62
+
63
+ /**
64
+ * The transport object for the subscription
65
+ */
66
+ export interface Transport {
67
+ /**
68
+ * The callback URL where the notifications are sent. The URL must use the HTTPS protocol
69
+ * and port 443. See Processing an event. Specify this field only if method is set to
70
+ * webhook.
71
+ */
72
+ callback?: string;
73
+ /**
74
+ * The UTC date and time that the WebSocket connection was established. This is a
75
+ * response-only field that Create EventSub Subscription and Get EventSub Subscription
76
+ * returns if the method field is set to websocket.
77
+ */
78
+ connected_at?: string;
79
+ /**
80
+ * The UTC date and time that the WebSocket connection was lost. This is a response-only
81
+ * field that Get EventSub Subscription returns if the method field is set to websocket.
82
+ */
83
+ disconnected_at?: string;
84
+ /**
85
+ * The transport method
86
+ */
87
+ method: Method;
88
+ /**
89
+ * The secret used to verify the signature. The secret must be an ASCII string that's a
90
+ * minimum of 10 characters long and a maximum of 100 characters long. For information about
91
+ * how the secret is used, see Verifying the event message. Specify this field only if
92
+ * method is set to webhook.
93
+ */
94
+ secret?: string;
95
+ /**
96
+ * An ID that identifies the WebSocket to send notifications to. When you connect to
97
+ * EventSub using WebSockets, the server returns the ID in the Welcome message. Specify this
98
+ * field only if method is set to websocket.
99
+ */
100
+ session_id?: string;
101
+ [property: string]: unknown;
102
+ }
103
+
104
+ /**
105
+ * The transport method
106
+ */
107
+ export type Method = "webhook" | "websocket";
108
+
10
109
  export interface CutList {
11
110
  /**
12
111
  * Audio channel mixing and volume control configuration
@@ -363,6 +462,20 @@ export interface StreamIngestionRequest {
363
462
  streamId: string;
364
463
  }
365
464
 
465
+ export interface SubscribeChatRequest {
466
+ }
467
+
468
+ export interface SubscribeChatResponse {
469
+ /**
470
+ * The status of the subscription request
471
+ */
472
+ status: string;
473
+ /**
474
+ * The ID of the created EventSub subscription, if successful
475
+ */
476
+ subscription_id?: null | string;
477
+ }
478
+
366
479
  /**
367
480
  * A task represents a unit of work in the system, with a unique identifier, status,
368
481
  * timestamps for creation and updates, type of task, and an associated record ID.
@@ -399,6 +512,18 @@ export interface TwitchCallbackResponse {
399
512
  url: string;
400
513
  }
401
514
 
515
+ export interface TwitchChatMessage {
516
+ channel_id: string;
517
+ event_type: string;
518
+ message: string;
519
+ sender_id: string;
520
+ timestamp: string;
521
+ ttl: number;
522
+ user_id: string;
523
+ user_login: string;
524
+ user_name: string;
525
+ }
526
+
402
527
  export interface TwitchSessionSecret {
403
528
  access_token?: string;
404
529
  csrf_token: string;