Skip to content

Commit

Permalink
Add missing getters to CallRecording (#834)
Browse files Browse the repository at this point in the history
* review CallRecording

* add record getter to CallRecording

* changeset
  • Loading branch information
Edoardo Gallo authored Jul 21, 2023
1 parent 070ada8 commit 81beb29
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-dryers-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@signalwire/core': patch
---

Update internal interfaces contracts to have better type checking
5 changes: 5 additions & 0 deletions .changeset/tough-papayas-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@signalwire/realtime-api': patch
---

Add missing CallRecording getters.
34 changes: 18 additions & 16 deletions packages/core/src/types/voiceCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,15 @@ export interface VoiceCallRecordingContract {
/** @ignore */
readonly controlId: string
/** @ignore */
readonly state?: CallingCallRecordState
readonly state: CallingCallRecordState | undefined
/** @ignore */
readonly url?: string
readonly url: string | undefined
/** @ignore */
readonly size?: number
readonly size: number | undefined
/** @ignore */
readonly duration?: number
readonly duration: number | undefined
/** @ignore */
readonly record: CallingCallRecordEventParams['record'] | undefined

stop(): Promise<this>
ended(): Promise<this>
Expand Down Expand Up @@ -552,12 +554,12 @@ export interface VoiceCallPromptContract {

readonly type?: CallingCallCollectResult['type']
/** Alias for type in case of errors */
readonly reason?: string
readonly digits?: string
readonly speech?: string
readonly terminator?: string
readonly text?: string
readonly confidence?: number
readonly reason: string | undefined
readonly digits: string | undefined
readonly speech: string | undefined
readonly terminator: string | undefined
readonly text: string | undefined
readonly confidence: number | undefined

stop(): Promise<this>
setVolume(volume: number): Promise<this>
Expand Down Expand Up @@ -592,12 +594,12 @@ export interface VoiceCallCollectContract {

readonly type?: CallingCallCollectResult['type']
/** Alias for type in case of errors */
readonly reason?: string
readonly digits?: string
readonly speech?: string
readonly terminator?: string
readonly text?: string
readonly confidence?: number
readonly reason: string | undefined
readonly digits: string | undefined
readonly speech: string | undefined
readonly terminator: string | undefined
readonly text: string | undefined
readonly confidence: number | undefined

stop(): Promise<this>
startInputTimers(): Promise<this>
Expand Down
16 changes: 16 additions & 0 deletions packages/realtime-api/src/voice/CallRecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ export class CallRecordingAPI
return this._payload?.state
}

get url() {
return this._payload?.url
}

get size() {
return this._payload?.size
}

get duration() {
return this._payload?.duration
}

get record() {
return this._payload?.record
}

/** @internal */
protected setPayload(payload: CallingCallRecordEventParams) {
this._payload = payload
Expand Down

0 comments on commit 81beb29

Please sign in to comment.