Socket
Socket
Sign inDemoInstall

@signalwire/compatibility-api

Package Overview
Dependencies
48
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.0.3-dev.202208111418.4e2284d.0

dist/core/src/utils/toInternalAction.test.d.ts

10

dist/core/src/index.d.ts

@@ -1,2 +0,2 @@

import { uuid, setLogger, getLogger, isGlobalEvent, toExternalJSON, toSnakeCaseKeys, toLocalEvent, toSyntheticEvent, extendComponent, validateEventsToSubscribe, toInternalEventName, serializeableProxy, timeoutPromise } from './utils';
import { uuid, setLogger, getLogger, isGlobalEvent, toExternalJSON, toSnakeCaseKeys, toLocalEvent, toSyntheticEvent, extendComponent, validateEventsToSubscribe, toInternalEventName, toInternalAction, serializeableProxy, timeoutPromise } from './utils';
import { BaseSession } from './BaseSession';

@@ -12,3 +12,6 @@ import { BaseJWTSession } from './BaseJWTSession';

import { MEMBER_UPDATED_EVENTS, INTERNAL_MEMBER_UPDATED_EVENTS } from './types/videoMember';
export { uuid, setLogger, getLogger, BaseSession, BaseJWTSession, BaseComponent, BaseConsumer, BaseClient, connect, configureStore, EventEmitter, extendComponent, validateEventsToSubscribe, getEventEmitter, isGlobalEvent, toExternalJSON, toSnakeCaseKeys, toLocalEvent, toInternalEventName, serializeableProxy, toSyntheticEvent, GLOBAL_VIDEO_EVENTS, MEMBER_UPDATED_EVENTS, INTERNAL_MEMBER_UPDATED_EVENTS, findNamespaceInPayload, timeoutPromise, };
export { uuid, setLogger, getLogger, BaseSession, BaseJWTSession, BaseComponent, BaseConsumer, BaseClient, connect, configureStore, EventEmitter, extendComponent, validateEventsToSubscribe, getEventEmitter, isGlobalEvent, toExternalJSON, toSnakeCaseKeys, toLocalEvent, toInternalEventName, toInternalAction, serializeableProxy, toSyntheticEvent, GLOBAL_VIDEO_EVENTS, MEMBER_UPDATED_EVENTS, INTERNAL_MEMBER_UPDATED_EVENTS, findNamespaceInPayload, timeoutPromise, };
export * from './redux/features/component/componentSlice';
export * from './redux/features/session/sessionSlice';
export * as componentSelectors from './redux/features/component/componentSelectors';
export * from './RPCMessages';

@@ -18,3 +21,3 @@ export * from './utils/interfaces';

export * from './CustomErrors';
export type { SessionState, CustomSagaParams, CustomSaga, PubSubChannel, MapToPubSubShape, SDKActions, } from './redux/interfaces';
export type { SessionState, CustomSagaParams, CustomSaga, PubSubChannel, PubSubAction, MapToPubSubShape, SDKActions, } from './redux/interfaces';
export type { ToExternalJSONResult } from './utils';

@@ -39,2 +42,3 @@ export * as actions from './redux/actions';

export { PubSubMessage } from './pubSub';
export * as testUtils from './testUtils';
//# sourceMappingURL=index.d.ts.map

@@ -5,3 +5,3 @@ import { sagaEffects, SDKWorker, SDKWorkerParams, VideoMemberUpdatedEventParams } from '..';

action: any;
}): Generator<sagaEffects.ChannelPutEffect<import("..").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("..").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("..").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("..").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("..").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("..").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("..").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("..").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("..").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("..").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | {
}): Generator<sagaEffects.ChannelPutEffect<import("..").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("..").MapToPubSubShape<import("..").InternalVideoRoomAudienceCountEvent> | import("..").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("..").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | import("..").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("..").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("..").MapToPubSubShape<import("..").VideoMemberPromotedEvent> | import("..").MapToPubSubShape<import("..").VideoMemberDemotedEvent> | import("..").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("..").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("..").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("..").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("..").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("..").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("..").MapToPubSubShape<import("..").VideoRoomAudienceCountEvent> | {
type: "session.unknown" | "session.idle" | "session.reconnecting" | "session.connected" | "session.disconnected" | "session.auth_error" | "session.expiring";

@@ -8,0 +8,0 @@ payload: Error | undefined;

@@ -35,2 +35,3 @@ import { BaseComponentOptions, BaseConsumer, JSONRPCSubscribeMethod, SessionEvents, EventEmitter, EventTransform } from '..';

};
private _checkMissingSubscriptions;
subscribe(channels?: PubSubChannel): Promise<unknown>;

@@ -40,4 +41,5 @@ unsubscribe(channels: PubSubChannel): Promise<void>;

publish(params: PubSubPublishParams): Promise<unknown>;
getAllowedChannels(): import("..").ChatAuthorizationChannels;
}
export declare const createBasePubSubObject: <PubSubType>(params: BaseComponentOptions<PubSubEventNames>) => PubSubType;
//# sourceMappingURL=BasePubSub.d.ts.map

@@ -5,3 +5,2 @@ import { SagaIterator, EventChannel } from '@redux-saga/core';

declare type SessionSagaParams = {
session: BaseSession;
sessionChannel: EventChannel<unknown>;

@@ -18,5 +17,5 @@ pubSubChannel: PubSubChannel;

export declare function executeActionWatcher(session: BaseSession): SagaIterator;
export declare function sessionChannelWatcher({ session, sessionChannel, pubSubChannel, swEventChannel, }: SessionSagaParams): SagaIterator;
export declare function sessionChannelWatcher({ sessionChannel, pubSubChannel, swEventChannel, }: SessionSagaParams): SagaIterator;
export declare function createSessionChannel(session: BaseSession): EventChannel<unknown>;
export {};
//# sourceMappingURL=sessionSaga.d.ts.map
import type { PayloadAction } from '../../toolkit';
import type { SessionState } from '../../interfaces';
import type { RPCConnectResult, SessionAuthStatus } from '../../../utils/interfaces';
import type { Authorization, RPCConnectResult, SessionAuthStatus } from '../../../utils/interfaces';
import type { DeepReadonly } from '../../../types';

@@ -29,4 +29,23 @@ export declare const initialSessionState: DeepReadonly<SessionState>;

readonly expires_at?: number | undefined;
readonly audio_allowed?: boolean | undefined;
readonly video_allowed?: boolean | undefined;
readonly media_allowed: import("../../../utils/interfaces").MediaAllowed;
readonly audio_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
readonly video_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
} | {
readonly type: "chat";
readonly channels: {
readonly [x: string]: {
readonly read?: boolean | undefined;
readonly write?: boolean | undefined;
};
};
readonly expires_at: number;
readonly member_id: string;
readonly project: string;
readonly project_id: string;
readonly resource: string;
readonly scope_id: string;
readonly scopes: readonly string[];
readonly signature: string;
readonly space_id: string;
readonly ttl: number;
} | undefined;

@@ -40,3 +59,3 @@ readonly authError?: {

authStatus: "authorized";
authState: import("../../../utils/interfaces").Authorization;
authState: Authorization;
authCount: number;

@@ -72,4 +91,23 @@ protocol: string;

readonly expires_at?: number | undefined;
readonly audio_allowed?: boolean | undefined;
readonly video_allowed?: boolean | undefined;
readonly media_allowed: import("../../../utils/interfaces").MediaAllowed;
readonly audio_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
readonly video_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
} | {
readonly type: "chat";
readonly channels: {
readonly [x: string]: {
readonly read?: boolean | undefined;
readonly write?: boolean | undefined;
};
};
readonly expires_at: number;
readonly member_id: string;
readonly project: string;
readonly project_id: string;
readonly resource: string;
readonly scope_id: string;
readonly scopes: readonly string[];
readonly signature: string;
readonly space_id: string;
readonly ttl: number;
} | undefined;

