@aws-amplify/notifications 2.0.1-console-preview.8f82e46.0 → 2.0.1-console-preview.b278dcb.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 (616) hide show
  1. package/lib/{common/eventListeners/index.js → eventListeners/eventListeners.js} +0 -1
  2. package/lib/eventListeners/index.d.ts +2 -0
  3. package/lib/{common → eventListeners}/index.js +0 -3
  4. package/{lib-esm/common → lib}/eventListeners/types.d.ts +2 -2
  5. package/lib/{common/AWSPinpointProviderCommon → eventListeners}/types.js +0 -1
  6. package/lib/inAppMessaging/errors/InAppMessagingError.js +0 -1
  7. package/lib/inAppMessaging/errors/assertServiceError.js +0 -1
  8. package/lib/inAppMessaging/errors/assertValidationError.js +0 -1
  9. package/lib/inAppMessaging/errors/index.js +0 -1
  10. package/lib/inAppMessaging/errors/validation.d.ts +0 -1
  11. package/lib/inAppMessaging/errors/validation.js +0 -5
  12. package/lib/inAppMessaging/index.js +0 -1
  13. package/lib/inAppMessaging/providers/index.js +0 -1
  14. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +2 -3
  15. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +4 -6
  16. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +8 -12
  17. package/lib/inAppMessaging/providers/pinpoint/apis/index.js +0 -1
  18. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +12 -16
  19. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +2 -3
  20. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +2 -3
  21. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +2 -3
  22. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +2 -3
  23. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +2 -3
  24. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
  25. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +6 -17
  26. package/lib/inAppMessaging/providers/pinpoint/index.js +0 -1
  27. package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +0 -1
  28. package/lib/inAppMessaging/providers/pinpoint/types/index.js +0 -3
  29. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
  30. package/lib/inAppMessaging/providers/pinpoint/types/options.js +0 -1
  31. package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +1 -1
  32. package/lib/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
  33. package/lib/inAppMessaging/providers/pinpoint/types/types.js +0 -1
  34. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
  35. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +1 -1
  36. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +2 -2
  37. package/lib/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
  38. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +1 -1
  39. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +1 -4
  40. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
  41. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
  42. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
  43. package/lib/inAppMessaging/types/event.js +0 -1
  44. package/lib/inAppMessaging/types/index.d.ts +0 -1
  45. package/lib/inAppMessaging/types/index.js +0 -1
  46. package/lib/inAppMessaging/types/inputs.d.ts +1 -3
  47. package/lib/inAppMessaging/types/inputs.js +0 -1
  48. package/lib/inAppMessaging/types/message.js +0 -1
  49. package/lib/inAppMessaging/types/options.d.ts +1 -1
  50. package/lib/inAppMessaging/types/options.js +0 -1
  51. package/lib/inAppMessaging/utils/index.js +0 -1
  52. package/lib/inAppMessaging/utils/statusHelpers.js +0 -1
  53. package/lib/index.d.ts +0 -4
  54. package/lib/index.js +0 -7
  55. package/lib/pushNotifications/errors/PushNotificationError.d.ts +4 -0
  56. package/lib/pushNotifications/errors/PushNotificationError.js +19 -0
  57. package/lib/pushNotifications/errors/errorHelpers.d.ts +9 -0
  58. package/lib/pushNotifications/errors/errorHelpers.js +34 -0
  59. package/lib/pushNotifications/errors/index.d.ts +2 -0
  60. package/lib/pushNotifications/errors/index.js +9 -0
  61. package/lib/pushNotifications/index.d.ts +3 -2
  62. package/lib/pushNotifications/index.js +12 -3
  63. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
  64. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +20 -0
  65. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
  66. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +14 -0
  67. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
  68. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +24 -0
  69. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
  70. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +11 -0
  71. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
  72. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +33 -0
  73. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
  74. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +11 -0
  75. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -2
  76. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +55 -5
  77. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
  78. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +42 -0
  79. package/lib/pushNotifications/providers/pinpoint/apis/index.d.ts +10 -0
  80. package/lib/pushNotifications/providers/pinpoint/apis/index.js +20 -1
  81. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
  82. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +23 -0
  83. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
  84. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +158 -0
  85. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
  86. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +33 -0
  87. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
  88. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +10 -0
  89. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
  90. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +49 -0
  91. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
  92. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +10 -0
  93. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
  94. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +33 -0
  95. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
  96. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +10 -0
  97. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
  98. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +34 -0
  99. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
  100. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +10 -0
  101. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
  102. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +38 -0
  103. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
  104. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +11 -0
  105. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
  106. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +20 -0
  107. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
  108. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +11 -0
  109. package/lib/pushNotifications/providers/pinpoint/index.d.ts +3 -1
  110. package/lib/pushNotifications/providers/pinpoint/index.js +10 -1
  111. package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
  112. package/lib/{common/eventListeners/types.js → pushNotifications/providers/pinpoint/types/analytics.js} +0 -1
  113. package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
  114. package/lib/{inAppMessaging/sessionTracker/types.js → pushNotifications/providers/pinpoint/types/apis.js} +0 -1
  115. package/lib/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
  116. package/lib/pushNotifications/{Platform/types.js → providers/pinpoint/types/index.js} +0 -1
  117. package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
  118. package/lib/pushNotifications/providers/pinpoint/types/inputs.js +4 -0
  119. package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
  120. package/lib/pushNotifications/providers/pinpoint/types/options.js +4 -0
  121. package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
  122. package/lib/pushNotifications/providers/pinpoint/types/outputs.js +4 -0
  123. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
  124. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +4 -0
  125. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +5 -0
  126. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +59 -0
  127. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +6 -0
  128. package/lib/pushNotifications/providers/{AWSPinpointProvider/utils.js → pinpoint/utils/getAnalyticsEvent.js} +8 -10
  129. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +4 -0
  130. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +23 -0
  131. package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.d.ts +2 -0
  132. package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +11 -0
  133. package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +3 -0
  134. package/lib/pushNotifications/providers/pinpoint/utils/index.js +10 -0
  135. package/lib/pushNotifications/types/errors.d.ts +3 -0
  136. package/lib/pushNotifications/types/errors.js +8 -0
  137. package/lib/pushNotifications/types/index.d.ts +5 -0
  138. package/lib/pushNotifications/types/index.js +6 -0
  139. package/lib/pushNotifications/types/inputs.d.ts +23 -0
  140. package/lib/pushNotifications/types/inputs.js +4 -0
  141. package/lib/pushNotifications/types/options.d.ts +4 -0
  142. package/lib/pushNotifications/types/options.js +4 -0
  143. package/lib/pushNotifications/types/outputs.d.ts +10 -0
  144. package/lib/pushNotifications/types/outputs.js +4 -0
  145. package/lib/pushNotifications/types/pushNotifications.d.ts +5 -0
  146. package/lib/pushNotifications/types/pushNotifications.js +4 -0
  147. package/lib/pushNotifications/utils/index.d.ts +4 -0
  148. package/lib/pushNotifications/utils/index.js +14 -0
  149. package/lib/pushNotifications/utils/initializationManager.d.ts +12 -0
  150. package/lib/pushNotifications/utils/initializationManager.js +23 -0
  151. package/lib/pushNotifications/utils/resolveConfig.d.ts +7 -0
  152. package/lib/pushNotifications/utils/resolveConfig.js +16 -0
  153. package/lib/pushNotifications/utils/resolveCredentials.d.ts +7 -0
  154. package/lib/pushNotifications/utils/resolveCredentials.js +22 -0
  155. package/lib/pushNotifications/utils/tokenManager.d.ts +12 -0
  156. package/lib/pushNotifications/utils/tokenManager.js +19 -0
  157. package/lib/tsconfig.build.tsbuildinfo +8589 -0
  158. package/lib-esm/{common/eventListeners/index.js → eventListeners/eventListeners.js} +0 -1
  159. package/lib-esm/eventListeners/index.d.ts +2 -0
  160. package/lib-esm/{common → eventListeners}/index.js +0 -2
  161. package/{lib/common → lib-esm}/eventListeners/types.d.ts +2 -2
  162. package/lib-esm/{common/AWSPinpointProviderCommon → eventListeners}/types.js +0 -1
  163. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +0 -1
  164. package/lib-esm/inAppMessaging/errors/assertServiceError.js +0 -1
  165. package/lib-esm/inAppMessaging/errors/assertValidationError.js +0 -1
  166. package/lib-esm/inAppMessaging/errors/index.js +0 -1
  167. package/lib-esm/inAppMessaging/errors/validation.d.ts +0 -1
  168. package/lib-esm/inAppMessaging/errors/validation.js +0 -5
  169. package/lib-esm/inAppMessaging/index.js +0 -1
  170. package/lib-esm/inAppMessaging/providers/index.js +0 -1
  171. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +1 -2
  172. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +4 -6
  173. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +9 -13
  174. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +0 -1
  175. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +4 -7
  176. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +1 -2
  177. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +1 -2
  178. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +1 -2
  179. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +1 -2
  180. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +1 -2
  181. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
  182. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +8 -19
  183. package/lib-esm/inAppMessaging/providers/pinpoint/index.js +0 -1
  184. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +0 -1
  185. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +0 -2
  186. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
  187. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +0 -1
  188. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +1 -1
  189. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
  190. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +0 -1
  191. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
  192. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +1 -1
  193. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +2 -2
  194. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
  195. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +1 -1
  196. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +1 -4
  197. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
  198. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
  199. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
  200. package/lib-esm/inAppMessaging/types/event.js +0 -1
  201. package/lib-esm/inAppMessaging/types/index.d.ts +0 -1
  202. package/lib-esm/inAppMessaging/types/index.js +0 -1
  203. package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -3
  204. package/lib-esm/inAppMessaging/types/inputs.js +0 -1
  205. package/lib-esm/inAppMessaging/types/message.js +0 -1
  206. package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
  207. package/lib-esm/inAppMessaging/types/options.js +0 -1
  208. package/lib-esm/inAppMessaging/utils/index.js +0 -1
  209. package/lib-esm/inAppMessaging/utils/statusHelpers.js +0 -1
  210. package/lib-esm/index.d.ts +0 -4
  211. package/lib-esm/index.js +0 -3
  212. package/lib-esm/pushNotifications/errors/PushNotificationError.d.ts +4 -0
  213. package/lib-esm/pushNotifications/errors/PushNotificationError.js +17 -0
  214. package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +9 -0
  215. package/lib-esm/pushNotifications/errors/errorHelpers.js +32 -0
  216. package/lib-esm/pushNotifications/errors/index.d.ts +2 -0
  217. package/lib-esm/pushNotifications/errors/index.js +4 -0
  218. package/lib-esm/pushNotifications/index.d.ts +3 -2
  219. package/lib-esm/pushNotifications/index.js +2 -3
  220. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
  221. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +18 -0
  222. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
  223. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +12 -0
  224. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
  225. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +22 -0
  226. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
  227. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +9 -0
  228. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
  229. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +31 -0
  230. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
  231. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +9 -0
  232. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -2
  233. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +55 -4
  234. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
  235. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +40 -0
  236. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.d.ts +10 -0
  237. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +10 -1
  238. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
  239. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +21 -0
  240. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
  241. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +156 -0
  242. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
  243. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +31 -0
  244. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
  245. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +8 -0
  246. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
  247. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +47 -0
  248. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
  249. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +8 -0
  250. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
  251. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +31 -0
  252. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
  253. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +8 -0
  254. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
  255. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +32 -0
  256. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
  257. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +8 -0
  258. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
  259. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +36 -0
  260. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
  261. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +9 -0
  262. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
  263. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +18 -0
  264. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
  265. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +9 -0
  266. package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +3 -1
  267. package/lib-esm/pushNotifications/providers/pinpoint/index.js +1 -2
  268. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
  269. package/lib-esm/{common/eventListeners/types.js → pushNotifications/providers/pinpoint/types/analytics.js} +0 -1
  270. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
  271. package/lib-esm/{inAppMessaging/sessionTracker/types.js → pushNotifications/providers/pinpoint/types/apis.js} +0 -1
  272. package/lib-esm/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
  273. package/lib-esm/pushNotifications/{Platform/types.js → providers/pinpoint/types/index.js} +0 -1
  274. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
  275. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +2 -0
  276. package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
  277. package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +2 -0
  278. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
  279. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +2 -0
  280. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
  281. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +2 -0
  282. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +5 -0
  283. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +57 -0
  284. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +6 -0
  285. package/lib-esm/pushNotifications/providers/{AWSPinpointProvider/utils.js → pinpoint/utils/getAnalyticsEvent.js} +8 -10
  286. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +4 -0
  287. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +21 -0
  288. package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.d.ts +2 -0
  289. package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +9 -0
  290. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +3 -0
  291. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +5 -0
  292. package/lib-esm/pushNotifications/types/errors.d.ts +3 -0
  293. package/lib-esm/pushNotifications/types/errors.js +6 -0
  294. package/lib-esm/pushNotifications/types/index.d.ts +5 -0
  295. package/lib-esm/pushNotifications/types/index.js +3 -0
  296. package/lib-esm/pushNotifications/types/inputs.d.ts +23 -0
  297. package/lib-esm/pushNotifications/types/inputs.js +2 -0
  298. package/lib-esm/pushNotifications/types/options.d.ts +4 -0
  299. package/lib-esm/pushNotifications/types/options.js +2 -0
  300. package/lib-esm/pushNotifications/types/outputs.d.ts +10 -0
  301. package/lib-esm/pushNotifications/types/outputs.js +2 -0
  302. package/lib-esm/pushNotifications/types/pushNotifications.d.ts +5 -0
  303. package/lib-esm/pushNotifications/types/pushNotifications.js +2 -0
  304. package/lib-esm/pushNotifications/utils/index.d.ts +4 -0
  305. package/lib-esm/pushNotifications/utils/index.js +6 -0
  306. package/lib-esm/pushNotifications/utils/initializationManager.d.ts +12 -0
  307. package/lib-esm/pushNotifications/utils/initializationManager.js +21 -0
  308. package/lib-esm/pushNotifications/utils/resolveConfig.d.ts +7 -0
  309. package/lib-esm/pushNotifications/utils/resolveConfig.js +14 -0
  310. package/lib-esm/pushNotifications/utils/resolveCredentials.d.ts +7 -0
  311. package/lib-esm/pushNotifications/utils/resolveCredentials.js +20 -0
  312. package/lib-esm/pushNotifications/utils/tokenManager.d.ts +12 -0
  313. package/lib-esm/pushNotifications/utils/tokenManager.js +17 -0
  314. package/lib-esm/tsconfig.build.tsbuildinfo +7080 -0
  315. package/package.json +12 -12
  316. package/push-notifications/package.json +4 -4
  317. package/src/{common → eventListeners}/index.ts +1 -6
  318. package/src/{common/eventListeners → eventListeners}/types.ts +2 -2
  319. package/src/inAppMessaging/errors/validation.ts +0 -4
  320. package/src/inAppMessaging/providers/pinpoint/apis/dispatchEvent.ts +1 -1
  321. package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +9 -8
  322. package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +4 -6
  323. package/src/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.ts +1 -1
  324. package/src/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.ts +1 -1
  325. package/src/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.ts +1 -1
  326. package/src/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.ts +1 -1
  327. package/src/inAppMessaging/providers/pinpoint/apis/onMessageReceived.ts +1 -1
  328. package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +12 -29
  329. package/src/inAppMessaging/providers/pinpoint/types/index.ts +0 -1
  330. package/src/inAppMessaging/providers/pinpoint/types/outputs.ts +1 -1
  331. package/src/inAppMessaging/providers/pinpoint/utils/helpers.ts +2 -4
  332. package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +2 -4
  333. package/src/inAppMessaging/types/index.ts +0 -1
  334. package/src/inAppMessaging/types/inputs.ts +1 -3
  335. package/src/inAppMessaging/types/options.ts +1 -1
  336. package/src/index.ts +0 -9
  337. package/src/pushNotifications/errors/PushNotificationError.ts +18 -0
  338. package/src/pushNotifications/errors/errorHelpers.ts +45 -0
  339. package/src/pushNotifications/errors/index.ts +5 -0
  340. package/src/pushNotifications/index.ts +27 -5
  341. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +13 -0
  342. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +21 -0
  343. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +14 -0
  344. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +26 -0
  345. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +14 -0
  346. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +34 -0
  347. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +36 -0
  348. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +58 -7
  349. package/src/pushNotifications/providers/pinpoint/apis/index.ts +10 -0
  350. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +199 -0
  351. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.ts +24 -0
  352. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +11 -0
  353. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.ts +39 -0
  354. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +12 -0
  355. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.ts +56 -0
  356. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +12 -0
  357. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.ts +40 -0
  358. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +11 -0
  359. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.ts +39 -0
  360. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +14 -0
  361. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +39 -0
  362. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +13 -0
  363. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.ts +21 -0
  364. package/src/pushNotifications/providers/pinpoint/index.ts +30 -1
  365. package/src/pushNotifications/providers/pinpoint/types/analytics.ts +14 -0
  366. package/src/pushNotifications/providers/pinpoint/types/apis.ts +54 -0
  367. package/src/pushNotifications/providers/pinpoint/types/index.ts +40 -0
  368. package/src/pushNotifications/providers/pinpoint/types/inputs.ts +31 -0
  369. package/src/pushNotifications/providers/pinpoint/types/options.ts +9 -0
  370. package/src/pushNotifications/providers/pinpoint/types/outputs.ts +34 -0
  371. package/src/pushNotifications/providers/pinpoint/types/pushNotifications.ts +6 -0
  372. package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +65 -0
  373. package/src/pushNotifications/providers/{AWSPinpointProvider/utils.ts → pinpoint/utils/getAnalyticsEvent.ts} +19 -21
  374. package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +25 -0
  375. package/src/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.ts +15 -0
  376. package/src/pushNotifications/providers/pinpoint/utils/index.ts +6 -0
  377. package/src/pushNotifications/{providers/index.ts → types/errors.ts} +3 -1
  378. package/src/pushNotifications/types/index.ts +8 -0
  379. package/src/pushNotifications/types/inputs.ts +45 -0
  380. package/src/pushNotifications/types/options.ts +7 -0
  381. package/src/pushNotifications/types/outputs.ts +28 -0
  382. package/src/pushNotifications/types/pushNotifications.ts +22 -0
  383. package/src/pushNotifications/utils/index.ts +7 -0
  384. package/src/pushNotifications/utils/initializationManager.ts +20 -0
  385. package/src/pushNotifications/utils/resolveConfig.ts +16 -0
  386. package/src/pushNotifications/utils/resolveCredentials.ts +14 -0
  387. package/src/pushNotifications/utils/tokenManager.ts +20 -0
  388. package/lib/.tsbuildinfo +0 -3
  389. package/lib/common/AWSPinpointProviderCommon/index.d.ts +0 -39
  390. package/lib/common/AWSPinpointProviderCommon/index.js +0 -289
  391. package/lib/common/AWSPinpointProviderCommon/index.js.map +0 -1
  392. package/lib/common/AWSPinpointProviderCommon/types.d.ts +0 -10
  393. package/lib/common/AWSPinpointProviderCommon/types.js.map +0 -1
  394. package/lib/common/eventListeners/index.js.map +0 -1
  395. package/lib/common/eventListeners/types.js.map +0 -1
  396. package/lib/common/index.d.ts +0 -3
  397. package/lib/common/index.js.map +0 -1
  398. package/lib/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
  399. package/lib/inAppMessaging/errors/assertServiceError.js.map +0 -1
  400. package/lib/inAppMessaging/errors/assertValidationError.js.map +0 -1
  401. package/lib/inAppMessaging/errors/index.js.map +0 -1
  402. package/lib/inAppMessaging/errors/validation.js.map +0 -1
  403. package/lib/inAppMessaging/index.js.map +0 -1
  404. package/lib/inAppMessaging/providers/index.js.map +0 -1
  405. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
  406. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
  407. package/lib/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
  408. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
  409. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
  410. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
  411. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
  412. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
  413. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
  414. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
  415. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
  416. package/lib/inAppMessaging/providers/pinpoint/index.js.map +0 -1
  417. package/lib/inAppMessaging/providers/pinpoint/types/errors.d.ts +0 -9
  418. package/lib/inAppMessaging/providers/pinpoint/types/errors.js +0 -15
  419. package/lib/inAppMessaging/providers/pinpoint/types/errors.js.map +0 -1
  420. package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
  421. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
  422. package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
  423. package/lib/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
  424. package/lib/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
  425. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
  426. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
  427. package/lib/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
  428. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
  429. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
  430. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
  431. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
  432. package/lib/inAppMessaging/sessionTracker/SessionTracker.d.ts +0 -9
  433. package/lib/inAppMessaging/sessionTracker/SessionTracker.js +0 -67
  434. package/lib/inAppMessaging/sessionTracker/SessionTracker.js.map +0 -1
  435. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.d.ts +0 -10
  436. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js +0 -53
  437. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js.map +0 -1
  438. package/lib/inAppMessaging/sessionTracker/index.d.ts +0 -3
  439. package/lib/inAppMessaging/sessionTracker/index.js +0 -8
  440. package/lib/inAppMessaging/sessionTracker/index.js.map +0 -1
  441. package/lib/inAppMessaging/sessionTracker/types.d.ts +0 -6
  442. package/lib/inAppMessaging/sessionTracker/types.js.map +0 -1
  443. package/lib/inAppMessaging/types/config.d.ts +0 -5
  444. package/lib/inAppMessaging/types/config.js +0 -3
  445. package/lib/inAppMessaging/types/config.js.map +0 -1
  446. package/lib/inAppMessaging/types/event.js.map +0 -1
  447. package/lib/inAppMessaging/types/index.js.map +0 -1
  448. package/lib/inAppMessaging/types/inputs.js.map +0 -1
  449. package/lib/inAppMessaging/types/message.js.map +0 -1
  450. package/lib/inAppMessaging/types/options.js.map +0 -1
  451. package/lib/inAppMessaging/utils/index.js.map +0 -1
  452. package/lib/inAppMessaging/utils/statusHelpers.js.map +0 -1
  453. package/lib/index.js.map +0 -1
  454. package/lib/pushNotifications/NotEnabledError.d.ts +0 -3
  455. package/lib/pushNotifications/NotEnabledError.js +0 -16
  456. package/lib/pushNotifications/NotEnabledError.js.map +0 -1
  457. package/lib/pushNotifications/Platform/index.d.ts +0 -2
  458. package/lib/pushNotifications/Platform/index.js +0 -26
  459. package/lib/pushNotifications/Platform/index.js.map +0 -1
  460. package/lib/pushNotifications/Platform/index.native.d.ts +0 -2
  461. package/lib/pushNotifications/Platform/index.native.js +0 -8
  462. package/lib/pushNotifications/Platform/index.native.js.map +0 -1
  463. package/lib/pushNotifications/Platform/types.d.ts +0 -5
  464. package/lib/pushNotifications/Platform/types.js.map +0 -1
  465. package/lib/pushNotifications/PlatformNotSupportedError.d.ts +0 -3
  466. package/lib/pushNotifications/PlatformNotSupportedError.js +0 -16
  467. package/lib/pushNotifications/PlatformNotSupportedError.js.map +0 -1
  468. package/lib/pushNotifications/index.js.map +0 -1
  469. package/lib/pushNotifications/providers/AWSPinpointProvider/index.d.ts +0 -15
  470. package/lib/pushNotifications/providers/AWSPinpointProvider/index.js +0 -65
  471. package/lib/pushNotifications/providers/AWSPinpointProvider/index.js.map +0 -1
  472. package/lib/pushNotifications/providers/AWSPinpointProvider/types.d.ts +0 -9
  473. package/lib/pushNotifications/providers/AWSPinpointProvider/types.js +0 -16
  474. package/lib/pushNotifications/providers/AWSPinpointProvider/types.js.map +0 -1
  475. package/lib/pushNotifications/providers/AWSPinpointProvider/utils.d.ts +0 -6
  476. package/lib/pushNotifications/providers/AWSPinpointProvider/utils.js.map +0 -1
  477. package/lib/pushNotifications/providers/index.d.ts +0 -1
  478. package/lib/pushNotifications/providers/index.js +0 -7
  479. package/lib/pushNotifications/providers/index.js.map +0 -1
  480. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
  481. package/lib/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
  482. package/lib/pushNotifications/providers/pinpoint/index.js.map +0 -1
  483. package/lib/pushNotifications/types.d.ts +0 -71
  484. package/lib/pushNotifications/types.js +0 -12
  485. package/lib/pushNotifications/types.js.map +0 -1
  486. package/lib/pushNotifications/utils.d.ts +0 -3
  487. package/lib/pushNotifications/utils.js +0 -81
  488. package/lib/pushNotifications/utils.js.map +0 -1
  489. package/lib/types.d.ts +0 -39
  490. package/lib/types.js +0 -5
  491. package/lib/types.js.map +0 -1
  492. package/lib-esm/.tsbuildinfo +0 -3
  493. package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +0 -39
  494. package/lib-esm/common/AWSPinpointProviderCommon/index.js +0 -287
  495. package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +0 -1
  496. package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +0 -10
  497. package/lib-esm/common/AWSPinpointProviderCommon/types.js.map +0 -1
  498. package/lib-esm/common/eventListeners/index.js.map +0 -1
  499. package/lib-esm/common/eventListeners/types.js.map +0 -1
  500. package/lib-esm/common/index.d.ts +0 -3
  501. package/lib-esm/common/index.js.map +0 -1
  502. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
  503. package/lib-esm/inAppMessaging/errors/assertServiceError.js.map +0 -1
  504. package/lib-esm/inAppMessaging/errors/assertValidationError.js.map +0 -1
  505. package/lib-esm/inAppMessaging/errors/index.js.map +0 -1
  506. package/lib-esm/inAppMessaging/errors/validation.js.map +0 -1
  507. package/lib-esm/inAppMessaging/index.js.map +0 -1
  508. package/lib-esm/inAppMessaging/providers/index.js.map +0 -1
  509. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
  510. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
  511. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
  512. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
  513. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
  514. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
  515. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
  516. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
  517. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
  518. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
  519. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
  520. package/lib-esm/inAppMessaging/providers/pinpoint/index.js.map +0 -1
  521. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.d.ts +0 -9
  522. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js +0 -13
  523. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js.map +0 -1
  524. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
  525. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
  526. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
  527. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
  528. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
  529. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
  530. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
  531. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
  532. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
  533. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
  534. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
  535. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
  536. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.d.ts +0 -9
  537. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js +0 -64
  538. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js.map +0 -1
  539. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.d.ts +0 -10
  540. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js +0 -50
  541. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js.map +0 -1
  542. package/lib-esm/inAppMessaging/sessionTracker/index.d.ts +0 -3
  543. package/lib-esm/inAppMessaging/sessionTracker/index.js +0 -5
  544. package/lib-esm/inAppMessaging/sessionTracker/index.js.map +0 -1
  545. package/lib-esm/inAppMessaging/sessionTracker/types.d.ts +0 -6
  546. package/lib-esm/inAppMessaging/sessionTracker/types.js.map +0 -1
  547. package/lib-esm/inAppMessaging/types/config.d.ts +0 -5
  548. package/lib-esm/inAppMessaging/types/config.js +0 -1
  549. package/lib-esm/inAppMessaging/types/config.js.map +0 -1
  550. package/lib-esm/inAppMessaging/types/event.js.map +0 -1
  551. package/lib-esm/inAppMessaging/types/index.js.map +0 -1
  552. package/lib-esm/inAppMessaging/types/inputs.js.map +0 -1
  553. package/lib-esm/inAppMessaging/types/message.js.map +0 -1
  554. package/lib-esm/inAppMessaging/types/options.js.map +0 -1
  555. package/lib-esm/inAppMessaging/utils/index.js.map +0 -1
  556. package/lib-esm/inAppMessaging/utils/statusHelpers.js.map +0 -1
  557. package/lib-esm/index.js.map +0 -1
  558. package/lib-esm/pushNotifications/NotEnabledError.d.ts +0 -3
  559. package/lib-esm/pushNotifications/NotEnabledError.js +0 -14
  560. package/lib-esm/pushNotifications/NotEnabledError.js.map +0 -1
  561. package/lib-esm/pushNotifications/Platform/index.d.ts +0 -2
  562. package/lib-esm/pushNotifications/Platform/index.js +0 -24
  563. package/lib-esm/pushNotifications/Platform/index.js.map +0 -1
  564. package/lib-esm/pushNotifications/Platform/index.native.d.ts +0 -2
  565. package/lib-esm/pushNotifications/Platform/index.native.js +0 -6
  566. package/lib-esm/pushNotifications/Platform/index.native.js.map +0 -1
  567. package/lib-esm/pushNotifications/Platform/types.d.ts +0 -5
  568. package/lib-esm/pushNotifications/Platform/types.js.map +0 -1
  569. package/lib-esm/pushNotifications/PlatformNotSupportedError.d.ts +0 -3
  570. package/lib-esm/pushNotifications/PlatformNotSupportedError.js +0 -14
  571. package/lib-esm/pushNotifications/PlatformNotSupportedError.js.map +0 -1
  572. package/lib-esm/pushNotifications/index.js.map +0 -1
  573. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.d.ts +0 -15
  574. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js +0 -63
  575. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js.map +0 -1
  576. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.d.ts +0 -9
  577. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.js +0 -14
  578. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.js.map +0 -1
  579. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/utils.d.ts +0 -6
  580. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/utils.js.map +0 -1
  581. package/lib-esm/pushNotifications/providers/index.d.ts +0 -1
  582. package/lib-esm/pushNotifications/providers/index.js +0 -4
  583. package/lib-esm/pushNotifications/providers/index.js.map +0 -1
  584. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
  585. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
  586. package/lib-esm/pushNotifications/providers/pinpoint/index.js.map +0 -1
  587. package/lib-esm/pushNotifications/types.d.ts +0 -71
  588. package/lib-esm/pushNotifications/types.js +0 -10
  589. package/lib-esm/pushNotifications/types.js.map +0 -1
  590. package/lib-esm/pushNotifications/utils.d.ts +0 -3
  591. package/lib-esm/pushNotifications/utils.js +0 -79
  592. package/lib-esm/pushNotifications/utils.js.map +0 -1
  593. package/lib-esm/types.d.ts +0 -39
  594. package/lib-esm/types.js +0 -3
  595. package/lib-esm/types.js.map +0 -1
  596. package/src/common/AWSPinpointProviderCommon/index.ts +0 -300
  597. package/src/common/AWSPinpointProviderCommon/types.ts +0 -29
  598. package/src/inAppMessaging/providers/pinpoint/types/errors.ts +0 -12
  599. package/src/inAppMessaging/sessionTracker/SessionTracker.native.ts +0 -60
  600. package/src/inAppMessaging/sessionTracker/SessionTracker.ts +0 -80
  601. package/src/inAppMessaging/sessionTracker/index.ts +0 -6
  602. package/src/inAppMessaging/sessionTracker/types.ts +0 -11
  603. package/src/inAppMessaging/types/config.ts +0 -8
  604. package/src/pushNotifications/NotEnabledError.ts +0 -11
  605. package/src/pushNotifications/Platform/index.native.ts +0 -9
  606. package/src/pushNotifications/Platform/index.ts +0 -22
  607. package/src/pushNotifications/Platform/types.ts +0 -15
  608. package/src/pushNotifications/PlatformNotSupportedError.ts +0 -9
  609. package/src/pushNotifications/providers/AWSPinpointProvider/index.ts +0 -93
  610. package/src/pushNotifications/providers/AWSPinpointProvider/types.ts +0 -13
  611. package/src/pushNotifications/types.ts +0 -114
  612. package/src/pushNotifications/utils.ts +0 -112
  613. package/src/types.ts +0 -56
  614. /package/lib/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +0 -0
  615. /package/lib-esm/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +0 -0
  616. /package/src/{common/eventListeners/index.ts → eventListeners/eventListeners.ts} +0 -0
