@trycourier/courier-react-native 3.2.2 → 4.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 (253) hide show
  1. package/README.md +14 -3
  2. package/android/build.gradle +4 -1
  3. package/android/src/main/java/com/courierreactnative/CourierClientModule.kt +441 -0
  4. package/android/src/main/java/com/courierreactnative/CourierInboxViewManager.kt +2 -2
  5. package/android/src/main/java/com/courierreactnative/CourierReactNativeActivity.kt +4 -0
  6. package/android/src/main/java/com/courierreactnative/CourierReactNativePackage.kt +9 -3
  7. package/android/src/main/java/com/courierreactnative/CourierSharedModule.kt +312 -0
  8. package/android/src/main/java/com/courierreactnative/CourierSystemModule.kt +91 -0
  9. package/android/src/main/java/com/courierreactnative/ReactNativeModule.kt +36 -0
  10. package/android/src/main/java/com/courierreactnative/{Extensions.kt → Utils.kt} +5 -5
  11. package/courier-react-native.podspec +1 -1
  12. package/ios/CourierClientModule.swift +450 -0
  13. package/ios/CourierInboxReactNativeManager.swift +17 -9
  14. package/ios/CourierReactNativeDelegate.m +21 -35
  15. package/ios/CourierReactNativeEventEmitter.swift +25 -0
  16. package/ios/CourierReactNativeModule.m +192 -23
  17. package/ios/CourierSharedModule.swift +412 -0
  18. package/ios/CourierSystemModule.swift +136 -0
  19. package/ios/Utils.swift +103 -115
  20. package/lib/commonjs/Broadcaster.js +30 -0
  21. package/lib/commonjs/Broadcaster.js.map +1 -0
  22. package/lib/commonjs/Modules.js +25 -0
  23. package/lib/commonjs/Modules.js.map +1 -0
  24. package/lib/commonjs/client/BrandClient.js +25 -0
  25. package/lib/commonjs/client/BrandClient.js.map +1 -0
  26. package/lib/commonjs/client/ClientModule.js +21 -0
  27. package/lib/commonjs/client/ClientModule.js.map +1 -0
  28. package/lib/commonjs/client/CourierClient.js +33 -0
  29. package/lib/commonjs/client/CourierClient.js.map +1 -0
  30. package/lib/commonjs/client/InboxClient.js +116 -0
  31. package/lib/commonjs/client/InboxClient.js.map +1 -0
  32. package/lib/commonjs/client/PreferenceClient.js +73 -0
  33. package/lib/commonjs/client/PreferenceClient.js.map +1 -0
  34. package/lib/commonjs/client/TokenClient.js +36 -0
  35. package/lib/commonjs/client/TokenClient.js.map +1 -0
  36. package/lib/commonjs/client/TrackingClient.js +25 -0
  37. package/lib/commonjs/client/TrackingClient.js.map +1 -0
  38. package/lib/commonjs/index.js +418 -186
  39. package/lib/commonjs/index.js.map +1 -1
  40. package/lib/commonjs/models/Android_CourierSheet.js.map +1 -1
  41. package/lib/commonjs/models/CourierAuthenticationListener.js.map +1 -1
  42. package/lib/commonjs/models/CourierBrand.js +2 -0
  43. package/lib/commonjs/models/{CourierUserPreferencesTopic.js.map → CourierBrand.js.map} +1 -1
  44. package/lib/commonjs/models/CourierButton.js.map +1 -1
  45. package/lib/commonjs/models/CourierDevice.js +2 -0
  46. package/lib/commonjs/models/CourierDevice.js.map +1 -0
  47. package/lib/commonjs/models/CourierFont.js.map +1 -1
  48. package/lib/commonjs/models/CourierInboxListener.js +2 -2
  49. package/lib/commonjs/models/CourierInboxListener.js.map +1 -1
  50. package/lib/commonjs/models/{CourierUserPreferencesTopic.js → CourierInboxMessages.js} +1 -1
  51. package/lib/commonjs/models/CourierInboxMessages.js.map +1 -0
  52. package/lib/commonjs/models/CourierInboxTheme.js.map +1 -1
  53. package/lib/commonjs/models/CourierInfoViewStyle.js.map +1 -1
  54. package/lib/commonjs/models/CourierPaging.js.map +1 -1
  55. package/lib/commonjs/models/CourierPreferencesTheme.js.map +1 -1
  56. package/lib/commonjs/models/CourierPushListener.js +7 -3
  57. package/lib/commonjs/models/CourierPushListener.js.map +1 -1
  58. package/lib/commonjs/models/CourierPushProvider.js.map +1 -1
  59. package/lib/commonjs/models/CourierTrackingEvent.js +16 -0
  60. package/lib/commonjs/models/CourierTrackingEvent.js.map +1 -0
  61. package/lib/commonjs/models/CourierUserPreferences.js +54 -0
  62. package/lib/commonjs/models/CourierUserPreferences.js.map +1 -1
  63. package/lib/commonjs/models/InboxAction.js.map +1 -1
  64. package/lib/commonjs/models/InboxMessage.js.map +1 -1
  65. package/lib/commonjs/models/iOS_CourierCell.js.map +1 -1
  66. package/lib/commonjs/models/iOS_CourierSheet.js.map +1 -1
  67. package/lib/commonjs/utils.js +9 -17
  68. package/lib/commonjs/utils.js.map +1 -1
  69. package/lib/commonjs/views/CourierInboxView.js +3 -3
  70. package/lib/commonjs/views/CourierInboxView.js.map +1 -1
  71. package/lib/commonjs/views/CourierPreferencesView.js.map +1 -1
  72. package/lib/module/Broadcaster.js +23 -0
  73. package/lib/module/Broadcaster.js.map +1 -0
  74. package/lib/module/Modules.js +18 -0
  75. package/lib/module/Modules.js.map +1 -0
  76. package/lib/module/client/BrandClient.js +18 -0
  77. package/lib/module/client/BrandClient.js.map +1 -0
  78. package/lib/module/client/ClientModule.js +14 -0
  79. package/lib/module/client/ClientModule.js.map +1 -0
  80. package/lib/module/client/CourierClient.js +26 -0
  81. package/lib/module/client/CourierClient.js.map +1 -0
  82. package/lib/module/client/InboxClient.js +109 -0
  83. package/lib/module/client/InboxClient.js.map +1 -0
  84. package/lib/module/client/PreferenceClient.js +66 -0
  85. package/lib/module/client/PreferenceClient.js.map +1 -0
  86. package/lib/module/client/TokenClient.js +29 -0
  87. package/lib/module/client/TokenClient.js.map +1 -0
  88. package/lib/module/client/TrackingClient.js +18 -0
  89. package/lib/module/client/TrackingClient.js.map +1 -0
  90. package/lib/module/index.js +383 -185
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/models/Android_CourierSheet.js.map +1 -1
  93. package/lib/module/models/CourierAuthenticationListener.js.map +1 -1
  94. package/lib/module/models/CourierBrand.js +2 -0
  95. package/lib/module/models/{CourierUserPreferencesTopic.js.map → CourierBrand.js.map} +1 -1
  96. package/lib/module/models/CourierButton.js.map +1 -1
  97. package/lib/module/models/CourierDevice.js +2 -0
  98. package/lib/module/models/CourierDevice.js.map +1 -0
  99. package/lib/module/models/CourierFont.js.map +1 -1
  100. package/lib/module/models/CourierInboxListener.js +1 -1
  101. package/lib/module/models/CourierInboxListener.js.map +1 -1
  102. package/lib/module/models/CourierInboxMessages.js +2 -0
  103. package/lib/module/models/CourierInboxMessages.js.map +1 -0
  104. package/lib/module/models/CourierInboxTheme.js.map +1 -1
  105. package/lib/module/models/CourierInfoViewStyle.js.map +1 -1
  106. package/lib/module/models/CourierPaging.js.map +1 -1
  107. package/lib/module/models/CourierPreferencesTheme.js.map +1 -1
  108. package/lib/module/models/CourierPushListener.js +7 -3
  109. package/lib/module/models/CourierPushListener.js.map +1 -1
  110. package/lib/module/models/CourierPushProvider.js.map +1 -1
  111. package/lib/module/models/CourierTrackingEvent.js +9 -0
  112. package/lib/module/models/CourierTrackingEvent.js.map +1 -0
  113. package/lib/module/models/CourierUserPreferences.js +53 -1
  114. package/lib/module/models/CourierUserPreferences.js.map +1 -1
  115. package/lib/module/models/InboxAction.js.map +1 -1
  116. package/lib/module/models/InboxMessage.js.map +1 -1
  117. package/lib/module/models/iOS_CourierCell.js.map +1 -1
  118. package/lib/module/models/iOS_CourierSheet.js.map +1 -1
  119. package/lib/module/utils.js +7 -16
  120. package/lib/module/utils.js.map +1 -1
  121. package/lib/module/views/CourierInboxView.js +3 -3
  122. package/lib/module/views/CourierInboxView.js.map +1 -1
  123. package/lib/module/views/CourierPreferencesView.js.map +1 -1
  124. package/lib/typescript/src/Broadcaster.d.ts +14 -0
  125. package/lib/typescript/src/Broadcaster.d.ts.map +1 -0
  126. package/lib/typescript/src/Modules.d.ts +8 -0
  127. package/lib/typescript/src/Modules.d.ts.map +1 -0
  128. package/lib/typescript/src/client/BrandClient.d.ts +15 -0
  129. package/lib/typescript/src/client/BrandClient.d.ts.map +1 -0
  130. package/lib/typescript/src/client/ClientModule.d.ts +8 -0
  131. package/lib/typescript/src/client/ClientModule.d.ts.map +1 -0
  132. package/lib/typescript/src/client/CourierClient.d.ts +31 -0
  133. package/lib/typescript/src/client/CourierClient.d.ts.map +1 -0
  134. package/lib/typescript/src/client/InboxClient.d.ts +94 -0
  135. package/lib/typescript/src/client/InboxClient.d.ts.map +1 -0
  136. package/lib/typescript/src/client/PreferenceClient.d.ts +39 -0
  137. package/lib/typescript/src/client/PreferenceClient.d.ts.map +1 -0
  138. package/lib/typescript/src/client/TokenClient.d.ts +28 -0
  139. package/lib/typescript/src/client/TokenClient.d.ts.map +1 -0
  140. package/lib/typescript/src/client/TrackingClient.d.ts +17 -0
  141. package/lib/typescript/src/client/TrackingClient.d.ts.map +1 -0
  142. package/lib/typescript/src/index.d.ts +300 -0
  143. package/lib/typescript/src/index.d.ts.map +1 -0
  144. package/lib/typescript/src/models/Android_CourierSheet.d.ts.map +1 -0
  145. package/lib/typescript/src/models/CourierAuthenticationListener.d.ts.map +1 -0
  146. package/lib/typescript/src/models/CourierBrand.d.ts +20 -0
  147. package/lib/typescript/src/models/CourierBrand.d.ts.map +1 -0
  148. package/lib/typescript/src/models/CourierButton.d.ts.map +1 -0
  149. package/lib/typescript/src/models/CourierDevice.d.ts +9 -0
  150. package/lib/typescript/src/models/CourierDevice.d.ts.map +1 -0
  151. package/lib/typescript/src/models/CourierFont.d.ts.map +1 -0
  152. package/lib/typescript/src/models/CourierInboxListener.d.ts.map +1 -0
  153. package/lib/typescript/src/models/CourierInboxMessages.d.ts +23 -0
  154. package/lib/typescript/src/models/CourierInboxMessages.d.ts.map +1 -0
  155. package/lib/typescript/src/models/CourierInboxTheme.d.ts.map +1 -0
  156. package/lib/typescript/src/models/CourierInfoViewStyle.d.ts.map +1 -0
  157. package/lib/typescript/src/models/CourierPaging.d.ts.map +1 -0
  158. package/lib/typescript/src/models/CourierPreferencesTheme.d.ts.map +1 -0
  159. package/lib/typescript/src/models/CourierPushListener.d.ts +8 -0
  160. package/lib/typescript/src/models/CourierPushListener.d.ts.map +1 -0
  161. package/lib/typescript/src/models/CourierPushProvider.d.ts.map +1 -0
  162. package/lib/typescript/src/models/CourierTrackingEvent.d.ts +8 -0
  163. package/lib/typescript/src/models/CourierTrackingEvent.d.ts.map +1 -0
  164. package/lib/typescript/src/models/CourierUserPreferences.d.ts +35 -0
  165. package/lib/typescript/src/models/CourierUserPreferences.d.ts.map +1 -0
  166. package/lib/typescript/src/models/InboxAction.d.ts.map +1 -0
  167. package/lib/typescript/src/models/InboxMessage.d.ts.map +1 -0
  168. package/lib/typescript/src/models/iOS_CourierCell.d.ts.map +1 -0
  169. package/lib/typescript/src/models/iOS_CourierSheet.d.ts.map +1 -0
  170. package/lib/typescript/src/utils.d.ts +14 -0
  171. package/lib/typescript/src/utils.d.ts.map +1 -0
  172. package/lib/typescript/src/views/CourierInboxView.d.ts.map +1 -0
  173. package/lib/typescript/src/views/CourierPreferencesView.d.ts.map +1 -0
  174. package/package.json +3 -3
  175. package/src/Broadcaster.tsx +32 -0
  176. package/src/Modules.tsx +28 -0
  177. package/src/client/BrandClient.tsx +23 -0
  178. package/src/client/ClientModule.tsx +21 -0
  179. package/src/client/CourierClient.tsx +49 -0
  180. package/src/client/InboxClient.tsx +114 -0
  181. package/src/client/PreferenceClient.tsx +77 -0
  182. package/src/client/TokenClient.tsx +34 -0
  183. package/src/client/TrackingClient.tsx +23 -0
  184. package/src/index.tsx +398 -205
  185. package/src/models/CourierBrand.tsx +24 -0
  186. package/src/models/CourierDevice.tsx +8 -0
  187. package/src/models/CourierInboxListener.tsx +1 -1
  188. package/src/models/CourierInboxMessages.tsx +28 -0
  189. package/src/models/CourierPushListener.tsx +11 -6
  190. package/src/models/CourierTrackingEvent.tsx +7 -0
  191. package/src/models/CourierUserPreferences.tsx +70 -3
  192. package/src/utils.tsx +7 -23
  193. package/src/views/CourierInboxView.tsx +3 -3
  194. package/android/src/main/java/com/courierreactnative/CourierReactNativeModule.kt +0 -393
  195. package/ios/CourierReactNativeModule.swift +0 -524
  196. package/lib/commonjs/models/CourierUserPreferencesChannel.js +0 -17
  197. package/lib/commonjs/models/CourierUserPreferencesChannel.js.map +0 -1
  198. package/lib/commonjs/models/CourierUserPreferencesStatus.js +0 -15
  199. package/lib/commonjs/models/CourierUserPreferencesStatus.js.map +0 -1
  200. package/lib/module/models/CourierUserPreferencesChannel.js +0 -10
  201. package/lib/module/models/CourierUserPreferencesChannel.js.map +0 -1
  202. package/lib/module/models/CourierUserPreferencesStatus.js +0 -8
  203. package/lib/module/models/CourierUserPreferencesStatus.js.map +0 -1
  204. package/lib/module/models/CourierUserPreferencesTopic.js +0 -2
  205. package/lib/typescript/index.d.ts +0 -199
  206. package/lib/typescript/index.d.ts.map +0 -1
  207. package/lib/typescript/models/Android_CourierSheet.d.ts.map +0 -1
  208. package/lib/typescript/models/CourierAuthenticationListener.d.ts.map +0 -1
  209. package/lib/typescript/models/CourierButton.d.ts.map +0 -1
  210. package/lib/typescript/models/CourierFont.d.ts.map +0 -1
  211. package/lib/typescript/models/CourierInboxListener.d.ts.map +0 -1
  212. package/lib/typescript/models/CourierInboxTheme.d.ts.map +0 -1
  213. package/lib/typescript/models/CourierInfoViewStyle.d.ts.map +0 -1
  214. package/lib/typescript/models/CourierPaging.d.ts.map +0 -1
  215. package/lib/typescript/models/CourierPreferencesTheme.d.ts.map +0 -1
  216. package/lib/typescript/models/CourierPushListener.d.ts +0 -7
  217. package/lib/typescript/models/CourierPushListener.d.ts.map +0 -1
  218. package/lib/typescript/models/CourierPushProvider.d.ts.map +0 -1
  219. package/lib/typescript/models/CourierUserPreferences.d.ts +0 -7
  220. package/lib/typescript/models/CourierUserPreferences.d.ts.map +0 -1
  221. package/lib/typescript/models/CourierUserPreferencesChannel.d.ts +0 -9
  222. package/lib/typescript/models/CourierUserPreferencesChannel.d.ts.map +0 -1
  223. package/lib/typescript/models/CourierUserPreferencesStatus.d.ts +0 -7
  224. package/lib/typescript/models/CourierUserPreferencesStatus.d.ts.map +0 -1
  225. package/lib/typescript/models/CourierUserPreferencesTopic.d.ts +0 -13
  226. package/lib/typescript/models/CourierUserPreferencesTopic.d.ts.map +0 -1
  227. package/lib/typescript/models/InboxAction.d.ts.map +0 -1
  228. package/lib/typescript/models/InboxMessage.d.ts.map +0 -1
  229. package/lib/typescript/models/iOS_CourierCell.d.ts.map +0 -1
  230. package/lib/typescript/models/iOS_CourierSheet.d.ts.map +0 -1
  231. package/lib/typescript/utils.d.ts +0 -21
  232. package/lib/typescript/utils.d.ts.map +0 -1
  233. package/lib/typescript/views/CourierInboxView.d.ts.map +0 -1
  234. package/lib/typescript/views/CourierPreferencesView.d.ts.map +0 -1
  235. package/src/models/CourierUserPreferencesChannel.tsx +0 -8
  236. package/src/models/CourierUserPreferencesStatus.tsx +0 -6
  237. package/src/models/CourierUserPreferencesTopic.tsx +0 -13
  238. /package/lib/typescript/{models → src/models}/Android_CourierSheet.d.ts +0 -0
  239. /package/lib/typescript/{models → src/models}/CourierAuthenticationListener.d.ts +0 -0
  240. /package/lib/typescript/{models → src/models}/CourierButton.d.ts +0 -0
  241. /package/lib/typescript/{models → src/models}/CourierFont.d.ts +0 -0
  242. /package/lib/typescript/{models → src/models}/CourierInboxListener.d.ts +0 -0
  243. /package/lib/typescript/{models → src/models}/CourierInboxTheme.d.ts +0 -0
  244. /package/lib/typescript/{models → src/models}/CourierInfoViewStyle.d.ts +0 -0
  245. /package/lib/typescript/{models → src/models}/CourierPaging.d.ts +0 -0
  246. /package/lib/typescript/{models → src/models}/CourierPreferencesTheme.d.ts +0 -0
  247. /package/lib/typescript/{models → src/models}/CourierPushProvider.d.ts +0 -0
  248. /package/lib/typescript/{models → src/models}/InboxAction.d.ts +0 -0
  249. /package/lib/typescript/{models → src/models}/InboxMessage.d.ts +0 -0
  250. /package/lib/typescript/{models → src/models}/iOS_CourierCell.d.ts +0 -0
  251. /package/lib/typescript/{models → src/models}/iOS_CourierSheet.d.ts +0 -0
  252. /package/lib/typescript/{views → src/views}/CourierInboxView.d.ts +0 -0
  253. /package/lib/typescript/{views → src/views}/CourierPreferencesView.d.ts +0 -0
