@stream-io/video-client 0.6.9 → 0.7.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/CHANGELOG.md +18 -0
- package/dist/index.browser.es.js +13 -170
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +12 -177
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +13 -175
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +1 -7
- package/dist/src/coordinator/connection/client.d.ts +0 -11
- package/dist/src/coordinator/connection/signing.d.ts +1 -24
- package/dist/src/coordinator/connection/token_manager.d.ts +2 -3
- package/dist/src/coordinator/connection/types.d.ts +4 -4
- package/dist/src/gen/coordinator/index.d.ts +323 -1184
- package/dist/src/store/CallState.d.ts +2 -2
- package/index.ts +0 -1
- package/package.json +2 -3
- package/src/Call.ts +0 -19
- package/src/__tests__/StreamVideoClient.test.ts +8 -3
- package/src/coordinator/connection/client.ts +1 -40
- package/src/coordinator/connection/signing.ts +10 -89
- package/src/coordinator/connection/token_manager.ts +3 -17
- package/src/coordinator/connection/types.ts +4 -4
- package/src/gen/coordinator/index.ts +299 -1155
- package/src/store/CallState.ts +5 -4
- package/dist/src/StreamVideoServerClient.d.ts +0 -33
- package/src/StreamVideoServerClient.ts +0 -106
- package/src/__tests__/server-side/call-members.test.ts +0 -93
- package/src/__tests__/server-side/call-types.test.ts +0 -127
- package/src/__tests__/server-side/call.test.ts +0 -158
- package/src/__tests__/server-side/create-token.test.ts +0 -44
- package/src/__tests__/server-side/server-side-user.test.ts +0 -28
package/dist/src/Call.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Publisher, Subscriber } from './rtc';
|
|
2
2
|
import { TrackType } from './gen/video/sfu/models/models';
|
|
3
3
|
import { CallState } from './store';
|
|
4
|
-
import { AcceptCallResponse, BlockUserResponse,
|
|
4
|
+
import { AcceptCallResponse, BlockUserResponse, EndCallResponse, GetCallResponse, GetCallStatsResponse, GetOrCreateCallRequest, GetOrCreateCallResponse, GoLiveRequest, GoLiveResponse, ListRecordingsResponse, ListTranscriptionsResponse, MuteUsersResponse, PinRequest, PinResponse, QueryMembersRequest, QueryMembersResponse, RejectCallResponse, RequestPermissionRequest, RequestPermissionResponse, SendEventResponse, SendReactionRequest, SendReactionResponse, StartHLSBroadcastingResponse, StartRecordingRequest, StartRecordingResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopHLSBroadcastingResponse, StopLiveResponse, StopRecordingResponse, StopTranscriptionResponse, UnblockUserResponse, UnpinRequest, UnpinResponse, UpdateCallMembersRequest, UpdateCallMembersResponse, UpdateCallRequest, UpdateCallResponse, UpdateUserPermissionsRequest, UpdateUserPermissionsResponse } from './gen/coordinator';
|
|
5
5
|
import { AudioTrackType, CallConstructor, CallLeaveOptions, DebounceType, JoinCallData, PublishOptions, SubscriptionChanges, TrackMuteType, VideoTrackType } from './types';
|
|
6
6
|
import { VideoLayerSetting } from './gen/video/sfu/event/events';
|
|
7
7
|
import { DynascaleManager } from './helpers/DynascaleManager';
|
|
@@ -470,12 +470,6 @@ export declare class Call {
|
|
|
470
470
|
* @returns The call stats.
|
|
471
471
|
*/
|
|
472
472
|
getCallStats: (callSessionID: string) => Promise<GetCallStatsResponse>;
|
|
473
|
-
/**
|
|
474
|
-
* Submit feedback on call experience
|
|
475
|
-
*
|
|
476
|
-
* @returns
|
|
477
|
-
*/
|
|
478
|
-
submitFeedback: (feedback: CollectUserFeedbackRequest) => Promise<CollectUserFeedbackResponse | undefined>;
|
|
479
473
|
/**
|
|
480
474
|
* Sends a custom event to all call participants.
|
|
481
475
|
*
|
|
@@ -172,15 +172,4 @@ export declare class StreamClient {
|
|
|
172
172
|
* creates an abort controller that will be used by the next HTTP Request.
|
|
173
173
|
*/
|
|
174
174
|
createAbortControllerForNextRequest: () => AbortController;
|
|
175
|
-
/**
|
|
176
|
-
* createToken - Creates a token to authenticate this user. This function is used server side.
|
|
177
|
-
* The resulting token should be passed to the client side when the users registers or logs in.
|
|
178
|
-
*
|
|
179
|
-
* @param {string} userID The UserWithId ID
|
|
180
|
-
* @param {number} [exp] The expiration time for the token expressed in the number of seconds since the epoch
|
|
181
|
-
* @param call_cids for anonymous tokens you have to provide the call cids the use can join
|
|
182
|
-
*
|
|
183
|
-
* @return {string} Returns a token
|
|
184
|
-
*/
|
|
185
|
-
createToken: (userID: string, exp?: number, iat?: number, call_cids?: string[]) => string;
|
|
186
175
|
}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import { Secret, SignOptions } from 'jsonwebtoken';
|
|
2
|
-
import { UR } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Creates the JWT token that can be used for a UserSession
|
|
5
|
-
* @method JWTUserToken
|
|
6
|
-
* @memberof signing
|
|
7
|
-
* @private
|
|
8
|
-
* @param {Secret} apiSecret - API Secret key
|
|
9
|
-
* @param {string} userId - The user_id key in the JWT payload
|
|
10
|
-
* @param {UR} [extraData] - Extra that should be part of the JWT token
|
|
11
|
-
* @param {SignOptions} [jwtOptions] - Options that can be past to jwt.sign
|
|
12
|
-
* @return {string} JWT Token
|
|
13
|
-
*/
|
|
14
|
-
export declare function JWTUserToken(apiSecret: Secret, userId: string, extraData?: UR, jwtOptions?: SignOptions): string;
|
|
15
|
-
export declare function JWTServerToken(apiSecret: Secret, jwtOptions?: SignOptions): string;
|
|
16
|
-
export declare function UserFromToken(token: string): string;
|
|
17
1
|
/**
|
|
18
2
|
*
|
|
19
3
|
* @param {string} userId the id of the user
|
|
20
4
|
* @return {string}
|
|
21
5
|
*/
|
|
22
6
|
export declare function DevToken(userId: string): string;
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
* @param {string} body the signed message
|
|
26
|
-
* @param {string} secret the shared secret used to generate the signature (Stream API secret)
|
|
27
|
-
* @param {string} signature the signature to validate
|
|
28
|
-
* @return {boolean}
|
|
29
|
-
*/
|
|
30
|
-
export declare function CheckSignature(body: string, secret: string, signature: string): boolean;
|
|
7
|
+
export declare function UserFromToken(token: string): string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Secret } from 'jsonwebtoken';
|
|
2
1
|
import type { TokenOrProvider, UserWithId } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* TokenManager
|
|
@@ -8,7 +7,7 @@ import type { TokenOrProvider, UserWithId } from './types';
|
|
|
8
7
|
export declare class TokenManager {
|
|
9
8
|
loadTokenPromise: Promise<string> | null;
|
|
10
9
|
type: 'static' | 'provider';
|
|
11
|
-
secret?:
|
|
10
|
+
secret?: string;
|
|
12
11
|
token?: string;
|
|
13
12
|
tokenProvider?: TokenOrProvider;
|
|
14
13
|
user?: UserWithId;
|
|
@@ -17,7 +16,7 @@ export declare class TokenManager {
|
|
|
17
16
|
*
|
|
18
17
|
* @param {Secret} secret
|
|
19
18
|
*/
|
|
20
|
-
constructor(secret?:
|
|
19
|
+
constructor(secret?: string);
|
|
21
20
|
/**
|
|
22
21
|
* Set the static string token or token provider.
|
|
23
22
|
* Token provider should return a token string or a promise which resolves to string token.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import { StableWSConnection } from './connection';
|
|
3
|
-
import { ConnectedEvent, UserRequest,
|
|
3
|
+
import { ConnectedEvent, UserRequest, WSEvent } from '../../gen/coordinator';
|
|
4
4
|
import { AllSfuEvents } from '../../rtc';
|
|
5
5
|
export type UR = Record<string, unknown>;
|
|
6
6
|
export type User = (Omit<UserRequest, 'role'> & {
|
|
@@ -50,13 +50,13 @@ export type TransportChangedEvent = {
|
|
|
50
50
|
export type ConnectionRecoveredEvent = {
|
|
51
51
|
type: 'connection.recovered';
|
|
52
52
|
};
|
|
53
|
-
export type StreamVideoEvent = (
|
|
53
|
+
export type StreamVideoEvent = (WSEvent | ConnectionChangedEvent | TransportChangedEvent | ConnectionRecoveredEvent) & {
|
|
54
54
|
received_at?: string | Date;
|
|
55
55
|
};
|
|
56
56
|
export type StreamCallEvent = Extract<StreamVideoEvent, {
|
|
57
57
|
call_cid: string;
|
|
58
58
|
}>;
|
|
59
|
-
export type EventTypes = 'all' |
|
|
59
|
+
export type EventTypes = 'all' | WSEvent['type'];
|
|
60
60
|
export type AllClientEventTypes = 'all' | StreamVideoEvent['type'];
|
|
61
61
|
export type AllClientEvents = {
|
|
62
62
|
[K in AllClientEventTypes]: Extract<StreamVideoEvent, {
|
|
@@ -65,7 +65,7 @@ export type AllClientEvents = {
|
|
|
65
65
|
};
|
|
66
66
|
export type ClientEventListener<E extends keyof AllClientEvents> = (event: AllClientEvents[E]) => void;
|
|
67
67
|
export type AllClientCallEvents = {
|
|
68
|
-
[K in EventTypes]: Extract<
|
|
68
|
+
[K in EventTypes]: Extract<WSEvent, {
|
|
69
69
|
type: K;
|
|
70
70
|
}>;
|
|
71
71
|
};
|