@4players/odin-common 9.1.1 → 9.2.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/README.md +36 -9
- package/{schema → api}/serialization.d.ts +3 -3
- package/cjs/mod.js +1 -1
- package/esm/mod.js +1 -1
- package/mod.d.ts +1 -11
- package/package.json +2 -2
- package/utility/bytearray.d.ts +1 -1
- package/utility/json.d.ts +1 -1
- package/utility/log.d.ts +7 -1
- package/rpc/commands.d.ts +0 -138
- package/rpc/notifications.d.ts +0 -276
- package/schema/channels.d.ts +0 -11
- package/schema/media.d.ts +0 -45
- package/schema/message.d.ts +0 -6
- package/schema/peer.d.ts +0 -54
- package/schema/room.d.ts +0 -350
- package/schema/token.d.ts +0 -31
- package/schema/webrtc.d.ts +0 -19
package/README.md
CHANGED
|
@@ -7,28 +7,55 @@
|
|
|
7
7
|
A collection of commonly used type definitions and schemas across ODIN web
|
|
8
8
|
projects.
|
|
9
9
|
|
|
10
|
+
## Entrypoints
|
|
11
|
+
|
|
12
|
+
The package is split into three entrypoints:
|
|
13
|
+
|
|
14
|
+
### `@4players/odin-common`
|
|
15
|
+
|
|
16
|
+
Lightweight utilities with no heavy dependencies. Includes logging, a `Result` type, video
|
|
17
|
+
codec helpers, async primitives (sleep, task queues, promise racing), base64/byte array encoding,
|
|
18
|
+
UUID generation, environment detection, type guards, URL helpers and the backend plugin API types.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Logger, LogFilter } from '@4players/odin-common';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### `@4players/odin-common/api`
|
|
25
|
+
|
|
26
|
+
Zod-based schemas for the ODIN Voice protocol (rooms, peers, media, tokens, channels)
|
|
27
|
+
and RPC command/notification definitions. Importing from this entrypoint will pull in Zod.
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { TokenClaims, TokenClaimsSchema } from '@4players/odin-common/api';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### `@4players/odin-common/zod`
|
|
34
|
+
|
|
35
|
+
Re-exports the Zod library for consumers that need to create their own schemas without
|
|
36
|
+
adding a separate Zod dependency.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { zod } from '@4players/odin-common/zod';
|
|
40
|
+
```
|
|
41
|
+
|
|
10
42
|
## Troubleshooting
|
|
11
43
|
|
|
12
|
-
Contact us through the listed methods below to receive answers to your questions
|
|
13
|
-
and learn more about ODIN.
|
|
44
|
+
Contact us through the listed methods below to receive answers to your questions and learn more about ODIN.
|
|
14
45
|
|
|
15
46
|
### Discord
|
|
16
47
|
|
|
17
|
-
Join our official Discord server to chat with us directly and become a part of
|
|
18
|
-
the 4Players ODIN community.
|
|
48
|
+
Join our official Discord server to chat with us directly and become a part of the 4Players ODIN community.
|
|
19
49
|
|
|
20
50
|
[](https://4np.de/discord)
|
|
21
51
|
|
|
22
52
|
### Twitter
|
|
23
53
|
|
|
24
|
-
Have a quick question? Tweet us at
|
|
25
|
-
[@ODIN4Players](https://twitter.com/ODIN4Players) and we’ll help you resolve any
|
|
26
|
-
issues.
|
|
54
|
+
Have a quick question? Tweet us at [@ODIN4Players](https://twitter.com/ODIN4Players) and we’ll help you resolve any issues.
|
|
27
55
|
|
|
28
56
|
### Email
|
|
29
57
|
|
|
30
|
-
Don’t use Discord or Twitter? Send us an [email](mailto:odin@4players.io) and
|
|
31
|
-
we’ll get back to you as soon as possible.
|
|
58
|
+
Don’t use Discord or Twitter? Send us an [email](mailto:odin@4players.io) and we’ll get back to you as soon as possible.
|
|
32
59
|
|
|
33
60
|
[npm-badge-url]: https://www.npmjs.com/package/@4players/odin-common
|
|
34
61
|
[license-url]: https://github.com/4Players/odin-sdk-web/blob/master/LICENSE
|
|
@@ -3,14 +3,14 @@ export type RpcValue = Uint8Array | string | number | boolean | null | RpcValue[
|
|
|
3
3
|
[key: string]: RpcValue;
|
|
4
4
|
};
|
|
5
5
|
export type RpcSchema = z.ZodType<RpcValue, unknown>;
|
|
6
|
-
export declare const ByteArraySchema:
|
|
6
|
+
export declare const ByteArraySchema: any;
|
|
7
7
|
export type ByteArray = z.infer<typeof ByteArraySchema>;
|
|
8
|
-
declare const LiteralSchema:
|
|
8
|
+
declare const LiteralSchema: any;
|
|
9
9
|
type Literal = z.infer<typeof LiteralSchema>;
|
|
10
10
|
export type JsonValue = Literal | {
|
|
11
11
|
[key: string]: JsonValue;
|
|
12
12
|
} | JsonValue[];
|
|
13
13
|
export declare const JsonSchema: z.ZodType<JsonValue>;
|
|
14
|
-
export declare const MessagePackRpcSchema:
|
|
14
|
+
export declare const MessagePackRpcSchema: any;
|
|
15
15
|
export type MessagePackRpc = z.infer<typeof MessagePackRpcSchema>;
|
|
16
16
|
export {};
|
package/cjs/mod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ce=Object.create;var M=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ae=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},ee=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of Re(t))!Te.call(e,p)&&p!==n&&M(e,p,{get:()=>t[p],enumerable:!(o=ke(t,p))||o.enumerable});return e};var P=(e,t,n)=>(n=e!=null?Ce(Pe(e)):{},ee(t||!e||!e.__esModule?M(n,"default",{value:e,enumerable:!0}):n,e)),Le=e=>ee(M({},"__esModule",{value:!0}),e);var _t={};Ae(_t,{APM_DEFAULTS:()=>Nt,Backend:()=>ye,ByteArraySchema:()=>x,CONNECTION_STATS_INITIAL:()=>Mt,ChannelSet:()=>B,ChannelSetSchema:()=>K,ConsoleSink:()=>V,Formatter:()=>ge,GLOBAL_LOGGER:()=>R,JITTER_STATS_INITIAL:()=>jt,JsonSchema:()=>T,LogFilter:()=>F,LogLevel:()=>Q,LogSymbols:()=>fe,Logger:()=>C,MainCommandsRpc:()=>Ie,MainNotificationSchema:()=>Ee,MainNotificationsRpc:()=>De,MediaAudioPropertiesSchema:()=>ne,MediaIdSchema:()=>S,MediaPropertiesSchema:()=>j,MediaSchema:()=>U,MediaVideoPropertiesSchema:()=>oe,MessagePackRpcSchema:()=>Me,MessageReceivedSchema:()=>O,MinDBFS:()=>Mr,PeerIdSchema:()=>b,PeerPositionSchema:()=>L,PeerSchema:()=>N,PeerUpdateSchema:()=>_,RoomCommandsRpc:()=>Be,RoomNotificationSchema:()=>Fe,RoomNotificationsRpc:()=>Ve,RoomV1:()=>z,RoomV2:()=>ae,Selector:()=>$,Strand:()=>H,TokenAudienceSchema:()=>te,TokenClaimsSchema:()=>je,TokenSubjectSchema:()=>re,VAD_DEFAULTS:()=>Ut,VideoCodec:()=>G,WebRtcUpdateSchema:()=>k,abortableSleep:()=>nt,assert:()=>w,debug:()=>Lt,error:()=>Pt,extendUrl:()=>at,fail:()=>W,failure:()=>h,find:()=>He,fromBase64:()=>qe,fromBase64Url:()=>Ke,fromBytes:()=>Ge,generateUUID:()=>pt,info:()=>At,isAudioCapable:()=>Ze,isBlinkBrowser:()=>pe,isElectronBrowser:()=>Xe,isFailure:()=>xt,isFirefoxBrowser:()=>Qe,isFunction:()=>dt,isNull:()=>mt,isNumber:()=>lt,isObject:()=>ft,isProperty:()=>ut,isSafariBrowser:()=>et,isSharedArrayBufferCapable:()=>Ye,isString:()=>gt,isSuccess:()=>bt,isUndefined:()=>yt,log:()=>wt,nextTick:()=>ot,normalizeUrl:()=>it,oneOrMany:()=>A,parseCommand:()=>Ue,parseNotification:()=>Oe,parseRequest:()=>Ne,parseResponse:()=>_e,sleep:()=>rt,success:()=>y,toBytes:()=>We,toRaw:()=>tt,tryParseLogFilter:()=>kt,unwrap:()=>Je,unwrapOr:()=>E,validateUUID:()=>ct,warn:()=>Tt});module.exports=Le(_t);var m=require("zod"),x=m.z.custom(e=>e instanceof Uint8Array),we=m.z.union([m.z.string(),m.z.number(),m.z.boolean(),m.z.null()]),T=m.z.lazy(()=>m.z.union([we,m.z.array(T),m.z.record(m.z.string(),T)])),Me=m.z.union([m.z.tuple([m.z.literal(0),m.z.number(),m.z.string(),m.z.unknown()]),m.z.tuple([m.z.literal(1),m.z.number(),m.z.nullable(m.z.string()),m.z.unknown()]),m.z.tuple([m.z.literal(2),m.z.string(),m.z.unknown()])]);var u=require("zod"),te=u.z.enum(["sfu","gateway"]),re=u.z.enum(["connect","roomclose","roomupdate","roombanclient","roomsendmessage"]),je=u.z.object({uid:u.z.string(),cid:u.z.optional(u.z.string()),rid:A(u.z.string()).refine(e=>e.length>=1,{message:"missing rid"}),nsp:u.z.optional(u.z.string()),adr:u.z.optional(u.z.string()),aud:u.z.optional(A(te)),sub:u.z.optional(A(re)),exp:u.z.optional(u.z.number()),nbf:u.z.optional(u.z.number()),ups:u.z.optional(u.z.string()),tgs:u.z.optional(A(u.z.string())),tsp:u.z.optional(u.z.number()),internal:u.z.optional(u.z.object({server:u.z.optional(u.z.string())}))});function A(e){return u.z.union([e.transform(t=>[t]),u.z.array(e)])}var r=P(require("zod"));var d=P(require("zod")),S=d.number(),ne=d.object({kind:d.optional(d.literal("audio")),uid:d.optional(d.string()),customType:d.optional(d.string())}),oe=d.object({kind:d.optional(d.literal("video")),codec:d.optional(d.string()),uid:d.optional(d.string()),customType:d.optional(d.string()),id:d.optional(d.string())}),j=d.union([ne,oe]),U=d.object({id:S,properties:j,paused:d.boolean()});var l=P(require("zod"));var b=l.number(),L=l.union([l.tuple([l.number(),l.number(),l.number()]),l.tuple([l.number(),l.number()])]),N=l.object({id:b,user_id:l.string(),user_data:x,medias:l.array(U)}),_=l.discriminatedUnion("kind",[l.object({kind:l.literal("UserDataChanged"),peer_id:b,user_data:x}),l.object({kind:l.literal("MediaStarted"),peer_id:b,media:U}),l.object({kind:l.literal("MediaStopped"),peer_id:b,media_id:S})]);var ie=P(require("zod")),B=class e{constructor(t=BigInt(0)){this.value=t}from(...t){let n=t.reduce((o,p)=>o|I(p),BigInt(0));return new e(n)}contains(t){return(this.value&I(t))!==BigInt(0)}insert(t){this.value|=I(t)}remove(t){this.value&=~I(t)}[Symbol.iterator](){let t=-1,n=new e(this.value);return{next(){for(;t<63;)if(t+=1,n.contains(t))return{value:t,done:!1};return{value:void 0,done:!0}}}}},K=ie.bigint().transform(e=>new B(e));function I(e){return BigInt(1)<<BigInt(e)}var z;(c=>(c.RoomIdSchema=r.string(),c.RoomSchema=r.object({id:c.RoomIdSchema,customer:r.string(),user_data:x,peers:r.array(N)}),c.RoomUpdateSchema=r.discriminatedUnion("kind",[r.object({kind:r.literal("Joined"),room:c.RoomSchema,media_ids:r.array(S),own_peer_id:b}),r.object({kind:r.literal("Left"),reason:r.enum(["RoomClosing","ServerClosing","PeerKicked"])}),r.object({kind:r.literal("UserDataChanged"),user_data:r.optional(x)}),r.object({kind:r.literal("PeerJoined"),peer:N}),r.object({kind:r.literal("PeerLeft"),peer_id:b})]),c.RoomUpdatesSchema=r.object({updates:r.array(c.RoomUpdateSchema)}),c.RoomStatusSchema=r.enum(["Joining","Joined","Closed"]),c.RoomStatusChangedSchema=r.object({status:c.RoomStatusSchema,message:r.optional(r.string())})))(z||={});var ae;(a=>(a.ParametersSchema=r.record(r.string(),T),a.PeerProperties=r.object({user_data:x.optional(),tags:r.array(r.string()).optional(),audio_parameters:a.ParametersSchema.optional(),video_parameters:a.ParametersSchema.optional()}),a.PingSchema=r.object({Ping:r.object({id:r.number()})}),a.ChangeSelfSchema=r.object({ChangeSelf:a.PeerProperties.omit({tags:!0})}),a.SetAudioMaskSchema=r.object({SetAudioMask:r.object({peer_id:r.number(),mask:K})}),a.SendMessageSchema=r.object({SendMessage:r.object({peer_ids:r.number().array().default([]),message:x})}),a.CallSchema=a.PingSchema.or(a.ChangeSelfSchema).or(a.SetAudioMaskSchema).or(a.SendMessageSchema),a.PongSchema=r.object({Pong:r.object({id:r.number()})}),a.JoinedSchema=r.object({Joined:r.object({own_peer_id:r.number(),room_id:r.string(),customer:r.string()})}),a.LeftSchema=r.object({Left:r.object({reason:r.enum(["room_closing","server_closing","peer_kicked"])})}),a.PeerJoinedSchema=r.object({PeerJoined:a.PeerProperties.extend({peer_id:r.number(),user_id:r.string()})}),a.PeerLeftSchema=r.object({PeerLeft:r.object({peer_id:r.number()})}),a.PeerChangedSchema=r.object({PeerChanged:a.PeerProperties.extend({peer_id:r.number()})}),a.NewReconnectTokenSchema=r.object({NewReconnectToken:r.object({token:r.string()})}),a.MessageReceivedSchema=r.object({MessageReceived:r.object({sender_peer_id:r.number(),message:x})}),a.ErrorSchema=r.object({Error:r.object({message:x})}),a.EventSchema=a.PongSchema.or(a.JoinedSchema).or(a.LeftSchema).or(a.PeerJoinedSchema).or(a.PeerLeftSchema).or(a.PeerChangedSchema).or(a.NewReconnectTokenSchema).or(a.MessageReceivedSchema).or(a.ErrorSchema)))(ae||={});var se=require("zod");var O=se.z.object({sender_peer_id:b,message:x});var s=P(require("zod"));var k=s.discriminatedUnion("kind",[s.object({kind:s.literal("Sdp"),type:s.enum(["Answer","Offer"]),sdp:s.string(),media_map:s.array(s.tuple([S,s.string()]))}),s.object({kind:s.literal("Trickle"),candidate:s.string(),spd_mid:s.optional(s.string()),spd_mline_index:s.optional(s.number()),username_fragment:s.optional(s.union([s.string(),s.null()]))}),s.object({kind:s.literal("TrickleFinished")})]);var i=require("zod");function Ue(e,t,n){let o=n[e];if(!o)return;let p=o.request.safeParse(t);return p.success?{name:e,request:p.data}:void 0}function Ne(e,t,n){return n[e].request.parse(t)}function _e(e,t,n){let o=n[e].response.safeParse(t);return o.success?o.data:void 0}var Ie={Hello:{request:i.z.object({stream:i.z.literal("main")}),response:i.z.null()},JoinRoom:{request:i.z.object({token:i.z.string(),room_id:z.RoomIdSchema,user_data:x,position:L}),response:i.z.object({peer_id:b,stream_id:i.z.optional(i.z.number()),token:i.z.optional(i.z.string())})},WebRtcUpdate:{request:k,response:i.z.null()},RequestReconnectToken:{request:i.z.object({peer_id:i.z.optional(b)}),response:i.z.string()},Ping:{request:i.z.object({}),response:i.z.null()}},Be={Hello:{request:i.z.object({stream:i.z.literal("room"),token:i.z.string(),room_id:i.z.string(),user_data:x,position:L}),response:i.z.null()},UpdatePeer:{request:i.z.object({user_data:x}),response:i.z.null()},StartMedia:{request:i.z.object({media_id:S,properties:j}),response:i.z.null()},StopMedia:{request:i.z.object({media_id:S}),response:i.z.null()},PauseMedia:{request:i.z.object({media_id:S}),response:i.z.null()},ResumeMedia:{request:i.z.object({media_id:S}),response:i.z.null()},SetPeerPosition:{request:i.z.object({position:L}),response:i.z.null()},SendMessage:{request:i.z.object({target_peer_ids:i.z.optional(i.z.array(b)),message:x}),response:i.z.null()}};var v=require("zod");function Oe(e,t,n){let o=n[e];if(!o)return;let p=o.safeParse(t);return p.success?{name:e,properties:p.data}:void 0}var Ee=v.z.object({name:v.z.literal("WebRtcUpdate"),properties:k}),De={WebRtcUpdate:k},Fe=v.z.union([v.z.object({name:v.z.literal("RoomStatusChanged"),properties:z.RoomStatusChangedSchema}),v.z.object({name:v.z.literal("RoomUpdated"),properties:z.RoomUpdatesSchema}),v.z.object({name:v.z.literal("PeerUpdated"),properties:_}),v.z.object({name:v.z.literal("MessageReceived"),properties:O})]),Ve={RoomStatusChanged:z.RoomStatusChangedSchema,RoomUpdated:z.RoomUpdatesSchema,PeerUpdated:_,MessageReceived:O};function w(e,t){e||W(t)}function W(e){throw new Error(e)}function y(e){return{type:"Success",value:e}}function h(e){return{type:"Failure",reason:e}}function Je(e){return e.type==="Failure"&&W(e.reason),e.value}function E(e,t){return e.type==="Success"?e.value:t}function qe(e){try{let t=atob(e),n=Uint8Array.from(t,p=>p.codePointAt(0)),o=new TextDecoder("utf8");return y(o.decode(n))}catch(t){return h(String(t))}}function Ke(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,p=>p.codePointAt(0)),o=new TextDecoder("utf8");return y(o.decode(n))}catch(t){return h(String(t))}}function We(e){try{w(e!==void 0,"undefined cannot be converted to byte array"),w(e!==null,"null cannot be converted to byte array");let t=JSON.stringify(e),n=new TextEncoder;return y(n.encode(t))}catch(t){return h(String(t))}}function Ge(e){try{w(e.length>0,"empty byte array cannot be converted to value");let t=new TextDecoder().decode(e),n=JSON.parse(t);return y(n)}catch(t){return h(String(t))}}var $e=["VP8","VP9","AV1","H264"],G=class{constructor(t){this.codec=t}channels=0;clockRate=9e4;isValid(){return $e.includes(this.codec)}isSupported(){if(typeof RTCRtpReceiver>"u"||typeof RTCRtpReceiver.getCapabilities>"u")return null;let t=E(this.getMimeType(),"").toLowerCase(),n=new Set(E(this.getSdpFmtpLine(),"").split(";").map(o=>o.trim().toLowerCase()));return RTCRtpReceiver.getCapabilities("video")?.codecs?.find(o=>{let p=o.mimeType.toLowerCase(),f=new Set((o.sdpFmtpLine??"").split(";").map(c=>c.trim().toLowerCase()));if(t!==p||n.size!==f.size)return!1;for(let c of n)if(!f.has(c))return!1;return!0})??null}getPayloadType(){switch(this.codec){case"VP8":return y(96);case"VP9":return y(98);case"AV1":return y(41);case"H264":return y(102);default:return h("invalid video codec")}}getMimeType(){switch(this.codec){case"VP8":return y("video/VP8");case"VP9":return y("video/VP9");case"AV1":return y("video/AV1");case"H264":return y("video/H264");default:return h("invalid video codec")}}getSdpFmtpLine(){switch(this.codec){case"VP8":return y("");case"VP9":return y("profile-id=2");case"AV1":return y("level-idx=5;profile=0;tier=0");case"H264":return y("level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f");default:return h("invalid video codec")}}};function He(e,t){for(let n of e)if(t(n))return n}function Ze(){return typeof AudioContext<"u"&&typeof Worker<"u"}function Ye(){return typeof SharedArrayBuffer<"u"}function pe(){return/(apple)?webkit\/537\.36/i.test(globalThis.navigator.userAgent)}function Xe(){return/electron/i.test(globalThis.navigator.userAgent)}function Qe(){return/firefox|iceweasel|fxios/i.test(globalThis.navigator.userAgent)}function et(){return pe()?!1:/safari|applewebkit/i.test(globalThis.navigator.userAgent)}function tt(e){return JSON.parse(JSON.stringify(e))}var $=class e{constructor(t){this._Generators=t;this._Futures=t.map(e.addIndex)}_Futures;async next(){let[t,n]=await Promise.race(this._Futures);return this._Futures[n]=e.addIndex(this._Generators[n],n),t}static async addIndex(t,n){return[await t(),n]}};function rt(e,t){return e<=0?Promise.resolve(t):new Promise(n=>setTimeout(()=>n(t),e))}function nt(e,t){return t.aborted?Promise.resolve("aborted"):new Promise(n=>{let o=()=>n("aborted");t.addEventListener("abort",o,{once:!0}),setTimeout(()=>{t.removeEventListener("abort",o),n(void 0)},e)})}function ot(){return new Promise(e=>setTimeout(e,0))}var H=class{_Tasks=[];_Running=!1;_Values;constructor(...t){this._Values=t}enqueue(t){return new Promise((n,o)=>{let p=async()=>{try{let f=await t(...this._Values);n(f)}catch(f){o(f)}};this._Tasks.push(p),this._Running||this.execute()})}async execute(){for(this._Running=!0;;){let t=this._Tasks.shift();if(t===void 0)break;await t()}this._Running=!1}};function it(e){let t=e.trim();e.indexOf("://")===-1&&(t=`https://${t}`);try{return y(new URL(t))}catch(n){return h(String(n))}}function at(e,t){let n=e.pathname;n.endsWith("/")===!1&&(n+="/");try{return y(new URL(n+t,e))}catch(o){return h(String(o))}}var st=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function pt(){return crypto.randomUUID()}function ct(e){return st.test(e)}function ut(e,t){return t in e}function dt(e){return typeof e=="function"}function mt(e){return typeof e=="object"&&e===null}function lt(e){return typeof e=="number"}function ft(e){return typeof e=="object"}function gt(e){return typeof e=="string"}function yt(e){return typeof e>"u"}function xt(e){return e.type==="Failure"}function bt(e){return e.type==="Success"}var{Deno:ce}=globalThis,ht=typeof ce?.noColor=="boolean"?ce.noColor:!1,St=!ht;function Z(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}function Y(e,t){return St?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}function D(e){return Y(e,Z([0],0))}function X(e){return Y(e,Z([1],22))}function ue(e){return Y(e,Z([2],22))}var Lr=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g");var F=(g=>(g[g.Nothing=0]="Nothing",g[g.CRITICAL=1]="CRITICAL",g[g.ERROR=2]="ERROR",g[g.WARN=3]="WARN",g[g.INFO=4]="INFO",g[g.DEBUG=5]="DEBUG",g[g.Everything=6]="Everything",g))(F||{}),zt=new Date,Q=(f=>(f[f.CRITICAL=1]="CRITICAL",f[f.ERROR=2]="ERROR",f[f.WARN=3]="WARN",f[f.INFO=4]="INFO",f[f.DEBUG=5]="DEBUG",f))(Q||{}),fe={1:"\u{1F4A5}",2:"\u{1F534}",3:"\u{1F7E1}",4:"\u{1F535}",5:"\u{1F7E3}"},Ct={5:ue,4:D,3:D,2:X,1:X};function kt(e){for(let t of Object.keys(F))if(isNaN(Number(t))!==!1&&t.localeCompare(e,void 0,{sensitivity:"accent"})===0)return F[t]}function Rt({message:e}){return String(e)}function de(e){return JSON.stringify({timestamp:e.date.toISOString(),level:Q[e.level],message:e.message,extra:e.extra})}function me(e){function t(c,g){return[Math.floor(c/g),c%g]}function n(){let c,g=e.date.valueOf()-zt.valueOf();[g,c]=t(g,1e3);let[J,q]=t(g,60);return`${J.toString().padStart(4,"0")}:${q.toString().padStart(2,"0")}.${c.toString().padStart(4,"0")}`}function o(){return e.extra===void 0?"":"Deno"in globalThis?" "+Deno.inspect(e.extra,{compact:!1,colors:!0,trailingComma:!0}).trimStart():" "+JSON.stringify(e.extra)}let p=fe[e.level],f=e.logger.name!==void 0?`@${e.logger}`:"";return`${D(n())}${f} ${p} ${Ct[e.level](String(e.message))}${o()}`}var ge={sparse:Rt,json:de,pretty:me,default:"Deno"in globalThis&&Deno.stdout.isTerminal()?me:de},V=class{#e;#t;filter;constructor(t=ge.default,n=6,o=console){this.filter=n,this.#e=t,this.#t=o}handle(t){let n=this.#e(t);switch(t.level){case 2:this.#t.error(n);break;case 3:this.#t.warn(n);break;case 4:this.#t.info(n);break;case 5:this.#t.debug(n);break}}},C=class{#e;sinks;filter;get name(){return this.#e}constructor(t,n=void 0,o=[new V]){this.#e=n,this.sinks=o,this.filter=t}log(t,n,o=void 0){if(this.filter<t)return;let p=le;for(let f of this.sinks)f.filter<t||(p===le&&(p={date:new Date,level:t,logger:this,message:typeof n=="function"?n():n,extra:o}),f.handle(p))}error=this.log.bind(this,2);warn=this.log.bind(this,3);info=this.log.bind(this,4);debug=this.log.bind(this,5)},R=new C(4),Pt=C.prototype.log.bind(R,2),Tt=C.prototype.log.bind(R,3),At=C.prototype.log.bind(R,4),Lt=C.prototype.log.bind(R,5),wt=C.prototype.log.bind(R),le=Symbol();var Mr=-758.596,ye;(t=>{let e;(c=>(c[c.InvalidPassword=-1]="InvalidPassword",c[c.Unknown=0]="Unknown",c[c.Unencrypted=1]="Unencrypted",c[c.Encrypted=2]="Encrypted"))(e=t.PeerCipherStatus||={})})(ye||={});var Mt={bytesSent:0,bytesReceived:0,packetsSent:0,packetsReceived:0,rtt:0,packetLoss:0},jt={packetsBuffered:0,packetsSeen:0,packetsProcessed:0,packetsTooEarly:0,packetsTooLate:0,packetsDropped:0,packetsInvalid:0,packetsRepeated:0,packetsLost:0},Ut={voiceActivity:{attackThreshold:.9,releaseThreshold:.8},volumeGate:{attackThreshold:-30,releaseThreshold:-40}},Nt={echoCanceller:!0,highPassFilter:!1,noiseSuppression:"Moderate",transientSuppressor:!1,gainController:!0};0&&(module.exports={APM_DEFAULTS,Backend,ByteArraySchema,CONNECTION_STATS_INITIAL,ChannelSet,ChannelSetSchema,ConsoleSink,Formatter,GLOBAL_LOGGER,JITTER_STATS_INITIAL,JsonSchema,LogFilter,LogLevel,LogSymbols,Logger,MainCommandsRpc,MainNotificationSchema,MainNotificationsRpc,MediaAudioPropertiesSchema,MediaIdSchema,MediaPropertiesSchema,MediaSchema,MediaVideoPropertiesSchema,MessagePackRpcSchema,MessageReceivedSchema,MinDBFS,PeerIdSchema,PeerPositionSchema,PeerSchema,PeerUpdateSchema,RoomCommandsRpc,RoomNotificationSchema,RoomNotificationsRpc,RoomV1,RoomV2,Selector,Strand,TokenAudienceSchema,TokenClaimsSchema,TokenSubjectSchema,VAD_DEFAULTS,VideoCodec,WebRtcUpdateSchema,abortableSleep,assert,debug,error,extendUrl,fail,failure,find,fromBase64,fromBase64Url,fromBytes,generateUUID,info,isAudioCapable,isBlinkBrowser,isElectronBrowser,isFailure,isFirefoxBrowser,isFunction,isNull,isNumber,isObject,isProperty,isSafariBrowser,isSharedArrayBufferCapable,isString,isSuccess,isUndefined,log,nextTick,normalizeUrl,oneOrMany,parseCommand,parseNotification,parseRequest,parseResponse,sleep,success,toBytes,toRaw,tryParseLogFilter,unwrap,unwrapOr,validateUUID,warn});
|
|
1
|
+
var x=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var _=(e,t)=>{for(var r in t)x(e,r,{get:t[r],enumerable:!0})},$=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of M(t))!j.call(e,s)&&s!==r&&x(e,s,{get:()=>t[s],enumerable:!(n=N(t,s))||n.enumerable});return e};var G=e=>$(x({},"__esModule",{value:!0}),e);var Fe={};_(Fe,{APM_DEFAULTS:()=>H,Backend:()=>P,CONNECTION_STATS_INITIAL:()=>J,ConsoleSink:()=>g,Formatter:()=>B,GLOBAL_LOGGER:()=>l,InteractiveConsoleSink:()=>S,JITTER_STATS_INITIAL:()=>W,LogFilter:()=>y,LogLevel:()=>b,LogSymbols:()=>A,Logger:()=>p,MinDBFS:()=>Me,Selector:()=>R,Strand:()=>T,VAD_DEFAULTS:()=>z,VideoCodec:()=>h,abortableSleep:()=>ue,assert:()=>d,debug:()=>Be,error:()=>Ie,extendUrl:()=>le,fail:()=>v,failure:()=>c,find:()=>ee,fromBase64:()=>q,fromBase64Url:()=>Y,fromBytes:()=>K,generateUUID:()=>ge,info:()=>Ee,isAudioCapable:()=>te,isBlinkBrowser:()=>w,isElectronBrowser:()=>ne,isFailure:()=>Te,isFirefoxBrowser:()=>oe,isFunction:()=>ye,isNull:()=>be,isNumber:()=>xe,isObject:()=>ve,isProperty:()=>me,isSafariBrowser:()=>ie,isSharedArrayBufferCapable:()=>re,isString:()=>he,isSuccess:()=>ke,isUndefined:()=>Re,log:()=>Ue,nextTick:()=>ce,normalizeUrl:()=>pe,sleep:()=>ae,success:()=>o,toBytes:()=>X,toRaw:()=>se,tryParseLogFilter:()=>we,unwrap:()=>Z,unwrapOr:()=>f,validateUUID:()=>fe,warn:()=>De});module.exports=G(Fe);var Me=-758.596,P;(t=>{let e;(u=>(u[u.InvalidPassword=-1]="InvalidPassword",u[u.Unknown=0]="Unknown",u[u.Unencrypted=1]="Unencrypted",u[u.Encrypted=2]="Encrypted"))(e=t.PeerCipherStatus||={})})(P||={});var J={bytesSent:0,bytesReceived:0,packetsSent:0,packetsReceived:0,rtt:0,packetLoss:0},W={packetsBuffered:0,packetsSeen:0,packetsProcessed:0,packetsTooEarly:0,packetsTooLate:0,packetsDropped:0,packetsInvalid:0,packetsRepeated:0,packetsLost:0},z={voiceActivity:{attackThreshold:.9,releaseThreshold:.8},volumeGate:{attackThreshold:-30,releaseThreshold:-40}},H={echoCanceller:!0,highPassFilter:!1,noiseSuppression:"Moderate",transientSuppressor:!1,gainController:!0};function d(e,t){e||v(t)}function v(e){throw new Error(e)}function o(e){return{type:"Success",value:e}}function c(e){return{type:"Failure",reason:e}}function Z(e){return e.type==="Failure"&&v(e.reason),e.value}function f(e,t){return e.type==="Success"?e.value:t}function q(e){try{let t=atob(e),r=Uint8Array.from(t,s=>s.codePointAt(0)),n=new TextDecoder("utf8");return o(n.decode(r))}catch(t){return c(String(t))}}function Y(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(t,s=>s.codePointAt(0)),n=new TextDecoder("utf8");return o(n.decode(r))}catch(t){return c(String(t))}}function X(e){try{d(e!==void 0,"undefined cannot be converted to byte array"),d(e!==null,"null cannot be converted to byte array");let t=JSON.stringify(e),r=new TextEncoder;return o(r.encode(t))}catch(t){return c(String(t))}}function K(e){try{d(e.length>0,"empty byte array cannot be converted to value");let t=new TextDecoder().decode(e),r=JSON.parse(t);return o(r)}catch(t){return c(String(t))}}var Q=["VP8","VP9","AV1","H264"],h=class{constructor(t){this.codec=t}channels=0;clockRate=9e4;isValid(){return Q.includes(this.codec)}isSupported(){if(typeof RTCRtpReceiver>"u"||typeof RTCRtpReceiver.getCapabilities>"u")return null;let t=f(this.getMimeType(),"").toLowerCase(),r=new Set(f(this.getSdpFmtpLine(),"").split(";").map(n=>n.trim().toLowerCase()));return RTCRtpReceiver.getCapabilities("video")?.codecs?.find(n=>{let s=n.mimeType.toLowerCase(),i=new Set((n.sdpFmtpLine??"").split(";").map(u=>u.trim().toLowerCase()));if(t!==s||r.size!==i.size)return!1;for(let u of r)if(!i.has(u))return!1;return!0})??null}getPayloadType(){switch(this.codec){case"VP8":return o(96);case"VP9":return o(98);case"AV1":return o(41);case"H264":return o(102);default:return c("invalid video codec")}}getMimeType(){switch(this.codec){case"VP8":return o("video/VP8");case"VP9":return o("video/VP9");case"AV1":return o("video/AV1");case"H264":return o("video/H264");default:return c("invalid video codec")}}getSdpFmtpLine(){switch(this.codec){case"VP8":return o("");case"VP9":return o("profile-id=2");case"AV1":return o("level-idx=5;profile=0;tier=0");case"H264":return o("level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f");default:return c("invalid video codec")}}};function ee(e,t){for(let r of e)if(t(r))return r}function te(){return typeof AudioContext<"u"&&typeof Worker<"u"}function re(){return typeof SharedArrayBuffer<"u"}function w(){return/(apple)?webkit\/537\.36/i.test(globalThis.navigator.userAgent)}function ne(){return/electron/i.test(globalThis.navigator.userAgent)}function oe(){return/firefox|iceweasel|fxios/i.test(globalThis.navigator.userAgent)}function ie(){return w()?!1:/safari|applewebkit/i.test(globalThis.navigator.userAgent)}function se(e){return JSON.parse(JSON.stringify(e))}var R=class e{constructor(t){this._Generators=t;this._Futures=t.map(e.addIndex)}_Futures;async next(){let[t,r]=await Promise.race(this._Futures);return this._Futures[r]=e.addIndex(this._Generators[r],r),t}static async addIndex(t,r){return[await t(),r]}};function ae(e,t){return e<=0?Promise.resolve(t):new Promise(r=>setTimeout(()=>r(t),e))}function ue(e,t){return t.aborted?Promise.resolve("aborted"):new Promise(r=>{let n=()=>r("aborted");t.addEventListener("abort",n,{once:!0}),setTimeout(()=>{t.removeEventListener("abort",n),r(void 0)},e)})}function ce(){return new Promise(e=>setTimeout(e,0))}var T=class{_Tasks=[];_Running=!1;_Values;constructor(...t){this._Values=t}enqueue(t){return new Promise((r,n)=>{let s=async()=>{try{let i=await t(...this._Values);r(i)}catch(i){n(i)}};this._Tasks.push(s),this._Running||this.execute()})}async execute(){for(this._Running=!0;;){let t=this._Tasks.shift();if(t===void 0)break;await t()}this._Running=!1}};function pe(e){let t=e.trim();e.indexOf("://")===-1&&(t=`https://${t}`);try{return o(new URL(t))}catch(r){return c(String(r))}}function le(e,t){let r=e.pathname;r.endsWith("/")===!1&&(r+="/");try{return o(new URL(r+t,e))}catch(n){return c(String(n))}}var de=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function ge(){return crypto.randomUUID()}function fe(e){return de.test(e)}function me(e,t){return t in e}function ye(e){return typeof e=="function"}function be(e){return typeof e=="object"&&e===null}function xe(e){return typeof e=="number"}function ve(e){return typeof e=="object"}function he(e){return typeof e=="string"}function Re(e){return typeof e>"u"}function Te(e){return e.type==="Failure"}function ke(e){return e.type==="Success"}var{Deno:V}=globalThis,Ce=typeof V?.noColor=="boolean"?V.noColor:!1,Le=!Ce;function k(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}function C(e,t){return Le?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}function m(e){return C(e,k([0],0))}function L(e){return C(e,k([1],22))}function O(e){return C(e,k([2],22))}var ot=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g");var y=(a=>(a[a.Nothing=0]="Nothing",a[a.CRITICAL=1]="CRITICAL",a[a.ERROR=2]="ERROR",a[a.WARN=3]="WARN",a[a.INFO=4]="INFO",a[a.DEBUG=5]="DEBUG",a[a.Everything=6]="Everything",a))(y||{}),Ae=new Date,b=(i=>(i[i.CRITICAL=1]="CRITICAL",i[i.ERROR=2]="ERROR",i[i.WARN=3]="WARN",i[i.INFO=4]="INFO",i[i.DEBUG=5]="DEBUG",i))(b||{}),A={1:"\u{1F4A5}",2:"\u{1F534}",3:"\u{1F7E1}",4:"\u{1F535}",5:"\u{1F7E3}"},Pe={5:O,4:m,3:m,2:L,1:L};function we(e){for(let t of Object.keys(y))if(isNaN(Number(t))!==!1&&t.localeCompare(e,void 0,{sensitivity:"accent"})===0)return y[t]}function Ve({message:e}){return String(e)}function I(e){return JSON.stringify({timestamp:e.date.toISOString(),level:b[e.level],message:e.message,extra:e.extra})}function D(e){function t(u,a){return[Math.floor(u/a),u%a]}function r(){let u,a=e.date.valueOf()-Ae.valueOf();[a,u]=t(a,1e3);let[U,F]=t(a,60);return`${U.toString().padStart(4,"0")}:${F.toString().padStart(2,"0")}.${u.toString().padStart(4,"0")}`}function n(){return e.extra===void 0?"":"Deno"in globalThis?" "+Deno.inspect(e.extra,{compact:!1,colors:!0,trailingComma:!0}).trimStart():" "+JSON.stringify(e.extra)}let s=A[e.level],i=e.logger.name!==void 0?`@${e.logger}`:"";return`${m(r())}${i} ${s} ${Pe[e.level](String(e.message))}${n()}`}function Oe(e){let t=`[${e.date.toISOString()}]`,r=`[${b[e.level]}]`,n=e.logger.name!==void 0?`[${e.logger.name}] `:"",s=A[e.level];return`${t} ${s} ${r.padEnd(7," ")} ${n}${e.message}`}var B={sparse:Ve,json:I,pretty:D,structured:Oe,default:"Deno"in globalThis&&Deno.stdout.isTerminal()?D:I},g=class{formatter;consoleObject;filter;constructor(t=B.default,r=6,n=console){this.filter=r,this.formatter=t,this.consoleObject=n}handle(t){let r=this.formatter(t);switch(t.level){case 2:this.consoleObject.error(r);break;case 3:this.consoleObject.warn(r);break;case 4:this.consoleObject.info(r);break;case 5:this.consoleObject.debug(r);break}}},S=class extends g{handle(t){let r=this.formatter(t),n=t.extra!==void 0?[r,t.extra]:[r];switch(t.level){case 1:case 2:this.consoleObject.error(...n);break;case 3:this.consoleObject.warn(...n);break;case 4:this.consoleObject.info(...n);break;case 5:this.consoleObject.debug(...n);break}}},p=class{#e;sinks;filter;get name(){return this.#e}constructor(t,r=void 0,n=[new g]){this.#e=r,this.sinks=n,this.filter=t}log(t,r,n=void 0){if(this.filter<t)return;let s=E;for(let i of this.sinks)i.filter<t||(s===E&&(s={date:new Date,level:t,logger:this,message:typeof r=="function"?r():r,extra:n}),i.handle(s))}error=this.log.bind(this,2);warn=this.log.bind(this,3);info=this.log.bind(this,4);debug=this.log.bind(this,5)},l=new p(4),Ie=p.prototype.log.bind(l,2),De=p.prototype.log.bind(l,3),Ee=p.prototype.log.bind(l,4),Be=p.prototype.log.bind(l,5),Ue=p.prototype.log.bind(l),E=Symbol();0&&(module.exports={APM_DEFAULTS,Backend,CONNECTION_STATS_INITIAL,ConsoleSink,Formatter,GLOBAL_LOGGER,InteractiveConsoleSink,JITTER_STATS_INITIAL,LogFilter,LogLevel,LogSymbols,Logger,MinDBFS,Selector,Strand,VAD_DEFAULTS,VideoCodec,abortableSleep,assert,debug,error,extendUrl,fail,failure,find,fromBase64,fromBase64Url,fromBytes,generateUUID,info,isAudioCapable,isBlinkBrowser,isElectronBrowser,isFailure,isFirefoxBrowser,isFunction,isNull,isNumber,isObject,isProperty,isSafariBrowser,isSharedArrayBufferCapable,isString,isSuccess,isUndefined,log,nextTick,normalizeUrl,sleep,success,toBytes,toRaw,tryParseLogFilter,unwrap,unwrapOr,validateUUID,warn});
|
package/esm/mod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as d}from"zod";var x=d.custom(e=>e instanceof Uint8Array),ue=d.union([d.string(),d.number(),d.boolean(),d.null()]),P=d.lazy(()=>d.union([ue,d.array(P),d.record(d.string(),P)])),Me=d.union([d.tuple([d.literal(0),d.number(),d.string(),d.unknown()]),d.tuple([d.literal(1),d.number(),d.nullable(d.string()),d.unknown()]),d.tuple([d.literal(2),d.string(),d.unknown()])]);import{z as c}from"zod";var de=c.enum(["sfu","gateway"]),me=c.enum(["connect","roomclose","roomupdate","roombanclient","roomsendmessage"]),Ne=c.object({uid:c.string(),cid:c.optional(c.string()),rid:T(c.string()).refine(e=>e.length>=1,{message:"missing rid"}),nsp:c.optional(c.string()),adr:c.optional(c.string()),aud:c.optional(T(de)),sub:c.optional(T(me)),exp:c.optional(c.number()),nbf:c.optional(c.number()),ups:c.optional(c.string()),tgs:c.optional(T(c.string())),tsp:c.optional(c.number()),internal:c.optional(c.object({server:c.optional(c.string())}))});function T(e){return c.union([e.transform(t=>[t]),c.array(e)])}import*as r from"zod";import*as u from"zod";var S=u.number(),le=u.object({kind:u.optional(u.literal("audio")),uid:u.optional(u.string()),customType:u.optional(u.string())}),fe=u.object({kind:u.optional(u.literal("video")),codec:u.optional(u.string()),uid:u.optional(u.string()),customType:u.optional(u.string()),id:u.optional(u.string())}),N=u.union([le,fe]),_=u.object({id:S,properties:N,paused:u.boolean()});import*as m from"zod";var b=m.number(),A=m.union([m.tuple([m.number(),m.number(),m.number()]),m.tuple([m.number(),m.number()])]),I=m.object({id:b,user_id:m.string(),user_data:x,medias:m.array(_)}),B=m.discriminatedUnion("kind",[m.object({kind:m.literal("UserDataChanged"),peer_id:b,user_data:x}),m.object({kind:m.literal("MediaStarted"),peer_id:b,media:_}),m.object({kind:m.literal("MediaStopped"),peer_id:b,media_id:S})]);import*as W from"zod";var O=class e{constructor(t=BigInt(0)){this.value=t}from(...t){let n=t.reduce((o,l)=>o|L(l),BigInt(0));return new e(n)}contains(t){return(this.value&L(t))!==BigInt(0)}insert(t){this.value|=L(t)}remove(t){this.value&=~L(t)}[Symbol.iterator](){let t=-1,n=new e(this.value);return{next(){for(;t<63;)if(t+=1,n.contains(t))return{value:t,done:!1};return{value:void 0,done:!0}}}}},G=W.bigint().transform(e=>new O(e));function L(e){return BigInt(1)<<BigInt(e)}var z;(p=>(p.RoomIdSchema=r.string(),p.RoomSchema=r.object({id:p.RoomIdSchema,customer:r.string(),user_data:x,peers:r.array(I)}),p.RoomUpdateSchema=r.discriminatedUnion("kind",[r.object({kind:r.literal("Joined"),room:p.RoomSchema,media_ids:r.array(S),own_peer_id:b}),r.object({kind:r.literal("Left"),reason:r.enum(["RoomClosing","ServerClosing","PeerKicked"])}),r.object({kind:r.literal("UserDataChanged"),user_data:r.optional(x)}),r.object({kind:r.literal("PeerJoined"),peer:I}),r.object({kind:r.literal("PeerLeft"),peer_id:b})]),p.RoomUpdatesSchema=r.object({updates:r.array(p.RoomUpdateSchema)}),p.RoomStatusSchema=r.enum(["Joining","Joined","Closed"]),p.RoomStatusChangedSchema=r.object({status:p.RoomStatusSchema,message:r.optional(r.string())})))(z||={});var ge;(a=>(a.ParametersSchema=r.record(r.string(),P),a.PeerProperties=r.object({user_data:x.optional(),tags:r.array(r.string()).optional(),audio_parameters:a.ParametersSchema.optional(),video_parameters:a.ParametersSchema.optional()}),a.PingSchema=r.object({Ping:r.object({id:r.number()})}),a.ChangeSelfSchema=r.object({ChangeSelf:a.PeerProperties.omit({tags:!0})}),a.SetAudioMaskSchema=r.object({SetAudioMask:r.object({peer_id:r.number(),mask:G})}),a.SendMessageSchema=r.object({SendMessage:r.object({peer_ids:r.number().array().default([]),message:x})}),a.CallSchema=a.PingSchema.or(a.ChangeSelfSchema).or(a.SetAudioMaskSchema).or(a.SendMessageSchema),a.PongSchema=r.object({Pong:r.object({id:r.number()})}),a.JoinedSchema=r.object({Joined:r.object({own_peer_id:r.number(),room_id:r.string(),customer:r.string()})}),a.LeftSchema=r.object({Left:r.object({reason:r.enum(["room_closing","server_closing","peer_kicked"])})}),a.PeerJoinedSchema=r.object({PeerJoined:a.PeerProperties.extend({peer_id:r.number(),user_id:r.string()})}),a.PeerLeftSchema=r.object({PeerLeft:r.object({peer_id:r.number()})}),a.PeerChangedSchema=r.object({PeerChanged:a.PeerProperties.extend({peer_id:r.number()})}),a.NewReconnectTokenSchema=r.object({NewReconnectToken:r.object({token:r.string()})}),a.MessageReceivedSchema=r.object({MessageReceived:r.object({sender_peer_id:r.number(),message:x})}),a.ErrorSchema=r.object({Error:r.object({message:x})}),a.EventSchema=a.PongSchema.or(a.JoinedSchema).or(a.LeftSchema).or(a.PeerJoinedSchema).or(a.PeerLeftSchema).or(a.PeerChangedSchema).or(a.NewReconnectTokenSchema).or(a.MessageReceivedSchema).or(a.ErrorSchema)))(ge||={});import{z as ye}from"zod";var E=ye.object({sender_peer_id:b,message:x});import*as s from"zod";var k=s.discriminatedUnion("kind",[s.object({kind:s.literal("Sdp"),type:s.enum(["Answer","Offer"]),sdp:s.string(),media_map:s.array(s.tuple([S,s.string()]))}),s.object({kind:s.literal("Trickle"),candidate:s.string(),spd_mid:s.optional(s.string()),spd_mline_index:s.optional(s.number()),username_fragment:s.optional(s.union([s.string(),s.null()]))}),s.object({kind:s.literal("TrickleFinished")})]);import{z as i}from"zod";function ot(e,t,n){let o=n[e];if(!o)return;let l=o.request.safeParse(t);return l.success?{name:e,request:l.data}:void 0}function it(e,t,n){return n[e].request.parse(t)}function at(e,t,n){let o=n[e].response.safeParse(t);return o.success?o.data:void 0}var st={Hello:{request:i.object({stream:i.literal("main")}),response:i.null()},JoinRoom:{request:i.object({token:i.string(),room_id:z.RoomIdSchema,user_data:x,position:A}),response:i.object({peer_id:b,stream_id:i.optional(i.number()),token:i.optional(i.string())})},WebRtcUpdate:{request:k,response:i.null()},RequestReconnectToken:{request:i.object({peer_id:i.optional(b)}),response:i.string()},Ping:{request:i.object({}),response:i.null()}},pt={Hello:{request:i.object({stream:i.literal("room"),token:i.string(),room_id:i.string(),user_data:x,position:A}),response:i.null()},UpdatePeer:{request:i.object({user_data:x}),response:i.null()},StartMedia:{request:i.object({media_id:S,properties:N}),response:i.null()},StopMedia:{request:i.object({media_id:S}),response:i.null()},PauseMedia:{request:i.object({media_id:S}),response:i.null()},ResumeMedia:{request:i.object({media_id:S}),response:i.null()},SetPeerPosition:{request:i.object({position:A}),response:i.null()},SendMessage:{request:i.object({target_peer_ids:i.optional(i.array(b)),message:x}),response:i.null()}};import{z as v}from"zod";function gt(e,t,n){let o=n[e];if(!o)return;let l=o.safeParse(t);return l.success?{name:e,properties:l.data}:void 0}var yt=v.object({name:v.literal("WebRtcUpdate"),properties:k}),xt={WebRtcUpdate:k},bt=v.union([v.object({name:v.literal("RoomStatusChanged"),properties:z.RoomStatusChangedSchema}),v.object({name:v.literal("RoomUpdated"),properties:z.RoomUpdatesSchema}),v.object({name:v.literal("PeerUpdated"),properties:B}),v.object({name:v.literal("MessageReceived"),properties:E})]),ht={RoomStatusChanged:z.RoomStatusChangedSchema,RoomUpdated:z.RoomUpdatesSchema,PeerUpdated:B,MessageReceived:E};function w(e,t){e||$(t)}function $(e){throw new Error(e)}function y(e){return{type:"Success",value:e}}function h(e){return{type:"Failure",reason:e}}function vt(e){return e.type==="Failure"&&$(e.reason),e.value}function D(e,t){return e.type==="Success"?e.value:t}function kt(e){try{let t=atob(e),n=Uint8Array.from(t,l=>l.codePointAt(0)),o=new TextDecoder("utf8");return y(o.decode(n))}catch(t){return h(String(t))}}function Rt(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,l=>l.codePointAt(0)),o=new TextDecoder("utf8");return y(o.decode(n))}catch(t){return h(String(t))}}function At(e){try{w(e!==void 0,"undefined cannot be converted to byte array"),w(e!==null,"null cannot be converted to byte array");let t=JSON.stringify(e),n=new TextEncoder;return y(n.encode(t))}catch(t){return h(String(t))}}function Lt(e){try{w(e.length>0,"empty byte array cannot be converted to value");let t=new TextDecoder().decode(e),n=JSON.parse(t);return y(n)}catch(t){return h(String(t))}}var xe=["VP8","VP9","AV1","H264"],H=class{constructor(t){this.codec=t}channels=0;clockRate=9e4;isValid(){return xe.includes(this.codec)}isSupported(){if(typeof RTCRtpReceiver>"u"||typeof RTCRtpReceiver.getCapabilities>"u")return null;let t=D(this.getMimeType(),"").toLowerCase(),n=new Set(D(this.getSdpFmtpLine(),"").split(";").map(o=>o.trim().toLowerCase()));return RTCRtpReceiver.getCapabilities("video")?.codecs?.find(o=>{let l=o.mimeType.toLowerCase(),f=new Set((o.sdpFmtpLine??"").split(";").map(p=>p.trim().toLowerCase()));if(t!==l||n.size!==f.size)return!1;for(let p of n)if(!f.has(p))return!1;return!0})??null}getPayloadType(){switch(this.codec){case"VP8":return y(96);case"VP9":return y(98);case"AV1":return y(41);case"H264":return y(102);default:return h("invalid video codec")}}getMimeType(){switch(this.codec){case"VP8":return y("video/VP8");case"VP9":return y("video/VP9");case"AV1":return y("video/AV1");case"H264":return y("video/H264");default:return h("invalid video codec")}}getSdpFmtpLine(){switch(this.codec){case"VP8":return y("");case"VP9":return y("profile-id=2");case"AV1":return y("level-idx=5;profile=0;tier=0");case"H264":return y("level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f");default:return h("invalid video codec")}}};function Ut(e,t){for(let n of e)if(t(n))return n}function _t(){return typeof AudioContext<"u"&&typeof Worker<"u"}function It(){return typeof SharedArrayBuffer<"u"}function be(){return/(apple)?webkit\/537\.36/i.test(globalThis.navigator.userAgent)}function Bt(){return/electron/i.test(globalThis.navigator.userAgent)}function Ot(){return/firefox|iceweasel|fxios/i.test(globalThis.navigator.userAgent)}function Et(){return be()?!1:/safari|applewebkit/i.test(globalThis.navigator.userAgent)}function Ft(e){return JSON.parse(JSON.stringify(e))}var Z=class e{constructor(t){this._Generators=t;this._Futures=t.map(e.addIndex)}_Futures;async next(){let[t,n]=await Promise.race(this._Futures);return this._Futures[n]=e.addIndex(this._Generators[n],n),t}static async addIndex(t,n){return[await t(),n]}};function qt(e,t){return e<=0?Promise.resolve(t):new Promise(n=>setTimeout(()=>n(t),e))}function Kt(e,t){return t.aborted?Promise.resolve("aborted"):new Promise(n=>{let o=()=>n("aborted");t.addEventListener("abort",o,{once:!0}),setTimeout(()=>{t.removeEventListener("abort",o),n(void 0)},e)})}function Wt(){return new Promise(e=>setTimeout(e,0))}var Y=class{_Tasks=[];_Running=!1;_Values;constructor(...t){this._Values=t}enqueue(t){return new Promise((n,o)=>{let l=async()=>{try{let f=await t(...this._Values);n(f)}catch(f){o(f)}};this._Tasks.push(l),this._Running||this.execute()})}async execute(){for(this._Running=!0;;){let t=this._Tasks.shift();if(t===void 0)break;await t()}this._Running=!1}};function Zt(e){let t=e.trim();e.indexOf("://")===-1&&(t=`https://${t}`);try{return y(new URL(t))}catch(n){return h(String(n))}}function Yt(e,t){let n=e.pathname;n.endsWith("/")===!1&&(n+="/");try{return y(new URL(n+t,e))}catch(o){return h(String(o))}}var he=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Qt(){return crypto.randomUUID()}function er(e){return he.test(e)}function rr(e,t){return t in e}function nr(e){return typeof e=="function"}function or(e){return typeof e=="object"&&e===null}function ir(e){return typeof e=="number"}function ar(e){return typeof e=="object"}function sr(e){return typeof e=="string"}function pr(e){return typeof e>"u"}function cr(e){return e.type==="Failure"}function ur(e){return e.type==="Success"}var{Deno:X}=globalThis,Se=typeof X?.noColor=="boolean"?X.noColor:!1,ve=!Se;function F(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}function V(e,t){return ve?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}function M(e){return V(e,F([0],0))}function J(e){return V(e,F([1],22))}function Q(e){return V(e,F([2],22))}var mr=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g");var q=(g=>(g[g.Nothing=0]="Nothing",g[g.CRITICAL=1]="CRITICAL",g[g.ERROR=2]="ERROR",g[g.WARN=3]="WARN",g[g.INFO=4]="INFO",g[g.DEBUG=5]="DEBUG",g[g.Everything=6]="Everything",g))(q||{}),Ce=new Date,ne=(f=>(f[f.CRITICAL=1]="CRITICAL",f[f.ERROR=2]="ERROR",f[f.WARN=3]="WARN",f[f.INFO=4]="INFO",f[f.DEBUG=5]="DEBUG",f))(ne||{}),ke={1:"\u{1F4A5}",2:"\u{1F534}",3:"\u{1F7E1}",4:"\u{1F535}",5:"\u{1F7E3}"},Re={5:Q,4:M,3:M,2:J,1:J};function lr(e){for(let t of Object.keys(q))if(isNaN(Number(t))!==!1&&t.localeCompare(e,void 0,{sensitivity:"accent"})===0)return q[t]}function Pe({message:e}){return String(e)}function ee(e){return JSON.stringify({timestamp:e.date.toISOString(),level:ne[e.level],message:e.message,extra:e.extra})}function te(e){function t(p,g){return[Math.floor(p/g),p%g]}function n(){let p,g=e.date.valueOf()-Ce.valueOf();[g,p]=t(g,1e3);let[j,U]=t(g,60);return`${j.toString().padStart(4,"0")}:${U.toString().padStart(2,"0")}.${p.toString().padStart(4,"0")}`}function o(){return e.extra===void 0?"":"Deno"in globalThis?" "+Deno.inspect(e.extra,{compact:!1,colors:!0,trailingComma:!0}).trimStart():" "+JSON.stringify(e.extra)}let l=ke[e.level],f=e.logger.name!==void 0?`@${e.logger}`:"";return`${M(n())}${f} ${l} ${Re[e.level](String(e.message))}${o()}`}var Te={sparse:Pe,json:ee,pretty:te,default:"Deno"in globalThis&&Deno.stdout.isTerminal()?te:ee},K=class{#e;#t;filter;constructor(t=Te.default,n=6,o=console){this.filter=n,this.#e=t,this.#t=o}handle(t){let n=this.#e(t);switch(t.level){case 2:this.#t.error(n);break;case 3:this.#t.warn(n);break;case 4:this.#t.info(n);break;case 5:this.#t.debug(n);break}}},C=class{#e;sinks;filter;get name(){return this.#e}constructor(t,n=void 0,o=[new K]){this.#e=n,this.sinks=o,this.filter=t}log(t,n,o=void 0){if(this.filter<t)return;let l=re;for(let f of this.sinks)f.filter<t||(l===re&&(l={date:new Date,level:t,logger:this,message:typeof n=="function"?n():n,extra:o}),f.handle(l))}error=this.log.bind(this,2);warn=this.log.bind(this,3);info=this.log.bind(this,4);debug=this.log.bind(this,5)},R=new C(4),fr=C.prototype.log.bind(R,2),gr=C.prototype.log.bind(R,3),yr=C.prototype.log.bind(R,4),xr=C.prototype.log.bind(R,5),br=C.prototype.log.bind(R),re=Symbol();var Sr=-758.596,Ae;(t=>{let e;(p=>(p[p.InvalidPassword=-1]="InvalidPassword",p[p.Unknown=0]="Unknown",p[p.Unencrypted=1]="Unencrypted",p[p.Encrypted=2]="Encrypted"))(e=t.PeerCipherStatus||={})})(Ae||={});var vr={bytesSent:0,bytesReceived:0,packetsSent:0,packetsReceived:0,rtt:0,packetLoss:0},zr={packetsBuffered:0,packetsSeen:0,packetsProcessed:0,packetsTooEarly:0,packetsTooLate:0,packetsDropped:0,packetsInvalid:0,packetsRepeated:0,packetsLost:0},Cr={voiceActivity:{attackThreshold:.9,releaseThreshold:.8},volumeGate:{attackThreshold:-30,releaseThreshold:-40}},kr={echoCanceller:!0,highPassFilter:!1,noiseSuppression:"Moderate",transientSuppressor:!1,gainController:!0};export{kr as APM_DEFAULTS,Ae as Backend,x as ByteArraySchema,vr as CONNECTION_STATS_INITIAL,O as ChannelSet,G as ChannelSetSchema,K as ConsoleSink,Te as Formatter,R as GLOBAL_LOGGER,zr as JITTER_STATS_INITIAL,P as JsonSchema,q as LogFilter,ne as LogLevel,ke as LogSymbols,C as Logger,st as MainCommandsRpc,yt as MainNotificationSchema,xt as MainNotificationsRpc,le as MediaAudioPropertiesSchema,S as MediaIdSchema,N as MediaPropertiesSchema,_ as MediaSchema,fe as MediaVideoPropertiesSchema,Me as MessagePackRpcSchema,E as MessageReceivedSchema,Sr as MinDBFS,b as PeerIdSchema,A as PeerPositionSchema,I as PeerSchema,B as PeerUpdateSchema,pt as RoomCommandsRpc,bt as RoomNotificationSchema,ht as RoomNotificationsRpc,z as RoomV1,ge as RoomV2,Z as Selector,Y as Strand,de as TokenAudienceSchema,Ne as TokenClaimsSchema,me as TokenSubjectSchema,Cr as VAD_DEFAULTS,H as VideoCodec,k as WebRtcUpdateSchema,Kt as abortableSleep,w as assert,xr as debug,fr as error,Yt as extendUrl,$ as fail,h as failure,Ut as find,kt as fromBase64,Rt as fromBase64Url,Lt as fromBytes,Qt as generateUUID,yr as info,_t as isAudioCapable,be as isBlinkBrowser,Bt as isElectronBrowser,cr as isFailure,Ot as isFirefoxBrowser,nr as isFunction,or as isNull,ir as isNumber,ar as isObject,rr as isProperty,Et as isSafariBrowser,It as isSharedArrayBufferCapable,sr as isString,ur as isSuccess,pr as isUndefined,br as log,Wt as nextTick,Zt as normalizeUrl,T as oneOrMany,ot as parseCommand,gt as parseNotification,it as parseRequest,at as parseResponse,qt as sleep,y as success,At as toBytes,Ft as toRaw,lr as tryParseLogFilter,vt as unwrap,D as unwrapOr,er as validateUUID,gr as warn};
|
|
1
|
+
var z=-758.596,E;(t=>{let e;(a=>(a[a.InvalidPassword=-1]="InvalidPassword",a[a.Unknown=0]="Unknown",a[a.Unencrypted=1]="Unencrypted",a[a.Encrypted=2]="Encrypted"))(e=t.PeerCipherStatus||={})})(E||={});var H={bytesSent:0,bytesReceived:0,packetsSent:0,packetsReceived:0,rtt:0,packetLoss:0},Z={packetsBuffered:0,packetsSeen:0,packetsProcessed:0,packetsTooEarly:0,packetsTooLate:0,packetsDropped:0,packetsInvalid:0,packetsRepeated:0,packetsLost:0},q={voiceActivity:{attackThreshold:.9,releaseThreshold:.8},volumeGate:{attackThreshold:-30,releaseThreshold:-40}},Y={echoCanceller:!0,highPassFilter:!1,noiseSuppression:"Moderate",transientSuppressor:!1,gainController:!0};function d(e,t){e||R(t)}function R(e){throw new Error(e)}function i(e){return{type:"Success",value:e}}function c(e){return{type:"Failure",reason:e}}function K(e){return e.type==="Failure"&&R(e.reason),e.value}function m(e,t){return e.type==="Success"?e.value:t}function te(e){try{let t=atob(e),r=Uint8Array.from(t,u=>u.codePointAt(0)),n=new TextDecoder("utf8");return i(n.decode(r))}catch(t){return c(String(t))}}function re(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(t,u=>u.codePointAt(0)),n=new TextDecoder("utf8");return i(n.decode(r))}catch(t){return c(String(t))}}function ie(e){try{d(e!==void 0,"undefined cannot be converted to byte array"),d(e!==null,"null cannot be converted to byte array");let t=JSON.stringify(e),r=new TextEncoder;return i(r.encode(t))}catch(t){return c(String(t))}}function se(e){try{d(e.length>0,"empty byte array cannot be converted to value");let t=new TextDecoder().decode(e),r=JSON.parse(t);return i(r)}catch(t){return c(String(t))}}var B=["VP8","VP9","AV1","H264"],T=class{constructor(t){this.codec=t}channels=0;clockRate=9e4;isValid(){return B.includes(this.codec)}isSupported(){if(typeof RTCRtpReceiver>"u"||typeof RTCRtpReceiver.getCapabilities>"u")return null;let t=m(this.getMimeType(),"").toLowerCase(),r=new Set(m(this.getSdpFmtpLine(),"").split(";").map(n=>n.trim().toLowerCase()));return RTCRtpReceiver.getCapabilities("video")?.codecs?.find(n=>{let u=n.mimeType.toLowerCase(),o=new Set((n.sdpFmtpLine??"").split(";").map(a=>a.trim().toLowerCase()));if(t!==u||r.size!==o.size)return!1;for(let a of r)if(!o.has(a))return!1;return!0})??null}getPayloadType(){switch(this.codec){case"VP8":return i(96);case"VP9":return i(98);case"AV1":return i(41);case"H264":return i(102);default:return c("invalid video codec")}}getMimeType(){switch(this.codec){case"VP8":return i("video/VP8");case"VP9":return i("video/VP9");case"AV1":return i("video/AV1");case"H264":return i("video/H264");default:return c("invalid video codec")}}getSdpFmtpLine(){switch(this.codec){case"VP8":return i("");case"VP9":return i("profile-id=2");case"AV1":return i("level-idx=5;profile=0;tier=0");case"H264":return i("level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f");default:return c("invalid video codec")}}};function pe(e,t){for(let r of e)if(t(r))return r}function de(){return typeof AudioContext<"u"&&typeof Worker<"u"}function ge(){return typeof SharedArrayBuffer<"u"}function U(){return/(apple)?webkit\/537\.36/i.test(globalThis.navigator.userAgent)}function fe(){return/electron/i.test(globalThis.navigator.userAgent)}function me(){return/firefox|iceweasel|fxios/i.test(globalThis.navigator.userAgent)}function ye(){return U()?!1:/safari|applewebkit/i.test(globalThis.navigator.userAgent)}function xe(e){return JSON.parse(JSON.stringify(e))}var k=class e{constructor(t){this._Generators=t;this._Futures=t.map(e.addIndex)}_Futures;async next(){let[t,r]=await Promise.race(this._Futures);return this._Futures[r]=e.addIndex(this._Generators[r],r),t}static async addIndex(t,r){return[await t(),r]}};function Re(e,t){return e<=0?Promise.resolve(t):new Promise(r=>setTimeout(()=>r(t),e))}function Te(e,t){return t.aborted?Promise.resolve("aborted"):new Promise(r=>{let n=()=>r("aborted");t.addEventListener("abort",n,{once:!0}),setTimeout(()=>{t.removeEventListener("abort",n),r(void 0)},e)})}function ke(){return new Promise(e=>setTimeout(e,0))}var C=class{_Tasks=[];_Running=!1;_Values;constructor(...t){this._Values=t}enqueue(t){return new Promise((r,n)=>{let u=async()=>{try{let o=await t(...this._Values);r(o)}catch(o){n(o)}};this._Tasks.push(u),this._Running||this.execute()})}async execute(){for(this._Running=!0;;){let t=this._Tasks.shift();if(t===void 0)break;await t()}this._Running=!1}};function Ae(e){let t=e.trim();e.indexOf("://")===-1&&(t=`https://${t}`);try{return i(new URL(t))}catch(r){return c(String(r))}}function Pe(e,t){let r=e.pathname;r.endsWith("/")===!1&&(r+="/");try{return i(new URL(r+t,e))}catch(n){return c(String(n))}}var F=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Ve(){return crypto.randomUUID()}function Oe(e){return F.test(e)}function De(e,t){return t in e}function Ee(e){return typeof e=="function"}function Be(e){return typeof e=="object"&&e===null}function Ue(e){return typeof e=="number"}function Fe(e){return typeof e=="object"}function Ne(e){return typeof e=="string"}function Me(e){return typeof e>"u"}function je(e){return e.type==="Failure"}function _e(e){return e.type==="Success"}var{Deno:L}=globalThis,N=typeof L?.noColor=="boolean"?L.noColor:!1,M=!N;function y(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}function b(e,t){return M?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}function g(e){return b(e,y([0],0))}function x(e){return b(e,y([1],22))}function S(e){return b(e,y([2],22))}var Ge=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g");var v=(s=>(s[s.Nothing=0]="Nothing",s[s.CRITICAL=1]="CRITICAL",s[s.ERROR=2]="ERROR",s[s.WARN=3]="WARN",s[s.INFO=4]="INFO",s[s.DEBUG=5]="DEBUG",s[s.Everything=6]="Everything",s))(v||{}),_=new Date,h=(o=>(o[o.CRITICAL=1]="CRITICAL",o[o.ERROR=2]="ERROR",o[o.WARN=3]="WARN",o[o.INFO=4]="INFO",o[o.DEBUG=5]="DEBUG",o))(h||{}),O={1:"\u{1F4A5}",2:"\u{1F534}",3:"\u{1F7E1}",4:"\u{1F535}",5:"\u{1F7E3}"},$={5:S,4:g,3:g,2:x,1:x};function Je(e){for(let t of Object.keys(v))if(isNaN(Number(t))!==!1&&t.localeCompare(e,void 0,{sensitivity:"accent"})===0)return v[t]}function G({message:e}){return String(e)}function A(e){return JSON.stringify({timestamp:e.date.toISOString(),level:h[e.level],message:e.message,extra:e.extra})}function P(e){function t(a,s){return[Math.floor(a/s),a%s]}function r(){let a,s=e.date.valueOf()-_.valueOf();[s,a]=t(s,1e3);let[I,D]=t(s,60);return`${I.toString().padStart(4,"0")}:${D.toString().padStart(2,"0")}.${a.toString().padStart(4,"0")}`}function n(){return e.extra===void 0?"":"Deno"in globalThis?" "+Deno.inspect(e.extra,{compact:!1,colors:!0,trailingComma:!0}).trimStart():" "+JSON.stringify(e.extra)}let u=O[e.level],o=e.logger.name!==void 0?`@${e.logger}`:"";return`${g(r())}${o} ${u} ${$[e.level](String(e.message))}${n()}`}function J(e){let t=`[${e.date.toISOString()}]`,r=`[${h[e.level]}]`,n=e.logger.name!==void 0?`[${e.logger.name}] `:"",u=O[e.level];return`${t} ${u} ${r.padEnd(7," ")} ${n}${e.message}`}var W={sparse:G,json:A,pretty:P,structured:J,default:"Deno"in globalThis&&Deno.stdout.isTerminal()?P:A},f=class{formatter;consoleObject;filter;constructor(t=W.default,r=6,n=console){this.filter=r,this.formatter=t,this.consoleObject=n}handle(t){let r=this.formatter(t);switch(t.level){case 2:this.consoleObject.error(r);break;case 3:this.consoleObject.warn(r);break;case 4:this.consoleObject.info(r);break;case 5:this.consoleObject.debug(r);break}}},w=class extends f{handle(t){let r=this.formatter(t),n=t.extra!==void 0?[r,t.extra]:[r];switch(t.level){case 1:case 2:this.consoleObject.error(...n);break;case 3:this.consoleObject.warn(...n);break;case 4:this.consoleObject.info(...n);break;case 5:this.consoleObject.debug(...n);break}}},p=class{#e;sinks;filter;get name(){return this.#e}constructor(t,r=void 0,n=[new f]){this.#e=r,this.sinks=n,this.filter=t}log(t,r,n=void 0){if(this.filter<t)return;let u=V;for(let o of this.sinks)o.filter<t||(u===V&&(u={date:new Date,level:t,logger:this,message:typeof r=="function"?r():r,extra:n}),o.handle(u))}error=this.log.bind(this,2);warn=this.log.bind(this,3);info=this.log.bind(this,4);debug=this.log.bind(this,5)},l=new p(4),We=p.prototype.log.bind(l,2),ze=p.prototype.log.bind(l,3),He=p.prototype.log.bind(l,4),Ze=p.prototype.log.bind(l,5),qe=p.prototype.log.bind(l),V=Symbol();export{Y as APM_DEFAULTS,E as Backend,H as CONNECTION_STATS_INITIAL,f as ConsoleSink,W as Formatter,l as GLOBAL_LOGGER,w as InteractiveConsoleSink,Z as JITTER_STATS_INITIAL,v as LogFilter,h as LogLevel,O as LogSymbols,p as Logger,z as MinDBFS,k as Selector,C as Strand,q as VAD_DEFAULTS,T as VideoCodec,Te as abortableSleep,d as assert,Ze as debug,We as error,Pe as extendUrl,R as fail,c as failure,pe as find,te as fromBase64,re as fromBase64Url,se as fromBytes,Ve as generateUUID,He as info,de as isAudioCapable,U as isBlinkBrowser,fe as isElectronBrowser,je as isFailure,me as isFirefoxBrowser,Ee as isFunction,Be as isNull,Ue as isNumber,Fe as isObject,De as isProperty,ye as isSafariBrowser,ge as isSharedArrayBufferCapable,Ne as isString,_e as isSuccess,Me as isUndefined,qe as log,ke as nextTick,Ae as normalizeUrl,Re as sleep,i as success,ie as toBytes,xe as toRaw,Je as tryParseLogFilter,K as unwrap,m as unwrapOr,Oe as validateUUID,ze as warn};
|
package/mod.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './schema/token.ts';
|
|
3
|
-
export * from './schema/room.ts';
|
|
4
|
-
export * from './schema/peer.ts';
|
|
5
|
-
export * from './schema/media.ts';
|
|
6
|
-
export * from './schema/message.ts';
|
|
7
|
-
export * from './schema/webrtc.ts';
|
|
8
|
-
export * from './schema/channels.ts';
|
|
9
|
-
export * from './rpc/commands.ts';
|
|
10
|
-
export * from './rpc/notifications.ts';
|
|
1
|
+
export * from './plugin/api.ts';
|
|
11
2
|
export * from './utility/base64.ts';
|
|
12
3
|
export * from './utility/bytearray.ts';
|
|
13
4
|
export * from './utility/codec.ts';
|
|
@@ -22,4 +13,3 @@ export * from './utility/url.ts';
|
|
|
22
13
|
export * from './utility/uuid.ts';
|
|
23
14
|
export * from './utility/validation.ts';
|
|
24
15
|
export * from './utility/log.ts';
|
|
25
|
-
export * from './plugin/api.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.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",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"zod": "~4.3.0"
|
|
45
|
+
"@zod/zod": "~4.3.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/utility/bytearray.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ByteArray, JsonValue } from '../
|
|
1
|
+
import type { ByteArray, JsonValue } from '../api/serialization.ts';
|
|
2
2
|
import { type Result } from './result.ts';
|
|
3
3
|
export declare function toBytes(value: JsonValue): Result<ByteArray>;
|
|
4
4
|
export declare function fromBytes(bytes: ByteArray): Result<JsonValue>;
|
package/utility/json.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { JsonValue } from '../
|
|
1
|
+
import type { JsonValue } from '../api/serialization.ts';
|
|
2
2
|
export declare function toRaw<T extends JsonValue>(value: T): JsonValue;
|
package/utility/log.d.ts
CHANGED
|
@@ -27,18 +27,24 @@ export type LogFormatter = (record: LogRecord) => string;
|
|
|
27
27
|
declare function sparseFormat({ message }: LogRecord): string;
|
|
28
28
|
declare function jsonFormat(record: LogRecord): string;
|
|
29
29
|
declare function prettyFormat(record: LogRecord): string;
|
|
30
|
+
declare function structuredFormat(record: LogRecord): string;
|
|
30
31
|
export declare const Formatter: {
|
|
31
32
|
sparse: typeof sparseFormat;
|
|
32
33
|
json: typeof jsonFormat;
|
|
33
34
|
pretty: typeof prettyFormat;
|
|
35
|
+
structured: typeof structuredFormat;
|
|
34
36
|
default: typeof jsonFormat;
|
|
35
37
|
};
|
|
36
38
|
export declare class ConsoleSink implements LogSink {
|
|
37
|
-
|
|
39
|
+
protected formatter: LogFormatter;
|
|
40
|
+
protected consoleObject: ConsoleObject;
|
|
38
41
|
filter: LogFilter;
|
|
39
42
|
constructor(formatter?: LogFormatter, filter?: LogFilter, consoleObject?: ConsoleObject);
|
|
40
43
|
handle(record: LogRecord): void;
|
|
41
44
|
}
|
|
45
|
+
export declare class InteractiveConsoleSink extends ConsoleSink {
|
|
46
|
+
handle(record: LogRecord): void;
|
|
47
|
+
}
|
|
42
48
|
export declare class Logger {
|
|
43
49
|
#private;
|
|
44
50
|
sinks: LogSink[];
|
package/rpc/commands.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type RpcSchema } from '../schema/serialization.ts';
|
|
3
|
-
export type Infer<T extends RpcSchema> = z.output<T>;
|
|
4
|
-
export type CommandSchema = {
|
|
5
|
-
request: RpcSchema;
|
|
6
|
-
response: RpcSchema;
|
|
7
|
-
};
|
|
8
|
-
export type Commands = Record<string, CommandSchema>;
|
|
9
|
-
export type CommandRequest<C extends Commands, K extends keyof C> = z.infer<C[K]['request']>;
|
|
10
|
-
export type CommandResponse<C extends Commands, K extends keyof C> = z.infer<C[K]['response']>;
|
|
11
|
-
export type ParsedCommand<C extends Commands, K extends keyof C = keyof C> = {
|
|
12
|
-
[Name in K]: {
|
|
13
|
-
name: Name;
|
|
14
|
-
request: z.infer<C[Name]['request']>;
|
|
15
|
-
};
|
|
16
|
-
}[K];
|
|
17
|
-
export declare function parseCommand<C extends Commands, K extends keyof C>(name: K, request: unknown, schema: C): ParsedCommand<C, K> | undefined;
|
|
18
|
-
export declare function parseRequest<C extends Commands, K extends keyof C>(name: K, request: unknown, schema: C): CommandRequest<C, K>;
|
|
19
|
-
export declare function parseResponse<C extends Commands, K extends keyof C>(name: K, response: unknown, schema: C): CommandResponse<C, K> | undefined;
|
|
20
|
-
export declare const MainCommandsRpc: {
|
|
21
|
-
Hello: {
|
|
22
|
-
request: z.ZodObject<{
|
|
23
|
-
stream: z.ZodLiteral<"main">;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
response: z.ZodNull;
|
|
26
|
-
};
|
|
27
|
-
JoinRoom: {
|
|
28
|
-
request: z.ZodObject<{
|
|
29
|
-
token: z.ZodString;
|
|
30
|
-
room_id: z.ZodString;
|
|
31
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
32
|
-
position: z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
response: z.ZodObject<{
|
|
35
|
-
peer_id: z.ZodNumber;
|
|
36
|
-
stream_id: z.ZodOptional<z.ZodNumber>;
|
|
37
|
-
token: z.ZodOptional<z.ZodString>;
|
|
38
|
-
}, z.core.$strip>;
|
|
39
|
-
};
|
|
40
|
-
WebRtcUpdate: {
|
|
41
|
-
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
-
kind: z.ZodLiteral<"Sdp">;
|
|
43
|
-
type: z.ZodEnum<{
|
|
44
|
-
Answer: "Answer";
|
|
45
|
-
Offer: "Offer";
|
|
46
|
-
}>;
|
|
47
|
-
sdp: z.ZodString;
|
|
48
|
-
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>>;
|
|
49
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
-
kind: z.ZodLiteral<"Trickle">;
|
|
51
|
-
candidate: z.ZodString;
|
|
52
|
-
spd_mid: z.ZodOptional<z.ZodString>;
|
|
53
|
-
spd_mline_index: z.ZodOptional<z.ZodNumber>;
|
|
54
|
-
username_fragment: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
55
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
-
kind: z.ZodLiteral<"TrickleFinished">;
|
|
57
|
-
}, z.core.$strip>], "kind">;
|
|
58
|
-
response: z.ZodNull;
|
|
59
|
-
};
|
|
60
|
-
RequestReconnectToken: {
|
|
61
|
-
request: z.ZodObject<{
|
|
62
|
-
peer_id: z.ZodOptional<z.ZodNumber>;
|
|
63
|
-
}, z.core.$strip>;
|
|
64
|
-
response: z.ZodString;
|
|
65
|
-
};
|
|
66
|
-
Ping: {
|
|
67
|
-
request: z.ZodObject<{}, z.core.$strip>;
|
|
68
|
-
response: z.ZodNull;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export type MainCommands = typeof MainCommandsRpc;
|
|
72
|
-
export declare const RoomCommandsRpc: {
|
|
73
|
-
Hello: {
|
|
74
|
-
request: z.ZodObject<{
|
|
75
|
-
stream: z.ZodLiteral<"room">;
|
|
76
|
-
token: z.ZodString;
|
|
77
|
-
room_id: z.ZodString;
|
|
78
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
79
|
-
position: z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
response: z.ZodNull;
|
|
82
|
-
};
|
|
83
|
-
UpdatePeer: {
|
|
84
|
-
request: z.ZodObject<{
|
|
85
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
86
|
-
}, z.core.$strip>;
|
|
87
|
-
response: z.ZodNull;
|
|
88
|
-
};
|
|
89
|
-
StartMedia: {
|
|
90
|
-
request: z.ZodObject<{
|
|
91
|
-
media_id: z.ZodNumber;
|
|
92
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
93
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
94
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
95
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
96
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
98
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
99
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
100
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
101
|
-
id: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip>]>;
|
|
103
|
-
}, z.core.$strip>;
|
|
104
|
-
response: z.ZodNull;
|
|
105
|
-
};
|
|
106
|
-
StopMedia: {
|
|
107
|
-
request: z.ZodObject<{
|
|
108
|
-
media_id: z.ZodNumber;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
|
-
response: z.ZodNull;
|
|
111
|
-
};
|
|
112
|
-
PauseMedia: {
|
|
113
|
-
request: z.ZodObject<{
|
|
114
|
-
media_id: z.ZodNumber;
|
|
115
|
-
}, z.core.$strip>;
|
|
116
|
-
response: z.ZodNull;
|
|
117
|
-
};
|
|
118
|
-
ResumeMedia: {
|
|
119
|
-
request: z.ZodObject<{
|
|
120
|
-
media_id: z.ZodNumber;
|
|
121
|
-
}, z.core.$strip>;
|
|
122
|
-
response: z.ZodNull;
|
|
123
|
-
};
|
|
124
|
-
SetPeerPosition: {
|
|
125
|
-
request: z.ZodObject<{
|
|
126
|
-
position: z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
127
|
-
}, z.core.$strip>;
|
|
128
|
-
response: z.ZodNull;
|
|
129
|
-
};
|
|
130
|
-
SendMessage: {
|
|
131
|
-
request: z.ZodObject<{
|
|
132
|
-
target_peer_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
133
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
134
|
-
}, z.core.$strip>;
|
|
135
|
-
response: z.ZodNull;
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
export type RoomCommands = typeof RoomCommandsRpc;
|
package/rpc/notifications.d.ts
DELETED
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { RpcSchema } from '../schema/serialization.ts';
|
|
3
|
-
export type Notifications = Record<string, RpcSchema>;
|
|
4
|
-
export type ParsedNotification<N extends Notifications, K extends keyof N = keyof N> = {
|
|
5
|
-
[Name in K]: {
|
|
6
|
-
name: Name;
|
|
7
|
-
properties: z.infer<N[Name]>;
|
|
8
|
-
};
|
|
9
|
-
}[K];
|
|
10
|
-
export declare function parseNotification<N extends Notifications, K extends keyof N>(name: K, properties: unknown, schema: N): ParsedNotification<N, K> | undefined;
|
|
11
|
-
export declare const MainNotificationSchema: z.ZodObject<{
|
|
12
|
-
name: z.ZodLiteral<"WebRtcUpdate">;
|
|
13
|
-
properties: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
-
kind: z.ZodLiteral<"Sdp">;
|
|
15
|
-
type: z.ZodEnum<{
|
|
16
|
-
Answer: "Answer";
|
|
17
|
-
Offer: "Offer";
|
|
18
|
-
}>;
|
|
19
|
-
sdp: z.ZodString;
|
|
20
|
-
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>>;
|
|
21
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
-
kind: z.ZodLiteral<"Trickle">;
|
|
23
|
-
candidate: z.ZodString;
|
|
24
|
-
spd_mid: z.ZodOptional<z.ZodString>;
|
|
25
|
-
spd_mline_index: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
username_fragment: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
kind: z.ZodLiteral<"TrickleFinished">;
|
|
29
|
-
}, z.core.$strip>], "kind">;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
export type MainNotification = z.infer<typeof MainNotificationSchema>;
|
|
32
|
-
export declare const MainNotificationsRpc: {
|
|
33
|
-
WebRtcUpdate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
|
-
kind: z.ZodLiteral<"Sdp">;
|
|
35
|
-
type: z.ZodEnum<{
|
|
36
|
-
Answer: "Answer";
|
|
37
|
-
Offer: "Offer";
|
|
38
|
-
}>;
|
|
39
|
-
sdp: z.ZodString;
|
|
40
|
-
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>>;
|
|
41
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
-
kind: z.ZodLiteral<"Trickle">;
|
|
43
|
-
candidate: z.ZodString;
|
|
44
|
-
spd_mid: z.ZodOptional<z.ZodString>;
|
|
45
|
-
spd_mline_index: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
username_fragment: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
47
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
-
kind: z.ZodLiteral<"TrickleFinished">;
|
|
49
|
-
}, z.core.$strip>], "kind">;
|
|
50
|
-
};
|
|
51
|
-
export type MainNotifications = typeof MainNotificationsRpc;
|
|
52
|
-
export declare const RoomNotificationSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
53
|
-
name: z.ZodLiteral<"RoomStatusChanged">;
|
|
54
|
-
properties: z.ZodObject<{
|
|
55
|
-
status: z.ZodEnum<{
|
|
56
|
-
Joined: "Joined";
|
|
57
|
-
Joining: "Joining";
|
|
58
|
-
Closed: "Closed";
|
|
59
|
-
}>;
|
|
60
|
-
message: z.ZodOptional<z.ZodString>;
|
|
61
|
-
}, z.core.$strip>;
|
|
62
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
-
name: z.ZodLiteral<"RoomUpdated">;
|
|
64
|
-
properties: z.ZodObject<{
|
|
65
|
-
updates: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
|
-
kind: z.ZodLiteral<"Joined">;
|
|
67
|
-
room: z.ZodObject<{
|
|
68
|
-
id: z.ZodString;
|
|
69
|
-
customer: z.ZodString;
|
|
70
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
71
|
-
peers: z.ZodArray<z.ZodObject<{
|
|
72
|
-
id: z.ZodNumber;
|
|
73
|
-
user_id: z.ZodString;
|
|
74
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
75
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
76
|
-
id: z.ZodNumber;
|
|
77
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
78
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
79
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
80
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
81
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
83
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
84
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
85
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
86
|
-
id: z.ZodOptional<z.ZodString>;
|
|
87
|
-
}, z.core.$strip>]>;
|
|
88
|
-
paused: z.ZodBoolean;
|
|
89
|
-
}, z.core.$strip>>;
|
|
90
|
-
}, z.core.$strip>>;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
media_ids: z.ZodArray<z.ZodNumber>;
|
|
93
|
-
own_peer_id: z.ZodNumber;
|
|
94
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
-
kind: z.ZodLiteral<"Left">;
|
|
96
|
-
reason: z.ZodEnum<{
|
|
97
|
-
RoomClosing: "RoomClosing";
|
|
98
|
-
ServerClosing: "ServerClosing";
|
|
99
|
-
PeerKicked: "PeerKicked";
|
|
100
|
-
}>;
|
|
101
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
103
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
104
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
105
|
-
kind: z.ZodLiteral<"PeerJoined">;
|
|
106
|
-
peer: z.ZodObject<{
|
|
107
|
-
id: z.ZodNumber;
|
|
108
|
-
user_id: z.ZodString;
|
|
109
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
110
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
111
|
-
id: z.ZodNumber;
|
|
112
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
113
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
114
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
115
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
116
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
118
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
119
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
120
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
121
|
-
id: z.ZodOptional<z.ZodString>;
|
|
122
|
-
}, z.core.$strip>]>;
|
|
123
|
-
paused: z.ZodBoolean;
|
|
124
|
-
}, z.core.$strip>>;
|
|
125
|
-
}, z.core.$strip>;
|
|
126
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
-
kind: z.ZodLiteral<"PeerLeft">;
|
|
128
|
-
peer_id: z.ZodNumber;
|
|
129
|
-
}, z.core.$strip>], "kind">>;
|
|
130
|
-
}, z.core.$strip>;
|
|
131
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
132
|
-
name: z.ZodLiteral<"PeerUpdated">;
|
|
133
|
-
properties: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
134
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
135
|
-
peer_id: z.ZodNumber;
|
|
136
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
137
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
138
|
-
kind: z.ZodLiteral<"MediaStarted">;
|
|
139
|
-
peer_id: z.ZodNumber;
|
|
140
|
-
media: z.ZodObject<{
|
|
141
|
-
id: z.ZodNumber;
|
|
142
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
143
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
144
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
145
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
146
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
148
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
149
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
150
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
151
|
-
id: z.ZodOptional<z.ZodString>;
|
|
152
|
-
}, z.core.$strip>]>;
|
|
153
|
-
paused: z.ZodBoolean;
|
|
154
|
-
}, z.core.$strip>;
|
|
155
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
156
|
-
kind: z.ZodLiteral<"MediaStopped">;
|
|
157
|
-
peer_id: z.ZodNumber;
|
|
158
|
-
media_id: z.ZodNumber;
|
|
159
|
-
}, z.core.$strip>], "kind">;
|
|
160
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
161
|
-
name: z.ZodLiteral<"MessageReceived">;
|
|
162
|
-
properties: z.ZodObject<{
|
|
163
|
-
sender_peer_id: z.ZodNumber;
|
|
164
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
165
|
-
}, z.core.$strip>;
|
|
166
|
-
}, z.core.$strip>]>;
|
|
167
|
-
export type RoomNotification = z.infer<typeof RoomNotificationSchema>;
|
|
168
|
-
export declare const RoomNotificationsRpc: {
|
|
169
|
-
RoomStatusChanged: z.ZodObject<{
|
|
170
|
-
status: z.ZodEnum<{
|
|
171
|
-
Joined: "Joined";
|
|
172
|
-
Joining: "Joining";
|
|
173
|
-
Closed: "Closed";
|
|
174
|
-
}>;
|
|
175
|
-
message: z.ZodOptional<z.ZodString>;
|
|
176
|
-
}, z.core.$strip>;
|
|
177
|
-
RoomUpdated: z.ZodObject<{
|
|
178
|
-
updates: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
|
-
kind: z.ZodLiteral<"Joined">;
|
|
180
|
-
room: z.ZodObject<{
|
|
181
|
-
id: z.ZodString;
|
|
182
|
-
customer: z.ZodString;
|
|
183
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
184
|
-
peers: z.ZodArray<z.ZodObject<{
|
|
185
|
-
id: z.ZodNumber;
|
|
186
|
-
user_id: z.ZodString;
|
|
187
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
188
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
189
|
-
id: z.ZodNumber;
|
|
190
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
191
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
192
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
193
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
194
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
196
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
197
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
198
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
199
|
-
id: z.ZodOptional<z.ZodString>;
|
|
200
|
-
}, z.core.$strip>]>;
|
|
201
|
-
paused: z.ZodBoolean;
|
|
202
|
-
}, z.core.$strip>>;
|
|
203
|
-
}, z.core.$strip>>;
|
|
204
|
-
}, z.core.$strip>;
|
|
205
|
-
media_ids: z.ZodArray<z.ZodNumber>;
|
|
206
|
-
own_peer_id: z.ZodNumber;
|
|
207
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
208
|
-
kind: z.ZodLiteral<"Left">;
|
|
209
|
-
reason: z.ZodEnum<{
|
|
210
|
-
RoomClosing: "RoomClosing";
|
|
211
|
-
ServerClosing: "ServerClosing";
|
|
212
|
-
PeerKicked: "PeerKicked";
|
|
213
|
-
}>;
|
|
214
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
215
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
216
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
217
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
-
kind: z.ZodLiteral<"PeerJoined">;
|
|
219
|
-
peer: z.ZodObject<{
|
|
220
|
-
id: z.ZodNumber;
|
|
221
|
-
user_id: z.ZodString;
|
|
222
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
223
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
224
|
-
id: z.ZodNumber;
|
|
225
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
226
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
227
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
228
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
229
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
231
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
232
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
233
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
234
|
-
id: z.ZodOptional<z.ZodString>;
|
|
235
|
-
}, z.core.$strip>]>;
|
|
236
|
-
paused: z.ZodBoolean;
|
|
237
|
-
}, z.core.$strip>>;
|
|
238
|
-
}, z.core.$strip>;
|
|
239
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
-
kind: z.ZodLiteral<"PeerLeft">;
|
|
241
|
-
peer_id: z.ZodNumber;
|
|
242
|
-
}, z.core.$strip>], "kind">>;
|
|
243
|
-
}, z.core.$strip>;
|
|
244
|
-
PeerUpdated: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
245
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
246
|
-
peer_id: z.ZodNumber;
|
|
247
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
248
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
-
kind: z.ZodLiteral<"MediaStarted">;
|
|
250
|
-
peer_id: z.ZodNumber;
|
|
251
|
-
media: z.ZodObject<{
|
|
252
|
-
id: z.ZodNumber;
|
|
253
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
254
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
255
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
256
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
257
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
258
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
259
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
260
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
261
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
262
|
-
id: z.ZodOptional<z.ZodString>;
|
|
263
|
-
}, z.core.$strip>]>;
|
|
264
|
-
paused: z.ZodBoolean;
|
|
265
|
-
}, z.core.$strip>;
|
|
266
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
267
|
-
kind: z.ZodLiteral<"MediaStopped">;
|
|
268
|
-
peer_id: z.ZodNumber;
|
|
269
|
-
media_id: z.ZodNumber;
|
|
270
|
-
}, z.core.$strip>], "kind">;
|
|
271
|
-
MessageReceived: z.ZodObject<{
|
|
272
|
-
sender_peer_id: z.ZodNumber;
|
|
273
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
274
|
-
}, z.core.$strip>;
|
|
275
|
-
};
|
|
276
|
-
export type RoomNotifications = typeof RoomNotificationsRpc;
|
package/schema/channels.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare class ChannelSet {
|
|
3
|
-
private value;
|
|
4
|
-
constructor(value?: bigint);
|
|
5
|
-
from(...channels: number[]): ChannelSet;
|
|
6
|
-
contains(channel: number): boolean;
|
|
7
|
-
insert(channel: number): void;
|
|
8
|
-
remove(channel: number): void;
|
|
9
|
-
[Symbol.iterator](): Iterator<number>;
|
|
10
|
-
}
|
|
11
|
-
export declare const ChannelSetSchema: z.ZodPipe<z.ZodBigInt, z.ZodTransform<ChannelSet, bigint>>;
|
package/schema/media.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare const MediaIdSchema: z.ZodNumber;
|
|
3
|
-
export type MediaId = z.infer<typeof MediaIdSchema>;
|
|
4
|
-
export declare const MediaAudioPropertiesSchema: z.ZodObject<{
|
|
5
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
6
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
7
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
export type MediaAudioProperties = z.infer<typeof MediaAudioPropertiesSchema>;
|
|
10
|
-
export declare const MediaVideoPropertiesSchema: z.ZodObject<{
|
|
11
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
12
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
13
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
14
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
15
|
-
id: z.ZodOptional<z.ZodString>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
export type MediaVideoProperties = z.infer<typeof MediaVideoPropertiesSchema>;
|
|
18
|
-
export declare const MediaPropertiesSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
19
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
20
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
21
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
24
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
25
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
26
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
27
|
-
id: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$strip>]>;
|
|
29
|
-
export type MediaProperties = z.infer<typeof MediaPropertiesSchema>;
|
|
30
|
-
export declare const MediaSchema: z.ZodObject<{
|
|
31
|
-
id: z.ZodNumber;
|
|
32
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
33
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
34
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
35
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
36
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
38
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
39
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
40
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
41
|
-
id: z.ZodOptional<z.ZodString>;
|
|
42
|
-
}, z.core.$strip>]>;
|
|
43
|
-
paused: z.ZodBoolean;
|
|
44
|
-
}, z.core.$strip>;
|
|
45
|
-
export type Media = z.infer<typeof MediaSchema>;
|
package/schema/message.d.ts
DELETED
package/schema/peer.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare const PeerIdSchema: z.ZodNumber;
|
|
3
|
-
export type PeerId = z.infer<typeof PeerIdSchema>;
|
|
4
|
-
export declare const PeerPositionSchema: z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
|
|
5
|
-
export type PeerPosition = z.infer<typeof PeerPositionSchema>;
|
|
6
|
-
export declare const PeerSchema: z.ZodObject<{
|
|
7
|
-
id: z.ZodNumber;
|
|
8
|
-
user_id: z.ZodString;
|
|
9
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
10
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
11
|
-
id: z.ZodNumber;
|
|
12
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
14
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
15
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
16
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
18
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
19
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
20
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
21
|
-
id: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>]>;
|
|
23
|
-
paused: z.ZodBoolean;
|
|
24
|
-
}, z.core.$strip>>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
export type Peer = z.infer<typeof PeerSchema>;
|
|
27
|
-
export declare const PeerUpdateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
29
|
-
peer_id: z.ZodNumber;
|
|
30
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
31
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
-
kind: z.ZodLiteral<"MediaStarted">;
|
|
33
|
-
peer_id: z.ZodNumber;
|
|
34
|
-
media: z.ZodObject<{
|
|
35
|
-
id: z.ZodNumber;
|
|
36
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
37
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
38
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
39
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
40
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
42
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
43
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
44
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
45
|
-
id: z.ZodOptional<z.ZodString>;
|
|
46
|
-
}, z.core.$strip>]>;
|
|
47
|
-
paused: z.ZodBoolean;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
-
kind: z.ZodLiteral<"MediaStopped">;
|
|
51
|
-
peer_id: z.ZodNumber;
|
|
52
|
-
media_id: z.ZodNumber;
|
|
53
|
-
}, z.core.$strip>], "kind">;
|
|
54
|
-
export type PeerUpdate = z.infer<typeof PeerUpdateSchema>;
|
package/schema/room.d.ts
DELETED
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare namespace RoomV1 {
|
|
3
|
-
const RoomIdSchema: z.ZodString;
|
|
4
|
-
type RoomId = z.infer<typeof RoomIdSchema>;
|
|
5
|
-
const RoomSchema: z.ZodObject<{
|
|
6
|
-
id: z.ZodString;
|
|
7
|
-
customer: z.ZodString;
|
|
8
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
9
|
-
peers: z.ZodArray<z.ZodObject<{
|
|
10
|
-
id: z.ZodNumber;
|
|
11
|
-
user_id: z.ZodString;
|
|
12
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
13
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
14
|
-
id: z.ZodNumber;
|
|
15
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
16
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
17
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
18
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
21
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
22
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
23
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
24
|
-
id: z.ZodOptional<z.ZodString>;
|
|
25
|
-
}, z.core.$strip>]>;
|
|
26
|
-
paused: z.ZodBoolean;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
}, z.core.$strip>>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
type Room = z.infer<typeof RoomSchema>;
|
|
31
|
-
const RoomUpdateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
-
kind: z.ZodLiteral<"Joined">;
|
|
33
|
-
room: z.ZodObject<{
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
customer: z.ZodString;
|
|
36
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
37
|
-
peers: z.ZodArray<z.ZodObject<{
|
|
38
|
-
id: z.ZodNumber;
|
|
39
|
-
user_id: z.ZodString;
|
|
40
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
41
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
42
|
-
id: z.ZodNumber;
|
|
43
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
44
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
45
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
46
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
49
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
50
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
51
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
52
|
-
id: z.ZodOptional<z.ZodString>;
|
|
53
|
-
}, z.core.$strip>]>;
|
|
54
|
-
paused: z.ZodBoolean;
|
|
55
|
-
}, z.core.$strip>>;
|
|
56
|
-
}, z.core.$strip>>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
media_ids: z.ZodArray<z.ZodNumber>;
|
|
59
|
-
own_peer_id: z.ZodNumber;
|
|
60
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
-
kind: z.ZodLiteral<"Left">;
|
|
62
|
-
reason: z.ZodEnum<{
|
|
63
|
-
RoomClosing: "RoomClosing";
|
|
64
|
-
ServerClosing: "ServerClosing";
|
|
65
|
-
PeerKicked: "PeerKicked";
|
|
66
|
-
}>;
|
|
67
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
69
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
70
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"PeerJoined">;
|
|
72
|
-
peer: z.ZodObject<{
|
|
73
|
-
id: z.ZodNumber;
|
|
74
|
-
user_id: z.ZodString;
|
|
75
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
76
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
77
|
-
id: z.ZodNumber;
|
|
78
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
79
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
80
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
81
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
82
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
84
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
85
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
86
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
87
|
-
id: z.ZodOptional<z.ZodString>;
|
|
88
|
-
}, z.core.$strip>]>;
|
|
89
|
-
paused: z.ZodBoolean;
|
|
90
|
-
}, z.core.$strip>>;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
-
kind: z.ZodLiteral<"PeerLeft">;
|
|
94
|
-
peer_id: z.ZodNumber;
|
|
95
|
-
}, z.core.$strip>], "kind">;
|
|
96
|
-
type RoomUpdate = z.infer<typeof RoomUpdateSchema>;
|
|
97
|
-
const RoomUpdatesSchema: z.ZodObject<{
|
|
98
|
-
updates: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
99
|
-
kind: z.ZodLiteral<"Joined">;
|
|
100
|
-
room: z.ZodObject<{
|
|
101
|
-
id: z.ZodString;
|
|
102
|
-
customer: z.ZodString;
|
|
103
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
104
|
-
peers: z.ZodArray<z.ZodObject<{
|
|
105
|
-
id: z.ZodNumber;
|
|
106
|
-
user_id: z.ZodString;
|
|
107
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
108
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
109
|
-
id: z.ZodNumber;
|
|
110
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
111
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
112
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
113
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
114
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
116
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
117
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
118
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
119
|
-
id: z.ZodOptional<z.ZodString>;
|
|
120
|
-
}, z.core.$strip>]>;
|
|
121
|
-
paused: z.ZodBoolean;
|
|
122
|
-
}, z.core.$strip>>;
|
|
123
|
-
}, z.core.$strip>>;
|
|
124
|
-
}, z.core.$strip>;
|
|
125
|
-
media_ids: z.ZodArray<z.ZodNumber>;
|
|
126
|
-
own_peer_id: z.ZodNumber;
|
|
127
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
-
kind: z.ZodLiteral<"Left">;
|
|
129
|
-
reason: z.ZodEnum<{
|
|
130
|
-
RoomClosing: "RoomClosing";
|
|
131
|
-
ServerClosing: "ServerClosing";
|
|
132
|
-
PeerKicked: "PeerKicked";
|
|
133
|
-
}>;
|
|
134
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
-
kind: z.ZodLiteral<"UserDataChanged">;
|
|
136
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
137
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
138
|
-
kind: z.ZodLiteral<"PeerJoined">;
|
|
139
|
-
peer: z.ZodObject<{
|
|
140
|
-
id: z.ZodNumber;
|
|
141
|
-
user_id: z.ZodString;
|
|
142
|
-
user_data: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
143
|
-
medias: z.ZodArray<z.ZodObject<{
|
|
144
|
-
id: z.ZodNumber;
|
|
145
|
-
properties: z.ZodUnion<readonly [z.ZodObject<{
|
|
146
|
-
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
|
|
147
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
148
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
149
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
150
|
-
kind: z.ZodOptional<z.ZodLiteral<"video">>;
|
|
151
|
-
codec: z.ZodOptional<z.ZodString>;
|
|
152
|
-
uid: z.ZodOptional<z.ZodString>;
|
|
153
|
-
customType: z.ZodOptional<z.ZodString>;
|
|
154
|
-
id: z.ZodOptional<z.ZodString>;
|
|
155
|
-
}, z.core.$strip>]>;
|
|
156
|
-
paused: z.ZodBoolean;
|
|
157
|
-
}, z.core.$strip>>;
|
|
158
|
-
}, z.core.$strip>;
|
|
159
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
-
kind: z.ZodLiteral<"PeerLeft">;
|
|
161
|
-
peer_id: z.ZodNumber;
|
|
162
|
-
}, z.core.$strip>], "kind">>;
|
|
163
|
-
}, z.core.$strip>;
|
|
164
|
-
type RoomUpdates = z.infer<typeof RoomUpdatesSchema>;
|
|
165
|
-
const RoomStatusSchema: z.ZodEnum<{
|
|
166
|
-
Joined: "Joined";
|
|
167
|
-
Joining: "Joining";
|
|
168
|
-
Closed: "Closed";
|
|
169
|
-
}>;
|
|
170
|
-
type RoomStatus = z.infer<typeof RoomStatusSchema>;
|
|
171
|
-
const RoomStatusChangedSchema: z.ZodObject<{
|
|
172
|
-
status: z.ZodEnum<{
|
|
173
|
-
Joined: "Joined";
|
|
174
|
-
Joining: "Joining";
|
|
175
|
-
Closed: "Closed";
|
|
176
|
-
}>;
|
|
177
|
-
message: z.ZodOptional<z.ZodString>;
|
|
178
|
-
}, z.core.$strip>;
|
|
179
|
-
type RoomStatusChanged = z.infer<typeof RoomStatusChangedSchema>;
|
|
180
|
-
}
|
|
181
|
-
export declare namespace RoomV2 {
|
|
182
|
-
const ParametersSchema: z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>;
|
|
183
|
-
const PeerProperties: z.ZodObject<{
|
|
184
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
185
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
186
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
187
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
188
|
-
}, z.core.$strip>;
|
|
189
|
-
const PingSchema: z.ZodObject<{
|
|
190
|
-
Ping: z.ZodObject<{
|
|
191
|
-
id: z.ZodNumber;
|
|
192
|
-
}, z.core.$strip>;
|
|
193
|
-
}, z.core.$strip>;
|
|
194
|
-
const ChangeSelfSchema: z.ZodObject<{
|
|
195
|
-
ChangeSelf: z.ZodObject<{
|
|
196
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
197
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
198
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
199
|
-
}, z.core.$strip>;
|
|
200
|
-
}, z.core.$strip>;
|
|
201
|
-
const SetAudioMaskSchema: z.ZodObject<{
|
|
202
|
-
SetAudioMask: z.ZodObject<{
|
|
203
|
-
peer_id: z.ZodNumber;
|
|
204
|
-
mask: z.ZodPipe<z.ZodBigInt, z.ZodTransform<import("./channels.ts").ChannelSet, bigint>>;
|
|
205
|
-
}, z.core.$strip>;
|
|
206
|
-
}, z.core.$strip>;
|
|
207
|
-
const SendMessageSchema: z.ZodObject<{
|
|
208
|
-
SendMessage: z.ZodObject<{
|
|
209
|
-
peer_ids: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
210
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
211
|
-
}, z.core.$strip>;
|
|
212
|
-
}, z.core.$strip>;
|
|
213
|
-
const CallSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
214
|
-
Ping: z.ZodObject<{
|
|
215
|
-
id: z.ZodNumber;
|
|
216
|
-
}, z.core.$strip>;
|
|
217
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
-
ChangeSelf: z.ZodObject<{
|
|
219
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
220
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
221
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
222
|
-
}, z.core.$strip>;
|
|
223
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
224
|
-
SetAudioMask: z.ZodObject<{
|
|
225
|
-
peer_id: z.ZodNumber;
|
|
226
|
-
mask: z.ZodPipe<z.ZodBigInt, z.ZodTransform<import("./channels.ts").ChannelSet, bigint>>;
|
|
227
|
-
}, z.core.$strip>;
|
|
228
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
229
|
-
SendMessage: z.ZodObject<{
|
|
230
|
-
peer_ids: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
231
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
232
|
-
}, z.core.$strip>;
|
|
233
|
-
}, z.core.$strip>]>;
|
|
234
|
-
type Call = z.infer<typeof CallSchema>;
|
|
235
|
-
const PongSchema: z.ZodObject<{
|
|
236
|
-
Pong: z.ZodObject<{
|
|
237
|
-
id: z.ZodNumber;
|
|
238
|
-
}, z.core.$strip>;
|
|
239
|
-
}, z.core.$strip>;
|
|
240
|
-
const JoinedSchema: z.ZodObject<{
|
|
241
|
-
Joined: z.ZodObject<{
|
|
242
|
-
own_peer_id: z.ZodNumber;
|
|
243
|
-
room_id: z.ZodString;
|
|
244
|
-
customer: z.ZodString;
|
|
245
|
-
}, z.core.$strip>;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
|
-
const LeftSchema: z.ZodObject<{
|
|
248
|
-
Left: z.ZodObject<{
|
|
249
|
-
reason: z.ZodEnum<{
|
|
250
|
-
room_closing: "room_closing";
|
|
251
|
-
server_closing: "server_closing";
|
|
252
|
-
peer_kicked: "peer_kicked";
|
|
253
|
-
}>;
|
|
254
|
-
}, z.core.$strip>;
|
|
255
|
-
}, z.core.$strip>;
|
|
256
|
-
const PeerJoinedSchema: z.ZodObject<{
|
|
257
|
-
PeerJoined: z.ZodObject<{
|
|
258
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
259
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
261
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
262
|
-
peer_id: z.ZodNumber;
|
|
263
|
-
user_id: z.ZodString;
|
|
264
|
-
}, z.core.$strip>;
|
|
265
|
-
}, z.core.$strip>;
|
|
266
|
-
const PeerLeftSchema: z.ZodObject<{
|
|
267
|
-
PeerLeft: z.ZodObject<{
|
|
268
|
-
peer_id: z.ZodNumber;
|
|
269
|
-
}, z.core.$strip>;
|
|
270
|
-
}, z.core.$strip>;
|
|
271
|
-
const PeerChangedSchema: z.ZodObject<{
|
|
272
|
-
PeerChanged: z.ZodObject<{
|
|
273
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
274
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
275
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
276
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
277
|
-
peer_id: z.ZodNumber;
|
|
278
|
-
}, z.core.$strip>;
|
|
279
|
-
}, z.core.$strip>;
|
|
280
|
-
const NewReconnectTokenSchema: z.ZodObject<{
|
|
281
|
-
NewReconnectToken: z.ZodObject<{
|
|
282
|
-
token: z.ZodString;
|
|
283
|
-
}, z.core.$strip>;
|
|
284
|
-
}, z.core.$strip>;
|
|
285
|
-
const MessageReceivedSchema: z.ZodObject<{
|
|
286
|
-
MessageReceived: z.ZodObject<{
|
|
287
|
-
sender_peer_id: z.ZodNumber;
|
|
288
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
289
|
-
}, z.core.$strip>;
|
|
290
|
-
}, z.core.$strip>;
|
|
291
|
-
const ErrorSchema: z.ZodObject<{
|
|
292
|
-
Error: z.ZodObject<{
|
|
293
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
294
|
-
}, z.core.$strip>;
|
|
295
|
-
}, z.core.$strip>;
|
|
296
|
-
const EventSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
297
|
-
Pong: z.ZodObject<{
|
|
298
|
-
id: z.ZodNumber;
|
|
299
|
-
}, z.core.$strip>;
|
|
300
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
301
|
-
Joined: z.ZodObject<{
|
|
302
|
-
own_peer_id: z.ZodNumber;
|
|
303
|
-
room_id: z.ZodString;
|
|
304
|
-
customer: z.ZodString;
|
|
305
|
-
}, z.core.$strip>;
|
|
306
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
307
|
-
Left: z.ZodObject<{
|
|
308
|
-
reason: z.ZodEnum<{
|
|
309
|
-
room_closing: "room_closing";
|
|
310
|
-
server_closing: "server_closing";
|
|
311
|
-
peer_kicked: "peer_kicked";
|
|
312
|
-
}>;
|
|
313
|
-
}, z.core.$strip>;
|
|
314
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
315
|
-
PeerJoined: z.ZodObject<{
|
|
316
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
317
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
318
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
319
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
320
|
-
peer_id: z.ZodNumber;
|
|
321
|
-
user_id: z.ZodString;
|
|
322
|
-
}, z.core.$strip>;
|
|
323
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
324
|
-
PeerLeft: z.ZodObject<{
|
|
325
|
-
peer_id: z.ZodNumber;
|
|
326
|
-
}, z.core.$strip>;
|
|
327
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
328
|
-
PeerChanged: z.ZodObject<{
|
|
329
|
-
user_data: z.ZodOptional<z.ZodCustom<Uint8Array, Uint8Array>>;
|
|
330
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
331
|
-
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
332
|
-
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./serialization.ts").JsonValue, unknown>>>>;
|
|
333
|
-
peer_id: z.ZodNumber;
|
|
334
|
-
}, z.core.$strip>;
|
|
335
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
336
|
-
NewReconnectToken: z.ZodObject<{
|
|
337
|
-
token: z.ZodString;
|
|
338
|
-
}, z.core.$strip>;
|
|
339
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
340
|
-
MessageReceived: z.ZodObject<{
|
|
341
|
-
sender_peer_id: z.ZodNumber;
|
|
342
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
343
|
-
}, z.core.$strip>;
|
|
344
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
345
|
-
Error: z.ZodObject<{
|
|
346
|
-
message: z.ZodCustom<Uint8Array, Uint8Array>;
|
|
347
|
-
}, z.core.$strip>;
|
|
348
|
-
}, z.core.$strip>]>;
|
|
349
|
-
type Event = z.infer<typeof EventSchema>;
|
|
350
|
-
}
|
package/schema/token.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const TokenAudienceSchema: z.ZodEnum<{
|
|
3
|
-
sfu: "sfu";
|
|
4
|
-
gateway: "gateway";
|
|
5
|
-
}>;
|
|
6
|
-
export declare const TokenSubjectSchema: z.ZodEnum<{
|
|
7
|
-
connect: "connect";
|
|
8
|
-
roomclose: "roomclose";
|
|
9
|
-
roomupdate: "roomupdate";
|
|
10
|
-
roombanclient: "roombanclient";
|
|
11
|
-
roomsendmessage: "roomsendmessage";
|
|
12
|
-
}>;
|
|
13
|
-
export declare const TokenClaimsSchema: z.ZodObject<{
|
|
14
|
-
uid: z.ZodString;
|
|
15
|
-
cid: z.ZodOptional<z.ZodString>;
|
|
16
|
-
rid: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
|
|
17
|
-
nsp: z.ZodOptional<z.ZodString>;
|
|
18
|
-
adr: z.ZodOptional<z.ZodString>;
|
|
19
|
-
aud: z.ZodOptional<z.ZodType<("sfu" | "gateway")[], unknown, z.core.$ZodTypeInternals<("sfu" | "gateway")[], unknown>>>;
|
|
20
|
-
sub: z.ZodOptional<z.ZodType<("connect" | "roomclose" | "roomupdate" | "roombanclient" | "roomsendmessage")[], unknown, z.core.$ZodTypeInternals<("connect" | "roomclose" | "roomupdate" | "roombanclient" | "roomsendmessage")[], unknown>>>;
|
|
21
|
-
exp: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
nbf: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
ups: z.ZodOptional<z.ZodString>;
|
|
24
|
-
tgs: z.ZodOptional<z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>>;
|
|
25
|
-
tsp: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
internal: z.ZodOptional<z.ZodObject<{
|
|
27
|
-
server: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$strip>>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
export type TokenClaims = z.infer<typeof TokenClaimsSchema>;
|
|
31
|
-
export declare function oneOrMany<T extends z.ZodType>(type: T): z.ZodType<z.infer<T>[]>;
|
package/schema/webrtc.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare const WebRtcUpdateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
-
kind: z.ZodLiteral<"Sdp">;
|
|
4
|
-
type: z.ZodEnum<{
|
|
5
|
-
Answer: "Answer";
|
|
6
|
-
Offer: "Offer";
|
|
7
|
-
}>;
|
|
8
|
-
sdp: z.ZodString;
|
|
9
|
-
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>>;
|
|
10
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
-
kind: z.ZodLiteral<"Trickle">;
|
|
12
|
-
candidate: z.ZodString;
|
|
13
|
-
spd_mid: z.ZodOptional<z.ZodString>;
|
|
14
|
-
spd_mline_index: z.ZodOptional<z.ZodNumber>;
|
|
15
|
-
username_fragment: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
16
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
-
kind: z.ZodLiteral<"TrickleFinished">;
|
|
18
|
-
}, z.core.$strip>], "kind">;
|
|
19
|
-
export type WebRtcUpdate = z.infer<typeof WebRtcUpdateSchema>;
|