voice-react-native-sdk 1.6.2-fork.17 → 1.6.2-fork.18

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.
Files changed (92) hide show
  1. package/lib/commonjs/AudioDevice.js +35 -27
  2. package/lib/commonjs/AudioDevice.js.map +1 -1
  3. package/lib/commonjs/Call.js +191 -270
  4. package/lib/commonjs/Call.js.map +1 -1
  5. package/lib/commonjs/CallInvite.js +121 -125
  6. package/lib/commonjs/CallInvite.js.map +1 -1
  7. package/lib/commonjs/CallMessage/CallMessage.js +7 -6
  8. package/lib/commonjs/CallMessage/CallMessage.js.map +1 -1
  9. package/lib/commonjs/CallMessage/IncomingCallMessage.js +40 -28
  10. package/lib/commonjs/CallMessage/IncomingCallMessage.js.map +1 -1
  11. package/lib/commonjs/CallMessage/OutgoingCallMessage.js +43 -56
  12. package/lib/commonjs/CallMessage/OutgoingCallMessage.js.map +1 -1
  13. package/lib/commonjs/Voice.js +106 -122
  14. package/lib/commonjs/Voice.js.map +1 -1
  15. package/lib/commonjs/common.js +13 -6
  16. package/lib/commonjs/common.js.map +1 -1
  17. package/lib/commonjs/constants.js +5 -27
  18. package/lib/commonjs/constants.js.map +1 -1
  19. package/lib/commonjs/error/InvalidArgumentError.js +9 -3
  20. package/lib/commonjs/error/InvalidArgumentError.js.map +1 -1
  21. package/lib/commonjs/error/InvalidStateError.js +9 -3
  22. package/lib/commonjs/error/InvalidStateError.js.map +1 -1
  23. package/lib/commonjs/error/TwilioError.js +11 -3
  24. package/lib/commonjs/error/TwilioError.js.map +1 -1
  25. package/lib/commonjs/error/UnsupportedPlatformError.js +9 -3
  26. package/lib/commonjs/error/UnsupportedPlatformError.js.map +1 -1
  27. package/lib/commonjs/error/generated.js +1547 -836
  28. package/lib/commonjs/error/generated.js.map +1 -1
  29. package/lib/commonjs/error/index.js +33 -28
  30. package/lib/commonjs/error/index.js.map +1 -1
  31. package/lib/commonjs/error/utility.js +7 -0
  32. package/lib/commonjs/error/utility.js.map +1 -1
  33. package/lib/commonjs/index.js +32 -17
  34. package/lib/commonjs/index.js.map +1 -1
  35. package/lib/commonjs/type/AudioDevice.js.map +1 -1
  36. package/lib/commonjs/type/Call.js.map +1 -1
  37. package/lib/commonjs/type/CallInvite.js.map +1 -1
  38. package/lib/commonjs/type/CallKit.js +9 -17
  39. package/lib/commonjs/type/CallKit.js.map +1 -1
  40. package/lib/commonjs/type/CallMessage.js.map +1 -1
  41. package/lib/commonjs/type/Error.js.map +1 -1
  42. package/lib/commonjs/type/NativeModule.js.map +1 -1
  43. package/lib/commonjs/type/RTCStats.js +9 -8
  44. package/lib/commonjs/type/RTCStats.js.map +1 -1
  45. package/lib/commonjs/type/Voice.js.map +1 -1
  46. package/lib/commonjs/type/common.js.map +1 -1
  47. package/lib/module/AudioDevice.js +32 -23
  48. package/lib/module/AudioDevice.js.map +1 -1
  49. package/lib/module/Call.js +180 -254
  50. package/lib/module/Call.js.map +1 -1
  51. package/lib/module/CallInvite.js +107 -109
  52. package/lib/module/CallInvite.js.map +1 -1
  53. package/lib/module/CallMessage/CallMessage.js +5 -2
  54. package/lib/module/CallMessage/CallMessage.js.map +1 -1
  55. package/lib/module/CallMessage/IncomingCallMessage.js +37 -25
  56. package/lib/module/CallMessage/IncomingCallMessage.js.map +1 -1
  57. package/lib/module/CallMessage/OutgoingCallMessage.js +36 -39
  58. package/lib/module/CallMessage/OutgoingCallMessage.js.map +1 -1
  59. package/lib/module/Voice.js +94 -119
  60. package/lib/module/Voice.js.map +1 -1
  61. package/lib/module/common.js +0 -1
  62. package/lib/module/common.js.map +1 -1
  63. package/lib/module/constants.js +4 -27
  64. package/lib/module/constants.js.map +1 -1
  65. package/lib/module/error/InvalidArgumentError.js +7 -4
  66. package/lib/module/error/InvalidArgumentError.js.map +1 -1
  67. package/lib/module/error/InvalidStateError.js +7 -4
  68. package/lib/module/error/InvalidStateError.js.map +1 -1
  69. package/lib/module/error/TwilioError.js +9 -3
  70. package/lib/module/error/TwilioError.js.map +1 -1
  71. package/lib/module/error/UnsupportedPlatformError.js +7 -4
  72. package/lib/module/error/UnsupportedPlatformError.js.map +1 -1
  73. package/lib/module/error/generated.js +1518 -831
  74. package/lib/module/error/generated.js.map +1 -1
  75. package/lib/module/error/index.js.map +1 -1
  76. package/lib/module/error/utility.js +3 -1
  77. package/lib/module/error/utility.js.map +1 -1
  78. package/lib/module/index.js +0 -1
  79. package/lib/module/index.js.map +1 -1
  80. package/lib/module/type/AudioDevice.js.map +1 -1
  81. package/lib/module/type/Call.js.map +1 -1
  82. package/lib/module/type/CallInvite.js.map +1 -1
  83. package/lib/module/type/CallKit.js +6 -16
  84. package/lib/module/type/CallKit.js.map +1 -1
  85. package/lib/module/type/CallMessage.js.map +1 -1
  86. package/lib/module/type/Error.js.map +1 -1
  87. package/lib/module/type/NativeModule.js.map +1 -1
  88. package/lib/module/type/RTCStats.js +6 -7
  89. package/lib/module/type/RTCStats.js.map +1 -1
  90. package/lib/module/type/Voice.js.map +1 -1
  91. package/lib/module/type/common.js.map +1 -1
  92. package/package.json +2 -3