@@ -103,4 +141,23 @@ readonly authError?: {

readonly expires_at?: number | undefined;
readonly audio_allowed?: boolean | undefined;
readonly video_allowed?: boolean | undefined;
readonly media_allowed: import("../../../utils/interfaces").MediaAllowed;
readonly audio_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
readonly video_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
} | {
readonly type: "chat";
readonly channels: {
readonly [x: string]: {
readonly read?: boolean | undefined;
readonly write?: boolean | undefined;
};
};
readonly expires_at: number;
readonly member_id: string;
readonly project: string;
readonly project_id: string;
readonly resource: string;
readonly scope_id: string;
readonly scopes: readonly string[];
readonly signature: string;
readonly space_id: string;
readonly ttl: number;
} | undefined;

@@ -113,2 +170,67 @@ authError?: {

};
updateAuthState: (state: {
readonly protocol: string;
readonly iceServers?: readonly {
readonly credential?: string | undefined;
readonly credentialType?: "password" | undefined;
readonly urls: string | readonly string[];
readonly username?: string | undefined;
}[] | undefined;
readonly authStatus: SessionAuthStatus;
readonly authState?: {
readonly type: "video";
readonly project: string;
readonly scopes: readonly string[];
readonly scope_id: string;
readonly resource: string;
readonly user_name: string;
readonly room?: {
readonly name: string;
readonly scopes: readonly string[];
} | undefined;
readonly signature: string;
readonly expires_at?: number | undefined;
readonly media_allowed: import("../../../utils/interfaces").MediaAllowed;
readonly audio_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
readonly video_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
} | {
readonly type: "chat";
readonly channels: {
readonly [x: string]: {
readonly read?: boolean | undefined;
readonly write?: boolean | undefined;
};
};
readonly expires_at: number;
readonly member_id: string;
readonly project: string;
readonly project_id: string;
readonly resource: string;
readonly scope_id: string;
readonly scopes: readonly string[];
readonly signature: string;
readonly space_id: string;
readonly ttl: number;
} | undefined;
readonly authError?: {
readonly code: number;
readonly message: string;
} | undefined;
readonly authCount: number;
}, { payload }: PayloadAction<Authorization>) => {
authState: Authorization;
protocol: string;
iceServers?: readonly {
readonly credential?: string | undefined;
readonly credentialType?: "password" | undefined;
readonly urls: string | readonly string[];
readonly username?: string | undefined;
}[] | undefined;
authStatus: SessionAuthStatus;
authError?: {
readonly code: number;
readonly message: string;
} | undefined;
authCount: number;
};
}>, sessionReducer: import("redux").Reducer<{

@@ -136,4 +258,23 @@ readonly protocol: string;

readonly expires_at?: number | undefined;
readonly audio_allowed?: boolean | undefined;
readonly video_allowed?: boolean | undefined;
readonly media_allowed: import("../../../utils/interfaces").MediaAllowed;
readonly audio_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
readonly video_allowed: import("../../../utils/interfaces").MediaDirectionAllowed;
} | {
readonly type: "chat";
readonly channels: {
readonly [x: string]: {
readonly read?: boolean | undefined;
readonly write?: boolean | undefined;
};
};
readonly expires_at: number;
readonly member_id: string;
readonly project: string;
readonly project_id: string;
readonly resource: string;
readonly scope_id: string;
readonly scopes: readonly string[];
readonly signature: string;
readonly space_id: string;
readonly ttl: number;
} | undefined;

