@protobase/schema 0.58.5 → 0.58.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calls/call-protocol.d.ts +166 -0
- package/dist/internal.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
//#region src/calls/call-protocol.d.ts
|
|
2
|
+
/** What a published track carries. */
|
|
3
|
+
export type CallTrackSource = 'camera' | 'microphone' | 'screen' | 'screen-audio';
|
|
4
|
+
/** One simulcast layer of a published video track, as the browser encodes it. */
|
|
5
|
+
export type CallVideoLayer = {
|
|
6
|
+
quality: 'low' | 'medium' | 'high';
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
bitrate: number;
|
|
10
|
+
};
|
|
11
|
+
/** A track the browser is about to send: `cid` is its `MediaStreamTrack.id`, which its offer names in `msid`. */
|
|
12
|
+
export type CallTrackRequest = {
|
|
13
|
+
cid: string;
|
|
14
|
+
kind: 'audio' | 'video';
|
|
15
|
+
source: CallTrackSource;
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
layers?: CallVideoLayer[];
|
|
19
|
+
};
|
|
20
|
+
/** An ICE candidate as `RTCIceCandidate.toJSON()` writes it. */
|
|
21
|
+
export type CallCandidate = {
|
|
22
|
+
candidate: string;
|
|
23
|
+
sdpMid?: string | null;
|
|
24
|
+
sdpMLineIndex?: number | null;
|
|
25
|
+
usernameFragment?: string | null;
|
|
26
|
+
};
|
|
27
|
+
/** What the browser hands a new server session so it resumes the member's media session where the last one left it. */
|
|
28
|
+
export type CallResume = {
|
|
29
|
+
/** The member's participant in the media server, from `joined`. */
|
|
30
|
+
participant: string;
|
|
31
|
+
/** The browser's current local (offer) and remote (answer) descriptions, with a media server. */
|
|
32
|
+
offer?: string;
|
|
33
|
+
answer?: string;
|
|
34
|
+
/** The member's published tracks. */
|
|
35
|
+
tracks: {
|
|
36
|
+
cid: string;
|
|
37
|
+
sid: string;
|
|
38
|
+
kind: 'audio' | 'video';
|
|
39
|
+
source: CallTrackSource;
|
|
40
|
+
}[];
|
|
41
|
+
};
|
|
42
|
+
/** A session description as `RTCSessionDescription.toJSON()` writes it. */
|
|
43
|
+
export type CallDescription = {
|
|
44
|
+
type: 'offer' | 'answer';
|
|
45
|
+
sdp: string;
|
|
46
|
+
};
|
|
47
|
+
/** How the call's media flows: through a media server, or directly between the members' browsers. */
|
|
48
|
+
export type CallMode = 'sfu' | 'peer';
|
|
49
|
+
/** A message from the browser. */
|
|
50
|
+
export type CallClientMessage = {
|
|
51
|
+
type: 'join';
|
|
52
|
+
} | ({
|
|
53
|
+
type: 'resume';
|
|
54
|
+
} & CallResume) | {
|
|
55
|
+
type: 'publish';
|
|
56
|
+
tracks: CallTrackRequest[];
|
|
57
|
+
} | {
|
|
58
|
+
type: 'offer';
|
|
59
|
+
sdp: string;
|
|
60
|
+
id: number;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'candidate';
|
|
63
|
+
candidate: CallCandidate;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'unpublish';
|
|
66
|
+
sid: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'mute';
|
|
69
|
+
sid: string;
|
|
70
|
+
muted: boolean;
|
|
71
|
+
} |
|
|
72
|
+
/** With `peer`: a description or candidate for another member's browser. */
|
|
73
|
+
{
|
|
74
|
+
type: 'signal';
|
|
75
|
+
to: string;
|
|
76
|
+
description?: CallDescription;
|
|
77
|
+
candidate?: CallCandidate;
|
|
78
|
+
} |
|
|
79
|
+
/** How large the browser shows remote video tracks, so the media server forwards the layer that fits; or not at all. */
|
|
80
|
+
{
|
|
81
|
+
type: 'view';
|
|
82
|
+
sids: string[];
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
hidden?: boolean;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'leave';
|
|
88
|
+
};
|
|
89
|
+
/** A track of another member the member hears. */
|
|
90
|
+
export type CallRemoteTrack = {
|
|
91
|
+
sid: string;
|
|
92
|
+
member: string;
|
|
93
|
+
kind: 'audio' | 'video';
|
|
94
|
+
source: CallTrackSource;
|
|
95
|
+
muted: boolean;
|
|
96
|
+
};
|
|
97
|
+
/** Why the member is no longer in the call: `ended` and `removed` are final, `rejoin` asks the browser to join anew. */
|
|
98
|
+
export type CallLeftReason = 'ended' | 'removed' | 'refused' | 'rejoin';
|
|
99
|
+
/** A message from the server. */
|
|
100
|
+
export type CallServerMessage = {
|
|
101
|
+
type: 'joined';
|
|
102
|
+
mode: CallMode;
|
|
103
|
+
participant: string;
|
|
104
|
+
iceServers: {
|
|
105
|
+
urls: string[];
|
|
106
|
+
username?: string;
|
|
107
|
+
credential?: string;
|
|
108
|
+
}[];
|
|
109
|
+
} | {
|
|
110
|
+
type: 'resumed';
|
|
111
|
+
} | {
|
|
112
|
+
type: 'published';
|
|
113
|
+
tracks: {
|
|
114
|
+
cid: string;
|
|
115
|
+
sid: string;
|
|
116
|
+
}[];
|
|
117
|
+
} | {
|
|
118
|
+
type: 'publish-refused';
|
|
119
|
+
reason: string;
|
|
120
|
+
} | {
|
|
121
|
+
type: 'answer';
|
|
122
|
+
sdp: string;
|
|
123
|
+
id: number;
|
|
124
|
+
mids: Record<string, string>;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'candidate';
|
|
127
|
+
candidate: CallCandidate;
|
|
128
|
+
} |
|
|
129
|
+
/** The member hears more tracks than the browser's description has receiving sections for: add them and offer. */
|
|
130
|
+
{
|
|
131
|
+
type: 'sections';
|
|
132
|
+
audio: number;
|
|
133
|
+
video: number;
|
|
134
|
+
} |
|
|
135
|
+
/** Every remote track the member hears, whenever that changes. */
|
|
136
|
+
{
|
|
137
|
+
type: 'tracks';
|
|
138
|
+
tracks: CallRemoteTrack[];
|
|
139
|
+
} |
|
|
140
|
+
/** The media server stopped one of the member's own tracks, such as after a demotion: stop sending it. */
|
|
141
|
+
{
|
|
142
|
+
type: 'unpublished';
|
|
143
|
+
sid: string;
|
|
144
|
+
} |
|
|
145
|
+
/** With `peer`: every other member in the call, whenever that changes. */
|
|
146
|
+
{
|
|
147
|
+
type: 'peers';
|
|
148
|
+
members: string[];
|
|
149
|
+
} |
|
|
150
|
+
/** With `peer`: a description or candidate from another member's browser. */
|
|
151
|
+
{
|
|
152
|
+
type: 'signal';
|
|
153
|
+
from: string;
|
|
154
|
+
description?: CallDescription;
|
|
155
|
+
candidate?: CallCandidate;
|
|
156
|
+
} | {
|
|
157
|
+
type: 'speakers';
|
|
158
|
+
speakers: {
|
|
159
|
+
member: string;
|
|
160
|
+
level: number;
|
|
161
|
+
}[];
|
|
162
|
+
} | {
|
|
163
|
+
type: 'left';
|
|
164
|
+
reason: CallLeftReason;
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
package/dist/internal.d.ts
CHANGED
|
@@ -36,4 +36,5 @@ import { deviceIdParam, devicesPath } from "./devices-path.js";
|
|
|
36
36
|
import { historyIdParam, historyIdPattern, historyPath } from "./history-path.js";
|
|
37
37
|
import { listColumnNames } from "./list-columns.js";
|
|
38
38
|
import { builtInFieldTypes } from "./built-in-field-types.js";
|
|
39
|
-
|
|
39
|
+
import { CallCandidate, CallClientMessage, CallDescription, CallLeftReason, CallMode, CallRemoteTrack, CallResume, CallServerMessage, CallTrackRequest, CallTrackSource, CallVideoLayer } from "./calls/call-protocol.js";
|
|
40
|
+
export { type AddressCheck, type CallCandidate, type CallClientMessage, type CallDescription, type CallLeftReason, type CallMode, type CallRemoteTrack, type CallResume, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type Locale, type MobileReleaseAnswer, type PluginHost, type PluginRequirement, type PropShapes, type RefShape, type ReleaseBinding, type SearchTerm, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, boardErrors, bottomBarFor, builtInFieldTypes, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
|