@zelloptt/react-native-zello-sdk 0.3.2 → 0.4.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 (150) hide show
  1. package/README.md +14 -1
  2. package/android/build.gradle +5 -3
  3. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +45 -0
  4. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModuleHelper.kt +23 -0
  5. package/ios/Extensions/ZelloConsoleSettings+Extension.swift +9 -0
  6. package/ios/Extensions/ZelloContact+Extension.swift +7 -2
  7. package/ios/Extensions/ZelloDispatchCall+Extension.swift +13 -0
  8. package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +37 -1
  9. package/ios/ZelloIOSSdkModule.swift +17 -2
  10. package/ios/ZelloIOSSdkModuleBridge.m +3 -1
  11. package/lib/commonjs/docs/assets/highlight.css +13 -6
  12. package/lib/commonjs/docs/assets/main.js +1 -1
  13. package/lib/commonjs/docs/assets/main.js.map +1 -1
  14. package/lib/commonjs/docs/assets/navigation.js +1 -1
  15. package/lib/commonjs/docs/assets/navigation.js.map +1 -1
  16. package/lib/commonjs/docs/assets/search.js +1 -1
  17. package/lib/commonjs/docs/assets/search.js.map +1 -1
  18. package/lib/commonjs/docs/classes/sdk.Zello.html +48 -40
  19. package/lib/commonjs/docs/classes/types.ZelloAlertMessage.html +7 -7
  20. package/lib/commonjs/docs/classes/types.ZelloChannel.html +8 -8
  21. package/lib/commonjs/docs/classes/types.ZelloChannelUser.html +2 -2
  22. package/lib/commonjs/docs/classes/types.ZelloConsoleSettings.html +5 -0
  23. package/lib/commonjs/docs/classes/types.ZelloDispatchCall.html +7 -0
  24. package/lib/commonjs/docs/classes/types.ZelloDispatchChannel.html +19 -0
  25. package/lib/commonjs/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
  26. package/lib/commonjs/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
  27. package/lib/commonjs/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
  28. package/lib/commonjs/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
  29. package/lib/commonjs/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
  30. package/lib/commonjs/docs/classes/types.ZelloImageMessage.html +8 -8
  31. package/lib/commonjs/docs/classes/types.ZelloIncomingEmergency.html +7 -7
  32. package/lib/commonjs/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
  33. package/lib/commonjs/docs/classes/types.ZelloLocationMessage.html +10 -10
  34. package/lib/commonjs/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
  35. package/lib/commonjs/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
  36. package/lib/commonjs/docs/classes/types.ZelloRecentEntry.html +7 -7
  37. package/lib/commonjs/docs/classes/types.ZelloTextMessage.html +7 -7
  38. package/lib/commonjs/docs/classes/types.ZelloUser.html +8 -8
  39. package/lib/commonjs/docs/enums/events.ZelloEvent.html +83 -67
  40. package/lib/commonjs/docs/enums/types.ZelloAccountStatus.html +3 -3
  41. package/lib/commonjs/docs/enums/types.ZelloChannelAlertLevel.html +3 -3
  42. package/lib/commonjs/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
  43. package/lib/commonjs/docs/enums/types.ZelloConnectionError.html +2 -2
  44. package/lib/commonjs/docs/enums/types.ZelloConnectionState.html +2 -2
  45. package/lib/commonjs/docs/enums/types.ZelloContactType.html +2 -2
  46. package/lib/commonjs/docs/enums/types.ZelloDispatchCallStatus.html +6 -0
  47. package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
  48. package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
  49. package/lib/commonjs/docs/enums/types.ZelloRecentEntryType.html +2 -2
  50. package/lib/commonjs/docs/enums/types.ZelloUserStatus.html +5 -5
  51. package/lib/commonjs/docs/index.html +10 -9
  52. package/lib/commonjs/docs/modules/events.html +1 -1
  53. package/lib/commonjs/docs/modules/index.html +7 -3
  54. package/lib/commonjs/docs/modules/sdk.html +1 -1
  55. package/lib/commonjs/docs/modules/types.html +5 -1
  56. package/lib/commonjs/docs/types/types.ZelloChannelOptions.html +1 -1
  57. package/lib/commonjs/docs/types/types.ZelloConfig.html +4 -3
  58. package/lib/commonjs/docs/types/types.ZelloContact.html +1 -1
  59. package/lib/commonjs/docs/types/types.ZelloCredentials.html +2 -2
  60. package/lib/commonjs/docs/types/types.ZelloHistoryMessage.html +1 -1
  61. package/lib/commonjs/docs/types/types.ZelloMessage.html +1 -1
  62. package/lib/commonjs/events/index.js +5 -0
  63. package/lib/commonjs/events/index.js.map +1 -1
  64. package/lib/commonjs/sdk/index.js +64 -2
  65. package/lib/commonjs/sdk/index.js.map +1 -1
  66. package/lib/commonjs/types/index.js +63 -1
  67. package/lib/commonjs/types/index.js.map +1 -1
  68. package/lib/commonjs/utils/index.js +34 -1
  69. package/lib/commonjs/utils/index.js.map +1 -1
  70. package/lib/module/docs/assets/highlight.css +13 -6
  71. package/lib/module/docs/assets/main.js +1 -1
  72. package/lib/module/docs/assets/main.js.map +1 -1
  73. package/lib/module/docs/assets/navigation.js +1 -1
  74. package/lib/module/docs/assets/navigation.js.map +1 -1
  75. package/lib/module/docs/assets/search.js +1 -1
  76. package/lib/module/docs/assets/search.js.map +1 -1
  77. package/lib/module/docs/classes/sdk.Zello.html +48 -40
  78. package/lib/module/docs/classes/types.ZelloAlertMessage.html +7 -7
  79. package/lib/module/docs/classes/types.ZelloChannel.html +8 -8
  80. package/lib/module/docs/classes/types.ZelloChannelUser.html +2 -2
  81. package/lib/module/docs/classes/types.ZelloConsoleSettings.html +5 -0
  82. package/lib/module/docs/classes/types.ZelloDispatchCall.html +7 -0
  83. package/lib/module/docs/classes/types.ZelloDispatchChannel.html +19 -0
  84. package/lib/module/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
  85. package/lib/module/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
  86. package/lib/module/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
  87. package/lib/module/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
  88. package/lib/module/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
  89. package/lib/module/docs/classes/types.ZelloImageMessage.html +8 -8
  90. package/lib/module/docs/classes/types.ZelloIncomingEmergency.html +7 -7
  91. package/lib/module/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
  92. package/lib/module/docs/classes/types.ZelloLocationMessage.html +10 -10
  93. package/lib/module/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
  94. package/lib/module/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
  95. package/lib/module/docs/classes/types.ZelloRecentEntry.html +7 -7
  96. package/lib/module/docs/classes/types.ZelloTextMessage.html +7 -7
  97. package/lib/module/docs/classes/types.ZelloUser.html +8 -8
  98. package/lib/module/docs/enums/events.ZelloEvent.html +83 -67
  99. package/lib/module/docs/enums/types.ZelloAccountStatus.html +3 -3
  100. package/lib/module/docs/enums/types.ZelloChannelAlertLevel.html +3 -3
  101. package/lib/module/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
  102. package/lib/module/docs/enums/types.ZelloConnectionError.html +2 -2
  103. package/lib/module/docs/enums/types.ZelloConnectionState.html +2 -2
  104. package/lib/module/docs/enums/types.ZelloContactType.html +2 -2
  105. package/lib/module/docs/enums/types.ZelloDispatchCallStatus.html +6 -0
  106. package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
  107. package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
  108. package/lib/module/docs/enums/types.ZelloRecentEntryType.html +2 -2
  109. package/lib/module/docs/enums/types.ZelloUserStatus.html +5 -5
  110. package/lib/module/docs/index.html +10 -9
  111. package/lib/module/docs/modules/events.html +1 -1
  112. package/lib/module/docs/modules/index.html +7 -3
  113. package/lib/module/docs/modules/sdk.html +1 -1
  114. package/lib/module/docs/modules/types.html +5 -1
  115. package/lib/module/docs/types/types.ZelloChannelOptions.html +1 -1
  116. package/lib/module/docs/types/types.ZelloConfig.html +4 -3
  117. package/lib/module/docs/types/types.ZelloContact.html +1 -1
  118. package/lib/module/docs/types/types.ZelloCredentials.html +2 -2
  119. package/lib/module/docs/types/types.ZelloHistoryMessage.html +1 -1
  120. package/lib/module/docs/types/types.ZelloMessage.html +1 -1
  121. package/lib/module/events/index.js +5 -0
  122. package/lib/module/events/index.js.map +1 -1
  123. package/lib/module/sdk/index.js +66 -2
  124. package/lib/module/sdk/index.js.map +1 -1
  125. package/lib/module/types/index.js +66 -0
  126. package/lib/module/types/index.js.map +1 -1
  127. package/lib/module/utils/index.js +33 -2
  128. package/lib/module/utils/index.js.map +1 -1
  129. package/lib/typescript/commonjs/src/events/index.d.ts +28 -2
  130. package/lib/typescript/commonjs/src/events/index.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/src/sdk/index.d.ts +16 -1
  132. package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/types/index.d.ts +47 -0
  134. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/utils/index.d.ts +3 -1
  136. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
  137. package/lib/typescript/module/src/events/index.d.ts +28 -2
  138. package/lib/typescript/module/src/events/index.d.ts.map +1 -1
  139. package/lib/typescript/module/src/sdk/index.d.ts +16 -1
  140. package/lib/typescript/module/src/sdk/index.d.ts.map +1 -1
  141. package/lib/typescript/module/src/types/index.d.ts +47 -0
  142. package/lib/typescript/module/src/types/index.d.ts.map +1 -1
  143. package/lib/typescript/module/src/utils/index.d.ts +3 -1
  144. package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
  145. package/package.json +2 -2
  146. package/react-native-zello-sdk.podspec +1 -1
  147. package/src/events/index.ts +27 -1
  148. package/src/sdk/index.ts +71 -2
  149. package/src/types/index.ts +69 -0
  150. package/src/utils/index.ts +61 -11