@@ -0,0 +1,136 @@
1
+ //
2
+ // CourierSystemModule.swift
3
+ // courier-react-native
4
+ //
5
+ // Created by Michael Miller on 8/27/24.
6
+ //
7
+
8
+ import Courier_iOS
9
+
10
+ @objc(CourierSystemModule)
11
+ class CourierSystemModule: CourierReactNativeEventEmitter {
12
+
13
+ private var lastClickedMessage: [AnyHashable: Any]? = nil
14
+ private var notificationCenter: NotificationCenter {
15
+ get { return NotificationCenter.default }
16
+ }
17
+
18
+ override init() {
19
+ super.init()
20
+ attachObservers()
21
+ }
22
+
23
+ // MARK: Push Interactions
24
+
25
+ private func attachObservers() {
26
+
27
+ notificationCenter.addObserver(
28
+ self,
29
+ selector: #selector(pushNotificationClicked),
30
+ name: Notification.Name(rawValue: PushEvents.CLICKED_EVENT),
31
+ object: nil
32
+ )
33
+
34
+ notificationCenter.addObserver(
35
+ self,
36
+ selector: #selector(pushNotificationDelivered),
37
+ name: Notification.Name(rawValue: PushEvents.DELIVERED_EVENT),
38
+ object: nil
39
+ )
40
+
41
+ }
42
+
43
+ @objc private func pushNotificationClicked(notification: Notification) {
44
+
45
+ // Cache the last clicked message
46
+ lastClickedMessage = notification.userInfo
47
+
48
+ guard let message = lastClickedMessage else {
49
+ return
50
+ }
51
+
52
+ self.broadcast(
53
+ name: PushEvents.CLICKED_EVENT,
54
+ message: message
55
+ )
56
+
57
+ }
58
+
59
+ @objc private func pushNotificationDelivered(notification: Notification) {
60
+
61
+ guard let message = notification.userInfo else {
62
+ return
63
+ }
64
+
65
+ self.broadcast(
66
+ name: PushEvents.DELIVERED_EVENT,
67
+ message: message
68
+ )
69
+
70
+ }
71
+
72
+ @objc func registerPushNotificationClickedOnKilledState() {
73
+
74
+ guard let message = lastClickedMessage else {
75
+ return
76
+ }
77
+
78
+ broadcast(
79
+ name: PushEvents.CLICKED_EVENT,
80
+ message: message
81
+ )
82
+
83
+ }
84
+
85
+ // MARK: Open App
86
+
87
+ @objc func openSettingsForApp() {
88
+ DispatchQueue.main.async {
89
+ Courier.openSettingsForApp()
90
+ }
91
+ }
92
+
93
+ // MARK: Notification Permissions
94
+
95
+ @objc(getNotificationPermissionStatus:withRejecter:)
96
+ func getNotificationPermissionStatus(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
97
+
98
+ Courier.getNotificationPermissionStatus { status in
99
+ resolve(status.name)
100
+ }
101
+
102
+ }
103
+
104
+ @objc(requestNotificationPermission:withRejecter:)
105
+ func requestNotificationPermission(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
106
+
107
+ Courier.requestNotificationPermission { status in
108
+ resolve(status.name)
109
+ }
110
+
111
+ }
112
+
113
+ // MARK: Notification Styling
114
+
115
+ @objc(setIOSForegroundPresentationOptions:)
116
+ func setIOSForegroundPresentationOptions(params: NSDictionary) -> String {
117
+
118
+ let rawValue = params.toPresentationOptions().rawValue
119
+ NotificationCenter.default.post(
120
+ name: Notification.Name("iosForegroundNotificationPresentationOptions"),
121
+ object: nil,
122
+ userInfo: ["options": rawValue]
123
+ )
124
+
125
+ return String(describing: rawValue)
126
+
127
+ }
128
+
129
+ override func supportedEvents() -> [String]! {
130
+ return [
131
+ PushEvents.CLICKED_EVENT,
132
+ PushEvents.DELIVERED_EVENT
133
+ ]
134
+ }
135
+
136
+ }
package/ios/Utils.swift CHANGED
@@ -23,121 +23,6 @@ extension UNAuthorizationStatus {
23
23
 
24
24
  }
