diff --git a/package-lock.json b/package-lock.json index dfc8c4d..02b0c0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@daily-co/react-native-daily-js", - "version": "0.67.0", + "version": "0.68.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@daily-co/react-native-daily-js", - "version": "0.67.0", + "version": "0.68.0", "license": "BSD-2-Clause", "dependencies": { - "@daily-co/daily-js": "^0.69.0", + "@daily-co/daily-js": "^0.70.0", "@types/react-native-background-timer": "^2.0.0", "base-64": "^1.0.0", "react-native-url-polyfill": "^1.1.2" @@ -40,9 +40,9 @@ } }, "node_modules/@daily-co/daily-js": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@daily-co/daily-js/-/daily-js-0.69.0.tgz", - "integrity": "sha512-kLG/EBPYZVjwA1TnagCtyCLNHhy3gC9lJyDr8NVNlpOYN2nx/MD8zfHX2sO5EmVSpPLROq3SqooPWJcdDD/bAg==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@daily-co/daily-js/-/daily-js-0.70.0.tgz", + "integrity": "sha512-+a/L5OUusyQ8TTYPC+t2ocZz+RDI9W25+YympkBdvuhqBFov1ry5v9s5u/+U10eFfNaskwXKrA+No9zAy2ebiQ==", "dependencies": { "@babel/runtime": "^7.12.5", "@sentry/browser": "^7.60.1", @@ -425,9 +425,9 @@ } }, "@daily-co/daily-js": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@daily-co/daily-js/-/daily-js-0.69.0.tgz", - "integrity": "sha512-kLG/EBPYZVjwA1TnagCtyCLNHhy3gC9lJyDr8NVNlpOYN2nx/MD8zfHX2sO5EmVSpPLROq3SqooPWJcdDD/bAg==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@daily-co/daily-js/-/daily-js-0.70.0.tgz", + "integrity": "sha512-+a/L5OUusyQ8TTYPC+t2ocZz+RDI9W25+YympkBdvuhqBFov1ry5v9s5u/+U10eFfNaskwXKrA+No9zAy2ebiQ==", "requires": { "@babel/runtime": "^7.12.5", "@sentry/browser": "^7.60.1", diff --git a/package.json b/package.json index 99313d6..f5ec6de 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@daily-co/react-native-daily-js", "private": true, "//": "^ COMMENT OUT 'private: true' BEFORE RUNNING NPM PUBLISH", - "version": "0.67.0", + "version": "0.68.0", "description": "React Native library for making video calls using Daily", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -30,7 +30,7 @@ "baseUrl": "https://github.com/daily-co/react-native-daily-js" }, "dependencies": { - "@daily-co/daily-js": "^0.69.0", + "@daily-co/daily-js": "^0.70.0", "@types/react-native-background-timer": "^2.0.0", "base-64": "^1.0.0", "react-native-url-polyfill": "^1.1.2" diff --git a/type-overrides/@daily-co/daily-js/index.d.ts b/type-overrides/@daily-co/daily-js/index.d.ts index c901faf..5ae63d6 100644 --- a/type-overrides/@daily-co/daily-js/index.d.ts +++ b/type-overrides/@daily-co/daily-js/index.d.ts @@ -69,6 +69,7 @@ export type DailyEvent = | 'active-speaker-change' | 'network-quality-change' | 'network-connection' + | 'test-completed' | 'cpu-load-change' | 'error' | 'nonfatal-error' @@ -423,6 +424,56 @@ export interface DailyStartScreenShare { | DailyScreenVideoSendSettingsPreset; } +export type DailyQualityTestResult = + | 'good' + | 'bad' + | 'warning' + | 'aborted' + | 'failed'; + +export type DailyP2PCallQualityTestResults = + | DailyP2PCallQualityTestStats + | DailyCallQualityTestAborted + | DailyCallQualityTestFailure; + +export interface DailyP2PCallQualityTestStats { + result: Extract; + data: DailyP2PCallQualityTestData; + secondsElapsed: number; +} + +export interface DailyP2PCallQualityTestData { + maxRoundTripTime: number | null; + avgRoundTripTime: number | null; + avgRecvPacketLoss: number | null; + avgAvailableOutgoingBitrate: number | null; + avgSendBitsPerSecond: number | null; + avgRecvBitsPerSecond: number | null; +} + +export interface DailyCallQualityTestAborted { + result: Extract; + secondsElapsed: number; +} + +export interface DailyCallQualityTestFailure { + result: Extract; + errorMsg: string; + error?: DailyFatalErrorObject; + secondsElapsed: number; +} + +export interface DailyWebsocketConnectivityTestResults { + result: 'passed' | 'failed' | 'warning' | 'aborted'; + abortedRegions: string[]; + failedRegions: string[]; + passedRegions: string[]; +} + +export interface DailyNetworkConnectivityTestStats { + result: 'passed' | 'failed' | 'aborted'; +} + export interface DailyNetworkStats { quality: number; stats: { @@ -894,6 +945,15 @@ export interface DailyEventObjectNetworkConnectionEvent sfu_id?: string; } +export interface DailyEventObjectTestCompleted extends DailyEventObjectBase { + action: Extract; + test: 'p2p-call-quality' | 'network-connectivity' | 'websocket-connectivity'; + results: + | DailyP2PCallQualityTestResults + | DailyNetworkConnectivityTestStats + | DailyWebsocketConnectivityTestResults; +} + export interface DailyEventObjectActiveSpeakerChange extends DailyEventObjectBase { action: Extract; @@ -1036,6 +1096,7 @@ export interface DailyEventObjectDialinWarning extends DailyEventObjectBase { export interface DailyEventObjectDialOutConnected extends DailyEventObjectBase { action: Extract; sessionId?: string; + userId?: string; actionTraceId?: string; } @@ -1043,12 +1104,14 @@ export interface DailyEventObjectDialOutError extends DailyEventObjectBase { action: Extract; errorMsg: string; sessionId?: string; + userId?: string; actionTraceId?: string; } export interface DailyEventObjectDialOutStopped extends DailyEventObjectBase { action: Extract; sessionId?: string; + userId?: string; actionTraceId?: string; } @@ -1056,6 +1119,7 @@ export interface DailyEventObjectDialOutWarning extends DailyEventObjectBase { action: Extract; errorMsg: string; sessionId?: string; + userId?: string; actionTraceId?: string; } @@ -1120,6 +1184,8 @@ export type DailyEventObject = ? DailyEventObjectCpuLoadEvent : T extends DailyEventObjectNetworkConnectionEvent['action'] ? DailyEventObjectNetworkConnectionEvent + : T extends DailyEventObjectTestCompleted['action'] + ? DailyEventObjectTestCompleted : T extends DailyEventObjectActiveSpeakerChange['action'] ? DailyEventObjectActiveSpeakerChange : T extends DailyEventObjectReceiveSettingsUpdated['action'] @@ -1371,6 +1437,7 @@ export interface DailyDialOutSession { export interface DailyStartDialoutSipOptions { sipUri?: string; displayName?: string; + userId?: string; video?: boolean; codecs?: DailyDialOutCodecs; } @@ -1378,7 +1445,9 @@ export interface DailyStartDialoutSipOptions { export interface DailyStartDialoutPhoneOptions { phoneNumber?: string; displayName?: string; + userId?: string; codecs?: DailyDialOutCodecs; + callerId?: string; } export type DailyStartDialoutOptions = @@ -1485,6 +1554,17 @@ export interface DailyCall { load(properties?: DailyLoadOptions): Promise; startScreenShare(properties?: DailyStartScreenShare): void; stopScreenShare(): void; + testPeerToPeerCallQuality(options: { + videoTrack: MediaStreamTrack; + duration?: number; + }): Promise; + stopTestPeerToPeerCallQuality(): void; + testWebsocketConnectivity(): Promise; + abortTestWebsocketConnectivity(): void; + testNetworkConnectivity( + videoTrack: MediaStreamTrack + ): Promise; + abortTestNetworkConnectivity(): void; getNetworkStats(): Promise; getCpuLoadStats(): Promise; updateSendSettings(settings: DailySendSettings): Promise;