@@ -2,7 +2,11 @@ import {
2
2
  ZelloChannel,
3
3
  ZelloChannelConnectionStatus,
4
4
  ZelloChannelUser,
5
+ ZelloConsoleSettings,
5
6
  ZelloContact,
7
+ ZelloDispatchCall,
8
+ ZelloDispatchCallStatus,
9
+ ZelloDispatchChannel,
6
10
  ZelloHistoryAlertMessage,
7
11
  ZelloHistoryImageMessage,
8
12
  ZelloHistoryLocationMessage,
@@ -28,17 +32,43 @@ export function bridgeContactToSdkContact(
28
32
  const contactName = eventContact.name;
29
33
  if (contactName) {
30
34
  if (eventContact.isChannel) {
31
- contact = new ZelloChannel(
32
- contactName,
33
- eventContact.isMuted,
34
- eventContact.isConnected
35
- ? ZelloChannelConnectionStatus.Connected
36
- : eventContact.isConnecting
37
- ? ZelloChannelConnectionStatus.Connecting
38
- : ZelloChannelConnectionStatus.Disconnected,
39
- eventContact.usersOnline,
40
- eventContact.options
41
- );
35
+ const isMuted = eventContact.isMuted;
36
+ const connectionStatus = eventContact.isConnected
37
+ ? ZelloChannelConnectionStatus.Connected
38
+ : eventContact.isConnecting
39
+ ? ZelloChannelConnectionStatus.Connecting
40
+ : ZelloChannelConnectionStatus.Disconnected;
41
+ const usersOnline = eventContact.usersOnline;
42
+ const options = eventContact.options;
43
+ if (eventContact.isDispatchChannel) {
44
+ let call: ZelloDispatchCall | undefined;
45
+ if (eventContact.currentCall) {
46
+ const statusValue =
47
+ eventContact.currentCall.status.toLowerCase() as ZelloDispatchCallStatus;
48
+ if (Object.values(ZelloDispatchCallStatus).includes(statusValue)) {
49
+ call = new ZelloDispatchCall(
50
+ statusValue,
51
+ eventContact.currentCall.dispatcher
52
+ );
53
+ }
54
+ }
55
+ contact = new ZelloDispatchChannel(
56
+ contactName,
57
+ isMuted,
58
+ connectionStatus,
59
+ usersOnline,
60
+ options,
61
+ call
62
+ );
63
+ } else {
64
+ contact = new ZelloChannel(
65
+ contactName,
66
+ isMuted,
67
+ connectionStatus,
68
+ usersOnline,
69
+ options
70
+ );
71
+ }
42
72
  } else {
43
73
  const statusValue = eventContact.status.toLowerCase() as ZelloUserStatus;
44
74
  let userStatus = ZelloUserStatus.Offline;
@@ -143,3 +173,23 @@ export function bridgeHistoryMessageToSdkHistoryMessage(
143
173
  return undefined;
144
174
  }
145
175
  }
176
+
177
+ export function bridgeCallToSdkCall(call: any): ZelloDispatchCall | undefined {
178
+ if (!call) {
179
+ return undefined;
180
+ }
181
+ const statusValue = call.status.toLowerCase() as ZelloDispatchCallStatus;
182
+ if (!Object.values(ZelloDispatchCallStatus).includes(statusValue)) {
183
+ return undefined;
184
+ }
185
+ return new ZelloDispatchCall(statusValue, call.dispatcher);
186
+ }
187
+
188
+ export function bridgeConsoleSettingsToSdkConsoleSettings(
189
+ settings: any
190
+ ): ZelloConsoleSettings | undefined {
191
+ if (!settings) {
192
+ return undefined;
193
+ }
194
+ return new ZelloConsoleSettings(settings.allowNonDispatchersToEndCalls);
195
+ }