@@ -140,0 +281,0 @@ readonly authError?: {

import type { SagaIterator } from '@redux-saga/types';
import type { PayloadAction } from './toolkit';
import { JSONRPCResponse, SessionAuthError, SessionAuthStatus, SessionEvents, JSONRPCMethod, BaseConnectionState, Authorization } from '../utils/interfaces';
import type { VideoAPIEventParams, InternalVideoAPIEvent, ChatAction, TaskAction, MessagingAction, SwEventParams, VoiceCallAction, VideoManagerAction, PubSubEventAction } from '../types';
import type { VideoAction, ChatAction, TaskAction, MessagingAction, SwEventParams, VoiceCallAction, VideoManagerAction, PubSubEventAction } from '../types';
import { SDKRunSaga } from '.';

@@ -74,3 +74,3 @@ import { END, MulticastChannel } from '@redux-saga/core';

};
export declare type PubSubAction = MapToPubSubShape<VideoAPIEventParams | InternalVideoAPIEvent> | {
export declare type PubSubAction = VideoAction | {
type: SessionEvents;

@@ -77,0 +77,0 @@ payload: Error | undefined;

@@ -416,4 +416,23 @@ export declare const rootReducer: import("redux").Reducer<import("redux").CombinedState<{

readonly expires_at?: number | undefined;
readonly audio_allowed?: boolean | undefined;
readonly video_allowed?: boolean | undefined;
readonly media_allowed: import("..").MediaAllowed;
readonly audio_allowed: import("..").MediaDirectionAllowed;
readonly video_allowed: import("..").MediaDirectionAllowed;
} | {
readonly type: "chat";
readonly channels: {
readonly [x: string]: {
readonly read?: boolean | undefined;
readonly write?: boolean | undefined;
};
};
readonly expires_at: number;
readonly member_id: string;
readonly project: string;
readonly project_id: string;
readonly resource: string;
readonly scope_id: string;
readonly scopes: readonly string[];
readonly signature: string;
readonly space_id: string;
readonly ttl: number;
} | undefined;

@@ -420,0 +439,0 @@ readonly authError?: {

@@ -21,6 +21,6 @@ import type { Task, SagaIterator } from '@redux-saga/types';

pubSubChannel: PubSubChannel;
}): Generator<import("@redux-saga/core/effects").ChannelPutEffect<import("./interfaces").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | {
}): Generator<import("@redux-saga/core/effects").ChannelPutEffect<import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomAudienceCountEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberPromotedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberDemotedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomAudienceCountEvent> | {
type: "session.unknown" | "session.idle" | "session.reconnecting" | "session.connected" | "session.disconnected" | "session.auth_error" | "session.expiring";
payload: Error | undefined;
} | import("./interfaces").MapToPubSubShape<import("..").VideoManagerRoomsSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoManagerRoomEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatChannelMessageEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").PubSubChannelMessageEvent> | import("..").TaskAction | import("./interfaces").MapToPubSubShape<import("..").MessagingStateEvent> | import("./interfaces").MapToPubSubShape<import("..").MessageUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").MessagingReceiveEvent> | import("./interfaces").MapToPubSubShape<import("..").MessageReceivedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallDialEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallStateEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallReceiveEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallPlayEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallRecordEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallCollectEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallTapEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallConnectEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallSendDigitsEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallDetectEvent> | import("./interfaces").MapToPubSubShape<import("..").CallReceivedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingFailedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptFailedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallTapStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallTapEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectConnectingEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectConnectedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectDisconnectedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectFailedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallDetectStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallDetectUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallDetectEndedEvent>> | import("@redux-saga/core/effects").CallEffect<true> | import("@redux-saga/core/effects").CallEffect<void>, void, unknown>;
} | import("./interfaces").MapToPubSubShape<import("..").VideoManagerRoomsSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoManagerRoomEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatChannelMessageEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").ChatMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").PubSubChannelMessageEvent> | import("..").TaskAction | import("./interfaces").MapToPubSubShape<import("..").MessagingStateEvent> | import("./interfaces").MapToPubSubShape<import("..").MessageUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").MessagingReceiveEvent> | import("./interfaces").MapToPubSubShape<import("..").MessageReceivedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallDialEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallStateEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallReceiveEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallPlayEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallRecordEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallCollectEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallTapEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallConnectEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallSendDigitsEvent> | import("./interfaces").MapToPubSubShape<import("..").CallingCallDetectEvent> | import("./interfaces").MapToPubSubShape<import("..").CallReceivedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallRecordingFailedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallPromptFailedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallTapStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallTapEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectConnectingEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectConnectedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectDisconnectedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallConnectFailedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallDetectStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallDetectUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").CallDetectEndedEvent>> | import("@redux-saga/core/effects").CallEffect<void> | import("@redux-saga/core/effects").CallEffect<true>, void, unknown>;
export declare function reauthenticateWorker({ session, token, pubSubChannel, }: {

@@ -30,3 +30,3 @@ session: BaseSession;

pubSubChannel: PubSubChannel;
}): Generator<import("@redux-saga/core/effects").ChannelPutEffect<import("./interfaces").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | {
}): Generator<import("@redux-saga/core/effects").ChannelPutEffect<import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomAudienceCountEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberPromotedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberDemotedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomAudienceCountEvent> | {
type: "session.unknown" | "session.idle" | "session.reconnecting" | "session.connected" | "session.disconnected" | "session.auth_error" | "session.expiring";

@@ -47,3 +47,3 @@ payload: Error | undefined;

}
export declare function sessionAuthErrorSaga(options: SessionAuthErrorOptions): Generator<import("@redux-saga/core/effects").TakeEffect | import("@redux-saga/core/effects").ChannelPutEffect<import("./interfaces").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | {
export declare function sessionAuthErrorSaga(options: SessionAuthErrorOptions): Generator<import("@redux-saga/core/effects").TakeEffect | import("@redux-saga/core/effects").ChannelPutEffect<import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoRoomAudienceCountEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").InternalVideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomSubscribedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberJoinedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberLeftEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberTalkingEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberPromotedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoMemberDemotedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoLayoutChangedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRecordingEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackStartedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackUpdatedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoPlaybackEndedEvent> | import("./interfaces").MapToPubSubShape<import("..").VideoRoomAudienceCountEvent> | {
type: "session.unknown" | "session.idle" | "session.reconnecting" | "session.connected" | "session.disconnected" | "session.auth_error" | "session.expiring";

@@ -50,0 +50,0 @@ payload: Error | undefined;

import { Saga } from '@redux-saga/core';
export declare const createRestartableSaga: (saga: Saga) => () => Generator<never, void, unknown>;
export declare const createCatchableSaga: <Args = any>(saga: Saga, errorHandler?: (error: any) => void) => (...params: Args[]) => Generator<import("@redux-saga/core/effects").CallEffect<any>, void, unknown>;
export { eventChannel } from '@redux-saga/core';
//# sourceMappingURL=sagaHelpers.d.ts.map
import { BaseRoomInterface } from '.';
import type { VideoMemberEntity, VideoRecordingEntity, VideoPlaybackEntity, MemberCommandParams, VideoPosition } from '../types';
import type { MediaAllowed } from '../utils/interfaces';
declare type RoomMethodParams = Record<string, unknown>;

@@ -37,3 +38,3 @@ interface RoomMethodPropertyDescriptor<OutputType, ParamsType> extends PropertyDescriptor {

export declare const setHideVideoMuted: RoomMethodDescriptor<void, boolean>;
interface GetRecordingsOutput {
export interface GetRecordingsOutput {
recordings: VideoRecordingEntity[];

@@ -43,3 +44,3 @@ }

export declare const startRecording: RoomMethodDescriptor<void>;
interface GetPlaybacksOutput {
export interface GetPlaybacksOutput {
playbacks: VideoPlaybackEntity[];

@@ -82,2 +83,12 @@ }

export declare const setInputSensitivityMember: RoomMethodDescriptor<void, RoomMemberMethodParams>;
interface PromoteDemoteMemberParams extends Required<MemberCommandParams> {
mediaAllowed?: MediaAllowed;
permissions?: string[];
}
export interface PromoteMemberParams extends PromoteDemoteMemberParams {
}
export declare const promote: RoomMethodDescriptor<void, PromoteMemberParams>;
export interface DemoteMemberParams extends PromoteDemoteMemberParams {
}
export declare const demote: RoomMethodDescriptor<unknown, PromoteDemoteMemberParams>;
export interface SetMemberPositionParams extends MemberCommandParams {

@@ -109,3 +120,5 @@ position: VideoPosition;

export declare type SetMemberMeta = ReturnType<typeof setMemberMeta.value>;
export declare type PromoteMember = ReturnType<typeof promote.value>;
export declare type DemoteMember = ReturnType<typeof demote.value>;
export {};
//# sourceMappingURL=methods.d.ts.map

@@ -0,4 +1,6 @@

/// <reference types="jest" />
import { ConfigureStoreOptions } from './redux';
import { PubSubChannel, SwEventChannel } from './redux/interfaces';
import { RPCConnectResult, InternalSDKLogger } from './utils/interfaces';
import { EventEmitter } from './utils/EventEmitter';
export declare const createMockedLogger: () => InternalSDKLogger;

@@ -22,2 +24,36 @@ /**

};
/**
* Helper method to configure a Store with a rootSaga
* and a mocked Session object.
* This allow to write integration tests.
*
* @returns { store, session, emitter, destroy }
*/
export declare const configureFullStack: () => {
store: {
runSaga: <T>(saga: import("@redux-saga/types").Saga<any[]>, args: {
instance: T;
runSaga: any;
}) => import("@redux-saga/types").Task;
dispatch: import("redux").Dispatch<import("redux").AnyAction>;
getState(): any;
subscribe(listener: () => void): import("redux").Unsubscribe;
replaceReducer(nextReducer: import("redux").Reducer<any, import("redux").AnyAction>): void;
[Symbol.observable](): import("redux").Observable<any>;
};
session: {
dispatch: {
(...data: any[]): void;
(message?: any, ...optionalParams: any[]): void;
};
connect: jest.Mock<any, any>;
disconnect: jest.Mock<any, any>;
execute: jest.Mock<any, any>;
};
emitter: EventEmitter<string | symbol, any>;
destroy: () => {
payload: undefined;
type: "swSdk/destroy";
};
};
export declare const wait: (ms: number) => Promise<unknown>;

@@ -24,0 +60,0 @@ export declare const rpcConnectResultVRT: RPCConnectResult;

import type { OnlyStateProperties, OnlyFunctionProperties, SwEvent, CamelToSnakeCase } from '..';
import type { MapToPubSubShape } from '../redux/interfaces';
import type { PubSubContract, PubSubMessageEntity } from './pubSub';
import type { PubSubChannel, PubSubContract, PubSubMessageEntity, PubSubPublishParams } from './pubSub';
import type { PaginationCursor } from './common';

@@ -17,3 +17,3 @@ import { PRODUCT_PREFIX_CHAT } from '../utils/constants';

export declare type ChatChannel = string | string[];
interface ChatSetMemberStateParams {
export interface ChatSetMemberStateParams {
memberId: string;

@@ -23,11 +23,11 @@ channels: ChatChannel;

}
interface ChatGetMemberStateParams {
export interface ChatGetMemberStateParams {
memberId: string;
channels?: ChatChannel;
}
interface ChatGetMessagesParams {
export interface ChatGetMessagesParams {
channel: string;
cursor?: PaginationCursor;
}
interface ChatGetMembersParams {
export interface ChatGetMembersParams {
channel: string;

@@ -40,2 +40,28 @@ }

export interface ChatContract extends PubSubContract {
/**
* Returns the list of messages that were sent to the specified channel.
*
* @param params - {@link ChatGetMessagesParams}
*
* @example
* ```js
* const m = await chatClient.getMessages({ channel: 'chan1' })
*
* m.messages.length; // 23
* m.messages[0]; // the most recent message
* m.messages[0].member; // the sender
* m.messages[0].content; // the content
* m.messages[0].meta; // the metadata (if any)
*
* m.cursor.next; // if not null, there are more messages.
*
* // Get the next page using the cursor
* const next = await chatClient.getMessages({
* channel: 'chan1',
* cursor: {
* after: m.cursor.after
* }
* })
* ```
*/
getMessages(params: ChatGetMessagesParams): Promise<{

@@ -45,12 +71,119 @@ messages: ChatMessageEntity[];

}>;
/**
* Returns the list of members in the given channel.
*
* @param params - {@link ChatGetMembersParams}
*
* @example
* ```js
* const m = await chatClient.getMembers({ channel: 'my-channel' })
*
* m.members.length; // 7
* m.members[0]; // { id: ..., channel: ..., state: ... }
* ```
*/
getMembers(params: ChatGetMembersParams): Promise<{
members: ChatMemberEntity[];
}>;
/**
* Sets a state object for a member, for the specified channels. The
* previous state object will be completely replaced.
*
* @param params - {@link ChatSetMemberStateParams}
*
* @example
* ```js
* await chatClient.setMemberState({
* channels: ['chan1', 'chan2'],
* state: {
* online: true,
* typing: false
* }
* })
* ```
*/
setMemberState(params: ChatSetMemberStateParams): Promise<void>;
/**
* Returns the states of a member in the specified channels.
*
* @param params - {@link ChatGetMemberStateParams}
*
* @example
* ```js
* const s = await chatClient.getMemberState({
* channels: ['chan1', 'chan2'],
* memberId: 'my-member-id'
* })
*
* s.channels.length; // 2
* s.channels.chan1.state; // the state object for chan1
* ```
*/
getMemberState(params: ChatGetMemberStateParams): Promise<{
channels: Record<ChatChannelName, ChatChannelState>;
}>;
/**
* List of channels for which you want to receive
* messages.
*
* Note that the `subscribe` function is idempotent, and
* calling it again with a different set of channels _will
* not_ unsubscribe you from the old ones. To unsubscribe,
* use {@link unsubscribe}.
*
* @param channels - {@link PubSubChannel} the channels to
* subscribe to, either in the form of a string (for one
* channel) or an array of strings.
*
* @example
* ```js
* chatClient.on('message', m => console.log(m))
*
* await chatClient.subscribe("my-channel")
* await chatClient.subscribe(["chan-2", "chan-3"])
* ```
*/
subscribe(channels: PubSubChannel): Promise<void>;
/**
* List of channels from which you want to unsubscribe.
*
* @param channels - {@link PubSubChannel} the channels to
* unsubscribe from, either in the form of a string (for
* one channel) or an array of strings.
*
* @example
* ```js
* await chatClient.unsubscribe("my-channel")
* await chatClient.unsubscribe(["chan-2", "chan-3"])
* ```
*/
unsubscribe(channels: PubSubChannel): Promise<void>;
/**
* Publish a message into the specified channel.
*
* @param params - {@link PubSubPublishParams}
*
* @example Publishing a message as a string:
* ```js
* await chatClient.publish({
* channel: 'my-channel',
* content: 'Hello, world.'
* })
* ```
*
* @example Publishing a message as an object:
* ```js
* await chatClient.publish({
* channel: 'my-channel',
* content: {
* field_one: 'value_one',
* field_two: 'value_two',
* }
* })
* ```
*/
publish(params: PubSubPublishParams): Promise<void>;
}
export declare type ChatEntity = OnlyStateProperties<ChatContract>;
export declare type ChatMethods = Omit<OnlyFunctionProperties<ChatContract>, 'subscribe' | 'unsubscribe' | 'updateToken'>;
export declare type ChatMethods = Omit<OnlyFunctionProperties<ChatContract>, 'subscribe' | 'unsubscribe' | 'updateToken' | 'getAllowedChannels'>;
export interface ChatMessageContract extends PubSubMessageEntity {

@@ -57,0 +190,0 @@ member: ChatMemberContract;

@@ -20,2 +20,6 @@ import type { EventEmitter } from '../utils/EventEmitter';

export interface BaseComponentContract {
/**
* This only destroys the JavaScript object: it has no
* effect on the server-side room.
*/
destroy(): void;

@@ -58,3 +62,28 @@ }

readonly previewUrl?: string;
/**
* Replaces the current camera stream with the one coming from a different
* device.
* @param constraints Specify the constraints that the device should satisfy. {@link MediaTrackConstraints}
* See
* [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints).
*
* @example Replaces the current camera stream with the one coming from the specified deviceId:
* ```typescript
* await room.updateCamera({deviceId: "/o4ZeWzroh+8q0Ds/CFfmn9XpqaHzmW3L/5ZBC22CRg="})
* ```
*/
updateCamera(constraints: MediaTrackConstraints): Promise<void>;
/**
* Replaces the current microphone stream with the one coming from a different
* device.
* @param constraints Specify the constraints that the device should satisfy. {@link MediaTrackConstraints}
* See
* [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints).
*
* @example Replaces the current microphone stream with the one coming from
* the specified deviceId:
* ```typescript
* await room.updateMicrophone({deviceId: "/o4ZeWzroh+8q0Ds/CFfmn9XpqaHzmW3L/5ZBC22CRg="})
* ```
*/
updateMicrophone(constraints: MediaTrackConstraints): Promise<void>;

@@ -61,0 +90,0 @@ /** @internal */

@@ -1,2 +0,2 @@

import type { OnlyStateProperties, OnlyFunctionProperties, CamelToSnakeCase, SwEvent, MapToPubSubShape } from '..';
import type { OnlyStateProperties, OnlyFunctionProperties, CamelToSnakeCase, SwEvent, MapToPubSubShape, ChatAuthorizationChannels } from '..';
import { PRODUCT_PREFIX_PUBSUB } from '../utils/constants';

@@ -14,6 +14,64 @@ declare type ToInternalPubSubEvent<T extends string> = `${PubSubNamespace}.${T}`;

export interface PubSubContract {
/**
* Replaces the token used by the client with a new one.
* You can use this method to replace the token when for
* example it is expiring, in order to keep the session
* alive.
*/
updateToken(token: string): Promise<void>;
/**
* List of channels for which you want to receive messages.
*
* Note that the `subscribe` function is idempotent, and calling it again with
* a different set of channels _will not_ unsubscribe you from the old ones.
* To unsubscribe, use {@link unsubscribe}.
*
* @param channels - {@link PubSubChannel}
*
* @example
* ```js
* await pubSubClient.subscribe("my-channel")
* await pubSubClient.subscribe(["chan-2", "chan-3"])
* ```
*/
subscribe(channels: PubSubChannel): Promise<void>;
/**
* List of channels from which you want to unsubscribe.
*
* @param channels - {@link PubSubChannel}
*
* @example
* ```js
* await pubSubClient.unsubscribe("my-channel")
* await pubSubClient.unsubscribe(["chan-2", "chan-3"])
* ```
*/
unsubscribe(channels: PubSubChannel): Promise<void>;
/**
* Publish a message into the specified channel.
*
* @param params - {@link PubSubPublishParams}
*
* @example Publishing a message as a string:
* ```js
* await pubSubClient.publish({
* channel: 'my-channel',
* content: 'Hello, world.'
* })
* ```
*
* @example Publishing a message as an object:
* ```js
* await pubSubClient.publish({
* channel: 'my-channel',
* content: {
* field_one: 'value_one',
* field_two: 'value_two',
* }
* })
* ```
*/
publish(params: PubSubPublishParams): Promise<void>;
/** @internal */
getAllowedChannels(): Promise<ChatAuthorizationChannels>;
}

@@ -20,0 +78,0 @@ export declare type PubSubEntity = OnlyStateProperties<PubSubContract>;

@@ -15,50 +15,2 @@ export declare type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? '_' : ''}${Lowercase<T>}${CamelToSnakeCase<U>}` : S;

export declare type OnlyStateProperties<T> = Pick<T, OnlyStatePropertyNames<T>>;
declare type ShapeOf<T> = Omit<T, never>;
/**
* This type fails to be evaluated if the two type parameters don't match. If
* they match, it is equal to one of the two types.
*
* Motivation: we use this type for documentation purposes. Some of the types
* and interfaces that we want to publicly expose have several layers of
* indirection and are not detected correctly by TypeDoc. To workaround the
* problem, we additionally write a fully documented explicit type and we use
* `AssertSameType` to ensure that the two are equal at compile-time. Of the two
* input types, `AssertSameType` returns the documented one (which, apart from
* documentation, is indistinguishable from the other one).
*
* As an example, say we want to expose an interface named `RoomSession`, whose
* methods are not currently getting picked up by TypeDoc:
*
* ```typescript
* export interface RoomSession { ... }
* ```
*
* To make `RoomSession` documentable, we rename it (as a convention) into
* `RoomSessionMain` and we also add an equivalent `RoomSessionDocs` with
* explicit types:
*
* ```typescript
* interface RoomSessionMain { ... }
*
* interface RoomSessionDocs {
* // doc string ...
* audioMute(params: { memberId: string }): Promise<void>
*
* // doc string ...
* audioUnmute(params: { memberId: string }): Promise<void>
* }
* ```
*
* Then, we export a new interface which extends AssertSameType:
*
* ```typescript
* export interface RoomSession extends
* AssertSameType<RoomSessionMain, RoomSessionDocs> {}
* ```
*
* If `RoomSessionMain` and `RoomSessionDocs` are not equal, we get a
* compile-time error. If they are equal, `RoomSession` will refer to the
* documented version of the methods.
*/
export declare type AssertSameType<ExpectedType extends ShapeOf<Output>, Output extends ShapeOf<ExpectedType>> = Output;
declare type IsTimestampProperty<Property> = Property extends `${string}_at` ? Property : never;

@@ -65,0 +17,0 @@ export interface DefaultPublicToInternalTypeMapping {

@@ -1,6 +0,8 @@

import { VideoRoomSessionEventNames, VideoRoomEvent, InternalVideoRoomSessionEventNames, InternalVideoRoomEvent } from './videoRoomSession';
import { VideoMemberEventNames, VideoMemberEvent, InternalVideoMemberEventNames, InternalVideoMemberEvent } from './videoMember';
import { VideoLayoutEventNames, InternalVideoLayoutEventNames, VideoLayoutEvent } from './videoLayout';
import { VideoRecordingEventNames, VideoRecordingEvent, InternalVideoRecordingEventNames } from './videoRecording';
import { VideoPlaybackEventNames, VideoPlaybackEvent, InternalVideoPlaybackEventNames } from './videoPlayback';
import { VideoRoomEvent, InternalVideoRoomSessionEventNames, InternalVideoRoomEvent } from './videoRoomSession';
import { VideoMemberEvent, InternalVideoMemberEventNames, InternalVideoMemberEvent } from './videoMember';
import { InternalVideoLayoutEventNames, VideoLayoutEvent } from './videoLayout';
import { VideoRecordingEvent, InternalVideoRecordingEventNames } from './videoRecording';
import { VideoPlaybackEvent, InternalVideoPlaybackEventNames } from './videoPlayback';
import { VideoRoomAudienceCountEvent } from '.';
import { MapToPubSubShape } from '..';
export * from './videoRoomSession';

@@ -48,6 +50,2 @@ export * from './videoMember';

/**
* List of all the events a RoomObject can listen to
*/
export declare type RoomEventNames = VideoRoomSessionEventNames | VideoMemberEventNames | VideoLayoutEventNames | VideoRecordingEventNames | VideoPlaybackEventNames | RTCTrackEventName;
/**
* List of all the internal events

@@ -59,3 +57,4 @@ * for the video sdk

export declare type InternalVideoAPIEvent = InternalVideoRoomEvent | InternalVideoMemberEvent;
export declare type VideoAPIEventParams = VideoRoomEvent | VideoMemberEvent | VideoLayoutEvent | VideoRecordingEvent | VideoPlaybackEvent;
export declare type VideoAPIEventParams = VideoRoomEvent | VideoMemberEvent | VideoLayoutEvent | VideoRecordingEvent | VideoPlaybackEvent | VideoRoomAudienceCountEvent;
export declare type VideoAction = MapToPubSubShape<InternalVideoAPIEvent | VideoAPIEventParams | VideoRoomAudienceCountEvent>;
//# sourceMappingURL=video.d.ts.map
import type { SwEvent, VideoPosition } from '.';
import type { CamelToSnakeCase, SnakeToCamelCase, EntityUpdated, ToInternalVideoEvent, OnlyStateProperties, OnlyFunctionProperties, AssertSameType } from './utils';
import type { CamelToSnakeCase, SnakeToCamelCase, EntityUpdated, ToInternalVideoEvent, OnlyStateProperties, OnlyFunctionProperties } from './utils';
import * as Rooms from '../rooms';
import { Authorization } from '..';
/**

@@ -21,29 +22,7 @@ * Used to not duplicate member fields across constants and types

export declare const INTERNAL_MEMBER_UPDATED_EVENTS: ("video.member.updated.audio_muted" | "video.member.updated.video_muted" | "video.member.updated.deaf" | "video.member.updated.on_hold" | "video.member.updated.visible" | "video.member.updated.input_volume" | "video.member.updated.output_volume" | "video.member.updated.input_sensitivity")[];
declare type VideoMemberUpdatablePropsMain = {
declare type VideoMemberUpdatableProps = {
[K in keyof InternalVideoMemberUpdatableProps as SnakeToCamelCase<K>]: InternalVideoMemberUpdatableProps[K];
};
declare type VideoMemberUpdatableProps = AssertSameType<VideoMemberUpdatablePropsMain, {
/** Whether the outbound audio is muted (e.g., from the microphone) */
audioMuted: boolean;
/** Whether the outbound video is muted */
videoMuted: boolean;
/** Whether the inbound audio is muted */
deaf: boolean;
/** Whether the member is on hold */
onHold: boolean;
/** Whether the member is visible */
visible: boolean;
/** Input volume (e.g., of the microphone). Values range from -50 to 50, with a default of 0. */
inputVolume: number;
/** Output volume (e.g., of the speaker). Values range from -50 to 50, with a default of 0. */
outputVolume: number;
/** Input level at which the participant is identified as currently speaking.
* The default value is 30 and the scale goes from 0 (lowest sensitivity,
* essentially muted) to 100 (highest sensitivity). */
inputSensitivity: number;
/** Metadata associated to this member. */
meta?: Record<string, unknown>;
}>;
export declare const MEMBER_UPDATABLE_PROPS: VideoMemberUpdatableProps;
export declare const MEMBER_UPDATED_EVENTS: ("member.updated.meta" | "member.updated.deaf" | "member.updated.visible" | "member.updated.audioMuted" | "member.updated.videoMuted" | "member.updated.onHold" | "member.updated.inputVolume" | "member.updated.outputVolume" | "member.updated.inputSensitivity")[];
export declare const MEMBER_UPDATED_EVENTS: ("member.updated.deaf" | "member.updated.visible" | "member.updated.audioMuted" | "member.updated.videoMuted" | "member.updated.onHold" | "member.updated.inputVolume" | "member.updated.outputVolume" | "member.updated.inputSensitivity")[];
/**

@@ -56,2 +35,4 @@ * Public event types

export declare type MemberTalking = 'member.talking';
export declare type MemberPromoted = 'member.promoted';
export declare type MemberDemoted = 'member.demoted';
/**

@@ -336,5 +317,36 @@ * @privateRemarks

}
export declare type VideoMemberEvent = VideoMemberJoinedEvent | VideoMemberLeftEvent | VideoMemberUpdatedEvent | VideoMemberTalkingEvent;
/**
* 'video.member.promoted'
*/
export interface VideoMemberPromotedEventParams {
room_session_id: string;
room_id: string;
member_id: string;
authorization: Authorization;
}
export interface VideoMemberPromotedEvent extends SwEvent {
event_type: ToInternalVideoEvent<MemberPromoted>;
params: VideoMemberPromotedEventParams;
}
/**
* 'video.member.demoted'
*/
export interface VideoMemberDemotedEventParams {
room_session_id: string;
room_id: string;
member_id: string;
authorization: Authorization;
}
export interface VideoMemberDemotedEvent extends SwEvent {
event_type: ToInternalVideoEvent<MemberDemoted>;
params: VideoMemberDemotedEventParams;
}
export declare type VideoMemberEvent = VideoMemberJoinedEvent | VideoMemberLeftEvent | VideoMemberUpdatedEvent | VideoMemberTalkingEvent | VideoMemberPromotedEvent | VideoMemberDemotedEvent;
/**
* VideoMemberPromotedEventParams and VideoMemberDemotedEventParams
* are special events without the full `member` object so we avoid
* them in VideoMemberEventParams
*/
export declare type VideoMemberEventParams = VideoMemberJoinedEventParams | VideoMemberLeftEventParams | VideoMemberUpdatedEventParams | VideoMemberTalkingEventParams;
export {};
//# sourceMappingURL=videoMember.d.ts.map

@@ -12,7 +12,11 @@ import type { SwEvent } from '.';

export declare type RoomEnded = 'room.ended';
export declare type InternalRoomAudienceCount = 'room.audience_count';
export declare type RoomJoined = 'room.joined';
export declare type RoomLeft = 'room.left';
export declare type RoomAudienceCount = 'room.audienceCount';
export declare type VideoRoomAudienceCountEventNames = ToInternalVideoEvent<InternalRoomAudienceCount | RoomAudienceCount>;
/**
* List of public event names
*/
export declare type VideoRoomSessionEventNames = RoomStarted | RoomSubscribed | RoomJoined | RoomUpdated | RoomEnded;
export declare type VideoRoomSessionEventNames = RoomStarted | RoomSubscribed | RoomUpdated | RoomEnded | RoomJoined | RoomLeft;
/**

@@ -51,29 +55,563 @@ * List of internal events

members?: InternalVideoMemberEntity[];
/**
* Puts the microphone on mute. The other participants will not hear audio
* from the muted participant anymore. You can use this method to mute
* either yourself or another participant in the room.
* @param params
* @param params.memberId id of the member to mute. If omitted, mutes the
* default device in the local client.
*
* @permissions
* - `room.self.audio_mute`: to mute a local device
* - `room.member.audio_mute`: to mute a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Muting your own microphone:
* ```typescript
* await room.audioMute()
* ```
*
* @example Muting the microphone of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.audioMute({memberId: id})
* ```
*/
audioMute(params?: MemberCommandParams): Rooms.AudioMuteMember;
/**
* Unmutes the microphone if it had been previously muted. You can use this
* method to unmute either yourself or another participant in the room.
* @param params
* @param params.memberId id of the member to unmute. If omitted, unmutes
* the default device in the local client.
*
* @permissions
* - `room.self.audio_unmute`: to unmute a local device
* - `room.member.audio_unmute`: to unmute a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Unmuting your own microphone:
* ```typescript
* await room.audioUnmute()
* ```
*
* @example Unmuting the microphone of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.audioUnmute({memberId: id})
* ```
*/
audioUnmute(params?: MemberCommandParams): Rooms.AudioUnmuteMember;
/**
* Puts the video on mute. Participants will see a mute image instead of the
* video stream. You can use this method to mute either yourself or another
* participant in the room.
* @param params
* @param params.memberId id of the member to mute. If omitted, mutes the
* default device in the local client.
*
* @permissions
* - `room.self.video_mute`: to unmute a local device
* - `room.member.video_mute`: to unmute a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Muting your own video:
* ```typescript
* await room.videoMute()
* ```
*
* @example Muting the video of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.videoMute({memberId: id})
* ```
*/
videoMute(params?: MemberCommandParams): Rooms.VideoMuteMember;
/**
* Unmutes the video if it had been previously muted. Participants will
* start seeing the video stream again. You can use this method to unmute
* either yourself or another participant in the room.
* @param params
* @param params.memberId id of the member to unmute. If omitted, unmutes
* the default device in the local client.
*
* @permissions
* - `room.self.video_mute`: to unmute a local device
* - `room.member.video_mute`: to unmute a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Unmuting your own video:
* ```typescript
* await room.videoUnmute()
* ```
*
* @example Unmuting the video of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.videoUnmute({memberId: id})
* ```
*/
videoUnmute(params?: MemberCommandParams): Rooms.VideoUnmuteMember;
/** @deprecated Use {@link setInputVolume} instead. */
setMicrophoneVolume(params: MemberCommandWithVolumeParams): Rooms.SetInputVolumeMember;
/**
* Sets the input volume level (e.g. for the microphone). You can use this
* method to set the input volume for either yourself or another participant
* in the room.
*
* @param params
* @param params.memberId id of the member for which to set input volume. If
* omitted, sets the volume of the default device in the local client.
* @param params.volume desired volume. Values range from -50 to 50, with a
* default of 0.
*
* @permissions
* - `room.self.set_input_volume`: to set the volume for a local device
* - `room.member.set_input_volume`: to set the volume for a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Setting your own microphone volume:
* ```typescript
* await room.setInputVolume({volume: -10})
* ```
*
* @example Setting the microphone volume of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.setInputVolume({memberId: id, volume: -10})
* ```
*/
setInputVolume(params: MemberCommandWithVolumeParams): Rooms.SetInputVolumeMember;
/**
* Sets the input level at which the participant is identified as currently
* speaking. You can use this method to set the input sensitivity for either
* yourself or another participant in the room.
* @param params
* @param params.memberId id of the member to affect. If omitted, affects
* the default device in the local client.
* @param params.value desired sensitivity. The default value is 30 and the
* scale goes from 0 (lowest sensitivity, essentially muted) to 100 (highest
* sensitivity).
*
* @permissions
* - `room.self.set_input_sensitivity`: to set the sensitivity for a local
* device
* - `room.member.set_input_sensitivity`: to set the sensitivity for a
* remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Setting your own input sensitivity:
* ```typescript
* await room.setInputSensitivity({value: 80})
* ```
*
* @example Setting the input sensitivity of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.setInputSensitivity({memberId: id, value: 80})
* ```
*/
setInputSensitivity(params: MemberCommandWithValueParams): Rooms.SetInputSensitivityMember;
/**
* Returns a list of members currently in the room.
*
* @example
* ```typescript
* await room.getMembers()
* ```
*/
getMembers(): Rooms.GetMembers;
/**
* Mutes the incoming audio. The affected participant will not hear audio
* from the other participants anymore. You can use this method to make deaf
* either yourself or another participant in the room.
*
* Note that in addition to making a participant deaf, this will also
* automatically mute the microphone of the target participant (even if
* there is no `audio_mute` permission). If you want, you can then manually
* unmute it by calling {@link audioUnmute}.
* @param params
* @param params.memberId id of the member to affect. If omitted, affects
* the default device in the local client.
*
* @permissions
* - `room.self.deaf`: to make yourself deaf
* - `room.member.deaf`: to make deaf a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Making yourself deaf:
* ```typescript
* await room.deaf()
* ```
*
* @example Making another participant deaf:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.deaf({memberId: id})
* ```
*/
deaf(params?: MemberCommandParams): Rooms.DeafMember;
/**
* Unmutes the incoming audio. The affected participant will start hearing
* audio from the other participants again. You can use this method to
* undeaf either yourself or another participant in the room.
*
* Note that in addition to allowing a participants to hear the others, this
* will also automatically unmute the microphone of the target participant
* (even if there is no `audio_unmute` permission). If you want, you can then
* manually mute it by calling {@link audioMute}.
* @param params
* @param params.memberId id of the member to affect. If omitted, affects
* the default device in the local client.
*
* @permissions
* - `room.self.deaf`: to make yourself deaf
* - `room.member.deaf`: to make deaf a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Undeaf yourself:
* ```typescript
* await room.undeaf()
* ```
*
* @example Undeaf another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.undeaf({memberId: id})
* ```
*/
undeaf(params?: MemberCommandParams): Rooms.UndeafMember;
/** @deprecated Use {@link setOutputVolume} instead. */
setSpeakerVolume(params: MemberCommandWithVolumeParams): Rooms.SetOutputVolumeMember;
/**
* Sets the output volume level (e.g., for the speaker). You can use this
* method to set the output volume for either yourself or another participant
* in the room.
* @param params
* @param params.memberId id of the member to affect. If omitted, affects the
* default device in the local client.
* @param params.volume desired volume. Values range from -50 to 50, with a
* default of 0.
*
* @permissions
* - `room.self.set_output_volume`: to set the speaker volume for yourself
* - `room.member.set_output_volume`: to set the speaker volume for a remote
* member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Setting your own output volume:
* ```typescript
* await room.setOutputVolume({volume: -10})
* ```
*
* @example Setting the output volume of another participant:
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.setOutputVolume({memberId: id, volume: -10})
* ```
*/
setOutputVolume(params: MemberCommandWithVolumeParams): Rooms.SetOutputVolumeMember;
/**
* Removes a specific participant from the room.
* @param params
* @param params.memberId id of the member to remove
*
* @permissions
* - `room.member.remove`: to remove a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* const id = 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* await room.removeMember({memberId: id})
* ```
*/
removeMember(params: Required<MemberCommandParams>): Rooms.RemoveMember;
/**
* Removes all the participants from the room.
*
* @permissions
* - `room.member.remove`: to remove a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* await room.removeAllMembers()
* ```
*/
removeAllMembers(): Rooms.RemoveAllMembers;
/**
* Show or hide muted videos in the room layout. Members that have been muted
* via {@link videoMute} will display a mute image instead of the video, if
* this setting is enabled.
*
* @param value whether to show muted videos in the room layout.
*
* @permissions
* - `room.hide_video_muted`
* - `room.show_video_muted`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* await roomSession.setHideVideoMuted(false)
* ```
*/
setHideVideoMuted(value: boolean): Rooms.SetHideVideoMuted;
/**
* Returns a list of available layouts for the room. To set a room layout,
* use {@link setLayout}.
*
* @permissions
* - `room.list_available_layouts`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* await room.getLayouts()
* ```
*/
getLayouts(): Rooms.GetLayouts;
/**
* Sets a layout for the room. You can obtain a list of available layouts
* with {@link getLayouts}.
*
* @permissions
* - `room.set_layout`
* - `room.set_position` (if you need to assign positions)
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example Set the 6x6 layout:
* ```typescript
* await room.setLayout({name: "6x6"})
* ```
*/
setLayout(params: Rooms.SetLayoutParams): Rooms.SetLayout;
/**
* Assigns a position in the layout for multiple members.
*
* @permissions
* - `room.set_position`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```js
* await roomSession.setPositions({
* positions: {
* "1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60": "reserved-1",
* "e0c5be44-d6c7-438f-8cda-f859a1a0b1e7": "auto"
* }
* })
* ```
*/
setPositions(params: Rooms.SetPositionsParams): Rooms.SetPositions;
/**
* Assigns a position in the layout to the specified member.
*
* @permissions
* - `room.self.set_position`: to set the position for the local member
* - `room.member.set_position`: to set the position for a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```js
* await roomSession.setMemberPosition({
* memberId: "1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60",
* position: "off-canvas"
* })
* ```
*/
setMemberPosition(params: Rooms.SetMemberPositionParams): Rooms.SetMemberPosition;
/**
* Obtains a list of recordings for the current room session. To download the
* actual mp4 file, please use the [REST
* API](https://developer.signalwire.com/apis/reference/overview).
*
* @permissions
* - `room.recording`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* await room.getRecordings()
* ```
*
* From your server, you can obtain the mp4 file using the [REST API](https://developer.signalwire.com/apis/reference/overview):
* ```typescript
* curl --request GET \
* --url https://<yourspace>.signalwire.com/api/video/room_recordings/<recording_id> \
* --header 'Accept: application/json' \
* --header 'Authorization: Basic <your API token>'
* ```
*/
getRecordings(): Rooms.GetRecordings;
/**
* Starts the recording of the room. You can use the returned
* {@link RoomSessionRecording} object to control the recording (e.g., pause,
* resume, stop).
*
* @permissions
* - `room.recording`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* const rec = await room.startRecording()
* await rec.stop()
* ```
*/
startRecording(): Promise<Rooms.RoomSessionRecording>;
/**
* Obtains a list of recordings for the current room session.
*
* @permissions
* - `room.playback`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @returns The returned objects contain all the properties of a
* {@link RoomSessionPlayback}, but no methods.
*/
getPlaybacks(): Rooms.GetPlaybacks;
/**
* Starts a playback in the room. You can use the returned
* {@link RoomSessionPlayback} object to control the playback (e.g., pause,
* resume, setVolume and stop).
*
* @permissions
* - `room.playback`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```typescript
* const playback = await roomSession.play({ url: 'rtmp://example.com/foo' })
* await playback.stop()
* ```
*/
play(params: Rooms.PlayParams): Promise<Rooms.RoomSessionPlayback>;
/**
* Assigns custom metadata to the RoomSession. You can use this to store
* metadata whose meaning is entirely defined by your application.
*
* Note that calling this method overwrites any metadata that had been
* previously set on this RoomSession.
*
* @param meta The medatada object to assign to the RoomSession.
*
* @permissions
* - `room.set_meta`
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* ```js
* await roomSession.setMeta({ foo: 'bar' })
* ```
*/
setMeta(params: Rooms.SetMetaParams): Rooms.SetMeta;
/**
* Assigns custom metadata to the specified RoomSession member. You can use
* this to store metadata whose meaning is entirely defined by your
* application.
*
* Note that calling this method overwrites any metadata that had been
* previously set on the specified member.
*
* @param params.memberId Id of the member to affect. If omitted, affects the
* default device in the local client.
* @param params.meta The medatada object to assign to the member.
*
* @permissions
* - `room.self.set_meta`: to set the metadata for the local member
* - `room.member.set_meta`: to set the metadata for a remote member
*
* You need to specify the permissions when [creating the Video Room
* Token](https://developer.signalwire.com/apis/reference/create_room_token)
* on the server side.
*
* @example
* Setting metadata for the current member:
* ```js
* await roomSession.setMemberMeta({
* meta: {
* email: 'joe@example.com'
* }
* })
* ```
*
* @example
* Setting metadata for another member:
* ```js
* await roomSession.setMemberMeta({
* memberId: 'de550c0c-3fac-4efd-b06f-b5b8614b8966' // you can get this from getMembers()
* meta: {
* email: 'joe@example.com'
* }
* })
* ```
*/
setMemberMeta(params: Rooms.SetMemberMetaParams): Rooms.SetMemberMeta;
promote(params: Rooms.PromoteMemberParams): Rooms.PromoteMember;
demote(params: Rooms.DemoteMemberParams): Rooms.DemoteMember;
}

@@ -123,3 +661,7 @@ /**

}
export declare type InternalVideoRoomEvent = InternalVideoRoomJoinedEvent;
export interface InternalVideoRoomAudienceCountEvent extends SwEvent {
event_type: ToInternalVideoEvent<RoomAudienceCount>;
params: VideoRoomAudienceCountEventParams;
}
export declare type InternalVideoRoomEvent = InternalVideoRoomJoinedEvent | InternalVideoRoomAudienceCountEvent;
/**

@@ -188,2 +730,14 @@ * ==========

}
/**
* 'video.room.audience_count'
*/
export interface VideoRoomAudienceCountEventParams {
room_id: string;
room_session_id: string;
total: number;
}
export interface VideoRoomAudienceCountEvent extends SwEvent {
event_type: ToInternalVideoEvent<InternalRoomAudienceCount>;
params: VideoRoomAudienceCountEventParams;
}
export declare type VideoRoomEvent = VideoRoomStartedEvent | VideoRoomSubscribedEvent | VideoRoomUpdatedEvent | VideoRoomEndedEvent;

@@ -190,0 +744,0 @@ export declare type VideoRoomEventParams = VideoRoomStartedEventParams | VideoRoomSubscribedEventParams | VideoRoomUpdatedEventParams | VideoRoomEndedEventParams;

@@ -110,10 +110,18 @@ import type { SwEvent } from '.';

}
export interface VoicePlaylistAudioParams extends OmitType<VoiceCallPlayAudioParams> {
}
export interface VoiceCallPlaySilenceMethodParams extends OmitType<VoiceCallPlaySilenceParams> {
}
export interface VoicePlaylistSilenceParams extends OmitType<VoiceCallPlaySilenceParams> {
}
export interface VoiceCallPlayRingtoneMethodParams extends OmitType<VoiceCallPlayRingtoneParams> {
volume?: number;
}
export interface VoicePlaylistRingtoneParams extends OmitType<VoiceCallPlayRingtoneParams> {
}
export interface VoiceCallPlayTTSMethodParams extends OmitType<VoiceCallPlayTTSParams> {
volume?: number;
}
export interface VoicePlaylistTTSParams extends OmitType<VoiceCallPlayTTSParams> {
}
export interface VoiceCallRecordMethodParams {

@@ -148,3 +156,3 @@ audio: {

};
declare type SpeechOrDigits = {
export declare type SpeechOrDigits = {
digits: CollectDigitsConfig;

@@ -177,3 +185,3 @@ speech?: never;

declare type TapCodec = 'OPUS' | 'PCMA' | 'PCMU';
interface TapDeviceWS {
export interface TapDeviceWS {
type: 'ws';

@@ -184,3 +192,3 @@ uri: string;

}
interface TapDeviceRTP {
export interface TapDeviceRTP {
type: 'rtp';

@@ -193,3 +201,3 @@ addr: string;

export declare type TapDevice = TapDeviceWS | TapDeviceRTP;
declare type TapDirection = 'listen' | 'speak' | 'both';
export declare type TapDirection = 'listen' | 'speak' | 'both';
export interface VoiceCallTapMethodParams {

@@ -483,3 +491,3 @@ device: TapDevice;

declare type CallingCallDevice = CallingCallPhoneDevice | CallingCallSIPDevice;
declare type CallingCallDirection = 'inbound' | 'outbound';
export declare type CallingCallDirection = 'inbound' | 'outbound';
export declare type CallingCallState = 'created' | 'ringing' | 'answered' | 'ending' | 'ended';

@@ -486,0 +494,0 @@ interface CallingCall {

@@ -88,3 +88,7 @@ /// <reference types="node" />

}
export interface Authorization {
export declare type MediaAllowed = 'all' | 'audio-only' | 'video-only';
export declare type MediaDirectionAllowed = 'none' | 'receive' | 'both';
declare type AudioAllowed = MediaDirectionAllowed;
declare type VideoAllowed = MediaDirectionAllowed;
export interface VideoAuthorization {
type: 'video';

@@ -102,5 +106,25 @@ project: string;

expires_at?: number;
audio_allowed?: boolean;
video_allowed?: boolean;
media_allowed: MediaAllowed;
audio_allowed: AudioAllowed;
video_allowed: VideoAllowed;
}
export declare type ChatAuthorizationChannels = Record<string, {
read?: boolean;
write?: boolean;
}>;
export interface ChatAuthorization {
type: 'chat';
channels: ChatAuthorizationChannels;
expires_at: number;
member_id: string;
project: string;
project_id: string;
resource: string;
scope_id: string;
scopes: string[];
signature: string;
space_id: string;
ttl: number;
}
export declare type Authorization = VideoAuthorization | ChatAuthorization;
export interface RPCConnectResult {

@@ -130,3 +154,3 @@ identity: string;

*/
export declare type RoomMethod = 'video.room.get' | 'video.rooms.get' | 'video.list_available_layouts' | 'video.hide_video_muted' | 'video.show_video_muted' | 'video.members.get' | 'video.member.audio_mute' | 'video.member.audio_unmute' | 'video.member.video_mute' | 'video.member.video_unmute' | 'video.member.deaf' | 'video.member.undeaf' | 'video.member.set_input_volume' | 'video.member.set_output_volume' | 'video.member.set_input_sensitivity' | 'video.member.set_position' | 'video.member.remove' | 'video.member.set_meta' | 'video.set_meta' | 'video.set_layout' | 'video.set_position' | 'video.recording.list' | 'video.recording.start' | 'video.recording.stop' | 'video.recording.pause' | 'video.recording.resume' | 'video.playback.list' | 'video.playback.start' | 'video.playback.pause' | 'video.playback.resume' | 'video.playback.stop' | 'video.playback.set_volume' | 'video.playback.seek_absolute' | 'video.playback.seek_relative';
export declare type RoomMethod = 'video.room.get' | 'video.rooms.get' | 'video.list_available_layouts' | 'video.hide_video_muted' | 'video.show_video_muted' | 'video.members.get' | 'video.member.audio_mute' | 'video.member.audio_unmute' | 'video.member.video_mute' | 'video.member.video_unmute' | 'video.member.deaf' | 'video.member.undeaf' | 'video.member.set_input_volume' | 'video.member.set_output_volume' | 'video.member.set_input_sensitivity' | 'video.member.set_position' | 'video.member.remove' | 'video.member.set_meta' | 'video.set_meta' | 'video.set_layout' | 'video.set_position' | 'video.recording.list' | 'video.recording.start' | 'video.recording.stop' | 'video.recording.pause' | 'video.recording.resume' | 'video.playback.list' | 'video.playback.start' | 'video.playback.pause' | 'video.playback.resume' | 'video.playback.stop' | 'video.playback.set_volume' | 'video.playback.seek_absolute' | 'video.playback.seek_relative' | 'video.member.demote' | 'video.member.promote';
export interface WebSocketClient {

@@ -187,3 +211,3 @@ addEventListener: WebSocket['addEventListener'];

*/
export declare type EventTransformType = 'roomSession' | 'roomSessionSubscribed' | 'roomSessionMember' | 'roomSessionLayout' | 'roomSessionRecording' | 'roomSessionPlayback' | ChatTransformType | PubSubTransformType | MessagingTransformType | CallingTransformType;
export declare type EventTransformType = 'roomSession' | 'roomSessionSubscribed' | 'roomSessionMember' | 'roomSessionLayout' | 'roomSessionRecording' | 'roomSessionPlayback' | 'roomSessionAudienceCount' | ChatTransformType | PubSubTransformType | MessagingTransformType | CallingTransformType;
export interface NestedFieldToProcess {

@@ -190,0 +214,0 @@ /**

@@ -5,3 +5,4 @@ import { MapToPubSubShape } from '../redux/interfaces';

params?: unknown;
node_id?: string | undefined;
}>(event: T) => MapToPubSubShape<T>;
//# sourceMappingURL=toInternalAction.d.ts.map

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "3.0.2",
"version": "3.0.3-dev.202208111418.4e2284d.0",
"main": "dist/index.node.js",

@@ -9,0 +9,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc