@zelloptt/react-native-zello-sdk 0.1.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 (84) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +21 -0
  3. package/android/build.gradle +122 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/zellosdk/DummyPackage.kt +18 -0
  8. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +437 -0
  9. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModuleHelper.kt +198 -0
  10. package/ios/Extensions/Date+Extension.swift +5 -0
  11. package/ios/Extensions/UIImage+Extension.swift +9 -0
  12. package/ios/Extensions/ZelloContact+Extension.swift +52 -0
  13. package/ios/Extensions/ZelloHistoryAlertMessage+Extension.swift +18 -0
  14. package/ios/Extensions/ZelloHistoryImageMessage+Extension.swift +17 -0
  15. package/ios/Extensions/ZelloHistoryLocationMessage+Extension.swift +23 -0
  16. package/ios/Extensions/ZelloHistoryTextMessage+Extension.swift +18 -0
  17. package/ios/Extensions/ZelloHistoryVoiceMessage+Extension.swift +18 -0
  18. package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +285 -0
  19. package/ios/Extensions/ZelloIncomingEmergency+Extension.swift +16 -0
  20. package/ios/Extensions/ZelloOutgoingEmergency+Extension.swift +14 -0
  21. package/ios/Extensions/ZelloRecentEntry+Extension.swift +16 -0
  22. package/ios/ZelloIOSSdkModule.swift +209 -0
  23. package/ios/ZelloIOSSdkModuleBridge.h +5 -0
  24. package/ios/ZelloIOSSdkModuleBridge.m +44 -0
  25. package/lib/commonjs/events/index.js +43 -0
  26. package/lib/commonjs/events/index.js.map +1 -0
  27. package/lib/commonjs/index.js +47 -0
  28. package/lib/commonjs/index.js.map +1 -0
  29. package/lib/commonjs/package.json +1 -0
  30. package/lib/commonjs/sdk/index.js +833 -0
  31. package/lib/commonjs/sdk/index.js.map +1 -0
  32. package/lib/commonjs/types/index.js +518 -0
  33. package/lib/commonjs/types/index.js.map +1 -0
  34. package/lib/commonjs/utils/algorithms/index.js +79 -0
  35. package/lib/commonjs/utils/algorithms/index.js.map +1 -0
  36. package/lib/commonjs/utils/index.js +60 -0
  37. package/lib/commonjs/utils/index.js.map +1 -0
  38. package/lib/module/events/index.js +39 -0
  39. package/lib/module/events/index.js.map +1 -0
  40. package/lib/module/index.js +10 -0
  41. package/lib/module/index.js.map +1 -0
  42. package/lib/module/package.json +1 -0
  43. package/lib/module/sdk/index.js +829 -0
  44. package/lib/module/sdk/index.js.map +1 -0
  45. package/lib/module/types/index.js +547 -0
  46. package/lib/module/types/index.js.map +1 -0
  47. package/lib/module/utils/algorithms/index.js +72 -0
  48. package/lib/module/utils/algorithms/index.js.map +1 -0
  49. package/lib/module/utils/index.js +52 -0
  50. package/lib/module/utils/index.js.map +1 -0
  51. package/lib/typescript/commonjs/package.json +1 -0
  52. package/lib/typescript/commonjs/src/events/index.d.ts +192 -0
  53. package/lib/typescript/commonjs/src/events/index.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/src/index.d.ts +6 -0
  55. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/sdk/index.d.ts +221 -0
  57. package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/types/index.d.ts +560 -0
  59. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/utils/algorithms/index.d.ts +21 -0
  61. package/lib/typescript/commonjs/src/utils/algorithms/index.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/utils/index.d.ts +8 -0
  63. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
  64. package/lib/typescript/module/package.json +1 -0
  65. package/lib/typescript/module/src/events/index.d.ts +192 -0
  66. package/lib/typescript/module/src/events/index.d.ts.map +1 -0
  67. package/lib/typescript/module/src/index.d.ts +6 -0
  68. package/lib/typescript/module/src/index.d.ts.map +1 -0
  69. package/lib/typescript/module/src/sdk/index.d.ts +221 -0
  70. package/lib/typescript/module/src/sdk/index.d.ts.map +1 -0
  71. package/lib/typescript/module/src/types/index.d.ts +560 -0
  72. package/lib/typescript/module/src/types/index.d.ts.map +1 -0
  73. package/lib/typescript/module/src/utils/algorithms/index.d.ts +21 -0
  74. package/lib/typescript/module/src/utils/algorithms/index.d.ts.map +1 -0
  75. package/lib/typescript/module/src/utils/index.d.ts +8 -0
  76. package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
  77. package/package.json +195 -0
  78. package/react-native-zello-sdk.podspec +43 -0
  79. package/src/events/index.ts +191 -0
  80. package/src/index.ts +8 -0
  81. package/src/sdk/index.ts +1038 -0
  82. package/src/types/index.ts +818 -0
  83. package/src/utils/algorithms/index.ts +88 -0
  84. package/src/utils/index.ts +145 -0
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ import { isString } from 'lodash';
4
+ export function sortedArrayFind(array, item, comparator) {
5
+ const i = lowerBound(array, item, comparator);
6
+ if (i >= 0 && i < array.length && comparator(item, array[i]) === 0) {
7
+ return array[i];
8
+ }
9
+ return undefined;
10
+ }
11
+ export function lowerBound(array, item, comparator) {
12
+ let index = binarySearch(array, item, comparator);
13
+ // binarySearch returns the non-negative index of the item, or a negative index which is the -index - 1 where the item would be inserted
14
+ if (index < 0) {
15
+ index = -index - 1;
16
+ }
17
+ // Several identical objects may exist in the same collection; we need to find the first one
18
+ if (index > 0 && index < array.length) {
19
+ const foundObject = array[index];
20
+ while (index > 0) {
21
+ if (comparator(array[index - 1], foundObject) !== 0) {
22
+ break;
23
+ }
24
+ --index;
25
+ }
26
+ }
27
+ return index;
28
+ }
29
+
30
+ /**
31
+ * Binary search algorithm adapted from https://stackoverflow.com/a/29018745.
32
+ *
33
+ * The array may contain duplicate items. If there are more than one equal items in the array,
34
+ * the returned value can be the index of any one of the equal items.
35
+ *
36
+ * Time complexity: O(log n)
37
+ * @param array A sorted array.
38
+ * @param item An item to search for.
39
+ * @param comparator A comparator function. The function takes two arguments: (a, b) and returns:
40
+ * a negative number if a is less than b;
41
+ * 0 if a is equal to b;
42
+ * a positive number of a is greater than b.
43
+ * @return The index of the item in a sorted array or (-n-1) where n is the insertion point for the new item.
44
+ */
45
+ export function binarySearch(array, item, comparator) {
46
+ let m = 0;
47
+ let n = array.length - 1;
48
+ while (m <= n) {
49
+ const k = n + m >> 1;
50
+ const cmp = comparator(item, array[k]);
51
+ if (cmp > 0) {
52
+ m = k + 1;
53
+ } else if (cmp < 0) {
54
+ n = k - 1;
55
+ } else {
56
+ return k;
57
+ }
58
+ }
59
+ return -m - 1;
60
+ }
61
+ export function compareNameAscending(a, b) {
62
+ const alc = isString(a) ? a.toLowerCase() : a.name.toLowerCase();
63
+ const blc = isString(b) ? b.toLowerCase() : b.name.toLowerCase();
64
+ if (alc > blc) {
65
+ return 1;
66
+ }
67
+ if (alc < blc) {
68
+ return -1;
69
+ }
70
+ return 0;
71
+ }
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isString","sortedArrayFind","array","item","comparator","i","lowerBound","length","undefined","index","binarySearch","foundObject","m","n","k","cmp","compareNameAscending","a","b","alc","toLowerCase","name","blc"],"sourceRoot":"../../../../src","sources":["utils/algorithms/index.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAQ,QAAQ;AAEjC,OAAO,SAASC,eAAeA,CAC7BC,KAAmB,EACnBC,IAAS,EACTC,UAAkD,EACnC;EACf,MAAMC,CAAC,GAAGC,UAAU,CAACJ,KAAK,EAAEC,IAAI,EAAEC,UAAU,CAAC;EAC7C,IAAIC,CAAC,IAAI,CAAC,IAAIA,CAAC,GAAGH,KAAK,CAACK,MAAM,IAAIH,UAAU,CAACD,IAAI,EAAED,KAAK,CAACG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;IAClE,OAAOH,KAAK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EACA,OAAO,CAACF,CAAC,GAAG,CAAC;AACf;AAEA,OAAO,SAASI,oBAAoBA,CAClCC,CAAwB,EACxBC,CAAwB,EAChB;EACR,MAAMC,GAAG,GAAGnB,QAAQ,CAACiB,CAAC,CAAC,GAAGA,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGH,CAAC,CAACI,IAAI,CAACD,WAAW,CAAC,CAAC;EAChE,MAAME,GAAG,GAAGtB,QAAQ,CAACkB,CAAC,CAAC,GAAGA,CAAC,CAACE,WAAW,CAAC,CAAC,GAAGF,CAAC,CAACG,IAAI,CAACD,WAAW,CAAC,CAAC;EAChE,IAAID,GAAG,GAAGG,GAAG,EAAE;IACb,OAAO,CAAC;EACV;EACA,IAAIH,GAAG,GAAGG,GAAG,EAAE;IACb,OAAO,CAAC,CAAC;EACX;EACA,OAAO,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ import { ZelloChannel, ZelloChannelConnectionStatus, ZelloChannelUser, ZelloHistoryAlertMessage, ZelloHistoryImageMessage, ZelloHistoryLocationMessage, ZelloHistoryTextMessage, ZelloHistoryVoiceMessage, ZelloIncomingEmergency, ZelloUser, ZelloUserStatus } from "../types/index.js";
4
+ import { Platform } from 'react-native';
5
+ export const isSameContact = (a, b) => a.name.toLowerCase() === b.name.toLowerCase() && a.type === b.type;
6
+ export const isAndroid = Platform.OS === 'android';
7
+ export const isiOS = Platform.OS === 'ios';
8
+ export function bridgeContactToSdkContact(eventContact) {
9
+ let contact;
10
+ const contactName = eventContact.name;
11
+ if (contactName) {
12
+ if (eventContact.isChannel) {
13
+ contact = new ZelloChannel(contactName, eventContact.isMuted, eventContact.isConnected ? ZelloChannelConnectionStatus.Connected : eventContact.isConnecting ? ZelloChannelConnectionStatus.Connecting : ZelloChannelConnectionStatus.Disconnected, eventContact.usersOnline, eventContact.options);
14
+ } else {
15
+ const statusValue = eventContact.status.toLowerCase();
16
+ let userStatus = ZelloUserStatus.Offline;
17
+ if (Object.values(ZelloUserStatus).includes(statusValue)) {
18
+ userStatus = statusValue;
19
+ }
20
+ contact = new ZelloUser(contactName, eventContact.displayName, eventContact.isMuted, userStatus, eventContact.profilePictureUrl, eventContact.profilePictureThumbnailUrl);
21
+ }
22
+ }
23
+ return contact;
24
+ }
25
+ export function bridgeIncomingEmergencyToSdkIncomingEmergency(emergency) {
26
+ const channel = bridgeContactToSdkContact(emergency.channel);
27
+ if (!channel) {
28
+ return undefined;
29
+ }
30
+ return new ZelloIncomingEmergency(channel, new ZelloChannelUser(emergency.channelUserName), emergency.emergencyId, parseInt(emergency.startTimestamp, 10), parseInt(emergency.endTimestamp, 10));
31
+ }
32
+ export function bridgeHistoryMessageToSdkHistoryMessage(message) {
33
+ const contact = bridgeContactToSdkContact(message.contact);
34
+ if (!contact) {
35
+ return undefined;
36
+ }
37
+ switch (message.type) {
38
+ case 'voice':
39
+ return new ZelloHistoryVoiceMessage(contact, message.channelUserName ? new ZelloChannelUser(message.channelUserName) : undefined, parseInt(message.timestamp, 10), message.historyId, message.incoming, message.durationMs);
40
+ case 'image':
41
+ return new ZelloHistoryImageMessage(contact, message.channelUserName ? new ZelloChannelUser(message.channelUserName) : undefined, parseInt(message.timestamp, 10), message.historyId, message.incoming);
42
+ case 'location':
43
+ return new ZelloHistoryLocationMessage(contact, message.channelUserName ? new ZelloChannelUser(message.channelUserName) : undefined, parseInt(message.timestamp, 10), message.historyId, message.incoming, message.latitude, message.longitude, message.accuracy, message.address);
44
+ case 'text':
45
+ return new ZelloHistoryTextMessage(contact, message.channelUserName ? new ZelloChannelUser(message.channelUserName) : undefined, parseInt(message.timestamp, 10), message.historyId, message.incoming, message.text);
46
+ case 'alert':
47
+ return new ZelloHistoryAlertMessage(contact, message.channelUserName ? new ZelloChannelUser(message.channelUserName) : undefined, parseInt(message.timestamp, 10), message.historyId, message.incoming, message.text);
48
+ default:
49
+ return undefined;
50
+ }
51
+ }
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ZelloChannel","ZelloChannelConnectionStatus","ZelloChannelUser","ZelloHistoryAlertMessage","ZelloHistoryImageMessage","ZelloHistoryLocationMessage","ZelloHistoryTextMessage","ZelloHistoryVoiceMessage","ZelloIncomingEmergency","ZelloUser","ZelloUserStatus","Platform","isSameContact","a","b","name","toLowerCase","type","isAndroid","OS","isiOS","bridgeContactToSdkContact","eventContact","contact","contactName","isChannel","isMuted","isConnected","Connected","isConnecting","Connecting","Disconnected","usersOnline","options","statusValue","status","userStatus","Offline","Object","values","includes","displayName","profilePictureUrl","profilePictureThumbnailUrl","bridgeIncomingEmergencyToSdkIncomingEmergency","emergency","channel","undefined","channelUserName","emergencyId","parseInt","startTimestamp","endTimestamp","bridgeHistoryMessageToSdkHistoryMessage","message","timestamp","historyId","incoming","durationMs","latitude","longitude","accuracy","address","text"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;AAAA,SACEA,YAAY,EACZC,4BAA4B,EAC5BC,gBAAgB,EAEhBC,wBAAwB,EACxBC,wBAAwB,EACxBC,2BAA2B,EAE3BC,uBAAuB,EACvBC,wBAAwB,EACxBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,mBAAU;AACjB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,aAAa,GAAGA,CAACC,CAAe,EAAEC,CAAe,KAC5DD,CAAC,CAACE,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKF,CAAC,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,IAAIH,CAAC,CAACI,IAAI,KAAKH,CAAC,CAACG,IAAI;AAEpE,OAAO,MAAMC,SAAS,GAAGP,QAAQ,CAACQ,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMC,KAAK,GAAGT,QAAQ,CAACQ,EAAE,KAAK,KAAK;AAE1C,OAAO,SAASE,yBAAyBA,CACvCC,YAAiB,EACS;EAC1B,IAAIC,OAAiC;EACrC,MAAMC,WAAW,GAAGF,YAAY,CAAC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,gBAAgB,CAACoD,OAAO,CAACN,eAAe,CAAC,GAC7CD,SAAS,EACbG,QAAQ,CAACI,OAAO,CAACC,SAAS,EAAE,EAAE,CAAC,EAC/BD,OAAO,CAACE,SAAS,EACjBF,OAAO,CAACG,QAAQ,EAChBH,OAAO,CAACS,IACV,CAAC;IACH,KAAK,OAAO;MACV,OAAO,IAAI5D,wBAAwB,CACjCoB,OAAO,EACP+B,OAAO,CAACN,eAAe,GACnB,IAAI9C,gBAAgB,CAACoD,OAAO,CAACN,eAAe,CAAC,GAC7CD,SAAS,EACbG,QAAQ,CAACI,OAAO,CAACC,SAAS,EAAE,EAAE,CAAC,EAC/BD,OAAO,CAACE,SAAS,EACjBF,OAAO,CAACG,QAAQ,EAChBH,OAAO,CAACS,IACV,CAAC;IACH;MACE,OAAOhB,SAAS;EACpB;AACF","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,192 @@
1
+ export declare enum ZelloEvent {
2
+ /**
3
+ * The connection to the Zello Work network has failed.
4
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Disconnected | ZelloConnectionState.Disconnected}.
5
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
6
+ * @param {@link types.ZelloConnectionError | ZelloConnectionError} error The error that caused the connection to fail.
7
+ */
8
+ CONNECT_FAILED = "onConnectFailed",
9
+ /**
10
+ * The connection to the Zello Work network has started.
11
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Connecting | ZelloConnectionState.Connecting}.
12
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
13
+ * */
14
+ CONNECT_STARTED = "onConnectStarted",
15
+ /**
16
+ * The connection to the Zello Work network has succeeded.
17
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Connected | ZelloConnectionState.Connected}.
18
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
19
+ * */
20
+ CONNECT_SUCCEEDED = "onConnectSucceeded",
21
+ /**
22
+ * The connection to the Zello Work network has been disconnected.
23
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Disconnected | ZelloConnectionState.Disconnected}.
24
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
25
+ */
26
+ DISCONNECTED = "onDisconnected",
27
+ /**
28
+ * The connection to the Zello Work network is attempting to reconnect.
29
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Reconnecting | ZelloConnectionState.Reconnecting}.
30
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
31
+ */
32
+ RECONNECTING = "onWillReconnect",
33
+ /**
34
+ * The contact list has been updated.
35
+ * {@link sdk.Zello.users | Zello.users} and @{link sdk.Zello.channels | Zello.channels} will be updated.
36
+ * @param {@link types.ZelloUser | ZelloUser[]} users The list of users.
37
+ * @param {@link types.ZelloChannel | ZelloChannel[]} channels The list of channels.
38
+ */
39
+ CONTACT_LIST_UPDATED = "onContactListUpdated",
40
+ /**
41
+ * The selected contact has changed.
42
+ * {@link sdk.Zello.selectedContact | Zello.selectedContact} will be updated.
43
+ * @param {@link types.ZelloContact | ZelloContact} contact The selected contact.
44
+ */
45
+ SELECTED_CONTACT_CHANGED = "onSelectedContactChanged",
46
+ /**
47
+ * The account status has changed.
48
+ * {@link sdk.Zello.accountStatus | Zello.accountStatus} will be updated.
49
+ * @param {@link types.ZelloAccountStatus | ZelloAccountStatus} status The current account status.
50
+ */
51
+ ACCOUNT_STATUS_CHANGED = "onAccountStatusChanged",
52
+ /**
53
+ * An incoming voice message has started.
54
+ * {@link sdk.Zello.incomingVoiceMessage | Zello.incomingVoiceMessage} will be updated.
55
+ * @param {@link types.ZelloIncomingVoiceMessage | ZelloIncomingVoiceMessage} voiceMessage The incoming voice message.
56
+ */
57
+ INCOMING_VOICE_MESSAGE_STARTED = "onIncomingVoiceMessageStarted",
58
+ /**
59
+ * An incoming voice message has stopped.
60
+ * {@link sdk.Zello.incomingVoiceMessage | Zello.incomingVoiceMessage} will be set to undefined.
61
+ * @param {@link types.ZelloIncomingVoiceMessage | ZelloIncomingVoiceMessage} voiceMessage The incoming voice message.
62
+ */
63
+ INCOMING_VOICE_MESSAGE_STOPPED = "onIncomingVoiceMessageStopped",
64
+ /**
65
+ * An outgoing voice message is connecting.
66
+ * {@link sdk.Zello.outgoingVoiceMessage | Zello.outgoingVoiceMessage} will be updated.
67
+ * @param {@link types.ZelloOutgoingVoiceMessage | ZelloOutgoingVoiceMessage} voiceMessage The outgoing voice message.
68
+ */
69
+ OUTGOING_VOICE_MESSAGE_CONNECTING = "onOutgoingVoiceMessageConnecting",
70
+ /**
71
+ * An outgoing voice message has started.
72
+ * {@link sdk.Zello.outgoingVoiceMessage | Zello.outgoingVoiceMessage} will be updated.
73
+ * @param {@link types.ZelloOutgoingVoiceMessage | ZelloOutgoingVoiceMessage} voiceMessage The outgoing voice message.
74
+ */
75
+ OUTGOING_VOICE_MESSAGE_STARTED = "onOutgoingVoiceMessageStarted",
76
+ /**
77
+ * An outgoing voice message has stopped.
78
+ * {@link sdk.Zello.outgoingVoiceMessage | Zello.outgoingVoiceMessage} will be set to undefined.
79
+ * @param {@link types.ZelloOutgoingVoiceMessage | ZelloOutgoingVoiceMessage} voiceMessage The outgoing voice message.
80
+ * @param {@link types.ZelloOutgoingVoiceMessageState} error Optional; An error that caused the outgoing voice message to stop.
81
+ */
82
+ OUTGOING_VOICE_MESSAGE_STOPPED = "onOutgoingVoiceMessageStopped",
83
+ /**
84
+ * An incoming image message has been received.
85
+ * @param {@link types.ZelloImageMessage | ZelloImageMessage} imageMessage The incoming image message.
86
+ */
87
+ INCOMING_IMAGE_MESSAGE_RECEIVED = "onIncomingImageMessage",
88
+ /**
89
+ * An outgoing image message has been sent.
90
+ * @param {@link types.ZelloImageMessage | ZelloImageMessage} imageMessage The outgoing image message.
91
+ */
92
+ OUTGOING_IMAGE_MESSAGE_SENT = "onOutgoingImageMessageSent",
93
+ /**
94
+ * An outgoing image message has failed to send.
95
+ * @param {@link types.ZelloImageMessage | ZelloImageMessage} imageMessage The outgoing image message.
96
+ */
97
+ OUTGOING_IMAGE_MESSAGE_SEND_FAILED = "onOutgoingImageMessageSendFailed",
98
+ /**
99
+ * An incoming alert message has been received.
100
+ * @param {@link types.ZelloAlertMessage | ZelloAlertMessage} alertMessage The incoming alert message.
101
+ */
102
+ INCOMING_ALERT_MESSAGE_RECEIVED = "onIncomingAlertMessage",
103
+ /**
104
+ * An outgoing alert message has been sent.
105
+ * @param {@link types.ZelloAlertMessage | ZelloAlertMessage} alertMessage The outgoing alert message.
106
+ */
107
+ OUTGOING_ALERT_MESSAGE_SENT = "onOutgoingAlertMessageSent",
108
+ /**
109
+ * An outgoing alert message has failed to send.
110
+ * @param {@link types.ZelloAlertMessage | ZelloAlertMessage} alertMessage The outgoing alert message.
111
+ */
112
+ OUTGOING_ALERT_MESSAGE_SEND_FAILED = "onOutgoingAlertMessageSendFailed",
113
+ /**
114
+ * An incoming text message has been received.
115
+ * @param {@link types.ZelloTextMessage | ZelloTextMessage} textMessage The incoming text message.
116
+ */
117
+ INCOMING_TEXT_MESSAGE_RECEIVED = "onIncomingTextMessage",
118
+ /**
119
+ * An outgoing text message has been sent.
120
+ * @param {@link types.ZelloTextMessage | ZelloTextMessage} textMessage The outgoing text message.
121
+ */
122
+ OUTGOING_TEXT_MESSAGE_SENT = "onOutgoingTextMessageSent",
123
+ /**
124
+ * An outgoing text message has failed to send.
125
+ * @param {@link types.ZelloTextMessage | ZelloTextMessage} textMessage The outgoing text message.
126
+ */
127
+ OUTGOING_TEXT_MESSAGE_SEND_FAILED = "onOutgoingTextMessageSendFailed",
128
+ /**
129
+ * An incoming location message has been received.
130
+ * @param {@link types.ZelloLocationMessage | ZelloLocationMessage} locationMessage The incoming location message.
131
+ */
132
+ INCOMING_LOCATION_MESSAGE_RECEIVED = "onIncomingLocationMessage",
133
+ /**
134
+ * An outgoing location message has been sent.
135
+ * @param {@link types.ZelloLocationMessage | ZelloLocationMessage} locationMessage The outgoing location message.
136
+ */
137
+ OUTGOING_LOCATION_MESSAGE_SENT = "onOutgoingLocationMessageSent",
138
+ /**
139
+ * An outgoing location message has failed to send.
140
+ * @param {@link types.ZelloLocationMessage | ZelloLocationMessage} locationMessage The outgoing location message.
141
+ */
142
+ OUTGOING_LOCATION_MESSAGE_SEND_FAILED = "onOutgoingLocationMessageSendFailed",
143
+ /**
144
+ * An incoming emergency has started.
145
+ * {@link sdk.Zello.incomingEmergencies | Zello.incomingEmergencies} will be updated.
146
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency} emergency The incoming emergency.
147
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency[]} emergencies The list of incoming emergencies.
148
+ */
149
+ INCOMING_EMERGENCY_STARTED = "onIncomingEmergencyStarted",
150
+ /**
151
+ * An incoming emergency has stopped.
152
+ * {@link sdk.Zello.incomingEmergencies | Zello.incomingEmergencies} will be updated.
153
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency} emergency The stopped incoming emergency.
154
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency[]} emergencies The list of incoming emergencies.
155
+ */
156
+ INCOMING_EMERGENCY_STOPPED = "onIncomingEmergencyStopped",
157
+ /**
158
+ * An outgoing emergency has started.
159
+ * {@link sdk.Zello.outgoingEmergency | Zello.outgoingEmergency} will be updated.
160
+ * @param {@link types.ZelloOutgoingEmergency | ZelloOutgoingEmergency} emergency The outgoing emergency.
161
+ */
162
+ OUTGOING_EMERGENCY_STARTED = "onOutgoingEmergencyStarted",
163
+ /**
164
+ * An outgoing emergency has stopped.
165
+ * {@link sdk.Zello.outgoingEmergency | Zello.outgoingEmergency} will be set to undefined.
166
+ * @param {@link types.ZelloOutgoingEmergency | ZelloOutgoingEmergency} emergency The stopped outgoing emergency.
167
+ */
168
+ OUTGOING_EMERGENCY_STOPPED = "onOutgoingEmergencyStopped",
169
+ /**
170
+ * The list of recent entries has been updated.
171
+ * {@link sdk.Zello.recents | Zello.recents} will be updated.
172
+ * @param {@link types.ZelloRecentEntry | ZelloRecentEntry[]} recents The list of recent entries.
173
+ */
174
+ RECENTS_UPDATED = "onRecentsUpdated",
175
+ /**
176
+ * The history has been updated.
177
+ */
178
+ HISTORY_UPDATED = "onHistoryUpdated",
179
+ /**
180
+ * The history playback of a voice message has started.
181
+ * {@link sdk.Zello.historyVoiceMessage | Zello.historyVoiceMessage} will be updated.
182
+ * @param {@link types.ZelloHistoryVoiceMessage | ZelloHistoryVoiceMessage} voiceMessage The started history voice message.
183
+ */
184
+ HISTORY_PLAYBACK_STARTED = "onHistoryPlaybackStarted",
185
+ /**
186
+ * The history playback of a voice message has stopped.
187
+ * {@link sdk.Zello.historyVoiceMessage | Zello.historyVoiceMessage} will be set to undefined.
188
+ * @param {@link types.ZelloHistoryVoiceMessage | ZelloHistoryVoiceMessage} voiceMessage The stopped history voice message.
189
+ */
190
+ HISTORY_PLAYBACK_STOPPED = "onHistoryPlaybackStopped"
191
+ }
192
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/events/index.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB;;;;;OAKG;IACH,cAAc,oBAAoB;IAClC;;;;SAIK;IACL,eAAe,qBAAqB;IACpC;;;;SAIK;IACL,iBAAiB,uBAAuB;IACxC;;;;OAIG;IACH,YAAY,mBAAmB;IAC/B;;;;OAIG;IACH,YAAY,oBAAoB;IAChC;;;;;OAKG;IACH,oBAAoB,yBAAyB;IAC7C;;;;OAIG;IACH,wBAAwB,6BAA6B;IACrD;;;;OAIG;IACH,sBAAsB,2BAA2B;IACjD;;;;OAIG;IACH,8BAA8B,kCAAkC;IAChE;;;;OAIG;IACH,8BAA8B,kCAAkC;IAChE;;;;OAIG;IACH,iCAAiC,qCAAqC;IACtE;;;;OAIG;IACH,8BAA8B,kCAAkC;IAChE;;;;;OAKG;IACH,8BAA8B,kCAAkC;IAChE;;;OAGG;IACH,+BAA+B,2BAA2B;IAC1D;;;OAGG;IACH,2BAA2B,+BAA+B;IAC1D;;;OAGG;IACH,kCAAkC,qCAAqC;IACvE;;;OAGG;IACH,+BAA+B,2BAA2B;IAC1D;;;OAGG;IACH,2BAA2B,+BAA+B;IAC1D;;;OAGG;IACH,kCAAkC,qCAAqC;IACvE;;;OAGG;IACH,8BAA8B,0BAA0B;IACxD;;;OAGG;IACH,0BAA0B,8BAA8B;IACxD;;;OAGG;IACH,iCAAiC,oCAAoC;IACrE;;;OAGG;IACH,kCAAkC,8BAA8B;IAChE;;;OAGG;IACH,8BAA8B,kCAAkC;IAChE;;;OAGG;IACH,qCAAqC,wCAAwC;IAC7E;;;;;OAKG;IACH,0BAA0B,+BAA+B;IACzD;;;;;OAKG;IACH,0BAA0B,+BAA+B;IACzD;;;;OAIG;IACH,0BAA0B,+BAA+B;IACzD;;;;OAIG;IACH,0BAA0B,+BAA+B;IACzD;;;;OAIG;IACH,eAAe,qBAAqB;IACpC;;OAEG;IACH,eAAe,qBAAqB;IACpC;;;;OAIG;IACH,wBAAwB,6BAA6B;IACrD;;;;OAIG;IACH,wBAAwB,6BAA6B;CACtD"}
@@ -0,0 +1,6 @@
1
+ import { Zello } from './sdk';
2
+ export default Zello;
3
+ export * from './events';
4
+ export * from './types';
5
+ export * from './utils';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,eAAe,KAAK,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,221 @@
1
+ import { ZelloAccountStatus, ZelloChannel, ZelloChannelAlertLevel, ZelloConfig, ZelloConnectionState, ZelloContact, ZelloCredentials, ZelloHistoryImageMessage, ZelloHistoryMessage, ZelloHistoryVoiceMessage, ZelloIncomingEmergency, ZelloIncomingVoiceMessage, ZelloOutgoingEmergency, ZelloOutgoingVoiceMessage, ZelloRecentEntry, ZelloUser } from '../types';
2
+ import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
3
+ /**
4
+ * Zello SDK.
5
+ * This class is a singleton, and can be accessed via {@link Zello.getInstance}.
6
+ */
7
+ export declare class Zello extends EventEmitter {
8
+ private static instance;
9
+ static getInstance(): Zello;
10
+ /**
11
+ * The current connection state of the SDK.
12
+ */
13
+ state: ZelloConnectionState;
14
+ /**
15
+ * The currently selected contact.
16
+ */
17
+ selectedContact: ZelloContact | undefined;
18
+ /**
19
+ * The list of {@link ZelloUser} in the contact list. Sorted by name, ascending.
20
+ */
21
+ users: ZelloUser[];
22
+ /**
23
+ * The list of {@link ZelloChannel} in the contact list. Sorted by name, ascending.
24
+ */
25
+ channels: ZelloChannel[];
26
+ /**
27
+ * The current account status. undefined when {@link state} is not {@link ZelloConnectionState.Connected}.
28
+ */
29
+ accountStatus: ZelloAccountStatus | undefined;
30
+ /**
31
+ * The current incoming voice message.
32
+ */
33
+ incomingVoiceMessage: ZelloIncomingVoiceMessage | undefined;
34
+ /**
35
+ * The current outgoing voice message.
36
+ */
37
+ outgoingVoiceMessage: ZelloOutgoingVoiceMessage | undefined;
38
+ /**
39
+ * The configured emergency channel.
40
+ */
41
+ emergencyChannel: ZelloChannel | undefined;
42
+ /**
43
+ * The list of incoming emergencies. There can be multiple emergencies on the emergency channel at once.
44
+ * Sorted by start timestamp, ascending.
45
+ */
46
+ incomingEmergencies: ZelloIncomingEmergency[];
47
+ /**
48
+ * The current outgoing emergency.
49
+ */
50
+ outgoingEmergency: ZelloOutgoingEmergency | undefined;
51
+ /**
52
+ * The list of recent entries. Sorted by timestamp, descending.
53
+ */
54
+ recents: ZelloRecentEntry[];
55
+ /**
56
+ * The currently playing history voice message.
57
+ */
58
+ historyVoiceMessage: ZelloHistoryVoiceMessage | undefined;
59
+ private eventListener;
60
+ private constructor();
61
+ /**
62
+ * Sets configuration variables for the SDK.
63
+ *
64
+ * At the moment, this is only functional on Android.
65
+ *
66
+ * @param config The configuration to set.
67
+ */
68
+ configure(config: ZelloConfig): void;
69
+ /**
70
+ * Destroys the SDK instance and cleans up resources.
71
+ * Call this when you are done using the SDK instance for good (application quit).
72
+ */
73
+ destroy(): void;
74
+ /**
75
+ * Signs into to the Zello Work network using the provided credentials.
76
+ * This will typically trigger the {@link ZelloEvent.CONNECT_STARTED} event, followed by either {@link ZelloEvent.CONNECT_SUCCEEDED} or {@link ZelloEvent.CONNECT_FAILED}.
77
+ * However, if the state is incorrect, {@link ZelloEvent.CONNECT_FAILED} will be triggered immediately.
78
+ * @param credentials The credentials to use for signing in.
79
+ */
80
+ connect(credentials: ZelloCredentials): void;
81
+ /**
82
+ * Signs out of the Zello Work network.
83
+ * This will trigger the {@link ZelloEvent.DISCONNECTED} event.
84
+ */
85
+ disconnect(): void;
86
+ /**
87
+ * Returns the user with the given name. Case-insensitive.
88
+ * @param name The name of the user to search for.
89
+ * @return The user with the given name, or null if no user with that name exists.
90
+ */
91
+ getUser(name: string): ZelloUser | undefined;
92
+ /**
93
+ * Returns the channel with the given name. Case-insensitive.
94
+ * @param name The name of the channel to search for.
95
+ * @return The channel with the given name, or null if no channel with that name exists.
96
+ */
97
+ getChannel(name: string): ZelloChannel | undefined;
98
+ /**
99
+ * Sets the selected contact.
100
+ * While optional, this is typically used for tracking the contact that the user is currently interacting with.
101
+ * This will trigger the {@link ZelloEvent.SELECTED_CONTACT_CHANGED} event.
102
+ * @param contact The contact to set as selected.
103
+ */
104
+ setSelectedContact(contact: ZelloContact): void;
105
+ /**
106
+ * Sets the user's online account status.
107
+ * This will trigger the {@link ZelloEvent.ACCOUNT_STATUS_CHANGED} event.
108
+ * @param status The account status to set.
109
+ */
110
+ setAccountStatus(status: ZelloAccountStatus): void;
111
+ /**
112
+ * Connects to the given channel.
113
+ * Once connected, the user will be able to send and receive messages from the channel.
114
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
115
+ * @param channel The channel to connect to.
116
+ */
117
+ connectChannel(channel: ZelloChannel): void;
118
+ /**
119
+ * Disconnects from the given channel.
120
+ * Once disconnected, the user will no longer be able to send or receive messages from the channel.
121
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
122
+ * @param channel The channel to disconnect from.
123
+ */
124
+ disconnectChannel(channel: ZelloChannel): void;
125
+ /**
126
+ * Starts a voice message with the given contact.
127
+ * This will trigger the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_CONNECTING} event, followed by the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_STARTED} event.
128
+ * If there is an error, the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_STOPPED} event will be triggered.
129
+ * @param contact The contact to start the voice message with.
130
+ */
131
+ startVoiceMessage(contact: ZelloContact): void;
132
+ /**
133
+ * Stops the current outgoing voice message.
134
+ * This will trigger the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_STOPPED} event.
135
+ */
136
+ stopVoiceMessage(): void;
137
+ /**
138
+ * Sends the image message data to the given contact.
139
+ * This will trigger the {@link ZelloEvent.OUTGOING_IMAGE_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_IMAGE_MESSAGE_SEND_FAILED} event.
140
+ * @param contact The contact to send the image to.
141
+ * @param data The image data to send.
142
+ */
143
+ sendImage(contact: ZelloContact, data: number[]): void;
144
+ /**
145
+ * Sends the alert message to the given contact.
146
+ * This will trigger the {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SEND_FAILED} event.
147
+ * @param contact The contact to send the alert to.
148
+ */
149
+ sendLocation(contact: ZelloContact): void;
150
+ /**
151
+ * Sends the text message to the given contact.
152
+ * This will trigger the {@link ZelloEvent.OUTGOING_TEXT_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_TEXT_MESSAGE_SEND_FAILED} event.
153
+ * @param contact The contact to send the text to.
154
+ * @param text The text to send.
155
+ */
156
+ sendText(contact: ZelloContact, text: string): void;
157
+ /**
158
+ * Sends the alert message to the given contact.
159
+ * This will trigger the {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SEND_FAILED} event.
160
+ * @param contact The contact to send the alert to.
161
+ * @param text The text to send.
162
+ * @param level Optional; The alert level to send. Only applicable for channels.
163
+ */
164
+ sendAlert(contact: ZelloContact, text: string, level?: ZelloChannelAlertLevel): void;
165
+ /**
166
+ * Submits a problem report to Zello.
167
+ * Additionally, please contact us to provide more information on what happened.
168
+ */
169
+ submitProblemReport(): void;
170
+ /**
171
+ * Mutes the given contact. When muted, incoming messages from this contact will not play live, but will still appear in the history.
172
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
173
+ * @param contact The contact to mute.
174
+ */
175
+ muteContact(contact: ZelloContact): void;
176
+ /**
177
+ * Unmutes a previously muted contact. When unmuted, incoming messages from this contact will play live.
178
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
179
+ * @param contact The contact to unmute.
180
+ */
181
+ unmuteContact(contact: ZelloContact): void;
182
+ /**
183
+ * Starts an outgoing emergency to the emergency channel.
184
+ * Upon starting, the user's location will be sent, an alert message will be sent, and a 10-second-long voice message will start recording.
185
+ * This will trigger the {@link ZelloEvent.OUTGOING_EMERGENCY_STARTED} event.
186
+ */
187
+ startEmergency(): void;
188
+ /**
189
+ * Stops the outgoing emergency.
190
+ * This will trigger the {@link ZelloEvent.OUTGOING_EMERGENCY_STOPPED} event.
191
+ */
192
+ stopEmergency(): void;
193
+ /**
194
+ * Returns the history messages for the given contact.
195
+ * @param contact The contact to get the history for.
196
+ * @param size Optional; The number of history items to retrieve. Defaults to 50.
197
+ * @return The history items for the given contact.
198
+ */
199
+ getHistory(contact: ZelloContact, size?: number): Promise<ZelloHistoryMessage[]>;
200
+ /**
201
+ * Plays the given history message.
202
+ * This will trigger the {@link ZelloEvent.HISTORY_PLAYBACK_STARTED} event.
203
+ * @param message The history message to play.
204
+ */
205
+ playHistoryMessage(message: ZelloHistoryVoiceMessage): void;
206
+ /**
207
+ * Stops the current history message playback.
208
+ * This will trigger the {@link ZelloEvent.HISTORY_PLAYBACK_STOPPED} event.
209
+ */
210
+ stopHistoryMessagePlayback(): void;
211
+ /**
212
+ * Returns the image data for the given history image message.
213
+ * @param message The history image message to get the image data for.
214
+ * @return The image data for the given history image message.
215
+ */
216
+ getImageDataForHistoryImageMessage(message: ZelloHistoryImageMessage): Promise<string | undefined>;
217
+ private setupEventListener;
218
+ private clearContactList;
219
+ private static getSdk;
220
+ }
221
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAElB,YAAY,EACZ,sBAAsB,EAEtB,WAAW,EAEX,oBAAoB,EACpB,YAAY,EAEZ,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EAExB,sBAAsB,EACtB,yBAAyB,EAEzB,sBAAsB,EACtB,yBAAyB,EAGzB,gBAAgB,EAEhB,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAW9E;;;GAGG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAQ;WAEjB,WAAW,IAAI,KAAK;IAOlC;;OAEG;IACI,KAAK,EAAE,oBAAoB,CAAqC;IAEvE;;OAEG;IACI,eAAe,EAAE,YAAY,GAAG,SAAS,CAAC;IAEjD;;OAEG;IACI,KAAK,EAAE,SAAS,EAAE,CAAM;IAC/B;;OAEG;IACI,QAAQ,EAAE,YAAY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