@daily-co/react-native-daily-js 0.52.0 → 0.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ This package introduces some constraints on what OS/SDK versions your project ca
14
14
  Install `react-native-daily-js` along with its peer dependencies:
15
15
 
16
16
  ```bash
17
- npm i @daily-co/react-native-daily-js @react-native-async-storage/async-storage@^1.15.7 react-native-background-timer@^2.3.1
17
+ npm i @daily-co/react-native-daily-js @react-native-async-storage/async-storage@^1.15.7 react-native-background-timer@^2.3.1 react-native-get-random-values@^1.9.0
18
18
  npm i --save-exact @daily-co/react-native-webrtc@111.0.0-daily.2
19
19
  ```
20
20
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import DailyIframe from '../type-overrides/@daily-co/daily-js';
1
+ import Daily from '../type-overrides/@daily-co/daily-js';
2
2
  import DailyMediaView from './DailyMediaView';
3
3
  import 'react-native-url-polyfill/auto';
4
- export default DailyIframe;
4
+ import 'react-native-get-random-values';
5
+ export default Daily;
5
6
  export * from '../type-overrides/@daily-co/daily-js';
6
7
  export { DailyMediaView };
7
8
  export * from '@daily-co/react-native-webrtc';
package/dist/index.js CHANGED
@@ -38,6 +38,9 @@ require("react-native-url-polyfill/auto"); // Applies global URL polyfill
38
38
  var react_native_background_timer_1 = __importDefault(require("react-native-background-timer"));
39
39
  var base_64_1 = require("base-64");
40
40
  var react_native_1 = require("react-native");
41
+ // Preventing RN issue getrandomvalues not supported
42
+ // https://github.com/uuidjs/uuid#getrandomvalues-not-supported
43
+ require("react-native-get-random-values");
41
44
  var DailyNativeUtils = react_native_1.NativeModules.DailyNativeUtils, WebRTCModule = react_native_1.NativeModules.WebRTCModule;
42
45
  var webRTCEventEmitter = new react_native_1.NativeEventEmitter(WebRTCModule);
43
46
  var dailyNativeUtilsEventEmitter = new react_native_1.NativeEventEmitter(DailyNativeUtils);
@@ -134,8 +137,36 @@ function setupGlobals() {
134
137
  systemScreenCaptureStartCallback = listener;
135
138
  }, platform: react_native_1.Platform });
136
139
  }
140
+ function maybeCreatePromiseAnyPolyfill() {
141
+ // Support to Promise.any has only been introduced on RN 0.70.6
142
+ // https://github.com/facebook/react-native/releases/tag/v0.70.6
143
+ // As spec: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any
144
+ // The Promise.any() static method takes an iterable of promises as input and returns a single Promise.
145
+ // This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.
146
+ // It rejects when all of the input's promises reject (including when an empty iterable is passed)
147
+ if (!Promise.any) {
148
+ Promise.any = function (promises) {
149
+ return new Promise(function (resolve, reject) {
150
+ var errors = [];
151
+ promises.forEach(function (promise) {
152
+ return Promise.resolve(promise)
153
+ .then(function (value) {
154
+ resolve(value);
155
+ })
156
+ .catch(function (error) {
157
+ errors.push(error);
158
+ if (errors.length === promises.length) {
159
+ reject(errors);
160
+ }
161
+ });
162
+ });
163
+ });
164
+ };
165
+ }
166
+ }
137
167
  setupEventListeners();
138
168
  setupGlobals();
169
+ maybeCreatePromiseAnyPolyfill();
139
170
  exports.default = daily_js_1.default;
140
171
  __exportStar(require("@daily-co/daily-js"), exports);
