@hytopia.com/server-protocol 1.3.54 → 1.3.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hytopia.com/server-protocol",
3
- "version": "1.3.54",
3
+ "version": "1.3.56",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -10,8 +10,8 @@ type WrtcConnectAck = {
10
10
  }
11
11
 
12
12
  type WrtcDataChannel = {
13
- i: string; // data channel id
14
- di: string; // data producer id
13
+ i?: string; // data channel id
14
+ pi: string; // data producer id
15
15
  l: string; // label
16
16
  s: mediasoup.types.SctpStreamParameters; // sctp stream parameters
17
17
  }
@@ -22,9 +22,10 @@ type WrtcProduceDataAck = {
22
22
 
23
23
  type WrtcTransport = {
24
24
  i: string; // transport id
25
- ip: mediasoup.types.IceParameters; // ice parameters
26
- ic: mediasoup.types.IceCandidate[]; // ice candidates
25
+ f: 'cs' | 'sc'; // data flow (cs: client -> server | sc: server -> client)
27
26
  d: mediasoup.types.DtlsParameters; // dtls parameters
27
+ ic: mediasoup.types.IceCandidate[]; // ice candidates
28
+ ip: mediasoup.types.IceParameters; // ice parameters
28
29
  s: mediasoup.types.SctpParameters; // sctp parameters
29
30
  }
30
31
 
@@ -139,12 +140,13 @@ const wrtcTransportSchema: JSONSchemaType<WrtcTransport> = {
139
140
  type: 'object',
140
141
  properties: {
141
142
  i: { type: 'string' },
143
+ f: { type: 'string', enum: [ 'cs', 'sc' ] },
142
144
  ip: wrtcIceParametersSchema,
143
145
  ic: { type: 'array', items: wrtcIceCandidateSchema },
144
146
  d: wrtcDtlsParametersSchema,
145
147
  s: wrtcSctpParametersSchema,
146
148
  },
147
- required: [ 'i', 'ip', 'ic', 'd', 's' ],
149
+ required: [ 'i', 'f', 'ip', 'ic', 'd', 's' ],
148
150
  additionalProperties: false,
149
151
  };
150
152
 
@@ -161,12 +163,12 @@ const wrtcTransportConnectSchema: JSONSchemaType<WrtcTransportConnect> = {
161
163
  const wrtcDataChannelSchema: JSONSchemaType<WrtcDataChannel> = {
162
164
  type: 'object',
163
165
  properties: {
164
- i: { type: 'string' },
165
- di: { type: 'string' },
166
+ i: { type: 'string', nullable: true },
167
+ pi: { type: 'string' },
166
168
  l: { type: 'string' },
167
169
  s: wrtcSctpStreamParametersSchema,
168
170
  },
169
- required: [ 'i', 'di', 'l', 's' ],
171
+ required: [ 'pi', 'l', 's' ],
170
172
  additionalProperties: false,
171
173
  };
172
174