@@ -0,0 +1,32 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ var _a;
4
+ import { createAssertionFunction, } from '@aws-amplify/core/internals/utils';
5
+ import { isInitialized } from '../utils';
6
+ import { PushNotificationError } from './PushNotificationError';
7
+ export var PushNotificationValidationErrorCode;
8
+ (function (PushNotificationValidationErrorCode) {
9
+ PushNotificationValidationErrorCode["NoAppId"] = "NoAppId";
10
+ PushNotificationValidationErrorCode["NoCredentials"] = "NoCredentials";
11
+ PushNotificationValidationErrorCode["NoRegion"] = "NoRegion";
12
+ PushNotificationValidationErrorCode["NotInitialized"] = "NotInitialized";
13
+ })(PushNotificationValidationErrorCode || (PushNotificationValidationErrorCode = {}));
14
+ var pushNotificationValidationErrorMap = (_a = {},
15
+ _a[PushNotificationValidationErrorCode.NoAppId] = {
16
+ message: 'Missing application id.',
17
+ },
18
+ _a[PushNotificationValidationErrorCode.NoCredentials] = {
19
+ message: 'Credentials should not be empty.',
20
+ },
21
+ _a[PushNotificationValidationErrorCode.NoRegion] = {
22
+ message: 'Missing region.',
23
+ },
24
+ _a[PushNotificationValidationErrorCode.NotInitialized] = {
25
+ message: 'Push notification has not been initialized.',
26
+ recoverySuggestion: 'Please make sure to first call `initializePushNotifications`.',
27
+ },
28
+ _a);
29
+ export var assert = createAssertionFunction(pushNotificationValidationErrorMap, PushNotificationError);
30
+ export var assertIsInitialized = function () {
31
+ assert(isInitialized(), PushNotificationValidationErrorCode.NotInitialized);
32
+ };
@@ -0,0 +1,2 @@
1
+ export { PushNotificationError } from './PushNotificationError';
2
+ export { assert, PushNotificationValidationErrorCode } from './errorHelpers';
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { PushNotificationError } from './PushNotificationError';
4
+ export { assert, PushNotificationValidationErrorCode } from './errorHelpers';
@@ -1,2 +1,3 @@
1
- export { identifyUser } from './providers/pinpoint';
2
- export { PushNotificationEvent, PushNotificationMessage, PushNotificationPermissionStatus, } from './types';
1
+ export { getBadgeCount, getLaunchNotification, GetLaunchNotificationOutput, getPermissionStatus, GetPermissionStatusOutput, identifyUser, IdentifyUserInput, initializePushNotifications, onNotificationOpened, OnNotificationOpenedInput, OnNotificationOpenedOutput, onNotificationReceivedInBackground, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInBackgroundOutput, onNotificationReceivedInForeground, OnNotificationReceivedInForegroundInput, OnNotificationReceivedInForegroundOutput, onTokenReceived, OnTokenReceivedInput, OnTokenReceivedOutput, requestPermissions, RequestPermissionsInput, setBadgeCount, SetBadgeCountInput, } from './providers/pinpoint';
2
+ export { PushNotificationMessage } from './types';
3
+ export { PushNotificationError } from './errors';
@@ -1,5 +1,4 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { identifyUser } from './providers/pinpoint';
4
- export { PushNotificationPermissionStatus, } from './types';
5
- //# sourceMappingURL=index.js.map
3
+ export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './providers/pinpoint';
4
+ export { PushNotificationError } from './errors';
@@ -0,0 +1,14 @@
1
+ import { GetBadgeCount } from '../types';
2
+ /**
3
+ * Returns the current badge count (the number next to your app's icon). This function is safe to call (but will be
4
+ * ignored) even when your React Native app is running on platforms where badges are not supported.
5
+ *
6
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
7
+ * only React Native is supported by this API.
8
+ * @returns A promise that resolves to a number representing the current count displayed on the app badge.
9
+ * @example
10
+ * ```ts
11
+ * const badgeCount = await getBadgeCount();
12
+ * ```
13
+ */
14
+ export declare const getBadgeCount: GetBadgeCount;
@@ -0,0 +1,18 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
4
+ /**
5
+ * Returns the current badge count (the number next to your app's icon). This function is safe to call (but will be
6
+ * ignored) even when your React Native app is running on platforms where badges are not supported.
7
+ *
8
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
9
+ * only React Native is supported by this API.
10
+ * @returns A promise that resolves to a number representing the current count displayed on the app badge.
11
+ * @example
12
+ * ```ts
13
+ * const badgeCount = await getBadgeCount();
14
+ * ```
15
+ */
16
+ export var getBadgeCount = function () {
17
+ throw new PlatformNotSupportedError();
18
+ };
@@ -0,0 +1,2 @@
1
+ import { GetBadgeCount } from '../types';
2
+ export declare const getBadgeCount: GetBadgeCount;
@@ -0,0 +1,12 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { __awaiter, __generator } from "tslib";
4
+ import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
5
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
6
+ var getBadgeCountNative = loadAmplifyPushNotification().getBadgeCount;
7
+ export var getBadgeCount = function () { return __awaiter(void 0, void 0, void 0, function () {
8
+ return __generator(this, function (_a) {
9
+ assertIsInitialized();
10
+ return [2 /*return*/, getBadgeCountNative()];
11
+ });
12
+ }); };
@@ -0,0 +1,18 @@
1
+ import { GetLaunchNotification } from '../types';
2
+ /**
3
+ * Returns the notification which launched your app from a terminated state. The launch notification is consumed by
4
+ * calls to this function and will yield a null result if:
5
+ * 1. It is more than once (i.e. subsequent calls will be null)
6
+ * 2. Another notification was opened while your app was running (either in foreground or background)
7
+ * 3. Your app was brought back to the foreground by some other means (e.g. user tapped the app icon)
8
+ *
9
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
10
+ * only React Native is supported by this API.
11
+ * @returns {Promise<GetLaunchNotificationOutput>} - a promise resolving to {@link PushNotificationMessage} if there is
12
+ * a launch notification and `null` otherwise.
13
+ * @example
14
+ * ```ts
15
+ * const launchNotification = await getLaunchNotification();
16
+ * ```
17
+ */
18
+ export declare const getLaunchNotification: GetLaunchNotification;
@@ -0,0 +1,22 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
4
+ /**
5
+ * Returns the notification which launched your app from a terminated state. The launch notification is consumed by
6
+ * calls to this function and will yield a null result if:
7
+ * 1. It is more than once (i.e. subsequent calls will be null)
8
+ * 2. Another notification was opened while your app was running (either in foreground or background)
9
+ * 3. Your app was brought back to the foreground by some other means (e.g. user tapped the app icon)
10
+ *
11
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
12
+ * only React Native is supported by this API.
13
+ * @returns {Promise<GetLaunchNotificationOutput>} - a promise resolving to {@link PushNotificationMessage} if there is
14
+ * a launch notification and `null` otherwise.
15
+ * @example
16
+ * ```ts
17
+ * const launchNotification = await getLaunchNotification();
18
+ * ```
19
+ */
20
+ export var getLaunchNotification = function () {
21
+ throw new PlatformNotSupportedError();
22
+ };
@@ -0,0 +1,2 @@
1
+ import { GetLaunchNotification } from '../types';
2
+ export declare const getLaunchNotification: GetLaunchNotification;
@@ -0,0 +1,9 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
5
+ var getLaunchNotificationNative = loadAmplifyPushNotification().getLaunchNotification;
6
+ export var getLaunchNotification = function () {
7
+ assertIsInitialized();
8
+ return getLaunchNotificationNative();
9
+ };
@@ -0,0 +1,27 @@
1
+ import { GetPermissionStatus } from '../types';
2
+ /**
3
+ * Returns a string representing the current status of user permissions to display push notifications. The possible
4
+ * statuses are as follows:
5
+ *
6
+ * * `'shouldRequest'` - No permissions have been requested yet. It is idiomatic at this time to simply request for
7
+ * permissions from the user.
8
+ *
9
+ * * `'shouldExplainThenRequest'` - It is recommended at this time to provide some context or rationale to the user
10
+ * explaining why you want to send them push notifications before requesting for permissions.
11
+ *
12
+ * * `'granted'` - Permissions have been granted by the user. No further actions are needed and their app is ready to
13
+ * display notifications.
14
+ *
15
+ * * `'denied'` - Permissions have been denied by the user. Further attempts to request permissions will no longer
16
+ * trigger a permission dialog. Your app should now either degrade gracefully or prompt your user to grant the
17
+ * permissions needed in their device settings.
18
+ *
19
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
20
+ * only React Native is supported by this API.
21
+ * @return {Promise<GetPermissionStatusOutput>} a promise resolving to a string representing the current status of user
22
+ * selected notification permissions.
23
+ * @example
24
+ * ```ts
25
+ * const permissionStatus = await getPermissionStatus();
26
+ */
27
+ export declare const getPermissionStatus: GetPermissionStatus;
@@ -0,0 +1,31 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
4
+ /**
5
+ * Returns a string representing the current status of user permissions to display push notifications. The possible
6
+ * statuses are as follows:
7
+ *
8
+ * * `'shouldRequest'` - No permissions have been requested yet. It is idiomatic at this time to simply request for
9
+ * permissions from the user.
10
+ *
11
+ * * `'shouldExplainThenRequest'` - It is recommended at this time to provide some context or rationale to the user
12
+ * explaining why you want to send them push notifications before requesting for permissions.
13
+ *
14
+ * * `'granted'` - Permissions have been granted by the user. No further actions are needed and their app is ready to
15
+ * display notifications.
16
+ *
17
+ * * `'denied'` - Permissions have been denied by the user. Further attempts to request permissions will no longer
18
+ * trigger a permission dialog. Your app should now either degrade gracefully or prompt your user to grant the
19
+ * permissions needed in their device settings.
20
+ *
21
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
22
+ * only React Native is supported by this API.
23
+ * @return {Promise<GetPermissionStatusOutput>} a promise resolving to a string representing the current status of user
24
+ * selected notification permissions.
25
+ * @example
26
+ * ```ts
27
+ * const permissionStatus = await getPermissionStatus();
28
+ */
29
+ export var getPermissionStatus = function () {
30
+ throw new PlatformNotSupportedError();
31
+ };
@@ -0,0 +1,2 @@
1
+ import { GetPermissionStatus } from '../types';
2
+ export declare const getPermissionStatus: GetPermissionStatus;
@@ -0,0 +1,9 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
5
+ var getPermissionStatusNative = loadAmplifyPushNotification().getPermissionStatus;
6
+ export var getPermissionStatus = function () {
7
+ assertIsInitialized();
8
+ return getPermissionStatusNative();
9
+ };
@@ -1,2 +1,53 @@
1
- import { UserInfo } from '../../../../types';
2
- export declare function identifyUser(userId: string, userInfo: UserInfo): Promise<void>;
1
+ import { IdentifyUser } from '../types';
2
+ /**
3
+ * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
4
+ * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
5
+ * the same `userId`.
6
+ *
7
+ * @param {IdentifyUserInput} input The input object used to construct requests sent to Pinpoint's UpdateEndpoint
8
+ * API.
9
+ * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.
10
+ * @throws validation: {@link PushNotificationValidationErrorCode} - Thrown when the provided parameters or library
11
+ * configuration is incorrect.
12
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
13
+ * only React Native is supported by this API.
14
+ * @returns A promise that will resolve when the operation is complete.
15
+ * @example
16
+ * ```ts
17
+ * // Identify a user with Pinpoint
18
+ * await identifyUser({
19
+ * userId,
20
+ * userProfile: {
21
+ * email: 'userEmail@example.com'
22
+ * customProperties: {
23
+ * phoneNumber: ['555-555-5555'],
24
+ * },
25
+ * }
26
+ * });
27
+ * ```
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * // Identify a user with Pinpoint specific options
32
+ * await identifyUser({
33
+ * userId,
34
+ * userProfile: {
35
+ * email: 'userEmail@example.com'
36
+ * customProperties: {
37
+ * phoneNumber: ['555-555-5555'],
38
+ * },
39
+ * demographic: {
40
+ * platform: 'ios',
41
+ * timezone: 'America/Los_Angeles'
42
+ * }
43
+ * },
44
+ * options: {
45
+ * address: 'device-address',
46
+ * optOut: 'NONE',
47
+ * userAttributes: {
48
+ * interests: ['food']
49
+ * },
50
+ * },
51
+ * });
52
+ */
53
+ export declare const identifyUser: IdentifyUser;
@@ -1,6 +1,57 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export function identifyUser(userId, userInfo) {
4
- throw new Error('WIP');
5
- }
6
- //# sourceMappingURL=identifyUser.js.map
3
+ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
4
+ /**
5
+ * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
6
+ * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
7
+ * the same `userId`.
8
+ *
9
+ * @param {IdentifyUserInput} input The input object used to construct requests sent to Pinpoint's UpdateEndpoint
10
+ * API.
11
+ * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.
12
+ * @throws validation: {@link PushNotificationValidationErrorCode} - Thrown when the provided parameters or library
13
+ * configuration is incorrect.
14
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
15
+ * only React Native is supported by this API.
16
+ * @returns A promise that will resolve when the operation is complete.
17
+ * @example
18
+ * ```ts
19
+ * // Identify a user with Pinpoint
20
+ * await identifyUser({
21
+ * userId,
22
+ * userProfile: {
23
+ * email: 'userEmail@example.com'
24
+ * customProperties: {
25
+ * phoneNumber: ['555-555-5555'],
26
+ * },
27
+ * }
28
+ * });
29
+ * ```
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * // Identify a user with Pinpoint specific options
34
+ * await identifyUser({
35
+ * userId,
36
+ * userProfile: {
37
+ * email: 'userEmail@example.com'
38
+ * customProperties: {
39
+ * phoneNumber: ['555-555-5555'],
40
+ * },
41
+ * demographic: {
42
+ * platform: 'ios',
43
+ * timezone: 'America/Los_Angeles'
44
+ * }
45
+ * },
46
+ * options: {
47
+ * address: 'device-address',
48
+ * optOut: 'NONE',
49
+ * userAttributes: {
50
+ * interests: ['food']
51
+ * },
52
+ * },
53
+ * });
54
+ */
55
+ export var identifyUser = function () {
56
+ throw new PlatformNotSupportedError();
57
+ };
@@ -0,0 +1,2 @@
1
+ import { IdentifyUser } from '../types';
2
+ export declare const identifyUser: IdentifyUser;
@@ -0,0 +1,40 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { __awaiter, __generator } from "tslib";
4
+ import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
5
+ import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
6
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
7
+ import { resolveConfig, resolveCredentials } from '../../../utils';
8
+ import { getChannelType, getPushNotificationUserAgentString } from '../utils';
9
+ export var identifyUser = function (_a) {
10
+ var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
11
+ return __awaiter(void 0, void 0, void 0, function () {
12
+ var _b, credentials, identityId, _c, appId, region, _d, address, optOut, userAttributes;
13
+ return __generator(this, function (_e) {
14
+ switch (_e.label) {
15
+ case 0:
16
+ assertIsInitialized();
17
+ return [4 /*yield*/, resolveCredentials()];
18
+ case 1:
19
+ _b = _e.sent(), credentials = _b.credentials, identityId = _b.identityId;
20
+ _c = resolveConfig(), appId = _c.appId, region = _c.region;
21
+ _d = options !== null && options !== void 0 ? options : {}, address = _d.address, optOut = _d.optOut, userAttributes = _d.userAttributes;
22
+ updateEndpoint({
23
+ address: address,
24
+ channelType: getChannelType(),
25
+ optOut: optOut,
26
+ appId: appId,
27
+ category: 'PushNotification',
28
+ credentials: credentials,
29
+ identityId: identityId,
30
+ region: region,
31
+ userAttributes: userAttributes,
32
+ userId: userId,
33
+ userProfile: userProfile,
34
+ userAgentValue: getPushNotificationUserAgentString(PushNotificationAction.IdentifyUser),
35
+ });
36
+ return [2 /*return*/];
37
+ }
38
+ });
39
+ });
40
+ };
@@ -1 +1,11 @@
1
+ export { getBadgeCount } from './getBadgeCount';
2
+ export { getLaunchNotification } from './getLaunchNotification';
3
+ export { getPermissionStatus } from './getPermissionStatus';
1
4
  export { identifyUser } from './identifyUser';