141
172
  __exportStar(require("@daily-co/react-native-webrtc"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daily-co/react-native-daily-js",
3
- "version": "0.52.0",
3
+ "version": "0.53.1",
4
4
  "description": "React Native library for making video calls using Daily",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,15 +26,17 @@
26
26
  "baseUrl": "https://github.com/daily-co/react-native-daily-js"
27
27
  },
28
28
  "dependencies": {
29
- "@daily-co/daily-js": "^0.54.0",
29
+ "@daily-co/daily-js": "^0.55.1",
30
30
  "@types/react-native-background-timer": "^2.0.0",
31
31
  "base-64": "^1.0.0",
32
32
  "react-native-url-polyfill": "^1.1.2"
33
33
  },
34
+ "///": "WHEN ONE OF THESE CHANGE, PLEASE UPDATE README.md INSTALL SNIPPET ACCORDINGLY",
34
35
  "peerDependencies": {
35
36
  "@daily-co/react-native-webrtc": "^111.0.0-daily.2",
36
37
  "@react-native-async-storage/async-storage": "^1.15.7",
37
- "react-native-background-timer": "^2.3.1"
38
+ "react-native-background-timer": "^2.3.1",
39
+ "react-native-get-random-values": "^1.9.0"
38
40
  },
39
41
  "devDependencies": {
40
42
  "@daily-co/react-native-webrtc": "^111.0.0-daily.2",
@@ -78,6 +78,7 @@ export type DailyEvent =
78
78
  | 'remote-media-player-stopped'
79
79
  | 'remote-media-player-updated'
80
80
  | 'access-state-updated'
81
+ | 'meeting-session-summary-updated'
81
82
  | 'meeting-session-state-updated'
82
83
  | 'waiting-participant-added'
83
84
  | 'waiting-participant-updated'
@@ -111,6 +112,7 @@ export type DailyFatalErrorType =
111
112
  | 'nbf-token'
112
113
  | 'exp-room'
113
114
  | 'exp-token'
115
+ | 'no-room'
114
116
  | 'meeting-full'
115
117
  | 'end-of-life'
116
118
  | 'not-allowed'
@@ -581,6 +583,10 @@ export interface DailyRoomInfo {
581
583
  dialInPIN?: string;
582
584
  }
583
585
 
586
+ export interface DailyMeetingSessionSummary {
587
+ id: string;
588
+ }
589
+
584
590
  export interface DailyMeetingSessionState {
585
591
  data: unknown;
586
592
  }
@@ -694,9 +700,12 @@ export type DailyFatalError = {
694
700
  export interface DailyFatalConnectionError extends DailyFatalError {
695
701
  type: Extract<DailyFatalErrorType, 'connection-error'>;
696
702
  details: {
697
- on: 'join' | 'reconnect';
703
+ on: 'load' | 'join' | 'reconnect' | 'move';
698
704
  sourceError: Error;
699
705
  uri?: string;
706
+ workerGroup?: string;
707
+ geoGroup?: string;
708
+ bundleUrl?: string;
700
709
  };
701
710
  }
702
711
 
@@ -768,6 +777,11 @@ export interface DailyEventObjectAccessState extends DailyAccessState {
768
777
  action: Extract<DailyEvent, 'access-state-updated'>;
769
778
  }
770
779
 
780
+ export interface DailyEventObjectMeetingSessionSummaryUpdated {
781
+ action: Extract<DailyEvent, 'meeting-session-summary-updated'>;
782
+ meetingSession: DailyMeetingSessionSummary;
783
+ }
784
+
771
785
  export interface DailyEventObjectMeetingSessionStateUpdated {
772
786
  action: Extract<DailyEvent, 'meeting-session-state-updated'>;
773
787
  meetingSessionState: DailyMeetingSessionState;
@@ -878,8 +892,13 @@ export interface DailyEventObjectLiveStreamingStopped {
878
892
 
879
893
  export interface DailyEventObjectTranscriptionStarted {
880
894
  action: Extract<DailyEvent, 'transcription-started'>;
895
+ transcriptId?: string;
881
896
  language: string;
882
897
  model: string;
898
+ tier?: string;
899
+ detect_language?: boolean;
900
+ profanity_filter?: boolean;
901
+ redact?: Array<string> | Array<boolean> | boolean;
883
902
  startedBy: string;
884
903
  }
885
904
 
@@ -1155,7 +1174,7 @@ export interface DailyTranscriptionDeepgramOptions {
1155
1174
  model?: string;
1156
1175
  tier?: string;
1157
1176
  profanity_filter?: boolean;
1158
- redact?: Array<string> | boolean;
1177
+ redact?: Array<string> | Array<boolean> | boolean;
1159
1178
  }
1160
1179
 
1161
1180
  export interface DailyCall {
@@ -1256,6 +1275,7 @@ export interface DailyCall {
1256
1275
  sendAppMessage(data: any, to?: string | string[]): DailyCall;
1257
1276
  setProxyUrl(proxyUrl?: string): DailyCall;
1258
1277
  setIceConfig(iceConfig?: DailyIceConfig): DailyCall;
1278
+ meetingSessionSummary(): DailyMeetingSessionSummary;
1259
1279
  meetingSessionState(): DailyMeetingSessionState;
1260
1280
  setMeetingSessionData(
1261
1281
  data: unknown,
@@ -1284,6 +1304,6 @@ export interface DailyCall {
1284
1304
  };
1285
1305
  }
1286
1306
 
1287
- declare const DailyIframe: DailyCallFactory & DailyCallStaticUtils;
1307
+ declare const Daily: DailyCallFactory & DailyCallStaticUtils;
1288
1308
 
1289
- export default DailyIframe;
1309
+ export default Daily;