25
25
 
26
- internal extension [String: Any?] {
27
-
28
- func clean() -> NSMutableDictionary {
29
-
30
- let mutableDictionary = NSMutableDictionary()
31
- for (key, value) in self {
32
- if let unwrappedValue = value {
33
- mutableDictionary[key] = unwrappedValue
34
- }
35
- }
36
-
37
- return mutableDictionary
38
-
39
- }
40
-
41
- }
42
-
43
- internal extension CourierUserPreferences {
44
-
45
- @objc func toDictionary() -> NSDictionary {
46
-
47
- let dictionary: [String: Any?] = [
48
- "items": items.map { $0.toDictionary() },
49
- "paging": paging.toDictionary(),
50
- ]
51
-
52
- return dictionary.clean()
53
-
54
- }
55
-
56
- }
57
-
58
- internal extension CourierUserPreferencesTopic {
59
-
60
- @objc func toDictionary() -> NSDictionary {
61
-
62
- let dictionary: [String: Any?] = [
63
- "defaultStatus": defaultStatus.rawValue,
64
- "hasCustomRouting": hasCustomRouting,
65
- "customRouting": customRouting.map { $0.rawValue },
66
- "status": status,
67
- "topicId": topicId,
68
- "topicName": topicName,
69
- "sectionName": sectionName,
70
- "sectionId": sectionId,
71
- ]
72
-
73
- return dictionary.clean()
74
-
75
- }
76
-
77
- }
78
-
79
- internal extension CourierUserPreferencesPaging {
80
-
81
- @objc func toDictionary() -> NSDictionary {
82
-
83
- let dictionary: [String: Any?] = [
84
- "cursor": cursor,
85
- "more": more,
86
- ]
87
-
88
- return dictionary.clean()
89
-
90
- }
91
-
92
- }
93
-
94
- internal extension InboxMessage {
95
-
96
- @objc func toDictionary() -> NSDictionary {
97
-
98
- let dictionary: [String: Any?] = [
99
- "messageId": messageId,
100
- "title": title,
101
- "body": body,
102
- "preview": preview,
103
- "created": created,
104
- "actions": actions?.map { $0.toDictionary() },
105
- "data": data,
106
- "read": isRead,
107
- "opened": isOpened,
108
- "archived": isArchived,
109
- "trackingIds": [
110
- "archiveTrackingId": trackingIds?.archiveTrackingId,
111
- "openTrackingId": trackingIds?.openTrackingId,
112
- "clickTrackingId": trackingIds?.clickTrackingId,
113
- "deliverTrackingId": trackingIds?.deliverTrackingId,
114
- "unreadTrackingId": trackingIds?.unreadTrackingId,
115
- "readTrackingId": trackingIds?.readTrackingId,
116
- ]
117
- ]
118
-
119
- return dictionary.clean()
120
-
121
- }
122
-
123
- }
124
-
125
- internal extension InboxAction {
126
-
127
- @objc func toDictionary() -> NSDictionary {
128
-
129
- let dictionary: [String: Any?] = [
130
- "content": content,
131
- "href": href,
132
- "data": data
133
- ]
134
-
135
- return dictionary.clean()
136
-
137
- }
138
-
139
- }
140
-
141
26
  internal extension String {
142
27
 
143
28
  func toRowAnimation() -> UITableView.RowAnimation {
@@ -275,3 +160,106 @@ internal extension NSDictionary {
275
160
  }
276
161
 
277
162
  }
163
+
164
+ internal extension Encodable {
165
+
166
+ func toJson() throws -> String? {
167
+ let encoder = JSONEncoder()
168
+ encoder.outputFormatting = .prettyPrinted
169
+ let data = try encoder.encode(self)
170
+ return String(data: data, encoding: .utf8) ?? nil
171
+ }
172
+
173
+ }
174
+
175
+ internal class Rejections {
176
+
177
+ private static let CLIENT_TAG = "Courier Client Error"
178
+ private static let SHARED_TAG = "Courier SDK Error"
179
+
180
+ static func missingClient(_ reject: @escaping RCTPromiseRejectBlock) {
181
+ reject("Missing Client", Rejections.CLIENT_TAG, nil)
182
+ }
183
+
184
+ static func clientError(_ reject: @escaping RCTPromiseRejectBlock, error: Error) {
185
+ reject(String(describing: error), Rejections.CLIENT_TAG, nil)
186
+ }
187
+
188
+ static func sharedError(_ reject: @escaping RCTPromiseRejectBlock, error: Error) {
189
+ reject(String(describing: error), Rejections.SHARED_TAG, nil)
190
+ }
191
+
192
+ }
193
+
194
+ extension [AnyHashable: Any] {
195
+
196
+ func toString() throws -> String {
197
+ let json = try JSONSerialization.data(withJSONObject: self)
198
+ let str = String(data: json, encoding: .utf8)
199
+ return str ?? "Invalid JSON"
200
+ }
201
+
202
+ }
203
+
204
+ extension NSDictionary {
205
+
206
+ func toPresentationOptions() -> UNNotificationPresentationOptions {
207
+
208
+ var foregroundPresentationOptions: UNNotificationPresentationOptions = []
209
+
210
+ if let options = self["options"] as? [String] {
211
+ options.forEach { option in
212
+ switch option {
213
+ case "sound": foregroundPresentationOptions.insert(.sound)
214
+ case "badge": foregroundPresentationOptions.insert(.badge)
215
+ case "list": if #available(iOS 14.0, *) { foregroundPresentationOptions.insert(.list) } else { foregroundPresentationOptions.insert(.alert) }
216
+ case "banner": if #available(iOS 14.0, *) { foregroundPresentationOptions.insert(.banner) } else { foregroundPresentationOptions.insert(.alert) }
217
+ default: break
218
+ }
219
+ }
220
+ }
221
+
222
+ return foregroundPresentationOptions
223
+
224
+ }
225
+
226
+ }
227
+
228
+ internal class LogEvents {
229
+ static let DEBUG_LOG = "courierDebugEvent"
230
+ }
231
+
232
+ internal class PushEvents {
233
+ static let CLICKED_EVENT = "pushNotificationClicked"
234
+ static let DELIVERED_EVENT = "pushNotificationDelivered"
235
+ }
236
+
237
+ // MARK: Broadcasting
238
+
239
+ internal extension RCTEventEmitter {
240
+
241
+ func broadcast(name: String, body: Any? = nil) {
242
+
243
+ let events: [String]? = supportedEvents()
244
+ if (events?.contains(name) != true) {
245
+ return
246
+ }
247
+
248
+ sendEvent(
249
+ withName: name,
250
+ body: body
251
+ )
252
+
253
+ }
254
+
255
+ func broadcast(name: String, message: [AnyHashable: Any]? = nil) {
256
+
257
+ do {
258
+ broadcast(name: name, body: try message?.toString())
259
+ } catch {
260
+ Courier.shared.client?.log(String(describing: error))
261
+ }
262
+
263
+ }
264
+
265
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ class Broadcaster {
9
+ constructor(module) {
10
+ this.emitter = new _reactNative.NativeEventEmitter(module);
11
+ }
12
+
13
+ /**
14
+ * Creates an event listener for the native function
15
+ * @param key Key for the listener
16
+ * @param callback Value returned for the listener callback
17
+ * @returns Subscription
18
+ */
19
+ addListener(id, callback) {
20
+ if (_reactNative.Platform.OS === 'android') {
21
+ return _reactNative.DeviceEventEmitter.addListener(id, event => callback(event));
22
+ }
23
+ if (_reactNative.Platform.OS === 'ios') {
24
+ return this.emitter.addListener(id, event => callback(event));
25
+ }
26
+ return undefined;
27
+ }
28
+ }
29
+ exports.default = Broadcaster;
30
+ //# sourceMappingURL=Broadcaster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","Broadcaster","constructor","module","emitter","NativeEventEmitter","addListener","id","callback","Platform","OS","DeviceEventEmitter","event","undefined","exports","default"],"sourceRoot":"../../src","sources":["Broadcaster.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEe,MAAMC,WAAW,CAAC;EAI/BC,WAAWA,CAACC,MAAoB,EAAE;IAChC,IAAI,CAACC,OAAO,GAAG,IAAIC,+BAAkB,CAACF,MAAM,CAAC;EAC/C;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,WAAWA,CAACC,EAAU,EAAEC,QAA8B,EAAmC;IAEvF,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MAC7B,OAAOC,+BAAkB,CAACL,WAAW,CAACC,EAAE,EAAGK,KAAU,IAAKJ,QAAQ,CAACI,KAAK,CAAC,CAAC;IAC5E;IAEA,IAAIH,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB,OAAO,IAAI,CAACN,OAAO,CAACE,WAAW,CAACC,EAAE,EAAGK,KAAU,IAAKJ,QAAQ,CAACI,KAAK,CAAC,CAAC;IACtE;IAEA,OAAOC,SAAS;EAElB;AAEF;AAACC,OAAA,CAAAC,OAAA,GAAAd,WAAA","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Modules = void 0;
7
+ var _reactNative = require("react-native");
8
+ class Modules {
9
+ static LINKING_ERROR = `The package '@trycourier/courier-react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
10
+ ios: "- You have run 'pod install'\n",
11
+ default: ''
12
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
13
+ static Client = Modules.getNativeModule(_reactNative.NativeModules.CourierClientModule);
14
+ static Shared = Modules.getNativeModule(_reactNative.NativeModules.CourierSharedModule);
15
+ static System = Modules.getNativeModule(_reactNative.NativeModules.CourierSystemModule);
16
+ static getNativeModule(nativeModule) {
17
+ return nativeModule ? nativeModule : new Proxy({}, {
18
+ get() {
19
+ throw new Error(Modules.LINKING_ERROR);
20
+ }
21
+ });
22
+ }
23
+ }
24
+ exports.Modules = Modules;
25
+ //# sourceMappingURL=Modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","Modules","LINKING_ERROR","Platform","select","ios","default","Client","getNativeModule","NativeModules","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","nativeModule","Proxy","get","Error","exports"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,OAAO,CAAC;EAEnB,OAAgBC,aAAa,GAC7B,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;IAAEC,GAAG,EAAE,gCAAgC;IAAEC,OAAO,EAAE;EAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;EAE/B,OAAgBC,MAAM,GAAGN,OAAO,CAACO,eAAe,CAACC,0BAAa,CAACC,mBAAmB,CAAC;EACnF,OAAgBC,MAAM,GAAGV,OAAO,CAACO,eAAe,CAACC,0BAAa,CAACG,mBAAmB,CAAC;EACnF,OAAgBC,MAAM,GAAGZ,OAAO,CAACO,eAAe,CAACC,0BAAa,CAACK,mBAAmB,CAAC;EAEnF,OAAON,eAAeA,CAAIO,YAA2B,EAAK;IACxD,OAAOA,YAAY,GACfA,YAAY,GACZ,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;MACEC,GAAGA,CAAA,EAAG;QACJ,MAAM,IAAIC,KAAK,CAACjB,OAAO,CAACC,aAAa,CAAC;MACxC;IACF,CACF,CAAM;EACZ;AAEF;AAACiB,OAAA,CAAAlB,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BrandClient = void 0;
7
+ var _Modules = require("../Modules");
8
+ class BrandClient {
9
+ constructor(clientId) {
10
+ this.clientId = clientId;
11
+ }
12
+
13
+ /**
14
+ * Retrieves brand information for a specific brand ID.
15
+ * @param props - The properties for getting the brand.
16
+ * @param props.brandId - The ID of the brand to retrieve.
17
+ * @returns A promise that resolves with the CourierBrandResponse containing brand information.
18
+ */
19
+ async getBrand(props) {
20
+ const json = await _Modules.Modules.Client.getBrand(this.clientId, props.brandId);
21
+ return JSON.parse(json);
22
+ }
23
+ }
24
+ exports.BrandClient = BrandClient;
25
+ //# sourceMappingURL=BrandClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Modules","require","BrandClient","constructor","clientId","getBrand","props","json","Modules","Client","brandId","JSON","parse","exports"],"sourceRoot":"../../../src","sources":["client/BrandClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,WAAW,CAAC;EAIvBC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAaC,QAAQA,CAACC,KAA0B,EAAiC;IAC/E,MAAMC,IAAI,GAAG,MAAMC,gBAAO,CAACC,MAAM,CAACJ,QAAQ,CAAC,IAAI,CAACD,QAAQ,EAAEE,KAAK,CAACI,OAAO,CAAC;IACxE,OAAOC,IAAI,CAACC,KAAK,CAACL,IAAI,CAAC;EACzB;AAEF;AAACM,OAAA,CAAAX,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ClientModule = void 0;
7
+ var _Modules = require("../Modules");
8
+ class ClientModule {
9
+ // Constructor to create a low level CourierClient
10
+ constructor(options) {
11
+ this.clientId = this.add(options);
12
+ }
13
+ add(options) {
14
+ return _Modules.Modules.Client.addClient(options);
15
+ }
16
+ remove() {
17
+ return _Modules.Modules.Client.removeClient(this.clientId);
18
+ }
19
+ }
20
+ exports.ClientModule = ClientModule;
21
+ //# sourceMappingURL=ClientModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Modules","require","ClientModule","constructor","options","clientId","add","Modules","Client","addClient","remove","removeClient","exports"],"sourceRoot":"../../../src","sources":["client/ClientModule.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAeC,YAAY,CAAC;EAIjC;EACAC,WAAWA,CAACC,OAA6B,EAAE;IACzC,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACC,GAAG,CAACF,OAAO,CAAC;EACnC;EAEQE,GAAGA,CAACF,OAA6B,EAAU;IACjD,OAAOG,gBAAO,CAACC,MAAM,CAACC,SAAS,CAACL,OAAO,CAAC;EAC1C;EAEOM,MAAMA,CAAA,EAAW;IACtB,OAAOH,gBAAO,CAACC,MAAM,CAACG,YAAY,CAAC,IAAI,CAACN,QAAQ,CAAC;EACnD;AAEF;AAACO,OAAA,CAAAV,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CourierClient = void 0;
7
+ var _ = require("..");
8
+ var _ClientModule = require("./ClientModule");
9
+ var _InboxClient = require("./InboxClient");
10
+ var _PreferenceClient = require("./PreferenceClient");
11
+ var _TokenClient = require("./TokenClient");
12
+ var _TrackingClient = require("./TrackingClient");
13
+ class CourierClient extends _ClientModule.ClientModule {
14
+ constructor(props) {
15
+ const options = {
16
+ userId: props.userId,
17
+ showLogs: props.showLogs ?? __DEV__,
18
+ jwt: props.jwt,
19
+ clientKey: props.clientKey,
20
+ connectionId: props.clientKey,
21
+ tenantId: props.tenantId
22
+ };
23
+ super(options);
24
+ this.options = options;
25
+ this.tokens = new _TokenClient.TokenClient(this.clientId);
26
+ this.brands = new _.BrandClient(this.clientId);
27
+ this.inbox = new _InboxClient.InboxClient(this.clientId);
28
+ this.preferences = new _PreferenceClient.PreferenceClient(this.clientId);
29
+ this.tracking = new _TrackingClient.TrackingClient(this.clientId);
30
+ }
31
+ }
32
+ exports.CourierClient = CourierClient;
33
+ //# sourceMappingURL=CourierClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_","require","_ClientModule","_InboxClient","_PreferenceClient","_TokenClient","_TrackingClient","CourierClient","ClientModule","constructor","props","options","userId","showLogs","__DEV__","jwt","clientKey","connectionId","tenantId","tokens","TokenClient","clientId","brands","BrandClient","inbox","InboxClient","preferences","PreferenceClient","tracking","TrackingClient","exports"],"sourceRoot":"../../../src","sources":["client/CourierClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAWO,MAAMM,aAAa,SAASC,0BAAY,CAAC;EAS9CC,WAAWA,CAACC,KAAyH,EAAE;IAErI,MAAMC,OAAO,GAAG;MACdC,MAAM,EAAEF,KAAK,CAACE,MAAM;MACpBC,QAAQ,EAAEH,KAAK,CAACG,QAAQ,IAAIC,OAAO;MACnCC,GAAG,EAAEL,KAAK,CAACK,GAAG;MACdC,SAAS,EAAEN,KAAK,CAACM,SAAS;MAC1BC,YAAY,EAAEP,KAAK,CAACM,SAAS;MAC7BE,QAAQ,EAAER,KAAK,CAACQ;IAClB,CAAC;IAED,KAAK,CAACP,OAAO,CAAC;IAEd,IAAI,CAACA,OAAO,GAAGA,OAAO;IAEtB,IAAI,CAACQ,MAAM,GAAG,IAAIC,wBAAW,CAAC,IAAI,CAACC,QAAQ,CAAC;IAC5C,IAAI,CAACC,MAAM,GAAG,IAAIC,aAAW,CAAC,IAAI,CAACF,QAAQ,CAAC;IAC5C,IAAI,CAACG,KAAK,GAAG,IAAIC,wBAAW,CAAC,IAAI,CAACJ,QAAQ,CAAC;IAC3C,IAAI,CAACK,WAAW,GAAG,IAAIC,kCAAgB,CAAC,IAAI,CAACN,QAAQ,CAAC;IACtD,IAAI,CAACO,QAAQ,GAAG,IAAIC,8BAAc,CAAC,IAAI,CAACR,QAAQ,CAAC;EAEnD;AAEF;AAACS,OAAA,CAAAvB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InboxClient = void 0;
7
+ var _Modules = require("../Modules");
8
+ class InboxClient {
9
+ constructor(clientId) {
10
+ this.clientId = clientId;
11
+ }
12
+
13
+ /**
14
+ * Retrieves messages from the inbox.
15
+ * @param props - The properties for getting messages.
16
+ * @param props.paginationLimit - Optional. The number of messages to retrieve per page. Defaults to 24.
17
+ * @param props.startCursor - Optional. The cursor to start retrieving messages from.
18
+ * @returns A promise that resolves with the CourierGetInboxMessagesResponse containing the messages.
19
+ */
20
+ async getMessages(props) {
21
+ const json = await _Modules.Modules.Client.getMessages(this.clientId, props.paginationLimit ?? 24, props.startCursor);
22
+ return JSON.parse(json);
23
+ }
24
+
25
+ /**
26
+ * Retrieves archived messages from the inbox.
27
+ * @param props - The properties for getting archived messages.
28
+ * @param props.paginationLimit - Optional. The number of messages to retrieve per page. Defaults to 24.
29
+ * @param props.startCursor - Optional. The cursor to start retrieving messages from.
30
+ * @returns A promise that resolves with the CourierGetInboxMessagesResponse containing the archived messages.
31
+ */
32
+ async getArchivedMessages(props) {
33
+ const json = await _Modules.Modules.Client.getArchivedMessages(this.clientId, props.paginationLimit ?? 24, props.startCursor);
34
+ return JSON.parse(json);
35
+ }
36
+
37
+ /**
38
+ * Retrieves a specific message by its ID.
39
+ * @param props - The properties for getting the message.
40
+ * @param props.messageId - The ID of the message to retrieve.
41
+ * @returns A promise that resolves with the CourierGetInboxMessageResponse containing the message.
42
+ */
43
+ async getMessageById(props) {
44
+ const json = await _Modules.Modules.Client.getMessageById(this.clientId, props.messageId);
45
+ return JSON.parse(json);
46
+ }
47
+
48
+ /**
49
+ * Retrieves the count of unread messages in the inbox.
50
+ * @returns A promise that resolves with the number of unread messages.
51
+ */
52
+ async getUnreadMessageCount() {
53
+ return await _Modules.Modules.Client.getUnreadMessageCount(this.clientId);
54
+ }
55
+
56
+ /**
57
+ * Marks a message as opened.
58
+ * @param props - The properties for opening the message.
59
+ * @param props.messageId - The ID of the message to mark as opened.
60
+ * @returns A promise that resolves with a number indicating the operation result.
61
+ */
62
+ async open(props) {
63
+ return await _Modules.Modules.Client.openMessage(this.clientId, props.messageId);
64
+ }
65
+
66
+ /**
67
+ * Marks a message as read.
68
+ * @param props - The properties for reading the message.
69
+ * @param props.messageId - The ID of the message to mark as read.
70
+ * @returns A promise that resolves with a number indicating the operation result.
71
+ */
72
+ async read(props) {
73
+ return await _Modules.Modules.Client.readMessage(this.clientId, props.messageId);
74
+ }
75
+
76
+ /**
77
+ * Marks a message as unread.
78
+ * @param props - The properties for marking the message as unread.
79
+ * @param props.messageId - The ID of the message to mark as unread.
80
+ * @returns A promise that resolves with a number indicating the operation result.
81
+ */
82
+ async unread(props) {
83
+ return await _Modules.Modules.Client.unreadMessage(this.clientId, props.messageId);
84
+ }
85
+
86
+ /**
87
+ * Records a click event for a message.
88
+ * @param props - The properties for clicking the message.
89
+ * @param props.messageId - The ID of the message that was clicked.
90
+ * @param props.trackingId - The tracking ID associated with the click event.
91
+ * @returns A promise that resolves with a number indicating the operation result.
92
+ */
93
+ async click(props) {
94
+ return await _Modules.Modules.Client.clickMessage(this.clientId, props.messageId, props.trackingId);
95
+ }
96
+
97
+ /**
98
+ * Archives a message.
99
+ * @param props - The properties for archiving the message.
100
+ * @param props.messageId - The ID of the message to archive.
101
+ * @returns A promise that resolves with a number indicating the operation result.
102
+ */
103
+ async archive(props) {
104
+ return await _Modules.Modules.Client.archiveMessage(this.clientId, props.messageId);
105
+ }
106
+
107
+ /**
108
+ * Marks all messages as read.
109
+ * @returns A promise that resolves with a number indicating the operation result.
110
+ */
111
+ async readAll() {
112
+ return await _Modules.Modules.Client.readAllMessages(this.clientId);
113
+ }
114
+ }
115
+ exports.InboxClient = InboxClient;
116
+ //# sourceMappingURL=InboxClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Modules","require","InboxClient","constructor","clientId","getMessages","props","json","Modules","Client","paginationLimit","startCursor","JSON","parse","getArchivedMessages","getMessageById","messageId","getUnreadMessageCount","open","openMessage","read","readMessage","unread","unreadMessage","click","clickMessage","trackingId","archive","archiveMessage","readAll","readAllMessages","exports"],"sourceRoot":"../../../src","sources":["client/InboxClient.tsx"],"mappings":"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","ignoreList":[]}