@4players/odin-common 1.1.2 → 1.2.1
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 +8 -0
- package/lib/cjs/utility/rpc.js +186 -1
- package/lib/cjs/utility/selector.js +5 -5
- package/lib/cjs/utility/strand.js +7 -7
- package/lib/esm/utility/rpc.js +183 -0
- package/lib/esm/utility/selector.js +5 -5
- package/lib/esm/utility/strand.js +7 -7
- package/lib/rpc/commands.d.ts +217 -2
- package/lib/rpc/notifications.d.ts +779 -2
- package/lib/utility/rpc.d.ts +39 -1
- package/lib/utility/selector.d.ts +3 -3
- package/lib/utility/strand.d.ts +2 -2
- package/package.json +1 -1
- package/lib/utility/base64.spec.d.ts +0 -4
- package/lib/utility/bytearray.spec.d.ts +0 -4
- package/lib/utility/environment.spec.d.ts +0 -4
- package/lib/utility/iterable.spec.d.ts +0 -4
- package/lib/utility/json.spec.d.ts +0 -7
- package/lib/utility/websocket.spec.d.ts +0 -6
package/lib/rpc/commands.d.ts
CHANGED
|
@@ -3,7 +3,222 @@ export type Commands = Record<string, {
|
|
|
3
3
|
request: z.ZodTypeAny;
|
|
4
4
|
response: z.ZodTypeAny;
|
|
5
5
|
}>;
|
|
6
|
-
export declare const MainCommandsRpc:
|
|
6
|
+
export declare const MainCommandsRpc: {
|
|
7
|
+
JoinRoom: {
|
|
8
|
+
request: z.ZodObject<{
|
|
9
|
+
token: z.ZodString;
|
|
10
|
+
room_id: z.ZodString;
|
|
11
|
+
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
12
|
+
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
user_data: Uint8Array;
|
|
15
|
+
token: string;
|
|
16
|
+
room_id: string;
|
|
17
|
+
position: [number, number, number] | [number, number];
|
|
18
|
+
}, {
|
|
19
|
+
user_data: Uint8Array;
|
|
20
|
+
token: string;
|
|
21
|
+
room_id: string;
|
|
22
|
+
position: [number, number, number] | [number, number];
|
|
23
|
+
}>;
|
|
24
|
+
response: z.ZodObject<{
|
|
25
|
+
peer_id: z.ZodNumber;
|
|
26
|
+
stream_id: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
token: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
peer_id: number;
|
|
30
|
+
stream_id?: number | undefined;
|
|
31
|
+
token?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
peer_id: number;
|
|
34
|
+
stream_id?: number | undefined;
|
|
35
|
+
token?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
WebRtcUpdate: {
|
|
39
|
+
request: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"Sdp">;
|
|
41
|
+
type: z.ZodEnum<["Answer", "Offer"]>;
|
|
42
|
+
sdp: z.ZodString;
|
|
43
|
+
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>, "many">;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
type: "Answer" | "Offer";
|
|
46
|
+
kind: "Sdp";
|
|
47
|
+
sdp: string;
|
|
48
|
+
media_map: [number, string][];
|
|
49
|
+
}, {
|
|
50
|
+
type: "Answer" | "Offer";
|
|
51
|
+
kind: "Sdp";
|
|
52
|
+
sdp: string;
|
|
53
|
+
media_map: [number, string][];
|
|
54
|
+
}>, z.ZodObject<{
|
|
55
|
+
kind: z.ZodLiteral<"Trickle">;
|
|
56
|
+
candidate: z.ZodString;
|
|
57
|
+
spd_mid: z.ZodOptional<z.ZodString>;
|
|
58
|
+
spd_mline_index: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
username_fragment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
kind: "Trickle";
|
|
62
|
+
candidate: string;
|
|
63
|
+
spd_mid?: string | undefined;
|
|
64
|
+
spd_mline_index?: number | undefined;
|
|
65
|
+
username_fragment?: string | null | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
kind: "Trickle";
|
|
68
|
+
candidate: string;
|
|
69
|
+
spd_mid?: string | undefined;
|
|
70
|
+
spd_mline_index?: number | undefined;
|
|
71
|
+
username_fragment?: string | null | undefined;
|
|
72
|
+
}>, z.ZodObject<{
|
|
73
|
+
kind: z.ZodLiteral<"TrickleFinished">;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
kind: "TrickleFinished";
|
|
76
|
+
}, {
|
|
77
|
+
kind: "TrickleFinished";
|
|
78
|
+
}>]>;
|
|
79
|
+
response: z.ZodNull;
|
|
80
|
+
};
|
|
81
|
+
RequestReconnectToken: {
|
|
82
|
+
request: z.ZodObject<{
|
|
83
|
+
peer_id: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
peer_id?: number | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
peer_id?: number | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
response: z.ZodString;
|
|
90
|
+
};
|
|
91
|
+
Ping: {
|
|
92
|
+
request: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
93
|
+
response: z.ZodNull;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
7
96
|
export type MainCommands = typeof MainCommandsRpc;
|
|
8
|
-
export declare const RoomCommandsRpc:
|
|
97
|
+
export declare const RoomCommandsRpc: {
|
|
98
|
+
UpdatePeer: {
|
|
99
|
+
request: z.ZodObject<{
|
|
100
|
+
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
user_data: Uint8Array;
|
|
103
|
+
}, {
|
|
104
|
+
user_data: Uint8Array;
|
|
105
|
+
}>;
|
|
106
|
+
response: z.ZodNull;
|
|
107
|
+
};
|
|
108
|
+
StartMedia: {
|
|
109
|
+
request: z.ZodObject<{
|
|
110
|
+
media_id: z.ZodNumber;
|
|
111
|
+
properties: z.ZodUnion<[z.ZodObject<{
|
|
112
|
+
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
113
|
+
uid: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
kind?: "audio" | undefined;
|
|
116
|
+
uid?: string | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
kind?: "audio" | undefined;
|
|
119
|
+
uid?: string | undefined;
|
|
120
|
+
}>, z.ZodObject<{
|
|
121
|
+
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
122
|
+
codec: z.ZodOptional<z.ZodString>;
|
|
123
|
+
uid: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
kind?: "video" | undefined;
|
|
126
|
+
codec?: string | undefined;
|
|
127
|
+
uid?: string | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
kind?: "video" | undefined;
|
|
130
|
+
codec?: string | undefined;
|
|
131
|
+
uid?: string | undefined;
|
|
132
|
+
}>]>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
properties: ({
|
|
135
|
+
kind?: "audio" | undefined;
|
|
136
|
+
uid?: string | undefined;
|
|
137
|
+
} | {
|
|
138
|
+
kind?: "video" | undefined;
|
|
139
|
+
codec?: string | undefined;
|
|
140
|
+
uid?: string | undefined;
|
|
141
|
+
}) & ({
|
|
142
|
+
kind?: "audio" | undefined;
|
|
143
|
+
uid?: string | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
kind?: "video" | undefined;
|
|
146
|
+
codec?: string | undefined;
|
|
147
|
+
uid?: string | undefined;
|
|
148
|
+
} | undefined);
|
|
149
|
+
media_id: number;
|
|
150
|
+
}, {
|
|
151
|
+
properties: ({
|
|
152
|
+
kind?: "audio" | undefined;
|
|
153
|
+
uid?: string | undefined;
|
|
154
|
+
} | {
|
|
155
|
+
kind?: "video" | undefined;
|
|
156
|
+
codec?: string | undefined;
|
|
157
|
+
uid?: string | undefined;
|
|
158
|
+
}) & ({
|
|
159
|
+
kind?: "audio" | undefined;
|
|
160
|
+
uid?: string | undefined;
|
|
161
|
+
} | {
|
|
162
|
+
kind?: "video" | undefined;
|
|
163
|
+
codec?: string | undefined;
|
|
164
|
+
uid?: string | undefined;
|
|
165
|
+
} | undefined);
|
|
166
|
+
media_id: number;
|
|
167
|
+
}>;
|
|
168
|
+
response: z.ZodNull;
|
|
169
|
+
};
|
|
170
|
+
StopMedia: {
|
|
171
|
+
request: z.ZodObject<{
|
|
172
|
+
media_id: z.ZodNumber;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
media_id: number;
|
|
175
|
+
}, {
|
|
176
|
+
media_id: number;
|
|
177
|
+
}>;
|
|
178
|
+
response: z.ZodNull;
|
|
179
|
+
};
|
|
180
|
+
PauseMedia: {
|
|
181
|
+
request: z.ZodObject<{
|
|
182
|
+
media_id: z.ZodNumber;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
media_id: number;
|
|
185
|
+
}, {
|
|
186
|
+
media_id: number;
|
|
187
|
+
}>;
|
|
188
|
+
response: z.ZodNull;
|
|
189
|
+
};
|
|
190
|
+
ResumeMedia: {
|
|
191
|
+
request: z.ZodObject<{
|
|
192
|
+
media_id: z.ZodNumber;
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
media_id: number;
|
|
195
|
+
}, {
|
|
196
|
+
media_id: number;
|
|
197
|
+
}>;
|
|
198
|
+
response: z.ZodNull;
|
|
199
|
+
};
|
|
200
|
+
SetPeerPosition: {
|
|
201
|
+
request: z.ZodObject<{
|
|
202
|
+
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
position: [number, number, number] | [number, number];
|
|
205
|
+
}, {
|
|
206
|
+
position: [number, number, number] | [number, number];
|
|
207
|
+
}>;
|
|
208
|
+
response: z.ZodNull;
|
|
209
|
+
};
|
|
210
|
+
SendMessage: {
|
|
211
|
+
request: z.ZodObject<{
|
|
212
|
+
target_peer_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
213
|
+
message: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
message: Uint8Array;
|
|
216
|
+
target_peer_ids?: number[] | undefined;
|
|
217
|
+
}, {
|
|
218
|
+
message: Uint8Array;
|
|
219
|
+
target_peer_ids?: number[] | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
response: z.ZodNull;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
9
224
|
export type RoomCommands = typeof RoomCommandsRpc;
|