@signalwire/realtime-api
Advanced tools
Comparing version 3.0.1-dev.202205241624.4ad0935.0 to 3.0.1
import type { Task } from '@redux-saga/types'; | ||
import { Action } from './redux'; | ||
import { ExecuteParams, BaseComponentOptions, ExecuteExtendedOptions, EventsPrefix, EventTransform, SDKWorker, SDKWorkerDefinition, SessionAuthStatus, AttachSDKWorkerParams, SDKWorkerHooks } from './utils/interfaces'; | ||
import { ExecuteParams, BaseComponentOptions, ExecuteExtendedOptions, EventsPrefix, EventTransform, SDKWorker, SDKWorkerDefinition, SessionAuthStatus, SDKWorkerHooks } from './utils/interfaces'; | ||
import { EventEmitter } from './utils/EventEmitter'; | ||
@@ -77,3 +77,3 @@ import { SDKState } from './redux/interfaces'; | ||
runSaga: <T>(saga: import("@redux-saga/types").Saga<any[]>, args: { | ||
instance: T; /** @internal */ | ||
instance: T; | ||
runSaga: any; | ||
@@ -195,12 +195,2 @@ }) => Task; | ||
protected runWorker<Hooks extends SDKWorkerHooks = SDKWorkerHooks>(name: string, def: SDKWorkerDefinition<Hooks>): void; | ||
/** | ||
* @internal | ||
* @deprecated use {@link runWorker} instead | ||
*/ | ||
protected setWorker(name: string, def: SDKWorkerDefinition): void; | ||
/** | ||
* @internal | ||
* @deprecated use {@link runWorker} instead | ||
*/ | ||
protected attachWorkers(params?: AttachSDKWorkerParams<any>): void; | ||
private _setWorker; | ||
@@ -207,0 +197,0 @@ private _attachWorker; |
@@ -27,2 +27,4 @@ import { SessionOptions } from './utils/interfaces'; | ||
authenticate(): Promise<void>; | ||
retrieveRelayProtocol(): Promise<string>; | ||
persistRelayProtocol(): Promise<void>; | ||
/** | ||
@@ -29,0 +31,0 @@ * Reauthenticate with the SignalWire Network |
@@ -18,6 +18,5 @@ import type { SwEvent, VideoPosition } from '.'; | ||
input_sensitivity: number; | ||
meta: {}; | ||
}; | ||
export declare type InternalVideoMemberUpdatableProps = typeof INTERNAL_MEMBER_UPDATABLE_PROPS; | ||
export declare const INTERNAL_MEMBER_UPDATED_EVENTS: ("video.member.updated.meta" | "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")[]; | ||
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 = { | ||
@@ -46,3 +45,3 @@ [K in keyof InternalVideoMemberUpdatableProps as SnakeToCamelCase<K>]: InternalVideoMemberUpdatableProps[K]; | ||
/** Metadata associated to this member. */ | ||
meta: Record<string, unknown>; | ||
meta?: Record<string, unknown>; | ||
}>; | ||
@@ -49,0 +48,0 @@ export declare const MEMBER_UPDATABLE_PROPS: VideoMemberUpdatableProps; |
@@ -47,3 +47,5 @@ import type { SwEvent } from '.'; | ||
/** Metadata associated to this room session. */ | ||
meta: Record<string, unknown>; | ||
meta?: Record<string, unknown>; | ||
/** List of members that are part of this room session */ | ||
members?: InternalVideoMemberEntity[]; | ||
audioMute(params?: MemberCommandParams): Rooms.AudioMuteMember; | ||
@@ -50,0 +52,0 @@ audioUnmute(params?: MemberCommandParams): Rooms.AudioUnmuteMember; |
@@ -300,3 +300,2 @@ /// <reference types="node" /> | ||
export declare type SDKWorkerParams<T, Hooks extends SDKWorkerHooks = SDKWorkerHooks> = SDKWorkerBaseParams<T> & Hooks; | ||
export declare type AttachSDKWorkerParams<T> = Partial<SDKWorkerBaseParams<T>>; | ||
export declare type SDKWorker<T, Hooks extends SDKWorkerHooks = SDKWorkerHooks> = (params: SDKWorkerParams<T, Hooks>) => SagaIterator<any>; | ||
@@ -303,0 +302,0 @@ export declare type SDKWorkerDefinition<Hooks extends SDKWorkerHooks = SDKWorkerHooks> = { |
@@ -544,5 +544,5 @@ import { BaseComponentOptions, EventTransform, InternalVideoMemberEventNames, Rooms, InternalVideoRoomSessionEventNames, InternalVideoLayoutEventNames, InternalVideoRecordingEventNames, InternalVideoPlaybackEventNames, VideoRoomSessionContract, ConsumerContract, EntityUpdated, VideoMemberEntity, AssertSameType, BaseConsumer, EventEmitter, VideoPosition, VideoPositions } from '@signalwire/core'; | ||
export declare type RoomSessionUpdated = EntityUpdated<RoomSession>; | ||
export interface RoomSessionFullState extends RoomSession { | ||
export interface RoomSessionFullState extends Omit<RoomSession, "members"> { | ||
/** List of members that are part of this room session */ | ||
members: RoomSessionMember[]; | ||
members?: RoomSessionMember[]; | ||
} | ||
@@ -549,0 +549,0 @@ declare class RoomSessionConsumer extends BaseConsumer<RealTimeRoomApiEvents> { |
@@ -172,5 +172,15 @@ import type { VoiceCallContract, SipHeader, EmitterContract, VoicePlaylist, VoiceCallPlaybackContract, VoiceDeviceBuilder, VoiceCallRecordMethodParams, VoiceCallRecordingContract, VoiceCallPromptContract, RingtoneName, VoiceCallTapContract, VoiceCallTapMethodParams, TapDevice, VoiceCallDetectMethodParams, VoiceCallDetectContract, CollectDigitsConfig, CollectSpeechConfig, VoiceCallConnectMethodParams, SipCodec } from '@signalwire/core'; | ||
prompt(params: { | ||
/** Playlist defining the media to play. */ | ||
playlist: VoicePlaylist; | ||
/** Initial timeout in seconds. Default is 4 seconds. */ | ||
initialTimeout?: number; | ||
/** If true, partial result events are fired. Default is false. */ | ||
partialResults?: boolean; | ||
/** Configuration for collecting digits. You must either set this, or `speech`. */ | ||
digits?: CollectDigitsConfig; | ||
/** | ||
* Configuration for collecting speech. You must either set this, or | ||
* `digits`. Pass an empty object to use the default configuration. | ||
*/ | ||
speech?: CollectSpeechConfig; | ||
}): Promise<VoiceCallPromptContract>; | ||
@@ -177,0 +187,0 @@ /** |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "3.0.1-dev.202205241624.4ad0935.0", | ||
"version": "3.0.1", | ||
"main": "dist/index.node.js", | ||
@@ -45,3 +45,3 @@ "exports": { | ||
"dependencies": { | ||
"@signalwire/core": "3.8.1-dev.202205241624.4ad0935.0", | ||
"@signalwire/core": "3.8.1", | ||
"ws": "^8.5.0" | ||
@@ -48,0 +48,0 @@ }, |
# @signalwire/realtime-api | ||
# SignalWire RealTime SDK | ||
# RELAY RealTime SDK | ||
@@ -11,3 +11,3 @@ [![Build Status](https://ci.signalwire.com/api/badges/signalwire/signalwire-js/status.svg)](https://ci.signalwire.com/signalwire/signalwire-js) ![NPM](https://img.shields.io/npm/v/@signalwire/realtime-api.svg?color=brightgreen) | ||
Read the implementation documentation, guides and API Reference at the official [SignalWire RealTime SDK Documentation](https://developer.signalwire.com/client-sdk/docs/getting-started) site. | ||
Read the implementation documentation, guides and API Reference at the official [RELAY RealTime SDK Documentation](https://developer.signalwire.com/client-sdk/docs/getting-started) site. | ||
@@ -14,0 +14,0 @@ --- |
@@ -56,6 +56,5 @@ import { | ||
this.setWorker('messagingWorker', { | ||
this.runWorker('messagingWorker', { | ||
worker: messagingWorker, | ||
}) | ||
this.attachWorkers() | ||
this._attachListeners('') | ||
@@ -62,0 +61,0 @@ } |
@@ -22,6 +22,5 @@ import { | ||
this.setWorker('taskWorker', { | ||
this.runWorker('taskWorker', { | ||
worker: taskWorker, | ||
}) | ||
this.attachWorkers() | ||
this._attachListeners('') | ||
@@ -28,0 +27,0 @@ } |
import { | ||
getLogger, | ||
sagaEffects, | ||
@@ -10,15 +11,21 @@ SagaIterator, | ||
export const taskWorker: SDKWorker<Task> = function* (options): SagaIterator { | ||
getLogger().trace('taskWorker started') | ||
const { channels } = options | ||
const { swEventChannel, pubSubChannel } = channels | ||
const action = yield sagaEffects.take( | ||
swEventChannel, | ||
(action: SDKActions) => { | ||
return action.type === 'queuing.relay.tasks' | ||
} | ||
) | ||
yield sagaEffects.put(pubSubChannel, { | ||
type: 'task.received', | ||
payload: action.payload.message, | ||
}) | ||
while (true) { | ||
const action = yield sagaEffects.take( | ||
swEventChannel, | ||
(action: SDKActions) => { | ||
return action.type === 'queuing.relay.tasks' | ||
} | ||
) | ||
yield sagaEffects.put(pubSubChannel, { | ||
type: 'task.received', | ||
payload: action.payload.message, | ||
}) | ||
} | ||
getLogger().trace('taskWorker ended') | ||
} |
@@ -589,5 +589,5 @@ import { | ||
export type RoomSessionUpdated = EntityUpdated<RoomSession> | ||
export interface RoomSessionFullState extends RoomSession { | ||
export interface RoomSessionFullState extends Omit<RoomSession, "members"> { | ||
/** List of members that are part of this room session */ | ||
members: RoomSessionMember[] | ||
members?: RoomSessionMember[] | ||
} | ||
@@ -610,6 +610,5 @@ | ||
this.debouncedSubscribe = debounce(this.subscribe, 100) | ||
this.setWorker('memberPositionWorker', { | ||
this.runWorker('memberPositionWorker', { | ||
worker: memberPositionWorker, | ||
}) | ||
this.attachWorkers() | ||
} | ||
@@ -616,0 +615,0 @@ |
@@ -223,3 +223,2 @@ import type { | ||
// TODO | ||
/** | ||
@@ -229,5 +228,15 @@ * Generic method to prompt the user for input. Please see {@link promptAudio}, {@link promptRingtone}, {@link promptTTS}. | ||
prompt(params: { | ||
/** Playlist defining the media to play. */ | ||
playlist: VoicePlaylist | ||
/** Initial timeout in seconds. Default is 4 seconds. */ | ||
initialTimeout?: number | ||
/** If true, partial result events are fired. Default is false. */ | ||
partialResults?: boolean | ||
/** Configuration for collecting digits. You must either set this, or `speech`. */ | ||
digits?: CollectDigitsConfig | ||
/** | ||
* Configuration for collecting speech. You must either set this, or | ||
* `digits`. Pass an empty object to use the default configuration. | ||
*/ | ||
speech?: CollectSpeechConfig | ||
}): Promise<VoiceCallPromptContract> | ||
@@ -234,0 +243,0 @@ |
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 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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1692257
27067
0
+ Added@signalwire/core@3.8.1(transitive)
- Removed@signalwire/core@3.8.1-dev.202205241624.4ad0935.0(transitive)
Updated@signalwire/core@3.8.1