@@ -4,15 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.AudioDevice = void 0;
7
+
7
8
  var _common = require("./common");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
11
- * Copyright © 2022 Twilio, Inc. All rights reserved. Licensed under the Twilio
12
- * license.
13
- *
14
- * See LICENSE in the project root for license information.
15
- */
9
+
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
16
12
  /**
17
13
  * Describes audio devices as reported by the native layer and allows the
18
14
  * native selection of the described audio device.
@@ -27,6 +23,21 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
27
23
  * @public
28
24
  */
29
25
  class AudioDevice {
26
+ /**
27
+ * The native-UUID of this object. This is generated by the native layer and
28
+ * is used to associate functionality between the JS and native layers.
29
+ *
30
+ * @internal
31
+ */
32
+
33
+ /**
34
+ * The type of the audio device.
35
+ */
36
+
37
+ /**
38
+ * The name of the audio device.
39
+ */
40
+
30
41
  /**
31
42
  * Audio device class constructor.
32
43
  * @param audioDeviceInformation - A record describing an audio device.
@@ -38,26 +49,16 @@ class AudioDevice {
38
49
  type,
39
50
  name
40
51
  }) {
41
- /**
42
- * The native-UUID of this object. This is generated by the native layer and
43
- * is used to associate functionality between the JS and native layers.
44
- *
45
- * @internal
46
- */
47
52
  _defineProperty(this, "uuid", void 0);
48
- /**
49
- * The type of the audio device.
50
- */
53
+
51
54
  _defineProperty(this, "type", void 0);
52
- /**
53
- * The name of the audio device.
54
- */
55
+
55
56
  _defineProperty(this, "name", void 0);
57
+
56
58
  this.uuid = uuid;
57
59
  this.type = type;
58
60
  this.name = name;
59
61
  }
60
-
61
62
  /**
62
63
  * Calling this method will select this audio device as the active audio
63
64
  * device.
@@ -67,11 +68,13 @@ class AudioDevice {
67
68
  * selected as the active audio device.
68
69
  * - Rejects if the audio device cannot be selected.
69
70
  */
