@kaleyra/video-react-native-module 1.0.0

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 (271) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +292 -0
  3. package/android/build.gradle +100 -0
  4. package/android/gradle.properties +9 -0
  5. package/android/settings.gradle +6 -0
  6. package/android/src/main/AndroidManifest.xml +1 -0
  7. package/android/src/main/assets/kaleyra_video_wrapper_info.txt +1 -0
  8. package/android/src/main/java/com/kaleyra/video_react_native_module/ReactNativeAccessTokenProvider.kt +22 -0
  9. package/android/src/main/java/com/kaleyra/video_react_native_module/ReactNativeContextContainer.kt +9 -0
  10. package/android/src/main/java/com/kaleyra/video_react_native_module/ReactNativeVideoHybridBridge.kt +30 -0
  11. package/android/src/main/java/com/kaleyra/video_react_native_module/VideoNativeEmitter.kt +45 -0
  12. package/android/src/main/java/com/kaleyra/video_react_native_module/VideoNativeModule.kt +109 -0
  13. package/android/src/main/java/com/kaleyra/video_react_native_module/VideoReactPackage.kt +20 -0
  14. package/index.ts +47 -0
  15. package/ios/PluginInfo/_KaleyraVideoHybridVersionInfo.swift +31 -0
  16. package/ios/ReactEvents/ReactNativeEventEmitter.swift +31 -0
  17. package/ios/ReactEvents/VideoNativeEmitter.m +17 -0
  18. package/ios/ReactEvents/VideoNativeEmitter.swift +42 -0
  19. package/ios/ReactNativePlugin-Bridging-Header.h +5 -0
  20. package/ios/ReactNativePlugin.xcodeproj/project.pbxproj +301 -0
  21. package/ios/VideoNativeModule.m +45 -0
  22. package/ios/VideoNativeModule.swift +154 -0
  23. package/lib/commonjs/index.js +12 -0
  24. package/lib/commonjs/native-bridge/TypeScript/Environments.js +41 -0
  25. package/lib/commonjs/native-bridge/TypeScript/Events.js +46 -0
  26. package/lib/commonjs/native-bridge/TypeScript/Regions.js +47 -0
  27. package/lib/commonjs/native-bridge/TypeScript/UserDetailsFormatValidator.js +32 -0
  28. package/lib/commonjs/native-bridge/TypeScript/errors/IllegalArgumentError.js +12 -0
  29. package/lib/commonjs/native-bridge/TypeScript/types/AccessTokenRequest.js +4 -0
  30. package/lib/commonjs/native-bridge/TypeScript/types/AccessTokenResponse.js +36 -0
  31. package/lib/commonjs/native-bridge/TypeScript/types/AudioCallOptions.js +4 -0
  32. package/lib/commonjs/native-bridge/TypeScript/types/AudioCallType.js +19 -0
  33. package/lib/commonjs/native-bridge/TypeScript/types/CallDisplayMode.js +23 -0
  34. package/lib/commonjs/native-bridge/TypeScript/types/CallKitConfiguration.js +4 -0
  35. package/lib/commonjs/native-bridge/TypeScript/types/CallOptions.js +4 -0
  36. package/lib/commonjs/native-bridge/TypeScript/types/CallType.js +23 -0
  37. package/lib/commonjs/native-bridge/TypeScript/types/ChatToolConfiguration.js +4 -0
  38. package/lib/commonjs/native-bridge/TypeScript/types/CreateCallOptions.js +4 -0
  39. package/lib/commonjs/native-bridge/TypeScript/types/Environment.js +4 -0
  40. package/lib/commonjs/native-bridge/TypeScript/types/IosConfiguration.js +4 -0
  41. package/lib/commonjs/native-bridge/TypeScript/types/KaleyraVideoConfiguration.js +4 -0
  42. package/lib/commonjs/native-bridge/TypeScript/types/RecordingType.js +23 -0
  43. package/lib/commonjs/native-bridge/TypeScript/types/Region.js +4 -0
  44. package/lib/commonjs/native-bridge/TypeScript/types/ScreenShareToolConfiguration.js +4 -0
  45. package/lib/commonjs/native-bridge/TypeScript/types/Session.js +4 -0
  46. package/lib/commonjs/native-bridge/TypeScript/types/Tools.js +4 -0
  47. package/lib/commonjs/native-bridge/TypeScript/types/UserDetails.js +4 -0
  48. package/lib/commonjs/native-bridge/TypeScript/types/UserDetailsFormat.js +4 -0
  49. package/lib/commonjs/native-bridge/TypeScript/types/VoipHandlingStrategy.js +19 -0
  50. package/lib/commonjs/src/KaleyraVideo.js +259 -0
  51. package/lib/commonjs/src/ReactNativeEventEmitter.js +40 -0
  52. package/lib/commonjs/src/events/Events.js +4 -0
  53. package/lib/module/index.js +2 -0
  54. package/lib/module/native-bridge/TypeScript/Environments.js +37 -0
  55. package/lib/module/native-bridge/TypeScript/Events.js +43 -0
  56. package/lib/module/native-bridge/TypeScript/Regions.js +43 -0
  57. package/lib/module/native-bridge/TypeScript/UserDetailsFormatValidator.js +28 -0
  58. package/lib/module/native-bridge/TypeScript/errors/IllegalArgumentError.js +8 -0
  59. package/lib/module/native-bridge/TypeScript/types/AccessTokenRequest.js +3 -0
  60. package/lib/module/native-bridge/TypeScript/types/AccessTokenResponse.js +32 -0
  61. package/lib/module/native-bridge/TypeScript/types/AudioCallOptions.js +3 -0
  62. package/lib/module/native-bridge/TypeScript/types/AudioCallType.js +16 -0
  63. package/lib/module/native-bridge/TypeScript/types/CallDisplayMode.js +20 -0
  64. package/lib/module/native-bridge/TypeScript/types/CallKitConfiguration.js +3 -0
  65. package/lib/module/native-bridge/TypeScript/types/CallOptions.js +3 -0
  66. package/lib/module/native-bridge/TypeScript/types/CallType.js +20 -0
  67. package/lib/module/native-bridge/TypeScript/types/ChatToolConfiguration.js +3 -0
  68. package/lib/module/native-bridge/TypeScript/types/CreateCallOptions.js +3 -0
  69. package/lib/module/native-bridge/TypeScript/types/Environment.js +3 -0
  70. package/lib/module/native-bridge/TypeScript/types/IosConfiguration.js +3 -0
  71. package/lib/module/native-bridge/TypeScript/types/KaleyraVideoConfiguration.js +3 -0
  72. package/lib/module/native-bridge/TypeScript/types/RecordingType.js +20 -0
  73. package/lib/module/native-bridge/TypeScript/types/Region.js +3 -0
  74. package/lib/module/native-bridge/TypeScript/types/ScreenShareToolConfiguration.js +3 -0
  75. package/lib/module/native-bridge/TypeScript/types/Session.js +3 -0
  76. package/lib/module/native-bridge/TypeScript/types/Tools.js +3 -0
  77. package/lib/module/native-bridge/TypeScript/types/UserDetails.js +3 -0
  78. package/lib/module/native-bridge/TypeScript/types/UserDetailsFormat.js +3 -0
  79. package/lib/module/native-bridge/TypeScript/types/VoipHandlingStrategy.js +16 -0
  80. package/lib/module/src/KaleyraVideo.js +249 -0
  81. package/lib/module/src/ReactNativeEventEmitter.js +36 -0
  82. package/lib/module/src/events/Events.js +3 -0
  83. package/lib/typescript/index.d.ts +2 -0
  84. package/lib/typescript/native-bridge/TypeScript/Environments.d.ts +28 -0
  85. package/lib/typescript/native-bridge/TypeScript/Events.d.ts +40 -0
  86. package/lib/typescript/native-bridge/TypeScript/Regions.d.ts +32 -0
  87. package/lib/typescript/native-bridge/TypeScript/UserDetailsFormatValidator.d.ts +4 -0
  88. package/lib/typescript/native-bridge/TypeScript/errors/IllegalArgumentError.d.ts +6 -0
  89. package/lib/typescript/native-bridge/TypeScript/types/AccessTokenRequest.d.ts +4 -0
  90. package/lib/typescript/native-bridge/TypeScript/types/AccessTokenResponse.d.ts +12 -0
  91. package/lib/typescript/native-bridge/TypeScript/types/AudioCallOptions.d.ts +11 -0
  92. package/lib/typescript/native-bridge/TypeScript/types/AudioCallType.d.ts +13 -0
  93. package/lib/typescript/native-bridge/TypeScript/types/CallDisplayMode.d.ts +17 -0
  94. package/lib/typescript/native-bridge/TypeScript/types/CallKitConfiguration.d.ts +26 -0
  95. package/lib/typescript/native-bridge/TypeScript/types/CallOptions.d.ts +13 -0
  96. package/lib/typescript/native-bridge/TypeScript/types/CallType.d.ts +17 -0
  97. package/lib/typescript/native-bridge/TypeScript/types/ChatToolConfiguration.d.ts +15 -0
  98. package/lib/typescript/native-bridge/TypeScript/types/CreateCallOptions.d.ts +15 -0
  99. package/lib/typescript/native-bridge/TypeScript/types/Environment.d.ts +9 -0
  100. package/lib/typescript/native-bridge/TypeScript/types/IosConfiguration.d.ts +23 -0
  101. package/lib/typescript/native-bridge/TypeScript/types/KaleyraVideoConfiguration.d.ts +33 -0
  102. package/lib/typescript/native-bridge/TypeScript/types/RecordingType.d.ts +17 -0
  103. package/lib/typescript/native-bridge/TypeScript/types/Region.d.ts +9 -0
  104. package/lib/typescript/native-bridge/TypeScript/types/ScreenShareToolConfiguration.d.ts +19 -0
  105. package/lib/typescript/native-bridge/TypeScript/types/Session.d.ts +16 -0
  106. package/lib/typescript/native-bridge/TypeScript/types/Tools.d.ts +42 -0
  107. package/lib/typescript/native-bridge/TypeScript/types/UserDetails.d.ts +29 -0
  108. package/lib/typescript/native-bridge/TypeScript/types/UserDetailsFormat.d.ts +19 -0
  109. package/lib/typescript/native-bridge/TypeScript/types/VoipHandlingStrategy.d.ts +13 -0
  110. package/lib/typescript/src/KaleyraVideo.d.ts +125 -0
  111. package/lib/typescript/src/ReactNativeEventEmitter.d.ts +15 -0
  112. package/lib/typescript/src/events/Events.d.ts +37 -0
  113. package/native-bridge/LICENSE +165 -0
  114. package/native-bridge/TypeScript/Environments.ts +44 -0
  115. package/native-bridge/TypeScript/Events.ts +43 -0
  116. package/native-bridge/TypeScript/Regions.ts +51 -0
  117. package/native-bridge/TypeScript/UserDetailsFormatValidator.ts +35 -0
  118. package/native-bridge/TypeScript/errors/IllegalArgumentError.ts +9 -0
  119. package/native-bridge/TypeScript/types/AccessTokenRequest.ts +7 -0
  120. package/native-bridge/TypeScript/types/AccessTokenResponse.ts +41 -0
  121. package/native-bridge/TypeScript/types/AudioCallOptions.ts +15 -0
  122. package/native-bridge/TypeScript/types/AudioCallType.ts +17 -0
  123. package/native-bridge/TypeScript/types/CallDisplayMode.ts +22 -0
  124. package/native-bridge/TypeScript/types/CallKitConfiguration.ts +32 -0
  125. package/native-bridge/TypeScript/types/CallOptions.ts +18 -0
  126. package/native-bridge/TypeScript/types/CallType.ts +22 -0
  127. package/native-bridge/TypeScript/types/ChatToolConfiguration.ts +21 -0
  128. package/native-bridge/TypeScript/types/CreateCallOptions.ts +20 -0
  129. package/native-bridge/TypeScript/types/Environment.ts +12 -0
  130. package/native-bridge/TypeScript/types/IosConfiguration.ts +29 -0
  131. package/native-bridge/TypeScript/types/KaleyraVideoConfiguration.ts +42 -0
  132. package/native-bridge/TypeScript/types/RecordingType.ts +22 -0
  133. package/native-bridge/TypeScript/types/Region.ts +12 -0
  134. package/native-bridge/TypeScript/types/ScreenShareToolConfiguration.ts +24 -0
  135. package/native-bridge/TypeScript/types/Session.ts +20 -0
  136. package/native-bridge/TypeScript/types/Tools.ts +50 -0
  137. package/native-bridge/TypeScript/types/UserDetails.ts +37 -0
  138. package/native-bridge/TypeScript/types/UserDetailsFormat.ts +23 -0
  139. package/native-bridge/TypeScript/types/VoipHandlingStrategy.ts +17 -0
  140. package/native-bridge/android/build.gradle +72 -0
  141. package/native-bridge/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  142. package/native-bridge/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  143. package/native-bridge/android/gradle.properties +22 -0
  144. package/native-bridge/android/gradlew +234 -0
  145. package/native-bridge/android/gradlew.bat +89 -0
  146. package/native-bridge/android/settings.gradle +1 -0
  147. package/native-bridge/android/src/main/AndroidManifest.xml +1 -0
  148. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/AccessTokenProvider.kt +8 -0
  149. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/CallOptionsProxy.kt +9 -0
  150. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ContextContainer.kt +10 -0
  151. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/DTOs.kt +407 -0
  152. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/SDKAccessTokenProviderProxy.kt +16 -0
  153. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoHybridBridge.kt +21 -0
  154. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoSDKHybridBridge.kt +64 -0
  155. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/configurator/CachedSDKConfigurator.kt +15 -0
  156. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/configurator/VideoSDKConfigurator.kt +46 -0
  157. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/connector/CachedUserConnector.kt +15 -0
  158. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/connector/VideoSDKCachedUserConnector.kt +60 -0
  159. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/Events.kt +29 -0
  160. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/EventsEmitter.kt +8 -0
  161. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/EventsReporter.kt +9 -0
  162. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CallEventsReporter.kt +54 -0
  163. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ChatEventsReporter.kt +43 -0
  164. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CrossPlatformModuleStatus.kt +29 -0
  165. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ModuleEventsReporter.kt +34 -0
  166. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/SDKEventsReporter.kt +63 -0
  167. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/CallDisplayExtension.kt +15 -0
  168. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ConfigurationExtension.kt +39 -0
  169. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/EnvironmentExtension.kt +12 -0
  170. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RecordingTypeExtension.kt +15 -0
  171. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RegionExtension.kt +13 -0
  172. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ScreenShareToolConfigurationExtension.kt +15 -0
  173. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ToolsExtension.kt +95 -0
  174. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/UserExtensions.kt +35 -0
  175. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/notifications/KaleyraVideoNotificationReceiver.kt +139 -0
  176. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/notifications/KaleyraVideoNotificationService.kt +85 -0
  177. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/ConfigurationEntity.kt +27 -0
  178. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/ConnectedUserEntity.kt +30 -0
  179. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/Converters.kt +25 -0
  180. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsDao.kt +21 -0
  181. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsEntity.kt +22 -0
  182. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/VideoHybridBridgeRepository.kt +39 -0
  183. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ui/SDKUserInterfacePresenter.kt +49 -0
  184. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ui/UserInterfacePresenter.kt +14 -0
  185. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetails.kt +18 -0
  186. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetailsFormatter.kt +59 -0
  187. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/SDKCachedUserDetails.kt +74 -0
  188. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/utils/CaseInsensitiveEnumTypeAdapterFactory.kt +48 -0
  189. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/utils/TLSSocketFactoryCompat.kt +76 -0
  190. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.pbxproj +1399 -0
  191. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  192. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  193. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/xcshareddata/IDETemplateMacros.plist +9 -0
  194. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/xcshareddata/xcschemes/KaleyraVideoHybridNativeBridge.xcscheme +79 -0
  195. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcworkspace/contents.xcworkspacedata +10 -0
  196. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  197. package/native-bridge/iOS/Podfile +28 -0
  198. package/native-bridge/iOS/Podfile.lock +20 -0
  199. package/native-bridge/iOS/Source/Abstractions/BandyerSDKProtocol.swift +24 -0
  200. package/native-bridge/iOS/Source/Abstractions/CallWindowProtocol.swift +18 -0
  201. package/native-bridge/iOS/Source/AccessToken/AccessTokenRequester.swift +9 -0
  202. package/native-bridge/iOS/Source/AccessToken/TokenProvider.swift +78 -0
  203. package/native-bridge/iOS/Source/Broadcast/BroadcastConfigurationPlistReader.swift +49 -0
  204. package/native-bridge/iOS/Source/Concurrency/DispatchQueue+isMain.swift +19 -0
  205. package/native-bridge/iOS/Source/Concurrency/Lock.swift +21 -0
  206. package/native-bridge/iOS/Source/Concurrency/MainQueueDispatcher.swift +23 -0
  207. package/native-bridge/iOS/Source/Concurrency/MainQueueRelay.swift +18 -0
  208. package/native-bridge/iOS/Source/DTOs/AccessTokenRequest+Encodable.swift +27 -0
  209. package/native-bridge/iOS/Source/DTOs/AccessTokenResponse+Decodable.swift +24 -0
  210. package/native-bridge/iOS/Source/DTOs/Array+JSON.swift +6 -0
  211. package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Bandyer.swift +14 -0
  212. package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Decodable.swift +18 -0
  213. package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Equatable.swift +12 -0
  214. package/native-bridge/iOS/Source/DTOs/AudioCallType+Bandyer.swift +18 -0
  215. package/native-bridge/iOS/Source/DTOs/AudioCallType+Decodable.swift +25 -0
  216. package/native-bridge/iOS/Source/DTOs/CallKitConfiguration+Decodable.swift +20 -0
  217. package/native-bridge/iOS/Source/DTOs/CallOptions+Bandyer.swift +14 -0
  218. package/native-bridge/iOS/Source/DTOs/CallOptions+Decodable.swift +16 -0
  219. package/native-bridge/iOS/Source/DTOs/CallOptions+Equatable.swift +12 -0
  220. package/native-bridge/iOS/Source/DTOs/CallType+Bandyer.swift +20 -0
  221. package/native-bridge/iOS/Source/DTOs/CallType+Decodable.swift +27 -0
  222. package/native-bridge/iOS/Source/DTOs/ChatToolConfiguration+Decodable.swift +18 -0
  223. package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Decodable.swift +22 -0
  224. package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Equatable.swift +13 -0
  225. package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Intent.swift +17 -0
  226. package/native-bridge/iOS/Source/DTOs/DTOs.swift +314 -0
  227. package/native-bridge/iOS/Source/DTOs/Environment+Bandyer.swift +20 -0
  228. package/native-bridge/iOS/Source/DTOs/Environment+Decodable.swift +16 -0
  229. package/native-bridge/iOS/Source/DTOs/IosConfiguration+Decodable.swift +18 -0
  230. package/native-bridge/iOS/Source/DTOs/JSONDecodable.swift +27 -0
  231. package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+Bandyer.swift +158 -0
  232. package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+Decodable.swift +28 -0
  233. package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+UserInterfacePresenterConfiguration.swift +29 -0
  234. package/native-bridge/iOS/Source/DTOs/RecordingType+Bandyer.swift +33 -0
  235. package/native-bridge/iOS/Source/DTOs/RecordingType+Decodable.swift +27 -0
  236. package/native-bridge/iOS/Source/DTOs/Region+Bandyer.swift +22 -0
  237. package/native-bridge/iOS/Source/DTOs/Region+Decodable.swift +16 -0
  238. package/native-bridge/iOS/Source/DTOs/ScreenShareToolConfiguration+Decodable.swift +18 -0
  239. package/native-bridge/iOS/Source/DTOs/Tools+Decodable.swift +24 -0
  240. package/native-bridge/iOS/Source/DTOs/UserDetails+Bandyer.swift +18 -0
  241. package/native-bridge/iOS/Source/DTOs/UserDetails+Decodable.swift +28 -0
  242. package/native-bridge/iOS/Source/DTOs/UserDetailsFormat+Decodable.swift +19 -0
  243. package/native-bridge/iOS/Source/DTOs/VoipHandlingStrategy+Decodable.swift +25 -0
  244. package/native-bridge/iOS/Source/Events/Emitter/EventEmitter.swift +8 -0
  245. package/native-bridge/iOS/Source/Events/Events+CaseIterable.swift +18 -0
  246. package/native-bridge/iOS/Source/Events/Events+Description.swift +28 -0
  247. package/native-bridge/iOS/Source/Events/Events.swift +21 -0
  248. package/native-bridge/iOS/Source/Events/Reporters/CallClientEventsReporter.swift +46 -0
  249. package/native-bridge/iOS/Source/Events/Reporters/ChatClientEventsReporter.swift +46 -0
  250. package/native-bridge/iOS/Source/Events/Reporters/ClientState.swift +61 -0
  251. package/native-bridge/iOS/Source/Events/Reporters/EventsReporter.swift +69 -0
  252. package/native-bridge/iOS/Source/Events/Reporters/PushTokenEventsReporter.swift +34 -0
  253. package/native-bridge/iOS/Source/Extensions/URL+FromString.swift +26 -0
  254. package/native-bridge/iOS/Source/KaleyraVideoHybridNativeBridge.h +14 -0
  255. package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridge.swift +173 -0
  256. package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridgeError.swift +33 -0
  257. package/native-bridge/iOS/Source/UI/KaleyraVideoSDKUserInterfacePresenter.swift +249 -0
  258. package/native-bridge/iOS/Source/UI/Presenters/PresentingViewControllerViewControllerPresenter.swift +44 -0
  259. package/native-bridge/iOS/Source/UI/Presenters/ViewControllerPresenter.swift +17 -0
  260. package/native-bridge/iOS/Source/UI/Presenters/WindowViewControllerPresenter.swift +111 -0
  261. package/native-bridge/iOS/Source/UI/UserInterfacePresenter+MainQueueRelay.swift +30 -0
  262. package/native-bridge/iOS/Source/UI/UserInterfacePresenter.swift +14 -0
  263. package/native-bridge/iOS/Source/User Details/Cache/UsersDetailsCache.swift +36 -0
  264. package/native-bridge/iOS/Source/User Details/Formatter/FormatterProxy.swift +47 -0
  265. package/native-bridge/iOS/Source/User Details/Formatter/UserDetailsFormatter.swift +83 -0
  266. package/native-bridge/iOS/Source/User Details/Providers/UsersDetailsProvider.swift +39 -0
  267. package/package.json +147 -0
  268. package/src/KaleyraVideo.ts +343 -0
  269. package/src/ReactNativeEventEmitter.ts +51 -0
  270. package/src/events/Events.ts +46 -0
  271. package/video-react-native-module.podspec +36 -0
