@fraku/video 0.1.79 → 0.1.81
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/i18n/locales/ca.json.d.ts +2 -0
- package/dist/i18n/locales/de.json.d.ts +2 -0
- package/dist/i18n/locales/en.json.d.ts +2 -0
- package/dist/i18n/locales/es.json.d.ts +2 -0
- package/dist/i18n/locales/fr.json.d.ts +2 -0
- package/dist/index.cjs +202 -202
- package/dist/index.css +1 -1
- package/dist/index.js +20584 -19773
- package/dist/providers/SharedProvider/chatControlFallback.d.ts +27 -0
- package/dist/providers/SharedProvider/commandChannelActionHandlers.d.ts +8 -2
- package/dist/providers/SharedProvider/context.d.ts +4 -0
- package/dist/providers/SharedProvider/hooks.d.ts +5 -1
- package/dist/providers/SharedProvider/tests/chatControlFallback.test.d.ts +1 -0
- package/dist/providers/SharedProvider/tests/useCommandChannelController.test.d.ts +1 -0
- package/dist/providers/SharedProvider/useCommandChannelController.d.ts +21 -0
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/reducer.d.ts +2 -2
- package/dist/shared/reducer.test.d.ts +1 -0
- package/dist/shared/types.d.ts +20 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CommandChannelAction } from '../../shared';
|
|
2
|
+
|
|
3
|
+
type SupportedChatFallbackActionType = 'TOGGLE-HAND' | 'LOWER-USER-HAND' | 'TOGGLE-TURN-QUEUE' | 'TOGGLE-CHAT' | 'CHANGE-SESSION-STATUS' | 'REQUEST-HOST-ROLE' | 'GRANT-PARTICIPATION' | 'REVOKE-PARTICIPATION' | 'REVOKE-VIDEO-PARTICIPATION' | 'INVITE-TO-PARTICIPATE';
|
|
4
|
+
export type SupportedChatFallbackAction = Extract<CommandChannelAction, {
|
|
5
|
+
type: SupportedChatFallbackActionType;
|
|
6
|
+
}>;
|
|
7
|
+
type CommandEnvelope = {
|
|
8
|
+
i: string;
|
|
9
|
+
a: CommandChannelAction;
|
|
10
|
+
};
|
|
11
|
+
type DecodedChatFallback = {
|
|
12
|
+
messageId: string;
|
|
13
|
+
action: SupportedChatFallbackAction;
|
|
14
|
+
};
|
|
15
|
+
type ParsedCommandEnvelope = {
|
|
16
|
+
messageId: string | null;
|
|
17
|
+
action: CommandChannelAction;
|
|
18
|
+
};
|
|
19
|
+
export declare const CHAT_CONTROL_PREFIX = "!cc1|";
|
|
20
|
+
export declare const createTransportMessageId: () => string;
|
|
21
|
+
export declare const supportsChatControlFallback: (action: CommandChannelAction) => action is SupportedChatFallbackAction;
|
|
22
|
+
export declare const createCommandEnvelope: (action: CommandChannelAction, messageId: string) => CommandEnvelope;
|
|
23
|
+
export declare const parseCommandEnvelope: (payloadText: string) => ParsedCommandEnvelope | null;
|
|
24
|
+
export declare const encodeChatControlFallback: (action: SupportedChatFallbackAction, messageId: string) => string;
|
|
25
|
+
export declare const isChatControlFallbackMessage: (text: string | undefined | null) => boolean;
|
|
26
|
+
export declare const decodeChatControlFallback: (text: string) => DecodedChatFallback | null;
|
|
27
|
+
export {};
|
|
@@ -2,14 +2,20 @@ import { VideoClient } from '@zoom/videosdk';
|
|
|
2
2
|
import { CommandChannelAction, SharedState } from '../../shared';
|
|
3
3
|
import { ParticipationPermission } from '../../shared/participation';
|
|
4
4
|
import { AlertDialogProps } from '../DialogsProvider/context';
|
|
5
|
-
import { SendActionOptions } from './hooks';
|
|
5
|
+
import { SendActionOptions, SendActionResult } from './hooks';
|
|
6
6
|
|
|
7
7
|
export type CommandChannelContext = {
|
|
8
8
|
zmClient: typeof VideoClient;
|
|
9
|
-
sendAction: (action: CommandChannelAction, options?: SendActionOptions) => Promise<
|
|
9
|
+
sendAction: (action: CommandChannelAction, options?: SendActionOptions) => Promise<SendActionResult>;
|
|
10
10
|
sharedState: SharedState;
|
|
11
|
+
canServeSharedState: boolean;
|
|
12
|
+
canRespondToRecoveryRequest: boolean;
|
|
11
13
|
alert: (props: AlertDialogProps) => void;
|
|
12
14
|
dispatch: (action: CommandChannelAction) => void;
|
|
15
|
+
onStateRecoverySnapshot: (action: Extract<CommandChannelAction, {
|
|
16
|
+
type: 'SEND-STATE-RECOVERY';
|
|
17
|
+
}>) => void;
|
|
18
|
+
enqueuePendingSharedStateRequester: (userId: number) => void;
|
|
13
19
|
setRequestedHostRoleDialogVisible: (visible: boolean) => void;
|
|
14
20
|
setParticipationGranted: (value: ParticipationPermission | null) => void;
|
|
15
21
|
setParticipationRevoked: (value: boolean) => void;
|
|
@@ -2,6 +2,7 @@ import { Participant } from '@zoom/videosdk';
|
|
|
2
2
|
import { SharedState } from '../../shared';
|
|
3
3
|
import { ParticipationPermissions } from '../../shared/participation/types';
|
|
4
4
|
import { SessionStatus } from '../VideoPluginProvider/context';
|
|
5
|
+
import { CommandChannelStatus } from './useCommandChannelController';
|
|
5
6
|
|
|
6
7
|
export declare const CHAT_STATE_DEFAULT: {
|
|
7
8
|
active: boolean;
|
|
@@ -25,6 +26,9 @@ export type SharedContextType = {
|
|
|
25
26
|
toggleTurnQueue: (active: boolean) => Promise<void>;
|
|
26
27
|
toggleChat: (active: boolean) => Promise<void>;
|
|
27
28
|
alertUser: (userId: number, message: string) => Promise<void>;
|
|
29
|
+
commandChannelStatus: CommandChannelStatus;
|
|
30
|
+
commandChannelAttemptCount: number;
|
|
31
|
+
commandChannelShouldShowRejoinAlert: boolean;
|
|
28
32
|
changeSessionStatus: (status: SessionStatus) => Promise<void>;
|
|
29
33
|
requestHostRole: () => Promise<void>;
|
|
30
34
|
requestedHostUser: Participant | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommandChannelAction } from '../../shared';
|
|
2
|
+
import { CommandChannelControllerResult } from './useCommandChannelController';
|
|
2
3
|
|
|
3
4
|
export type SendActionOptions = {
|
|
4
5
|
maxAttempts?: number;
|
|
@@ -6,4 +7,7 @@ export type SendActionOptions = {
|
|
|
6
7
|
connectionTimeout?: number;
|
|
7
8
|
userId?: number;
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
+
export type SendActionResult = {
|
|
11
|
+
messageId: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const useActionSender: (controller: CommandChannelControllerResult) => (action: CommandChannelAction, options?: SendActionOptions) => Promise<SendActionResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type CommandChannelStatus = 'idle' | 'connecting' | 'connected' | 'reconnecting' | 'failed';
|
|
2
|
+
export type CommandChannelState = {
|
|
3
|
+
status: CommandChannelStatus;
|
|
4
|
+
attemptCount: number;
|
|
5
|
+
connectedAt: number | null;
|
|
6
|
+
disconnectedAt: number | null;
|
|
7
|
+
lastDisconnectReason: string | null;
|
|
8
|
+
shouldShowRejoinAlert: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type CommandChannelControllerResult = {
|
|
11
|
+
state: CommandChannelState;
|
|
12
|
+
isConnected: () => boolean;
|
|
13
|
+
waitForConnected: (timeoutMs?: number) => Promise<void>;
|
|
14
|
+
reportCommandChannelDegraded: (reason: string) => void;
|
|
15
|
+
resetController: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const COMMAND_CHANNEL_INITIAL_STATE: CommandChannelState;
|
|
18
|
+
export declare class CommandChannelWaitCancelledError extends Error {
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
21
|
+
export declare const useCommandChannelController: () => CommandChannelControllerResult;
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './reducer';
|
|
2
|
-
export type { SharedState, CommandChannelAction } from './types';
|
|
2
|
+
export type { SharedState, CommandChannelAction, SharedReducerAction } from './types';
|
package/dist/shared/reducer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SharedState,
|
|
1
|
+
import { SharedState, SharedReducerAction } from './types';
|
|
2
2
|
|
|
3
|
-
declare const reducer: (state: SharedState, action:
|
|
3
|
+
declare const reducer: (state: SharedState, action: SharedReducerAction) => SharedState;
|
|
4
4
|
export default reducer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { SessionAction } from './session-info';
|
|
|
6
6
|
import { SpeakerTurnAction, SpeakerTurnState } from './speaker-turn';
|
|
7
7
|
|
|
8
8
|
export type SharedState = {
|
|
9
|
+
revision: number;
|
|
10
|
+
lastUpdatedAt: number;
|
|
9
11
|
chatState: ChatState;
|
|
10
12
|
speakerTurnState: SpeakerTurnState;
|
|
11
13
|
sessionState: {
|
|
@@ -30,4 +32,21 @@ export type SendStateAction = {
|
|
|
30
32
|
type: 'SEND-SHARED-STATE';
|
|
31
33
|
state: SharedState;
|
|
32
34
|
};
|
|
33
|
-
export type
|
|
35
|
+
export type ResetSharedStateAction = {
|
|
36
|
+
type: 'RESET-SHARED-STATE';
|
|
37
|
+
state: SharedState;
|
|
38
|
+
};
|
|
39
|
+
export type RequestStateRecoveryAction = {
|
|
40
|
+
type: 'REQUEST-STATE-RECOVERY';
|
|
41
|
+
requesterUserId: number;
|
|
42
|
+
requestId: string;
|
|
43
|
+
};
|
|
44
|
+
export type SendStateRecoveryAction = {
|
|
45
|
+
type: 'SEND-STATE-RECOVERY';
|
|
46
|
+
requestId: string;
|
|
47
|
+
state: SharedState;
|
|
48
|
+
responderUserId: number;
|
|
49
|
+
responderRole: 'host' | 'manager' | 'attendee';
|
|
50
|
+
};
|
|
51
|
+
export type CommandChannelAction = AlertUserAction | RequestStateAction | SendStateAction | RequestStateRecoveryAction | SendStateRecoveryAction | SpeakerTurnAction | ChatAction | SessionAction | RequestHostRoleAction | GrantParticipationAction | RevokeParticipationAction | RevokeVideoParticipationAction | InviteToParticipateAction;
|
|
52
|
+
export type SharedReducerAction = CommandChannelAction | ResetSharedStateAction;
|