5
+ export { initializePushNotifications } from './initializePushNotifications';
6
+ export { onNotificationOpened } from './onNotificationOpened';
7
+ export { onNotificationReceivedInBackground } from './onNotificationReceivedInBackground';
8
+ export { onNotificationReceivedInForeground } from './onNotificationReceivedInForeground';
9
+ export { onTokenReceived } from './onTokenReceived';
10
+ export { requestPermissions } from './requestPermissions';
11
+ export { setBadgeCount } from './setBadgeCount';
@@ -1,4 +1,13 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ export { getBadgeCount } from './getBadgeCount';
4
+ export { getLaunchNotification } from './getLaunchNotification';
5
+ export { getPermissionStatus } from './getPermissionStatus';
3
6
  export { identifyUser } from './identifyUser';
4
- //# sourceMappingURL=index.js.map
7
+ export { initializePushNotifications } from './initializePushNotifications';
8
+ export { onNotificationOpened } from './onNotificationOpened';
9
+ export { onNotificationReceivedInBackground } from './onNotificationReceivedInBackground';
10
+ export { onNotificationReceivedInForeground } from './onNotificationReceivedInForeground';
11
+ export { onTokenReceived } from './onTokenReceived';
12
+ export { requestPermissions } from './requestPermissions';
13
+ export { setBadgeCount } from './setBadgeCount';
@@ -0,0 +1,17 @@
1
+ import { InitializePushNotifications } from '../types';
2
+ /**
3
+ * Initialize and set up the push notification category. The category must be first initialized before all other
4
+ * functionalities become available.
5
+ *
6
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
7
+ * only React Native is supported by this API.
8
+ * @remarks
9
+ * It is recommended that this be called as early in your app as possible at the root of your application to allow
10
+ * background processing of notifications.
11
+ * @example
12
+ * ```ts
13
+ * Amplify.configure(config);
14
+ * initializePushNotifications();
15
+ * ```
16
+ */
17
+ export declare const initializePushNotifications: InitializePushNotifications;
@@ -0,0 +1,21 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
4
+ /**
5
+ * Initialize and set up the push notification category. The category must be first initialized before all other
6
+ * functionalities become available.
7
+ *
8
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
9
+ * only React Native is supported by this API.
10
+ * @remarks
11
+ * It is recommended that this be called as early in your app as possible at the root of your application to allow
12
+ * background processing of notifications.
13
+ * @example
14
+ * ```ts
15
+ * Amplify.configure(config);
16
+ * initializePushNotifications();
17
+ * ```
18
+ */
19
+ export var initializePushNotifications = function () {
20
+ throw new PlatformNotSupportedError();
21
+ };
@@ -0,0 +1 @@
1
+ export declare const initializePushNotifications: () => Promise<void>;
@@ -0,0 +1,156 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { __awaiter, __generator } from "tslib";
4
+ import { ConsoleLogger } from '@aws-amplify/core';
5
+ import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
6
+ import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
7
+ import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
8
+ import { addEventListener, notifyEventListeners, notifyEventListenersAndAwaitHandlers, } from '../../../../eventListeners';
9
+ import { getToken, initialize, isInitialized, resolveConfig, resolveCredentials, setToken, } from '../../../utils';
10
+ import { createMessageEventRecorder, getChannelType, getPushNotificationUserAgentString, } from '../utils';
11
+ var _a = loadAmplifyPushNotification(), addMessageEventListener = _a.addMessageEventListener, addTokenEventListener = _a.addTokenEventListener, completeNotification = _a.completeNotification, getConstants = _a.getConstants, registerHeadlessTask = _a.registerHeadlessTask;
12
+ var logger = new ConsoleLogger('Notifications.PushNotification');
13
+ var BACKGROUND_TASK_TIMEOUT = 25; // seconds
14
+ export var initializePushNotifications = function () {
15
+ if (isInitialized()) {
16
+ logger.info('Push notifications have already been enabled');
17
+ return;
18
+ }
19
+ addNativeListeners();
20
+ addAnalyticsListeners();
21
+ initialize();
22
+ };
23
+ var addAnalyticsListeners = function () {
24
+ var launchNotificationOpenedListenerRemover;
25
+ // wire up default Pinpoint message event handling
26
+ addEventListener('backgroundMessageReceived', createMessageEventRecorder('backgroundMessageReceived'));
27
+ addEventListener('foregroundMessageReceived', createMessageEventRecorder('foregroundMessageReceived'));
28
+ launchNotificationOpenedListenerRemover = addEventListener('launchNotificationsOpened', createMessageEventRecorder('notificationOpened',
29
+ // once we are done with it we can remove the listener
30
+ launchNotificationOpenedListenerRemover === null ||
31
+ // once we are done with it we can remove the listener
32
+ launchNotificationOpenedListenerRemover === void 0 ? void 0 :
33
+ // once we are done with it we can remove the listener
34
+ launchNotificationOpenedListenerRemover.remove));
35
+ addEventListener('notificationOpened', createMessageEventRecorder('notificationOpened',
36
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
37
+ launchNotificationOpenedListenerRemover === null ||
38
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
39
+ launchNotificationOpenedListenerRemover === void 0 ? void 0 :
40
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
41
+ launchNotificationOpenedListenerRemover.remove));
42
+ };
43
+ var addNativeListeners = function () {
44
+ var _a = getConstants(), NativeEvent = _a.NativeEvent, NativeHeadlessTaskKey = _a.NativeHeadlessTaskKey;
45
+ var BACKGROUND_MESSAGE_RECEIVED = NativeEvent.BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED = NativeEvent.FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED = NativeEvent.LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED = NativeEvent.NOTIFICATION_OPENED, TOKEN_RECEIVED = NativeEvent.TOKEN_RECEIVED;
46
+ // on platforms that can handle headless tasks, register one to broadcast background message received to
47
+ // library listeners
48
+ if (NativeHeadlessTaskKey) {
49
+ registerHeadlessTask(function (message) { return __awaiter(void 0, void 0, void 0, function () {
50
+ return __generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0:
53
+ // keep headless task running until handlers have completed their work
54
+ return [4 /*yield*/, notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message)];
55
+ case 1:
56
+ // keep headless task running until handlers have completed their work
57
+ _a.sent();
58
+ return [2 /*return*/];
59
+ }
60
+ });
61
+ }); });
62
+ }
63
+ else if (BACKGROUND_MESSAGE_RECEIVED) {
64
+ // on platforms that can't handle headless tasks, listen for native background message received event and
65
+ // broadcast to library listeners
66
+ addMessageEventListener(BACKGROUND_MESSAGE_RECEIVED, function (message, completionHandlerId) { return __awaiter(void 0, void 0, void 0, function () {
67
+ var err_1;
68
+ return __generator(this, function (_a) {
69
+ switch (_a.label) {
70
+ case 0:
71
+ _a.trys.push([0, 2, 3, 4]);
72
+ return [4 /*yield*/, Promise.race([
73
+ notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message),
74
+ // background tasks will get suspended and all future tasks be deprioritized by the OS if they run for
75
+ // more than 30 seconds so we reject with a error in a shorter amount of time to prevent this from
76
+ // happening
77
+ new Promise(function (_, reject) {
78
+ setTimeout(function () {
79
+ return reject("onNotificationReceivedInBackground handlers should complete their work within " + BACKGROUND_TASK_TIMEOUT + " seconds, but they did not.");
80
+ }, BACKGROUND_TASK_TIMEOUT * 1000);
81
+ }),
82
+ ])];
83
+ case 1:
84
+ _a.sent();
85
+ return [3 /*break*/, 4];
86
+ case 2:
87
+ err_1 = _a.sent();
88
+ logger.error(err_1);
89
+ return [3 /*break*/, 4];
90
+ case 3:
91
+ // notify native module that handlers have completed their work (or timed out)
92
+ completeNotification(completionHandlerId);
93
+ return [7 /*endfinally*/];
94
+ case 4: return [2 /*return*/];
95
+ }
96
+ });
97
+ }); });
98
+ }
99
+ addMessageEventListener(
100
+ // listen for native foreground message received event and broadcast to library listeners
101
+ FOREGROUND_MESSAGE_RECEIVED, function (message) {
102
+ notifyEventListeners('foregroundMessageReceived', message);
103
+ });
104
+ var launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
105
+ ? addMessageEventListener(
106
+ // listen for native notification opened app (user tapped on notification, opening the app from quit -
107
+ // not background - state) event. This is broadcasted to an internal listener only as it is not intended
108
+ // for use otherwise as it produces inconsistent results when used within React Native app context
109
+ LAUNCH_NOTIFICATION_OPENED, function (message) {
110
+ notifyEventListeners('launchNotificationsOpened', message);
111
+ // once we are done with it we can remove the listener
112
+ launchNotificationOpenedListener === null || launchNotificationOpenedListener === void 0 ? void 0 : launchNotificationOpenedListener.remove();
113
+ })
114
+ : null;
115
+ addMessageEventListener(
116
+ // listen for native notification opened (user tapped on notification, opening the app from background -
117
+ // not quit - state) event and broadcast to library listeners
118
+ NOTIFICATION_OPENED, function (message) {
119
+ notifyEventListeners('notificationOpened', message);
120
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
121
+ launchNotificationOpenedListener === null || launchNotificationOpenedListener === void 0 ? void 0 : launchNotificationOpenedListener.remove();
122
+ });
123
+ addTokenEventListener(
124
+ // listen for native new token event, automatically re-register device with provider using new token and
125
+ // broadcast to library listeners
126
+ TOKEN_RECEIVED, function (token) {
127
+ // avoid a race condition where two endpoints are created with the same token on a fresh install
128
+ if (getToken() === token) {
129
+ return;
130
+ }
131
+ setToken(token);
132
+ registerDevice();
133
+ notifyEventListeners('tokenReceived', token);
134
+ });
135
+ };
136
+ var registerDevice = function () { return __awaiter(void 0, void 0, void 0, function () {
137
+ var _a, credentials, identityId, _b, appId, region;
138
+ return __generator(this, function (_c) {
139
+ switch (_c.label) {
140
+ case 0: return [4 /*yield*/, resolveCredentials()];
141
+ case 1:
142
+ _a = _c.sent(), credentials = _a.credentials, identityId = _a.identityId;
143
+ _b = resolveConfig(), appId = _b.appId, region = _b.region;
144
+ return [2 /*return*/, updateEndpoint({
145
+ address: getToken(),
146
+ appId: appId,
147
+ category: 'PushNotification',
148
+ credentials: credentials,
149
+ region: region,
150
+ channelType: getChannelType(),
151
+ identityId: identityId,
152
+ userAgentValue: getPushNotificationUserAgentString(PushNotificationAction.InitializePushNotifications),
153
+ })];
154
+ }
155
+ });
156
+ }); };