71
+
72
+
70
73
  select() {
71
74
  return _common.NativeModule.voice_selectAudioDevice(this.uuid);
72
75
  }
73
- }
74
76
 
77
+ }
75
78
  /**
76
79
  * Contains interfaces and enumerations associated with audio devices.
77
80
  *
@@ -80,14 +83,19 @@ class AudioDevice {
80
83
  *
81
84
  * @public
82
85
  */
86
+
87
+
83
88
  exports.AudioDevice = AudioDevice;
84
- (function (_AudioDevice2) {
85
- let Type = /*#__PURE__*/function (Type) {
89
+
90
+ (function (_AudioDevice) {
91
+ let Type;
92
+
93
+ (function (Type) {
86
94
  Type["Earpiece"] = "earpiece";
87
95
  Type["Speaker"] = "speaker";
88
96
  Type["Bluetooth"] = "bluetooth";
89
- return Type;
90
- }({});
91
- _AudioDevice2.Type = Type;
97
+ })(Type || (Type = {}));
98
+
99
+ _AudioDevice.Type = Type;
92
100
  })(AudioDevice || (exports.AudioDevice = AudioDevice = {}));
93
101
  //# sourceMappingURL=AudioDevice.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","AudioDevice","constructor","uuid","type","name","select","NativeModule","voice_selectAudioDevice","exports","_AudioDevice2","Type"],"sources":["AudioDevice.tsx"],"sourcesContent":["/**\n * Copyright © 2022 Twilio, Inc. All rights reserved. Licensed under the Twilio\n * license.\n *\n * See LICENSE in the project root for license information.\n */\n\nimport { NativeModule } from './common';\nimport type { NativeAudioDeviceInfo } from './type/AudioDevice';\nimport type { Uuid } from './type/common';\n\n/**\n * Describes audio devices as reported by the native layer and allows the\n * native selection of the described audio device.\n *\n * @remarks\n * To fetch a list of available audio devices and the currently selected audio\n * device, see {@link (Voice:class).getAudioDevices}.\n *\n * - See also the {@link (AudioDevice:namespace) | AudioDevice namespace} for\n * types used by this class.\n *\n * @public\n */\nexport class AudioDevice {\n /**\n * The native-UUID of this object. This is generated by the native layer and\n * is used to associate functionality between the JS and native layers.\n *\n * @internal\n */\n uuid: Uuid;\n\n /**\n * The type of the audio device.\n */\n type: AudioDevice.Type;\n\n /**\n * The name of the audio device.\n */\n name: string;\n\n /**\n * Audio device class constructor.\n * @param audioDeviceInformation - A record describing an audio device.\n *\n * @internal\n */\n constructor({ uuid, type, name }: NativeAudioDeviceInfo) {\n this.uuid = uuid;\n this.type = type;\n this.name = name;\n }\n\n /**\n * Calling this method will select this audio device as the active audio\n * device.\n * @returns\n * A `Promise` that\n * - Resolves with `void` when the audio device has been successfully\n * selected as the active audio device.\n * - Rejects if the audio device cannot be selected.\n */\n select(): Promise<void> {\n return NativeModule.voice_selectAudioDevice(this.uuid);\n }\n}\n\n/**\n * Contains interfaces and enumerations associated with audio devices.\n *\n * @remarks\n * - See also the {@link (AudioDevice:class) | AudioDevice class}.\n *\n * @public\n */\nexport namespace AudioDevice {\n /**\n * Audio device type enumeration. Describes all possible audio device types as\n * reportable by the native layer.\n */\n export enum Type {\n Earpiece = 'earpiece',\n Speaker = 'speaker',\n Bluetooth = 'bluetooth',\n }\n}\n"],"mappings":";;;;;;AAOA,IAAAA,OAAA,GAAAC,OAAA;AAAwC,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA,KAPxC;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMgB,WAAW,CAAC;EAmBvB;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAAC;IAAEC,IAAI;IAAEC,IAAI;IAAEC;EAA4B,CAAC,EAAE;IAxBzD;AACF;AACA;AACA;AACA;AACA;IALEvB,eAAA;IAQA;AACF;AACA;IAFEA,eAAA;IAKA;AACF;AACA;IAFEA,eAAA;IAYE,IAAI,CAACqB,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,MAAMA,CAAA,EAAkB;IACtB,OAAOC,oBAAY,CAACC,uBAAuB,CAAC,IAAI,CAACL,IAAI,CAAC;EACxD;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAM,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAAA,WAAAS,aAAA;EAAA,IAacC,IAAI,0BAAJA,IAAI;IAAJA,IAAI;IAAJA,IAAI;IAAJA,IAAI;IAAA,OAAJA,IAAI;EAAA;EAAAD,aAAA,CAAAC,IAAA,GAAAA,IAAA;AAAA,GALDV,WAAW,KAAAQ,OAAA,CAAAR,WAAA,GAAXA,WAAW","ignoreList":[]}
1
+ {"version":3,"sources":["AudioDevice.tsx"],"names":["AudioDevice","constructor","uuid","type","name","select","NativeModule","voice_selectAudioDevice","Type"],"mappings":";;;;;;;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAN,CAAkB;AACvB;AACF;AACA;AACA;AACA;AACA;;AAGE;AACF;AACA;;AAGE;AACF;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,WAAW,CAAC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,GAAD,EAA8C;AAAA;;AAAA;;AAAA;;AACvD,SAAKF,IAAL,GAAYA,IAAZ;AACA,SAAKC,IAAL,GAAYA,IAAZ;AACA,SAAKC,IAAL,GAAYA,IAAZ;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACEC,EAAAA,MAAM,GAAkB;AACtB,WAAOC,qBAAaC,uBAAb,CAAqC,KAAKL,IAA1C,CAAP;AACD;;AA1CsB;AA6CzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;MAMcM,I;;aAAAA,I;AAAAA,IAAAA,I;AAAAA,IAAAA,I;AAAAA,IAAAA,I;KAAAA,I,KAAAA,I;;;GALGR,W,2BAAAA,W","sourcesContent":["/**\n * Copyright © 2022 Twilio, Inc. All rights reserved. Licensed under the Twilio\n * license.\n *\n * See LICENSE in the project root for license information.\n */\n\nimport { NativeModule } from './common';\nimport type { NativeAudioDeviceInfo } from './type/AudioDevice';\nimport type { Uuid } from './type/common';\n\n/**\n * Describes audio devices as reported by the native layer and allows the\n * native selection of the described audio device.\n *\n * @remarks\n * To fetch a list of available audio devices and the currently selected audio\n * device, see {@link (Voice:class).getAudioDevices}.\n *\n * - See also the {@link (AudioDevice:namespace) | AudioDevice namespace} for\n * types used by this class.\n *\n * @public\n */\nexport class AudioDevice {\n /**\n * The native-UUID of this object. This is generated by the native layer and\n * is used to associate functionality between the JS and native layers.\n *\n * @internal\n */\n uuid: Uuid;\n\n /**\n * The type of the audio device.\n */\n type: AudioDevice.Type;\n\n /**\n * The name of the audio device.\n */\n name: string;\n\n /**\n * Audio device class constructor.\n * @param audioDeviceInformation - A record describing an audio device.\n *\n * @internal\n */\n constructor({ uuid, type, name }: NativeAudioDeviceInfo) {\n this.uuid = uuid;\n this.type = type;\n this.name = name;\n }\n\n /**\n * Calling this method will select this audio device as the active audio\n * device.\n * @returns\n * A `Promise` that\n * - Resolves with `void` when the audio device has been successfully\n * selected as the active audio device.\n * - Rejects if the audio device cannot be selected.\n */\n select(): Promise<void> {\n return NativeModule.voice_selectAudioDevice(this.uuid);\n }\n}\n\n/**\n * Contains interfaces and enumerations associated with audio devices.\n *\n * @remarks\n * - See also the {@link (AudioDevice:class) | AudioDevice class}.\n *\n * @public\n */\nexport namespace AudioDevice {\n /**\n * Audio device type enumeration. Describes all possible audio device types as\n * reportable by the native layer.\n */\n export enum Type {\n Earpiece = 'earpiece',\n Speaker = 'speaker',\n Bluetooth = 'bluetooth',\n }\n}\n"]}