@4players/odin-common 4.0.2 → 4.1.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/mod.js +1 -1182
- package/mod.mjs +1 -1065
- package/package.json +1 -1
- package/rpc/commands.d.ts +94 -94
- package/rpc/notifications.d.ts +1052 -1052
- package/schema/media.d.ts +62 -62
- package/schema/message.d.ts +4 -4
- package/schema/peer.d.ts +134 -134
- package/schema/room.d.ts +980 -980
- package/schema/token.d.ts +35 -35
- package/schema/webrtc.d.ts +20 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
|
|
5
5
|
"author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
|
|
6
6
|
"homepage": "https://www.4players.io",
|
package/rpc/commands.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export declare const MainCommandsRpc: {
|
|
|
9
9
|
request: z.ZodObject<{
|
|
10
10
|
stream: z.ZodLiteral<"main">;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
stream
|
|
12
|
+
stream: "main";
|
|
13
13
|
}, {
|
|
14
|
-
stream
|
|
14
|
+
stream: "main";
|
|
15
15
|
}>;
|
|
16
16
|
response: z.ZodNull;
|
|
17
17
|
};
|
|
@@ -22,28 +22,28 @@ export declare const MainCommandsRpc: {
|
|
|
22
22
|
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
23
23
|
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
position
|
|
26
|
-
user_data
|
|
27
|
-
room_id
|
|
28
|
-
token
|
|
25
|
+
position: [number, number] | [number, number, number];
|
|
26
|
+
user_data: Uint8Array;
|
|
27
|
+
room_id: string;
|
|
28
|
+
token: string;
|
|
29
29
|
}, {
|
|
30
|
-
position
|
|
31
|
-
user_data
|
|
32
|
-
room_id
|
|
33
|
-
token
|
|
30
|
+
position: [number, number] | [number, number, number];
|
|
31
|
+
user_data: Uint8Array;
|
|
32
|
+
room_id: string;
|
|
33
|
+
token: string;
|
|
34
34
|
}>;
|
|
35
35
|
response: z.ZodObject<{
|
|
36
36
|
peer_id: z.ZodNumber;
|
|
37
37
|
stream_id: z.ZodOptional<z.ZodNumber>;
|
|
38
38
|
token: z.ZodOptional<z.ZodString>;
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
peer_id
|
|
41
|
-
token?: string;
|
|
42
|
-
stream_id?: number;
|
|
40
|
+
peer_id: number;
|
|
41
|
+
token?: string | undefined;
|
|
42
|
+
stream_id?: number | undefined;
|
|
43
43
|
}, {
|
|
44
|
-
peer_id
|
|
45
|
-
token?: string;
|
|
46
|
-
stream_id?: number;
|
|
44
|
+
peer_id: number;
|
|
45
|
+
token?: string | undefined;
|
|
46
|
+
stream_id?: number | undefined;
|
|
47
47
|
}>;
|
|
48
48
|
};
|
|
49
49
|
WebRtcUpdate: {
|
|
@@ -53,15 +53,15 @@ export declare const MainCommandsRpc: {
|
|
|
53
53
|
sdp: z.ZodString;
|
|
54
54
|
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>, "many">;
|
|
55
55
|
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
type
|
|
57
|
-
kind
|
|
58
|
-
sdp
|
|
59
|
-
media_map
|
|
56
|
+
type: "Answer" | "Offer";
|
|
57
|
+
kind: "Sdp";
|
|
58
|
+
sdp: string;
|
|
59
|
+
media_map: [number, string][];
|
|
60
60
|
}, {
|
|
61
|
-
type
|
|
62
|
-
kind
|
|
63
|
-
sdp
|
|
64
|
-
media_map
|
|
61
|
+
type: "Answer" | "Offer";
|
|
62
|
+
kind: "Sdp";
|
|
63
|
+
sdp: string;
|
|
64
|
+
media_map: [number, string][];
|
|
65
65
|
}>, z.ZodObject<{
|
|
66
66
|
kind: z.ZodLiteral<"Trickle">;
|
|
67
67
|
candidate: z.ZodString;
|
|
@@ -69,23 +69,23 @@ export declare const MainCommandsRpc: {
|
|
|
69
69
|
spd_mline_index: z.ZodOptional<z.ZodNumber>;
|
|
70
70
|
username_fragment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
71
71
|
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
candidate
|
|
73
|
-
kind
|
|
74
|
-
spd_mid?: string;
|
|
75
|
-
spd_mline_index?: number;
|
|
76
|
-
username_fragment?: string;
|
|
72
|
+
candidate: string;
|
|
73
|
+
kind: "Trickle";
|
|
74
|
+
spd_mid?: string | undefined;
|
|
75
|
+
spd_mline_index?: number | undefined;
|
|
76
|
+
username_fragment?: string | null | undefined;
|
|
77
77
|
}, {
|
|
78
|
-
candidate
|
|
79
|
-
kind
|
|
80
|
-
spd_mid?: string;
|
|
81
|
-
spd_mline_index?: number;
|
|
82
|
-
username_fragment?: string;
|
|
78
|
+
candidate: string;
|
|
79
|
+
kind: "Trickle";
|
|
80
|
+
spd_mid?: string | undefined;
|
|
81
|
+
spd_mline_index?: number | undefined;
|
|
82
|
+
username_fragment?: string | null | undefined;
|
|
83
83
|
}>, z.ZodObject<{
|
|
84
84
|
kind: z.ZodLiteral<"TrickleFinished">;
|
|
85
85
|
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
kind
|
|
86
|
+
kind: "TrickleFinished";
|
|
87
87
|
}, {
|
|
88
|
-
kind
|
|
88
|
+
kind: "TrickleFinished";
|
|
89
89
|
}>]>;
|
|
90
90
|
response: z.ZodNull;
|
|
91
91
|
};
|
|
@@ -93,9 +93,9 @@ export declare const MainCommandsRpc: {
|
|
|
93
93
|
request: z.ZodObject<{
|
|
94
94
|
peer_id: z.ZodOptional<z.ZodNumber>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
peer_id?: number;
|
|
96
|
+
peer_id?: number | undefined;
|
|
97
97
|
}, {
|
|
98
|
-
peer_id?: number;
|
|
98
|
+
peer_id?: number | undefined;
|
|
99
99
|
}>;
|
|
100
100
|
response: z.ZodString;
|
|
101
101
|
};
|
|
@@ -114,17 +114,17 @@ export declare const RoomCommandsRpc: {
|
|
|
114
114
|
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
115
115
|
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
116
116
|
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
stream
|
|
118
|
-
position
|
|
119
|
-
user_data
|
|
120
|
-
room_id
|
|
121
|
-
token
|
|
117
|
+
stream: "room";
|
|
118
|
+
position: [number, number] | [number, number, number];
|
|
119
|
+
user_data: Uint8Array;
|
|
120
|
+
room_id: string;
|
|
121
|
+
token: string;
|
|
122
122
|
}, {
|
|
123
|
-
stream
|
|
124
|
-
position
|
|
125
|
-
user_data
|
|
126
|
-
room_id
|
|
127
|
-
token
|
|
123
|
+
stream: "room";
|
|
124
|
+
position: [number, number] | [number, number, number];
|
|
125
|
+
user_data: Uint8Array;
|
|
126
|
+
room_id: string;
|
|
127
|
+
token: string;
|
|
128
128
|
}>;
|
|
129
129
|
response: z.ZodNull;
|
|
130
130
|
};
|
|
@@ -132,9 +132,9 @@ export declare const RoomCommandsRpc: {
|
|
|
132
132
|
request: z.ZodObject<{
|
|
133
133
|
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
134
134
|
}, "strip", z.ZodTypeAny, {
|
|
135
|
-
user_data
|
|
135
|
+
user_data: Uint8Array;
|
|
136
136
|
}, {
|
|
137
|
-
user_data
|
|
137
|
+
user_data: Uint8Array;
|
|
138
138
|
}>;
|
|
139
139
|
response: z.ZodNull;
|
|
140
140
|
};
|
|
@@ -146,53 +146,53 @@ export declare const RoomCommandsRpc: {
|
|
|
146
146
|
uid: z.ZodOptional<z.ZodString>;
|
|
147
147
|
customType: z.ZodOptional<z.ZodString>;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
uid?: string;
|
|
150
|
-
kind?: "audio";
|
|
151
|
-
customType?: string;
|
|
149
|
+
uid?: string | undefined;
|
|
150
|
+
kind?: "audio" | undefined;
|
|
151
|
+
customType?: string | undefined;
|
|
152
152
|
}, {
|
|
153
|
-
uid?: string;
|
|
154
|
-
kind?: "audio";
|
|
155
|
-
customType?: string;
|
|
153
|
+
uid?: string | undefined;
|
|
154
|
+
kind?: "audio" | undefined;
|
|
155
|
+
customType?: string | undefined;
|
|
156
156
|
}>, z.ZodObject<{
|
|
157
157
|
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
158
158
|
codec: z.ZodOptional<z.ZodString>;
|
|
159
159
|
uid: z.ZodOptional<z.ZodString>;
|
|
160
160
|
customType: z.ZodOptional<z.ZodString>;
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
162
|
-
codec?: string;
|
|
163
|
-
uid?: string;
|
|
164
|
-
kind?: "video";
|
|
165
|
-
customType?: string;
|
|
162
|
+
codec?: string | undefined;
|
|
163
|
+
uid?: string | undefined;
|
|
164
|
+
kind?: "video" | undefined;
|
|
165
|
+
customType?: string | undefined;
|
|
166
166
|
}, {
|
|
167
|
-
codec?: string;
|
|
168
|
-
uid?: string;
|
|
169
|
-
kind?: "video";
|
|
170
|
-
customType?: string;
|
|
167
|
+
codec?: string | undefined;
|
|
168
|
+
uid?: string | undefined;
|
|
169
|
+
kind?: "video" | undefined;
|
|
170
|
+
customType?: string | undefined;
|
|
171
171
|
}>]>;
|
|
172
172
|
}, "strip", z.ZodTypeAny, {
|
|
173
|
-
properties
|
|
174
|
-
uid?: string;
|
|
175
|
-
kind?: "audio";
|
|
176
|
-
customType?: string;
|
|
173
|
+
properties: {
|
|
174
|
+
uid?: string | undefined;
|
|
175
|
+
kind?: "audio" | undefined;
|
|
176
|
+
customType?: string | undefined;
|
|
177
177
|
} | {
|
|
178
|
-
codec?: string;
|
|
179
|
-
uid?: string;
|
|
180
|
-
kind?: "video";
|
|
181
|
-
customType?: string;
|
|
178
|
+
codec?: string | undefined;
|
|
179
|
+
uid?: string | undefined;
|
|
180
|
+
kind?: "video" | undefined;
|
|
181
|
+
customType?: string | undefined;
|
|
182
182
|
};
|
|
183
|
-
media_id
|
|
183
|
+
media_id: number;
|
|
184
184
|
}, {
|
|
185
|
-
properties
|
|
186
|
-
uid?: string;
|
|
187
|
-
kind?: "audio";
|
|
188
|
-
customType?: string;
|
|
185
|
+
properties: {
|
|
186
|
+
uid?: string | undefined;
|
|
187
|
+
kind?: "audio" | undefined;
|
|
188
|
+
customType?: string | undefined;
|
|
189
189
|
} | {
|
|
190
|
-
codec?: string;
|
|
191
|
-
uid?: string;
|
|
192
|
-
kind?: "video";
|
|
193
|
-
customType?: string;
|
|
190
|
+
codec?: string | undefined;
|
|
191
|
+
uid?: string | undefined;
|
|
192
|
+
kind?: "video" | undefined;
|
|
193
|
+
customType?: string | undefined;
|
|
194
194
|
};
|
|
195
|
-
media_id
|
|
195
|
+
media_id: number;
|
|
196
196
|
}>;
|
|
197
197
|
response: z.ZodNull;
|
|
198
198
|
};
|
|
@@ -200,9 +200,9 @@ export declare const RoomCommandsRpc: {
|
|
|
200
200
|
request: z.ZodObject<{
|
|
201
201
|
media_id: z.ZodNumber;
|
|
202
202
|
}, "strip", z.ZodTypeAny, {
|
|
203
|
-
media_id
|
|
203
|
+
media_id: number;
|
|
204
204
|
}, {
|
|
205
|
-
media_id
|
|
205
|
+
media_id: number;
|
|
206
206
|
}>;
|
|
207
207
|
response: z.ZodNull;
|
|
208
208
|
};
|
|
@@ -210,9 +210,9 @@ export declare const RoomCommandsRpc: {
|
|
|
210
210
|
request: z.ZodObject<{
|
|
211
211
|
media_id: z.ZodNumber;
|
|
212
212
|
}, "strip", z.ZodTypeAny, {
|
|
213
|
-
media_id
|
|
213
|
+
media_id: number;
|
|
214
214
|
}, {
|
|
215
|
-
media_id
|
|
215
|
+
media_id: number;
|
|
216
216
|
}>;
|
|
217
217
|
response: z.ZodNull;
|
|
218
218
|
};
|
|
@@ -220,9 +220,9 @@ export declare const RoomCommandsRpc: {
|
|
|
220
220
|
request: z.ZodObject<{
|
|
221
221
|
media_id: z.ZodNumber;
|
|
222
222
|
}, "strip", z.ZodTypeAny, {
|
|
223
|
-
media_id
|
|
223
|
+
media_id: number;
|
|
224
224
|
}, {
|
|
225
|
-
media_id
|
|
225
|
+
media_id: number;
|
|
226
226
|
}>;
|
|
227
227
|
response: z.ZodNull;
|
|
228
228
|
};
|
|
@@ -230,9 +230,9 @@ export declare const RoomCommandsRpc: {
|
|
|
230
230
|
request: z.ZodObject<{
|
|
231
231
|
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
232
232
|
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
position
|
|
233
|
+
position: [number, number] | [number, number, number];
|
|
234
234
|
}, {
|
|
235
|
-
position
|
|
235
|
+
position: [number, number] | [number, number, number];
|
|
236
236
|
}>;
|
|
237
237
|
response: z.ZodNull;
|
|
238
238
|
};
|
|
@@ -241,11 +241,11 @@ export declare const RoomCommandsRpc: {
|
|
|
241
241
|
target_peer_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
242
242
|
message: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
243
243
|
}, "strip", z.ZodTypeAny, {
|
|
244
|
-
message
|
|
245
|
-
target_peer_ids?: number[];
|
|
244
|
+
message: Uint8Array;
|
|
245
|
+
target_peer_ids?: number[] | undefined;
|
|
246
246
|
}, {
|
|
247
|
-
message
|
|
248
|
-
target_peer_ids?: number[];
|
|
247
|
+
message: Uint8Array;
|
|
248
|
+
target_peer_ids?: number[] | undefined;
|
|
249
249
|
}>;
|
|
250
250
|
response: z.ZodNull;
|
|
251
251
|
};
|