@@ -0,0 +1,12 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ @available(iOS 12.0, *)
7
+ extension CallOptions: Equatable {
8
+
9
+ static func == (lhs: CallOptions, rhs: CallOptions) -> Bool {
10
+ lhs.recordingType == rhs.recordingType
11
+ }
12
+ }
@@ -0,0 +1,20 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+ import Bandyer
6
+
7
+ @available(iOS 12.0, *)
8
+ extension CallType {
9
+
10
+ var bandyerType: Bandyer.CallType {
11
+ switch self {
12
+ case .audio:
13
+ return .audioOnly
14
+ case .audioUpgradable:
15
+ return .audioUpgradable
16
+ case .audioVideo:
17
+ return .audioVideo
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,27 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ struct UnknownCallTypeError: Error {}
7
+
8
+ extension CallType: Decodable {
9
+
10
+ init(from decoder: Decoder) throws {
11
+ let container = try decoder.singleValueContainer()
12
+ try self.init(try container.decode(String.self))
13
+ }
14
+
15
+ init(_ string: String) throws {
16
+ switch string {
17
+ case "audio":
18
+ self = .audio
19
+ case "audioUpgradable":
20
+ self = .audioUpgradable
21
+ case "audioVideo":
22
+ self = .audioVideo
23
+ default:
24
+ throw UnknownCallTypeError()
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,18 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ extension ChatToolConfiguration: Decodable {
7
+
8
+ private enum CodingKeys: String, CodingKey {
9
+ case audioCallOption
10
+ case videoCallOption
11
+ }
12
+
13
+ init(from decoder: Decoder) throws {
14
+ let container = try decoder.container(keyedBy: CodingKeys.self)
15
+ self.audioCallOption = try container.decodeIfPresent(AudioCallOptions.self, forKey: .audioCallOption)
16
+ self.videoCallOption = try container.decodeIfPresent(CallOptions.self, forKey: .videoCallOption)
17
+ }
18
+ }
@@ -0,0 +1,22 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ extension CreateCallOptions: Decodable {
7
+
8
+ private enum CodingKeys: String, CodingKey {
9
+ case callees
10
+ case callType
11
+ case recordingType
12
+ }
13
+
14
+ init(from decoder: Decoder) throws {
15
+ let container = try decoder.container(keyedBy: CodingKeys.self)
16
+ self.callees = try container.decode([String].self, forKey: .callees)
17
+ self.callType = try container.decode(CallType.self, forKey: .callType)
18
+ self.recordingType = try container.decodeIfPresent(RecordingType.self, forKey: .recordingType) ?? RecordingType.none
19
+ }
20
+ }
21
+
22
+ extension CreateCallOptions: JSONDecodable {}
@@ -0,0 +1,13 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ extension CreateCallOptions: Equatable {
7
+
8
+ static func == (lhs: CreateCallOptions, rhs: CreateCallOptions) -> Bool {
9
+ lhs.callees == rhs.callees &&
10
+ lhs.callType == rhs.callType &&
11
+ lhs.recordingType == rhs.recordingType
12
+ }
13
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+ import Bandyer
6
+
7
+ @available(iOS 12.0, *)
8
+ extension CreateCallOptions {
9
+
10
+ func makeStartOutgoingCallIntent() -> StartOutgoingCallIntent {
11
+ .init(callees: callees, options: makeCallOptions())
12
+ }
13
+
14
+ private func makeCallOptions() -> Bandyer.CallOptions {
15
+ .init(callType: callType.bandyerType, recordingType: recordingType?.callRecordingType ?? CallRecordingType.none)
16
+ }
17
+ }
@@ -0,0 +1,314 @@
1
+ // This file was generated from JSON Schema using quicktype, do not modify it directly.
2
+ // To parse the JSON, add this file to your project and do:
3
+ //
4
+ // let accessTokenRequest = try AccessTokenRequest(json)
5
+ // let accessTokenResponse = try AccessTokenResponse(json)
6
+ // let recordingType = try? JSONDecoder().decode(RecordingType.self, from: jsonData)
7
+ // let callOptions = try CallOptions(json)
8
+ // let audioCallType = try? JSONDecoder().decode(AudioCallType.self, from: jsonData)
9
+ // let audioCallOptions = try AudioCallOptions(json)
10
+ // let callDisplayMode = try? JSONDecoder().decode(CallDisplayMode.self, from: jsonData)
11
+ // let callKitConfiguration = try CallKitConfiguration(json)
12
+ // let callType = try? JSONDecoder().decode(CallType.self, from: jsonData)
13
+ // let chatToolConfiguration = try ChatToolConfiguration(json)
14
+ // let createCallOptions = try CreateCallOptions(json)
15
+ // let environment = try Environment(json)
16
+ // let voipHandlingStrategy = try? JSONDecoder().decode(VoipHandlingStrategy.self, from: jsonData)
17
+ // let iosConfiguration = try IosConfiguration(json)
18
+ // let screenShareToolConfiguration = try ScreenShareToolConfiguration(json)
19
+ // let tools = try Tools(json)
20
+ // let region = try Region(json)
21
+ // let kaleyraVideoConfiguration = try KaleyraVideoConfiguration(json)
22
+ // let session = try Session(json)
23
+ // let userDetails = try UserDetails(json)
24
+ // let userDetailsFormat = try UserDetailsFormat(json)
25
+
26
+ import Foundation
27
+
28
+ // MARK: - AccessTokenRequest
29
+ struct AccessTokenRequest {
30
+ let requestID, userID: String
31
+ }
32
+
33
+ // MARK: - AccessTokenResponse
34
+ struct AccessTokenResponse {
35
+ let data: String
36
+ let error: String?
37
+ let requestID: String
38
+ let success: Bool
39
+ }
40
+
41
+ /// This class defines the display modes supported per call.
42
+ enum CallDisplayMode {
43
+ case background
44
+ case foreground
45
+ case foregroundPictureInPicture
46
+ }
47
+
48
+ /// Options to be used when creating a call
49
+ // MARK: - CreateCallOptions
50
+ struct CreateCallOptions {
51
+ /// Array of callees identifiers to call.
52
+ let callees: [String]
53
+ /// Type of call to create
54
+ let callType: CallType
55
+ /// May have three different values, NONE, AUTOMATIC, MANUAL
56
+ /// <br/>
57
+ /// <br/>
58
+ /// <b><font color="blue">default</font>: none</b>
59
+ let recordingType: RecordingType?
60
+ }
61
+
62
+ /// This class defines the types of calls supported.
63
+ ///
64
+ /// Type of call to create
65
+ enum CallType {
66
+ case audio
67
+ case audioUpgradable
68
+ case audioVideo
69
+ }
70
+
71
+ /// Recording type of the call
72
+ ///
73
+ /// May have three different values, NONE, AUTOMATIC, MANUAL
74
+ /// <br/>
75
+ /// <br/>
76
+ /// <b><font color="blue">default</font>: none</b>
77
+ enum RecordingType {
78
+ case automatic
79
+ case manual
80
+ case none
81
+ }
82
+
83
+ /// Generic configuration used for setup
84
+ // MARK: - KaleyraVideoConfiguration
85
+ struct KaleyraVideoConfiguration {
86
+ /// This key will be provided to you by us.
87
+ let appID: String
88
+ /// This variable defines the environment where you will be sandbox or production.
89
+ let environment: Environment
90
+ /// Define to customize the iOS configuration
91
+ let iosConfig: IosConfiguration?
92
+ /// Set to true to enable log, default value is false
93
+ let logEnabled: Bool?
94
+ /// This variable defines the region where you will be europe, india or us.
95
+ let region: Region
96
+ /// Define the tools to use
97
+ let tools: Tools?
98
+ }
99
+
100
+ /// An environment where your integration will run
101
+ ///
102
+ /// This variable defines the environment where you will be sandbox or production.
103
+ // MARK: - Environment
104
+ struct Environment {
105
+ /// name of the environment
106
+ let name: String
107
+ }
108
+
109
+ /// Configuration for iOS platform
110
+ ///
111
+ /// Define to customize the iOS configuration
112
+ // MARK: - IosConfiguration
113
+ struct IosConfiguration {
114
+ /// Specify the callkit configuration to enable the usage and it's behaviour
115
+ /// <br/>
116
+ /// <br/>
117
+ /// <b><font color="blue">default</font>: enabled</b>
118
+ let callkit: CallKitConfiguration?
119
+ /// Specify the voip handling strategy.
120
+ /// <br/>
121
+ /// This allows you to disable or leave the plugin behaviour for handling the voip
122
+ /// notifications.
123
+ /// <br/>
124
+ /// <br/>
125
+ /// <b><font color="blue">default</font>: VoipHandlingStrategy.AUTOMATIC </b>
126
+ let voipHandlingStrategy: VoipHandlingStrategy?
127
+ }
128
+
129
+ /// Configuration for callkit
130
+ ///
131
+ /// Specify the callkit configuration to enable the usage and it's behaviour
132
+ /// <br/>
133
+ /// <br/>
134
+ /// <b><font color="blue">default</font>: enabled</b>
135
+ // MARK: - CallKitConfiguration
136
+ struct CallKitConfiguration {
137
+ /// The icon resource name to be used in the callkit UI to represent the app
138
+ /// <br/>
139
+ /// <br/>
140
+ /// <b><font color="blue">default</font>: null</b>
141
+ let appIconName: String?
142
+ /// Set to false to disable
143
+ /// <br/>
144
+ /// <br/>
145
+ /// <b><font color="blue">default</font>: true</b>
146
+ let enabled: Bool?
147
+ /// The ringtone resource name to be used when callkit is launched
148
+ /// <br/>
149
+ /// <br/>
150
+ /// <b><font color="blue">default</font>: system</b>
151
+ let ringtoneSoundName: String?
152
+ }
153
+
154
+ /// This class defines the voip notification strategy per call.
155
+ ///
156
+ /// Specify the voip handling strategy.
157
+ /// <br/>
158
+ /// This allows you to disable or leave the plugin behaviour for handling the voip
159
+ /// notifications.
160
+ /// <br/>
161
+ /// <br/>
162
+ /// <b><font color="blue">default</font>: VoipHandlingStrategy.AUTOMATIC </b>
163
+ enum VoipHandlingStrategy {
164
+ case automatic
165
+ case disabled
166
+ }
167
+
168
+ /// A region where your integration will run
169
+ ///
170
+ /// This variable defines the region where you will be europe, india or us.
171
+ // MARK: - Region
172
+ struct Region {
173
+ /// name of the region
174
+ let name: String
175
+ }
176
+
177
+ /// Video Module Tools
178
+ ///
179
+ /// Define the tools to use
180
+ // MARK: - Tools
181
+ struct Tools {
182
+ /// Set to enable the chat feature
183
+ /// <br/>
184
+ /// <br/>
185
+ /// <b><font color="blue">default</font>: no chat</b>
186
+ let chat: ChatToolConfiguration?
187
+ /// Set to true to enable the feedback request after a call ends.
188
+ /// <br/>
189
+ /// <br/>
190
+ /// <b><font color="blue">default</font>: false</b>
191
+ let feedback: Bool?
192
+ /// Set to true to enable the file sharing feature
193
+ /// <br/>
194
+ /// <br/>
195
+ /// <b><font color="blue">default</font>: false</b>
196
+ let fileShare: Bool?
197
+ /// Set to enable the screen sharing feature
198
+ /// <br/>
199
+ /// <br/>
200
+ /// <b><font color="blue">default</font>: no screen share</b>
201
+ let screenShare: ScreenShareToolConfiguration?
202
+ /// Set to true to enable the whiteboard feature
203
+ /// <br/>
204
+ /// <br/>
205
+ /// <b><font color="blue">default</font>: false</b>
206
+ let whiteboard: Bool?
207
+ }
208
+
209
+ /// Chat tool configuration
210
+ ///
211
+ /// Set to enable the chat feature
212
+ /// <br/>
213
+ /// <br/>
214
+ /// <b><font color="blue">default</font>: no chat</b>
215
+ // MARK: - ChatToolConfiguration
216
+ struct ChatToolConfiguration {
217
+ /// Defining this object will enable an option to start an audio call from chat UI
218
+ let audioCallOption: AudioCallOptions?
219
+ /// Defining this object will enable an option to start an audio&video call from chat UI
220
+ let videoCallOption: CallOptions?
221
+ }
222
+
223
+ /// Audio call options used for chat
224
+ ///
225
+ /// Defining this object will enable an option to start an audio call from chat UI
226
+ // MARK: - AudioCallOptions
227
+ struct AudioCallOptions {
228
+ /// May have three different values, NONE, AUTOMATIC, MANUAL
229
+ /// <br/>
230
+ /// <br/>
231
+ /// <b><font color="blue">default</font>: none</b>
232
+ let recordingType: RecordingType?
233
+ /// Type of audioCall to launch when an option of the chat is tapped.
234
+ let type: AudioCallType
235
+ }
236
+
237
+ /// This class defines the types of audio calls supported.
238
+ ///
239
+ /// Type of audioCall to launch when an option of the chat is tapped.
240
+ enum AudioCallType {
241
+ case audio
242
+ case audioUpgradable
243
+ }
244
+
245
+ /// Options available for a call
246
+ ///
247
+ /// Defining this object will enable an option to start an audio&video call from chat UI
248
+ // MARK: - CallOptions
249
+ struct CallOptions {
250
+ /// May have three different values, NONE, AUTOMATIC, MANUAL
251
+ /// <br/>
252
+ /// <br/>
253
+ /// <b><font color="blue">default</font>: none</b>
254
+ let recordingType: RecordingType?
255
+ }
256
+
257
+ /// Screen Share tool configuration
258
+ ///
259
+ /// Set to enable the screen sharing feature
260
+ /// <br/>
261
+ /// <br/>
262
+ /// <b><font color="blue">default</font>: no screen share</b>
263
+ // MARK: - ScreenShareToolConfiguration
264
+ struct ScreenShareToolConfiguration {
265
+ /// Set to true to enable the in app screen share
266
+ /// <br/>
267
+ /// <br/>
268
+ /// <b><font color="blue">default</font>: false</b>
269
+ let inApp: Bool?
270
+ /// Set to true to enable the whole device screen share
271
+ /// <br/>
272
+ /// <br/>
273
+ /// <b><font color="blue">default</font>: false</b>
274
+ let wholeDevice: Bool?
275
+ }
276
+
277
+ /// Session
278
+ // MARK: - Session
279
+ struct Session {
280
+ /// The user id you want to connect
281
+ let userID: String
282
+ }
283
+
284
+ /// This is used to define the user details in the call/chat UI
285
+ // MARK: - UserDetails
286
+ struct UserDetails {
287
+ /// Email of the user
288
+ let email: String?
289
+ /// First name of the user
290
+ let firstName: String?
291
+ /// Last name of the user
292
+ let lastName: String?
293
+ /// Nickname for the user
294
+ let nickName: String?
295
+ /// Image url to use as placeholder for the user.
296
+ let profileImageURL: String?
297
+ /// User identifier
298
+ let userID: String
299
+ }
300
+
301
+ /// This is used to display the user details in the call/chat UI
302
+ // MARK: - UserDetailsFormat
303
+ struct UserDetailsFormat {
304
+ /// Format to be used when displaying an android notification
305
+ /// <br/>
306
+ /// <br/>
307
+ /// <b><font color="blue">default</font>: equals to UserDetailsFormatter.default</b>
308
+ let androidNotification: String?
309
+ /// Format to be used to display a user details on the call/chat UI
310
+ /// <br/>
311
+ /// <br/>
312
+ /// <b><font color="blue">default</font>: ${userAlias}</b>
313
+ let userDetailsFormatDefault: String
314
+ }
@@ -0,0 +1,20 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+ import Bandyer
6
+
7
+ @available(iOS 12.0, *)
8
+ extension Environment {
9
+
10
+ var bandyerEnvironment: Bandyer.Environment? {
11
+ switch name.lowercased() {
12
+ case "production":
13
+ return .production
14
+ case "sandbox":
15
+ return .sandbox
16
+ default:
17
+ return nil
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,16 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ extension Environment: Decodable {
7
+
8
+ private enum CodingKeys: String, CodingKey {
9
+ case name
10
+ }
11
+
12
+ init(from decoder: Decoder) throws {
13
+ let container = try decoder.container(keyedBy: CodingKeys.self)
14
+ self.name = try container.decode(String.self, forKey: .name)
15
+ }
16
+ }
@@ -0,0 +1,18 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ extension IosConfiguration: Decodable {
7
+
8
+ private enum CodingKeys: String, CodingKey {
9
+ case callkit
10
+ case voipHandlingStrategy
11
+ }
12
+
13
+ init(from decoder: Decoder) throws {
14
+ let container = try decoder.container(keyedBy: CodingKeys.self)
15
+ self.callkit = try container.decodeIfPresent(CallKitConfiguration.self, forKey: .callkit) ?? .init(appIconName: nil, enabled: true, ringtoneSoundName: nil)
16
+ self.voipHandlingStrategy = try container.decodeIfPresent(VoipHandlingStrategy.self, forKey: .voipHandlingStrategy)
17
+ }
18
+ }
@@ -0,0 +1,27 @@
1
+ // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
+ // See LICENSE for licensing information
3
+
4
+ import Foundation
5
+
6
+ protocol JSONDecodable {
7
+
8
+ static func decodeJSON(_ json: String, encoding: String.Encoding) throws -> Self
9
+
10
+ static func decodeJSON(data: Data) throws -> Self
11
+ }
12
+
13
+ extension JSONDecodable where Self: Decodable {
14
+
15
+ static func decodeJSON(_ json: String, encoding: String.Encoding = .utf8) throws -> Self {
16
+ guard let data = json.data(using: encoding) else {
17
+ throw StringEncodingError()
18
+ }
19
+ return try decodeJSON(data: data)
20
+ }
21
+
22
+ static func decodeJSON(data: Data) throws -> Self {
23
+ try JSONDecoder().decode(Self.self, from: data)
24
+ }
25
+ }
26
+
27
+ private struct StringEncodingError: Error {}