@signalwire/js
Advanced tools
Comparing version 3.28.0-dev.202407151509.db072e4.0 to 3.28.0-dev.202407151536.7130138.0
import { SwEvent } from '..'; | ||
export declare type ConversationMessageEventName = 'conversation.message'; | ||
export declare type ConversationMessageType = 'message'; | ||
export interface ConversationMessageEventParams { | ||
@@ -15,3 +14,3 @@ conversation_id: string; | ||
ts: number; | ||
type: ConversationMessageType; | ||
type: string; | ||
user_id: string; | ||
@@ -18,0 +17,0 @@ user_name: string; |
@@ -13,6 +13,2 @@ import { BaseComponentOptions, VideoMemberEntity, Rooms, BaseRPCResult } from '@signalwire/core'; | ||
private _lastLayoutEvent; | ||
protected initWorker(): void; | ||
start(): Promise<void>; | ||
/** @internal */ | ||
resume(): Promise<void>; | ||
get selfMember(): Rooms.RoomSessionMember; | ||
@@ -24,2 +20,6 @@ get targetMember(): Rooms.RoomSessionMember; | ||
private executeAction; | ||
protected initWorker(): void; | ||
start(): Promise<void>; | ||
/** @internal */ | ||
resume(): Promise<void>; | ||
audioMute(params: Rooms.RoomMemberMethodParams): Promise<BaseRPCResult>; | ||
@@ -26,0 +26,0 @@ audioUnmute(params: Rooms.RoomMemberMethodParams): Promise<BaseRPCResult>; |
@@ -1,2 +0,2 @@ | ||
import type { ConversationEventParams, ConversationMessageType, UserOptions } from '@signalwire/core'; | ||
import type { ConversationEventParams, UserOptions } from '@signalwire/core'; | ||
import { HTTPClient } from './HTTPClient'; | ||
@@ -217,3 +217,3 @@ import { WSClient } from './WSClient'; | ||
details: Record<string, any>; | ||
type: ConversationMessageType; | ||
type: string; | ||
subtype: string; | ||
@@ -220,0 +220,0 @@ kind?: string; |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "3.28.0-dev.202407151509.db072e4.0", | ||
"version": "3.28.0-dev.202407151536.7130138.0", | ||
"main": "dist/index.js", | ||
@@ -43,4 +43,4 @@ "module": "dist/index.esm.js", | ||
"dependencies": { | ||
"@signalwire/core": "4.2.0-dev.202407151509.db072e4.0", | ||
"@signalwire/webrtc": "3.12.2-dev.202407151509.db072e4.0", | ||
"@signalwire/core": "4.2.0-dev.202407151536.7130138.0", | ||
"@signalwire/webrtc": "3.12.2-dev.202407151536.7130138.0", | ||
"jwt-decode": "^3.1.2" | ||
@@ -47,0 +47,0 @@ }, |
@@ -47,41 +47,2 @@ import { | ||
protected initWorker() { | ||
/** | ||
* The unified eventing or CallFabric worker creates/stores member instances in the instance map | ||
* For now, the member instances are only required in the CallFabric SDK | ||
* It also handles `call.*` events | ||
*/ | ||
this.runWorker('callFabricWorker', { | ||
worker: callFabricWorker, | ||
}) | ||
} | ||
start() { | ||
return new Promise<void>(async (resolve, reject) => { | ||
try { | ||
this.once('room.subscribed', () => resolve()) | ||
await this.join() | ||
} catch (error) { | ||
this.logger.error('WSClient call start', error) | ||
reject(error) | ||
} | ||
}) | ||
} | ||
/** @internal */ | ||
override async resume() { | ||
this.logger.warn(`[resume] Call ${this.id}`) | ||
if (this.peer?.instance) { | ||
const { connectionState } = this.peer.instance | ||
this.logger.debug( | ||
`[resume] connectionState for ${this.id} is '${connectionState}'` | ||
) | ||
if (['closed', 'failed', 'disconnected'].includes(connectionState)) { | ||
this.resuming = true | ||
this.peer.restartIce() | ||
} | ||
} | ||
} | ||
get selfMember() { | ||
@@ -157,3 +118,42 @@ return this.callSegments[0]?.member | ||
audioMute(params: Rooms.RoomMemberMethodParams) { | ||
protected override initWorker() { | ||
/** | ||
* The unified eventing or CallFabric worker creates/stores member instances in the instance map | ||
* For now, the member instances are only required in the CallFabric SDK | ||
* It also handles `call.*` events | ||
*/ | ||
this.runWorker('callFabricWorker', { | ||
worker: callFabricWorker, | ||
}) | ||
} | ||
public start() { | ||
return new Promise<void>(async (resolve, reject) => { | ||
try { | ||
this.once('room.subscribed', () => resolve()) | ||
await this.join() | ||
} catch (error) { | ||
this.logger.error('WSClient call start', error) | ||
reject(error) | ||
} | ||
}) | ||
} | ||
/** @internal */ | ||
public override async resume() { | ||
this.logger.warn(`[resume] Call ${this.id}`) | ||
if (this.peer?.instance) { | ||
const { connectionState } = this.peer.instance | ||
this.logger.debug( | ||
`[resume] connectionState for ${this.id} is '${connectionState}'` | ||
) | ||
if (['closed', 'failed', 'disconnected'].includes(connectionState)) { | ||
this.resuming = true | ||
this.peer.restartIce() | ||
} | ||
} | ||
} | ||
public audioMute(params: Rooms.RoomMemberMethodParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -166,3 +166,3 @@ method: 'call.mute', | ||
audioUnmute(params: Rooms.RoomMemberMethodParams) { | ||
public audioUnmute(params: Rooms.RoomMemberMethodParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -175,3 +175,3 @@ method: 'call.unmute', | ||
videoMute(params: Rooms.RoomMemberMethodParams) { | ||
public videoMute(params: Rooms.RoomMemberMethodParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -184,3 +184,3 @@ method: 'call.mute', | ||
videoUnmute(params: Rooms.RoomMemberMethodParams) { | ||
public videoUnmute(params: Rooms.RoomMemberMethodParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -193,3 +193,3 @@ method: 'call.unmute', | ||
deaf(params: Rooms.RoomMemberMethodParams) { | ||
public deaf(params: Rooms.RoomMemberMethodParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -201,3 +201,3 @@ method: 'call.deaf', | ||
undeaf(params: Rooms.RoomMemberMethodParams) { | ||
public undeaf(params: Rooms.RoomMemberMethodParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -209,3 +209,3 @@ method: 'call.undeaf', | ||
getLayouts() { | ||
public getLayouts() { | ||
return this.executeAction<{ layouts: string[] }>( | ||
@@ -223,3 +223,3 @@ { | ||
getMembers() { | ||
public getMembers() { | ||
return this.executeAction<{ members: VideoMemberEntity[] }>( | ||
@@ -237,3 +237,3 @@ { | ||
removeMember(params: Required<Rooms.RoomMemberMethodParams>) { | ||
public removeMember(params: Required<Rooms.RoomMemberMethodParams>) { | ||
if (!params?.memberId) { | ||
@@ -248,3 +248,3 @@ throw new TypeError('Invalid or missing "memberId" argument') | ||
setLayout(params: { name: string }) { | ||
public setLayout(params: { name: string }) { | ||
const extraParams = { | ||
@@ -259,3 +259,3 @@ layout: params?.name, | ||
setInputVolume(params: MemberCommandWithVolumeParams) { | ||
public setInputVolume(params: MemberCommandWithVolumeParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -270,3 +270,3 @@ method: 'call.microphone.volume.set', | ||
setOutputVolume(params: MemberCommandWithVolumeParams) { | ||
public setOutputVolume(params: MemberCommandWithVolumeParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -281,3 +281,3 @@ method: 'video.member.set_output_volume', | ||
setInputSensitivity(params: MemberCommandWithValueParams) { | ||
public setInputSensitivity(params: MemberCommandWithValueParams) { | ||
return this.executeAction<BaseRPCResult>({ | ||
@@ -284,0 +284,0 @@ method: 'call.microphone.sensitivity.set', |
@@ -1,6 +0,2 @@ | ||
import type { | ||
ConversationEventParams, | ||
ConversationMessageType, | ||
UserOptions, | ||
} from '@signalwire/core' | ||
import type { ConversationEventParams, UserOptions } from '@signalwire/core' | ||
import { HTTPClient } from './HTTPClient' | ||
@@ -266,3 +262,3 @@ import { WSClient } from './WSClient' | ||
details: Record<string, any> | ||
type: ConversationMessageType | ||
type: string | ||
subtype: string | ||
@@ -269,0 +265,0 @@ kind?: string |
@@ -65,3 +65,3 @@ import { | ||
roomSessionId: action.payload.room_session_id, | ||
memberId: member.id, | ||
memberId: member.id || member.member_id, | ||
}) | ||
@@ -68,0 +68,0 @@ ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3061864
30710
+ Added@signalwire/core@4.2.0-dev.202407151536.7130138.0(transitive)
+ Added@signalwire/webrtc@3.12.2-dev.202407151536.7130138.0(transitive)
- Removed@signalwire/core@4.2.0-dev.202407151509.db072e4.0(transitive)
- Removed@signalwire/webrtc@3.12.2-dev.202407151509.db072e4.0(transitive)