@aws-amplify/notifications 1.6.6-api-v6-models.b3abc9b.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (691) hide show
  1. package/README.md +3 -0
  2. package/in-app-messaging/package.json +7 -0
  3. package/in-app-messaging/pinpoint/package.json +7 -0
  4. package/lib/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +2 -2
  5. package/lib/eventListeners/eventListeners.js +38 -0
  6. package/lib/eventListeners/index.d.ts +2 -0
  7. package/lib/eventListeners/index.js +9 -0
  8. package/lib/eventListeners/types.d.ts +10 -0
  9. package/lib/{InAppMessaging/SessionTracker → eventListeners}/types.js +0 -1
  10. package/lib/inAppMessaging/errors/InAppMessagingError.d.ts +7 -0
  11. package/lib/inAppMessaging/errors/InAppMessagingError.js +19 -0
  12. package/lib/inAppMessaging/errors/assertServiceError.d.ts +2 -0
  13. package/lib/inAppMessaging/errors/assertServiceError.js +19 -0
  14. package/lib/inAppMessaging/errors/assertValidationError.d.ts +5 -0
  15. package/lib/inAppMessaging/errors/assertValidationError.js +17 -0
  16. package/lib/inAppMessaging/errors/index.d.ts +4 -0
  17. package/lib/inAppMessaging/errors/index.js +14 -0
  18. package/lib/inAppMessaging/errors/validation.d.ts +8 -0
  19. package/lib/inAppMessaging/errors/validation.js +27 -0
  20. package/lib/inAppMessaging/index.d.ts +2 -0
  21. package/lib/inAppMessaging/index.js +17 -0
  22. package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
  23. package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.js +26 -0
  24. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.d.ts +26 -0
  25. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +56 -0
  26. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +51 -0
  27. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +79 -0
  28. package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +11 -0
  29. package/lib/inAppMessaging/providers/pinpoint/apis/index.js +27 -0
  30. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.d.ts +12 -0
  31. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +57 -0
  32. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.d.ts +16 -0
  33. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +26 -0
  34. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.d.ts +18 -0
  35. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +27 -0
  36. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.d.ts +18 -0
  37. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +27 -0
  38. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.d.ts +18 -0
  39. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +27 -0
  40. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.d.ts +18 -0
  41. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +27 -0
  42. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.d.ts +32 -0
  43. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +65 -0
  44. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.d.ts +16 -0
  45. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +69 -0
  46. package/lib/inAppMessaging/providers/pinpoint/index.d.ts +2 -0
  47. package/lib/inAppMessaging/providers/pinpoint/index.js +17 -0
  48. package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +4 -0
  49. package/lib/{InAppMessaging → inAppMessaging/providers/pinpoint/types}/index.js +2 -4
  50. package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +37 -0
  51. package/lib/{PushNotification/Platform/types.js → inAppMessaging/providers/pinpoint/types/inputs.js} +0 -1
  52. package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
  53. package/lib/{common/AWSPinpointProviderCommon/types.js → inAppMessaging/providers/pinpoint/types/options.js} +0 -1
  54. package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +17 -0
  55. package/lib/{common/eventListeners/types.js → inAppMessaging/providers/pinpoint/types/outputs.js} +0 -1
  56. package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +19 -0
  57. package/lib/inAppMessaging/providers/pinpoint/types/types.js +11 -0
  58. package/lib/inAppMessaging/providers/pinpoint/utils/constants.d.ts +4 -0
  59. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +9 -0
  60. package/lib/{InAppMessaging/Providers/AWSPinpointProvider/utils.d.ts → inAppMessaging/providers/pinpoint/utils/helpers.d.ts} +6 -7
  61. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +264 -0
  62. package/lib/inAppMessaging/providers/pinpoint/utils/index.d.ts +5 -0
  63. package/lib/inAppMessaging/providers/pinpoint/utils/index.js +20 -0
  64. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +6 -0
  65. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +169 -0
  66. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
  67. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +17 -0
  68. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
  69. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +16 -0
  70. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.d.ts +4 -0
  71. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +20 -0
  72. package/lib/inAppMessaging/types/event.d.ts +6 -0
  73. package/lib/inAppMessaging/types/event.js +4 -0
  74. package/lib/inAppMessaging/types/index.d.ts +4 -0
  75. package/lib/inAppMessaging/types/index.js +4 -0
  76. package/lib/inAppMessaging/types/inputs.d.ts +19 -0
  77. package/lib/inAppMessaging/types/inputs.js +4 -0
  78. package/lib/inAppMessaging/types/message.d.ts +44 -0
  79. package/lib/inAppMessaging/types/message.js +4 -0
  80. package/lib/inAppMessaging/types/options.d.ts +4 -0
  81. package/lib/inAppMessaging/types/options.js +4 -0
  82. package/lib/inAppMessaging/utils/index.d.ts +1 -0
  83. package/lib/inAppMessaging/utils/index.js +9 -0
  84. package/lib/inAppMessaging/utils/statusHelpers.d.ts +13 -0
  85. package/lib/inAppMessaging/utils/statusHelpers.js +27 -0
  86. package/lib/index.d.ts +0 -6
  87. package/lib/index.js +0 -10
  88. package/lib/pushNotifications/errors/PushNotificationError.d.ts +4 -0
  89. package/lib/pushNotifications/errors/PushNotificationError.js +16 -0
  90. package/lib/pushNotifications/errors/errorHelpers.d.ts +9 -0
  91. package/lib/pushNotifications/errors/errorHelpers.js +35 -0
  92. package/lib/pushNotifications/errors/index.d.ts +2 -0
  93. package/lib/pushNotifications/errors/index.js +10 -0
  94. package/lib/pushNotifications/index.d.ts +3 -0
  95. package/lib/pushNotifications/index.js +19 -0
  96. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
  97. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +22 -0
  98. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
  99. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +13 -0
  100. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
  101. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +26 -0
  102. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
  103. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +13 -0
  104. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
  105. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +35 -0
  106. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
  107. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +13 -0
  108. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -0
  109. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +61 -0
  110. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
  111. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +31 -0
  112. package/lib/pushNotifications/providers/pinpoint/apis/index.d.ts +11 -0
  113. package/lib/pushNotifications/providers/pinpoint/apis/index.js +27 -0
  114. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
  115. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +25 -0
  116. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
  117. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +133 -0
  118. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
  119. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +35 -0
  120. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
  121. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +12 -0
  122. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
  123. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +51 -0
  124. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
  125. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +12 -0
  126. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
  127. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +35 -0
  128. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
  129. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +12 -0
  130. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
  131. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +36 -0
  132. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
  133. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +12 -0
  134. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
  135. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +40 -0
  136. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
  137. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +13 -0
  138. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
  139. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +22 -0
  140. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
  141. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +13 -0
  142. package/lib/pushNotifications/providers/pinpoint/index.d.ts +3 -0
  143. package/lib/pushNotifications/providers/pinpoint/index.js +17 -0
  144. package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
  145. package/lib/pushNotifications/providers/pinpoint/types/analytics.js +4 -0
  146. package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
  147. package/lib/pushNotifications/providers/pinpoint/types/apis.js +4 -0
  148. package/lib/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
  149. package/lib/pushNotifications/providers/pinpoint/types/index.js +4 -0
  150. package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
  151. package/lib/pushNotifications/providers/pinpoint/types/inputs.js +4 -0
  152. package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
  153. package/lib/pushNotifications/providers/pinpoint/types/options.js +4 -0
  154. package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
  155. package/lib/pushNotifications/providers/pinpoint/types/outputs.js +4 -0
  156. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
  157. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +4 -0
  158. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +6 -0
  159. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +43 -0
  160. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +7 -0
  161. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +56 -0
  162. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +5 -0
  163. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +25 -0
  164. package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +4 -0
  165. package/lib/pushNotifications/providers/pinpoint/utils/index.js +13 -0
  166. package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
  167. package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.js +17 -0
  168. package/lib/pushNotifications/types/errors.d.ts +3 -0
  169. package/lib/pushNotifications/types/errors.js +9 -0
  170. package/lib/pushNotifications/types/index.d.ts +6 -0
  171. package/lib/pushNotifications/types/index.js +24 -0
  172. package/lib/pushNotifications/types/inputs.d.ts +24 -0
  173. package/lib/pushNotifications/types/inputs.js +4 -0
  174. package/lib/pushNotifications/types/module.d.ts +31 -0
  175. package/lib/pushNotifications/types/module.js +4 -0
  176. package/lib/pushNotifications/types/options.d.ts +4 -0
  177. package/lib/pushNotifications/types/options.js +4 -0
  178. package/lib/pushNotifications/types/outputs.d.ts +10 -0
  179. package/lib/pushNotifications/types/outputs.js +4 -0
  180. package/lib/pushNotifications/types/pushNotifications.d.ts +4 -0
  181. package/lib/pushNotifications/types/pushNotifications.js +4 -0
  182. package/lib/pushNotifications/utils/getPushNotificationUserAgentString.d.ts +2 -0
  183. package/lib/pushNotifications/utils/getPushNotificationUserAgentString.js +11 -0
  184. package/lib/pushNotifications/utils/index.d.ts +4 -0
  185. package/lib/pushNotifications/utils/index.js +15 -0
  186. package/lib/pushNotifications/utils/initializationManager.d.ts +12 -0
  187. package/lib/pushNotifications/utils/initializationManager.js +22 -0
  188. package/lib/pushNotifications/utils/resolveCredentials.d.ts +7 -0
  189. package/lib/pushNotifications/utils/resolveCredentials.js +16 -0
  190. package/lib/pushNotifications/utils/tokenManager.d.ts +12 -0
  191. package/lib/pushNotifications/utils/tokenManager.js +22 -0
  192. package/lib/tsconfig.tsbuildinfo +1 -0
  193. package/lib-esm/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +2 -2
  194. package/lib-esm/eventListeners/eventListeners.js +32 -0
  195. package/lib-esm/eventListeners/index.d.ts +2 -0
  196. package/lib-esm/{common → eventListeners}/index.js +0 -3
  197. package/lib-esm/eventListeners/types.d.ts +10 -0
  198. package/lib-esm/{PushNotification/Platform → eventListeners}/types.js +1 -1
  199. package/lib-esm/inAppMessaging/errors/InAppMessagingError.d.ts +7 -0
  200. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +15 -0
  201. package/lib-esm/inAppMessaging/errors/assertServiceError.d.ts +2 -0
  202. package/lib-esm/inAppMessaging/errors/assertServiceError.js +15 -0
  203. package/lib-esm/inAppMessaging/errors/assertValidationError.d.ts +5 -0
  204. package/lib-esm/inAppMessaging/errors/assertValidationError.js +13 -0
  205. package/lib-esm/inAppMessaging/errors/index.d.ts +4 -0
  206. package/lib-esm/inAppMessaging/errors/index.js +6 -0
  207. package/lib-esm/inAppMessaging/errors/validation.d.ts +8 -0
  208. package/lib-esm/inAppMessaging/errors/validation.js +24 -0
  209. package/lib-esm/inAppMessaging/index.d.ts +2 -0
  210. package/lib-esm/inAppMessaging/index.js +3 -0
  211. package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
  212. package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.js +22 -0
  213. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.d.ts +26 -0
  214. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +49 -0
  215. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +51 -0
  216. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +75 -0
  217. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +11 -0
  218. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +13 -0
  219. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.d.ts +12 -0
  220. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +53 -0
  221. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.d.ts +16 -0
  222. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +22 -0
  223. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.d.ts +18 -0
  224. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +23 -0
  225. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.d.ts +18 -0
  226. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +23 -0
  227. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.d.ts +18 -0
  228. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +23 -0
  229. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.d.ts +18 -0
  230. package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +23 -0
  231. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.d.ts +32 -0
  232. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +61 -0
  233. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.d.ts +16 -0
  234. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +65 -0
  235. package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +2 -0
  236. package/lib-esm/inAppMessaging/providers/pinpoint/index.js +3 -0
  237. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +4 -0
  238. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +3 -0
  239. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +37 -0
  240. package/lib-esm/{common/AWSPinpointProviderCommon/types.js → inAppMessaging/providers/pinpoint/types/inputs.js} +1 -1
  241. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
  242. package/lib-esm/{common/eventListeners/types.js → inAppMessaging/providers/pinpoint/types/options.js} +1 -1
  243. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +17 -0
  244. package/lib-esm/{InAppMessaging/SessionTracker/types.js → inAppMessaging/providers/pinpoint/types/outputs.js} +1 -1
  245. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +19 -0
  246. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +8 -0
  247. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.d.ts +4 -0
  248. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +6 -0
  249. package/lib-esm/{InAppMessaging/Providers/AWSPinpointProvider/utils.d.ts → inAppMessaging/providers/pinpoint/utils/helpers.d.ts} +6 -7
  250. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +246 -0
  251. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.d.ts +5 -0
  252. package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +7 -0
  253. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +6 -0
  254. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +163 -0
  255. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
  256. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +13 -0
  257. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
  258. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +12 -0
  259. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.d.ts +4 -0
  260. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +15 -0
  261. package/lib-esm/inAppMessaging/types/event.d.ts +6 -0
  262. package/lib-esm/inAppMessaging/types/event.js +3 -0
  263. package/lib-esm/inAppMessaging/types/index.d.ts +4 -0
  264. package/lib-esm/inAppMessaging/types/index.js +3 -0
  265. package/lib-esm/inAppMessaging/types/inputs.d.ts +19 -0
  266. package/lib-esm/inAppMessaging/types/inputs.js +3 -0
  267. package/lib-esm/inAppMessaging/types/message.d.ts +44 -0
  268. package/lib-esm/inAppMessaging/types/message.js +3 -0
  269. package/lib-esm/inAppMessaging/types/options.d.ts +4 -0
  270. package/lib-esm/inAppMessaging/types/options.js +3 -0
  271. package/lib-esm/inAppMessaging/utils/index.d.ts +1 -0
  272. package/lib-esm/inAppMessaging/utils/index.js +3 -0
  273. package/lib-esm/inAppMessaging/utils/statusHelpers.d.ts +13 -0
  274. package/lib-esm/inAppMessaging/utils/statusHelpers.js +21 -0
  275. package/lib-esm/index.d.ts +0 -6
  276. package/lib-esm/index.js +1 -5
  277. package/lib-esm/pushNotifications/errors/PushNotificationError.d.ts +4 -0
  278. package/lib-esm/pushNotifications/errors/PushNotificationError.js +12 -0
  279. package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +9 -0
  280. package/lib-esm/pushNotifications/errors/errorHelpers.js +31 -0
  281. package/lib-esm/pushNotifications/errors/index.d.ts +2 -0
  282. package/lib-esm/pushNotifications/errors/index.js +4 -0
  283. package/lib-esm/pushNotifications/index.d.ts +3 -0
  284. package/lib-esm/pushNotifications/index.js +4 -0
  285. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
  286. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +18 -0
  287. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
  288. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +9 -0
  289. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
  290. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +22 -0
  291. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
  292. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +9 -0
  293. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
  294. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +31 -0
  295. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
  296. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +9 -0
  297. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -0
  298. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +57 -0
  299. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
  300. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +27 -0
  301. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.d.ts +11 -0
  302. package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +13 -0
  303. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
  304. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +21 -0
  305. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
  306. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +129 -0
  307. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
  308. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +31 -0
  309. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
  310. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +8 -0
  311. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
  312. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +47 -0
  313. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
  314. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +8 -0
  315. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
  316. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +31 -0
  317. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
  318. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +8 -0
  319. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
  320. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +32 -0
  321. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
  322. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +8 -0
  323. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
  324. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +36 -0
  325. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
  326. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +9 -0
  327. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
  328. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +18 -0
  329. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
  330. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +9 -0
  331. package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +3 -0
  332. package/lib-esm/pushNotifications/providers/pinpoint/index.js +3 -0
  333. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
  334. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +3 -0
  335. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
  336. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +3 -0
  337. package/lib-esm/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
  338. package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +3 -0
  339. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
  340. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +3 -0
  341. package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
  342. package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +3 -0
  343. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
  344. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +3 -0
  345. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
  346. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +3 -0
  347. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +6 -0
  348. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +39 -0
  349. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +7 -0
  350. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +52 -0
  351. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +5 -0
  352. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +21 -0
  353. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +4 -0
  354. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +6 -0
  355. package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
  356. package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.js +13 -0
  357. package/lib-esm/pushNotifications/types/errors.d.ts +3 -0
  358. package/lib-esm/pushNotifications/types/errors.js +6 -0
  359. package/lib-esm/pushNotifications/types/index.d.ts +6 -0
  360. package/lib-esm/pushNotifications/types/index.js +8 -0
  361. package/lib-esm/pushNotifications/types/inputs.d.ts +24 -0
  362. package/lib-esm/pushNotifications/types/inputs.js +3 -0
  363. package/lib-esm/pushNotifications/types/module.d.ts +31 -0
  364. package/lib-esm/pushNotifications/types/module.js +3 -0
  365. package/lib-esm/pushNotifications/types/options.d.ts +4 -0
  366. package/lib-esm/pushNotifications/types/options.js +3 -0
  367. package/lib-esm/pushNotifications/types/outputs.d.ts +10 -0
  368. package/lib-esm/pushNotifications/types/outputs.js +3 -0
  369. package/lib-esm/pushNotifications/types/pushNotifications.d.ts +4 -0
  370. package/lib-esm/pushNotifications/types/pushNotifications.js +3 -0
  371. package/lib-esm/pushNotifications/utils/getPushNotificationUserAgentString.d.ts +2 -0
  372. package/lib-esm/pushNotifications/utils/getPushNotificationUserAgentString.js +7 -0
  373. package/lib-esm/pushNotifications/utils/index.d.ts +4 -0
  374. package/lib-esm/pushNotifications/utils/index.js +6 -0
  375. package/lib-esm/pushNotifications/utils/initializationManager.d.ts +12 -0
  376. package/lib-esm/pushNotifications/utils/initializationManager.js +17 -0
  377. package/lib-esm/pushNotifications/utils/resolveCredentials.d.ts +7 -0
  378. package/lib-esm/pushNotifications/utils/resolveCredentials.js +12 -0
  379. package/lib-esm/pushNotifications/utils/tokenManager.d.ts +12 -0
  380. package/lib-esm/pushNotifications/utils/tokenManager.js +17 -0
  381. package/lib-esm/tsconfig.tsbuildinfo +1 -0
  382. package/package.json +104 -38
  383. package/push-notifications/package.json +7 -0
  384. package/push-notifications/pinpoint/package.json +7 -0
  385. package/src/{common/eventListeners/index.ts → eventListeners/eventListeners.ts} +5 -3
  386. package/src/{common → eventListeners}/index.ts +1 -3
  387. package/src/{common/eventListeners → eventListeners}/types.ts +6 -2
  388. package/src/inAppMessaging/errors/InAppMessagingError.ts +21 -0
  389. package/src/inAppMessaging/errors/assertServiceError.ts +24 -0
  390. package/src/inAppMessaging/errors/assertValidationError.ts +22 -0
  391. package/src/inAppMessaging/errors/index.ts +10 -0
  392. package/src/inAppMessaging/errors/validation.ts +29 -0
  393. package/src/inAppMessaging/index.ts +39 -0
  394. package/src/inAppMessaging/providers/pinpoint/apis/clearMessages.ts +26 -0
  395. package/src/inAppMessaging/providers/pinpoint/apis/dispatchEvent.ts +63 -0
  396. package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +94 -0
  397. package/src/inAppMessaging/providers/pinpoint/apis/index.ts +14 -0
  398. package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +62 -0
  399. package/src/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.ts +28 -0
  400. package/src/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.ts +29 -0
  401. package/src/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.ts +29 -0
  402. package/src/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.ts +29 -0
  403. package/src/inAppMessaging/providers/pinpoint/apis/onMessageReceived.ts +29 -0
  404. package/src/inAppMessaging/providers/pinpoint/apis/setConflictHandler.ts +68 -0
  405. package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +88 -0
  406. package/src/inAppMessaging/providers/pinpoint/index.ts +31 -0
  407. package/src/inAppMessaging/providers/pinpoint/types/index.ts +29 -0
  408. package/src/inAppMessaging/providers/pinpoint/types/inputs.ts +58 -0
  409. package/src/inAppMessaging/providers/pinpoint/types/options.ts +9 -0
  410. package/src/inAppMessaging/providers/pinpoint/types/outputs.ts +24 -0
  411. package/src/{InAppMessaging/Providers/AWSPinpointProvider → inAppMessaging/providers/pinpoint/types}/types.ts +9 -1
  412. package/src/inAppMessaging/providers/pinpoint/utils/constants.ts +6 -0
  413. package/src/{InAppMessaging/Providers/AWSPinpointProvider/utils.ts → inAppMessaging/providers/pinpoint/utils/helpers.ts} +74 -58
  414. package/src/inAppMessaging/providers/pinpoint/utils/index.ts +18 -0
  415. package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +210 -0
  416. package/src/inAppMessaging/providers/pinpoint/utils/resolveConfig.ts +19 -0
  417. package/src/inAppMessaging/providers/pinpoint/utils/resolveCredentials.ts +20 -0
  418. package/src/inAppMessaging/providers/pinpoint/utils/userAgent.ts +25 -0
  419. package/src/inAppMessaging/types/event.ts +14 -0
  420. package/src/{InAppMessaging → inAppMessaging/types}/index.ts +7 -8
  421. package/src/inAppMessaging/types/inputs.ts +27 -0
  422. package/src/inAppMessaging/types/message.ts +62 -0
  423. package/src/inAppMessaging/types/options.ts +7 -0
  424. package/src/{PushNotification/Providers → inAppMessaging/utils}/index.ts +5 -1
  425. package/src/inAppMessaging/utils/statusHelpers.ts +32 -0
  426. package/src/index.ts +0 -24
  427. package/src/pushNotifications/errors/PushNotificationError.ts +18 -0
  428. package/src/pushNotifications/errors/errorHelpers.ts +45 -0
  429. package/src/pushNotifications/errors/index.ts +5 -0
  430. package/src/pushNotifications/index.ts +32 -0
  431. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +13 -0
  432. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +21 -0
  433. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +14 -0
  434. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +26 -0
  435. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +14 -0
  436. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +34 -0
  437. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +39 -0
  438. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +62 -0
  439. package/src/pushNotifications/providers/pinpoint/apis/index.ts +14 -0
  440. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +209 -0
  441. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.ts +24 -0
  442. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +11 -0
  443. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.ts +39 -0
  444. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +12 -0
  445. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.ts +56 -0
  446. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +12 -0
  447. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.ts +40 -0
  448. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +11 -0
  449. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.ts +39 -0
  450. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +14 -0
  451. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +39 -0
  452. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +13 -0
  453. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.ts +21 -0
  454. package/src/pushNotifications/providers/pinpoint/index.ts +34 -0
  455. package/src/pushNotifications/providers/pinpoint/types/analytics.ts +14 -0
  456. package/src/pushNotifications/providers/pinpoint/types/apis.ts +54 -0
  457. package/src/pushNotifications/providers/pinpoint/types/index.ts +40 -0
  458. package/src/pushNotifications/providers/pinpoint/types/inputs.ts +31 -0
  459. package/src/pushNotifications/providers/pinpoint/types/options.ts +9 -0
  460. package/src/pushNotifications/providers/pinpoint/types/outputs.ts +34 -0
  461. package/src/pushNotifications/providers/pinpoint/types/pushNotifications.ts +6 -0
  462. package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +66 -0
  463. package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +66 -0
  464. package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +25 -0
  465. package/src/pushNotifications/providers/pinpoint/utils/index.ts +7 -0
  466. package/src/pushNotifications/providers/pinpoint/utils/resolveConfig.ts +16 -0
  467. package/src/{InAppMessaging/Providers/index.ts → pushNotifications/types/errors.ts} +3 -1
  468. package/src/pushNotifications/types/index.ts +9 -0
  469. package/src/pushNotifications/types/inputs.ts +45 -0
  470. package/src/pushNotifications/types/module.ts +42 -0
  471. package/src/pushNotifications/types/options.ts +7 -0
  472. package/src/pushNotifications/types/outputs.ts +28 -0
  473. package/src/pushNotifications/types/pushNotifications.ts +17 -0
  474. package/src/pushNotifications/utils/getPushNotificationUserAgentString.ts +15 -0
  475. package/src/pushNotifications/utils/index.ts +7 -0
  476. package/src/pushNotifications/utils/initializationManager.ts +20 -0
  477. package/src/pushNotifications/utils/resolveCredentials.ts +14 -0
  478. package/src/pushNotifications/utils/tokenManager.ts +20 -0
  479. package/lib/.tsbuildinfo +0 -3
  480. package/lib/InAppMessaging/InAppMessaging.d.ts +0 -57
  481. package/lib/InAppMessaging/InAppMessaging.js +0 -340
  482. package/lib/InAppMessaging/InAppMessaging.js.map +0 -1
  483. package/lib/InAppMessaging/Providers/AWSPinpointProvider/index.d.ts +0 -31
  484. package/lib/InAppMessaging/Providers/AWSPinpointProvider/index.js +0 -266
  485. package/lib/InAppMessaging/Providers/AWSPinpointProvider/index.js.map +0 -1
  486. package/lib/InAppMessaging/Providers/AWSPinpointProvider/types.d.ts +0 -16
  487. package/lib/InAppMessaging/Providers/AWSPinpointProvider/types.js +0 -11
  488. package/lib/InAppMessaging/Providers/AWSPinpointProvider/types.js.map +0 -1
  489. package/lib/InAppMessaging/Providers/AWSPinpointProvider/utils.js +0 -247
  490. package/lib/InAppMessaging/Providers/AWSPinpointProvider/utils.js.map +0 -1
  491. package/lib/InAppMessaging/Providers/index.d.ts +0 -1
  492. package/lib/InAppMessaging/Providers/index.js +0 -7
  493. package/lib/InAppMessaging/Providers/index.js.map +0 -1
  494. package/lib/InAppMessaging/SessionTracker/SessionTracker.d.ts +0 -9
  495. package/lib/InAppMessaging/SessionTracker/SessionTracker.js +0 -68
  496. package/lib/InAppMessaging/SessionTracker/SessionTracker.js.map +0 -1
  497. package/lib/InAppMessaging/SessionTracker/SessionTracker.native.d.ts +0 -10
  498. package/lib/InAppMessaging/SessionTracker/SessionTracker.native.js +0 -53
  499. package/lib/InAppMessaging/SessionTracker/SessionTracker.native.js.map +0 -1
  500. package/lib/InAppMessaging/SessionTracker/index.d.ts +0 -3
  501. package/lib/InAppMessaging/SessionTracker/index.js +0 -8
  502. package/lib/InAppMessaging/SessionTracker/index.js.map +0 -1
  503. package/lib/InAppMessaging/SessionTracker/types.d.ts +0 -6
  504. package/lib/InAppMessaging/SessionTracker/types.js.map +0 -1
  505. package/lib/InAppMessaging/index.d.ts +0 -2
  506. package/lib/InAppMessaging/index.js.map +0 -1
  507. package/lib/InAppMessaging/types.d.ts +0 -87
  508. package/lib/InAppMessaging/types.js +0 -12
  509. package/lib/InAppMessaging/types.js.map +0 -1
  510. package/lib/Notifications.d.ts +0 -24
  511. package/lib/Notifications.js +0 -94
  512. package/lib/Notifications.js.map +0 -1
  513. package/lib/PushNotification/NotEnabledError.d.ts +0 -3
  514. package/lib/PushNotification/NotEnabledError.js +0 -16
  515. package/lib/PushNotification/NotEnabledError.js.map +0 -1
  516. package/lib/PushNotification/Platform/index.d.ts +0 -2
  517. package/lib/PushNotification/Platform/index.js +0 -26
  518. package/lib/PushNotification/Platform/index.js.map +0 -1
  519. package/lib/PushNotification/Platform/index.native.d.ts +0 -2
  520. package/lib/PushNotification/Platform/index.native.js +0 -8
  521. package/lib/PushNotification/Platform/index.native.js.map +0 -1
  522. package/lib/PushNotification/Platform/types.d.ts +0 -5
  523. package/lib/PushNotification/Platform/types.js.map +0 -1
  524. package/lib/PushNotification/PlatformNotSupportedError.d.ts +0 -3
  525. package/lib/PushNotification/PlatformNotSupportedError.js +0 -16
  526. package/lib/PushNotification/PlatformNotSupportedError.js.map +0 -1
  527. package/lib/PushNotification/Providers/AWSPinpointProvider/index.d.ts +0 -15
  528. package/lib/PushNotification/Providers/AWSPinpointProvider/index.js +0 -114
  529. package/lib/PushNotification/Providers/AWSPinpointProvider/index.js.map +0 -1
  530. package/lib/PushNotification/Providers/AWSPinpointProvider/types.d.ts +0 -9
  531. package/lib/PushNotification/Providers/AWSPinpointProvider/types.js +0 -16
  532. package/lib/PushNotification/Providers/AWSPinpointProvider/types.js.map +0 -1
  533. package/lib/PushNotification/Providers/AWSPinpointProvider/utils.d.ts +0 -7
  534. package/lib/PushNotification/Providers/AWSPinpointProvider/utils.js +0 -58
  535. package/lib/PushNotification/Providers/AWSPinpointProvider/utils.js.map +0 -1
  536. package/lib/PushNotification/Providers/index.d.ts +0 -1
  537. package/lib/PushNotification/Providers/index.js +0 -7
  538. package/lib/PushNotification/Providers/index.js.map +0 -1
  539. package/lib/PushNotification/PushNotification.d.ts +0 -39
  540. package/lib/PushNotification/PushNotification.js +0 -91
  541. package/lib/PushNotification/PushNotification.js.map +0 -1
  542. package/lib/PushNotification/PushNotification.native.d.ts +0 -63
  543. package/lib/PushNotification/PushNotification.native.js +0 -332
  544. package/lib/PushNotification/PushNotification.native.js.map +0 -1
  545. package/lib/PushNotification/index.d.ts +0 -2
  546. package/lib/PushNotification/index.js +0 -9
  547. package/lib/PushNotification/index.js.map +0 -1
  548. package/lib/PushNotification/types.d.ts +0 -77
  549. package/lib/PushNotification/types.js +0 -12
  550. package/lib/PushNotification/types.js.map +0 -1
  551. package/lib/PushNotification/utils.d.ts +0 -3
  552. package/lib/PushNotification/utils.js +0 -81
  553. package/lib/PushNotification/utils.js.map +0 -1
  554. package/lib/common/AWSPinpointProviderCommon/index.d.ts +0 -35
  555. package/lib/common/AWSPinpointProviderCommon/index.js +0 -280
  556. package/lib/common/AWSPinpointProviderCommon/index.js.map +0 -1
  557. package/lib/common/AWSPinpointProviderCommon/types.d.ts +0 -10
  558. package/lib/common/AWSPinpointProviderCommon/types.js.map +0 -1
  559. package/lib/common/constants.d.ts +0 -1
  560. package/lib/common/constants.js +0 -8
  561. package/lib/common/constants.js.map +0 -1
  562. package/lib/common/eventListeners/index.js +0 -55
  563. package/lib/common/eventListeners/index.js.map +0 -1
  564. package/lib/common/eventListeners/types.d.ts +0 -7
  565. package/lib/common/eventListeners/types.js.map +0 -1
  566. package/lib/common/index.d.ts +0 -4
  567. package/lib/common/index.js +0 -13
  568. package/lib/common/index.js.map +0 -1
  569. package/lib/index.js.map +0 -1
  570. package/lib/types.d.ts +0 -39
  571. package/lib/types.js +0 -5
  572. package/lib/types.js.map +0 -1
  573. package/lib-esm/.tsbuildinfo +0 -3
  574. package/lib-esm/InAppMessaging/InAppMessaging.d.ts +0 -57
  575. package/lib-esm/InAppMessaging/InAppMessaging.js +0 -338
  576. package/lib-esm/InAppMessaging/InAppMessaging.js.map +0 -1
  577. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/index.d.ts +0 -31
  578. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/index.js +0 -264
  579. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/index.js.map +0 -1
  580. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/types.d.ts +0 -16
  581. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/types.js +0 -9
  582. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/types.js.map +0 -1
  583. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/utils.js +0 -245
  584. package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/utils.js.map +0 -1
  585. package/lib-esm/InAppMessaging/Providers/index.d.ts +0 -1
  586. package/lib-esm/InAppMessaging/Providers/index.js +0 -4
  587. package/lib-esm/InAppMessaging/Providers/index.js.map +0 -1
  588. package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.d.ts +0 -9
  589. package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.js +0 -65
  590. package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.js.map +0 -1
  591. package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.native.d.ts +0 -10
  592. package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.native.js +0 -50
  593. package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.native.js.map +0 -1
  594. package/lib-esm/InAppMessaging/SessionTracker/index.d.ts +0 -3
  595. package/lib-esm/InAppMessaging/SessionTracker/index.js +0 -5
  596. package/lib-esm/InAppMessaging/SessionTracker/index.js.map +0 -1
  597. package/lib-esm/InAppMessaging/SessionTracker/types.d.ts +0 -6
  598. package/lib-esm/InAppMessaging/SessionTracker/types.js.map +0 -1
  599. package/lib-esm/InAppMessaging/index.d.ts +0 -2
  600. package/lib-esm/InAppMessaging/index.js +0 -5
  601. package/lib-esm/InAppMessaging/index.js.map +0 -1
  602. package/lib-esm/InAppMessaging/types.d.ts +0 -87
  603. package/lib-esm/InAppMessaging/types.js +0 -10
  604. package/lib-esm/InAppMessaging/types.js.map +0 -1
  605. package/lib-esm/Notifications.d.ts +0 -24
  606. package/lib-esm/Notifications.js +0 -92
  607. package/lib-esm/Notifications.js.map +0 -1
  608. package/lib-esm/PushNotification/NotEnabledError.d.ts +0 -3
  609. package/lib-esm/PushNotification/NotEnabledError.js +0 -14
  610. package/lib-esm/PushNotification/NotEnabledError.js.map +0 -1
  611. package/lib-esm/PushNotification/Platform/index.d.ts +0 -2
  612. package/lib-esm/PushNotification/Platform/index.js +0 -24
  613. package/lib-esm/PushNotification/Platform/index.js.map +0 -1
  614. package/lib-esm/PushNotification/Platform/index.native.d.ts +0 -2
  615. package/lib-esm/PushNotification/Platform/index.native.js +0 -6
  616. package/lib-esm/PushNotification/Platform/index.native.js.map +0 -1
  617. package/lib-esm/PushNotification/Platform/types.d.ts +0 -5
  618. package/lib-esm/PushNotification/Platform/types.js.map +0 -1
  619. package/lib-esm/PushNotification/PlatformNotSupportedError.d.ts +0 -3
  620. package/lib-esm/PushNotification/PlatformNotSupportedError.js +0 -14
  621. package/lib-esm/PushNotification/PlatformNotSupportedError.js.map +0 -1
  622. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/index.d.ts +0 -15
  623. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/index.js +0 -112
  624. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/index.js.map +0 -1
  625. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/types.d.ts +0 -9
  626. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/types.js +0 -14
  627. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/types.js.map +0 -1
  628. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/utils.d.ts +0 -7
  629. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/utils.js +0 -56
  630. package/lib-esm/PushNotification/Providers/AWSPinpointProvider/utils.js.map +0 -1
  631. package/lib-esm/PushNotification/Providers/index.d.ts +0 -1
  632. package/lib-esm/PushNotification/Providers/index.js +0 -4
  633. package/lib-esm/PushNotification/Providers/index.js.map +0 -1
  634. package/lib-esm/PushNotification/PushNotification.d.ts +0 -39
  635. package/lib-esm/PushNotification/PushNotification.js +0 -89
  636. package/lib-esm/PushNotification/PushNotification.js.map +0 -1
  637. package/lib-esm/PushNotification/PushNotification.native.d.ts +0 -63
  638. package/lib-esm/PushNotification/PushNotification.native.js +0 -330
  639. package/lib-esm/PushNotification/PushNotification.native.js.map +0 -1
  640. package/lib-esm/PushNotification/index.d.ts +0 -2
  641. package/lib-esm/PushNotification/index.js +0 -5
  642. package/lib-esm/PushNotification/index.js.map +0 -1
  643. package/lib-esm/PushNotification/types.d.ts +0 -77
  644. package/lib-esm/PushNotification/types.js +0 -10
  645. package/lib-esm/PushNotification/types.js.map +0 -1
  646. package/lib-esm/PushNotification/utils.d.ts +0 -3
  647. package/lib-esm/PushNotification/utils.js +0 -79
  648. package/lib-esm/PushNotification/utils.js.map +0 -1
  649. package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +0 -35
  650. package/lib-esm/common/AWSPinpointProviderCommon/index.js +0 -278
  651. package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +0 -1
  652. package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +0 -10
  653. package/lib-esm/common/AWSPinpointProviderCommon/types.js.map +0 -1
  654. package/lib-esm/common/constants.d.ts +0 -1
  655. package/lib-esm/common/constants.js +0 -6
  656. package/lib-esm/common/constants.js.map +0 -1
  657. package/lib-esm/common/eventListeners/index.js +0 -53
  658. package/lib-esm/common/eventListeners/index.js.map +0 -1
  659. package/lib-esm/common/eventListeners/types.d.ts +0 -7
  660. package/lib-esm/common/eventListeners/types.js.map +0 -1
  661. package/lib-esm/common/index.d.ts +0 -4
  662. package/lib-esm/common/index.js.map +0 -1
  663. package/lib-esm/index.js.map +0 -1
  664. package/lib-esm/types.d.ts +0 -39
  665. package/lib-esm/types.js +0 -3
  666. package/lib-esm/types.js.map +0 -1
  667. package/src/InAppMessaging/InAppMessaging.ts +0 -321
  668. package/src/InAppMessaging/Providers/AWSPinpointProvider/index.ts +0 -323
  669. package/src/InAppMessaging/SessionTracker/SessionTracker.native.ts +0 -60
  670. package/src/InAppMessaging/SessionTracker/SessionTracker.ts +0 -78
  671. package/src/InAppMessaging/SessionTracker/index.ts +0 -6
  672. package/src/InAppMessaging/SessionTracker/types.ts +0 -11
  673. package/src/InAppMessaging/types.ts +0 -142
  674. package/src/Notifications.ts +0 -90
  675. package/src/PushNotification/NotEnabledError.ts +0 -11
  676. package/src/PushNotification/Platform/index.native.ts +0 -9
  677. package/src/PushNotification/Platform/index.ts +0 -22
  678. package/src/PushNotification/Platform/types.ts +0 -15
  679. package/src/PushNotification/PlatformNotSupportedError.ts +0 -9
  680. package/src/PushNotification/Providers/AWSPinpointProvider/index.ts +0 -137
  681. package/src/PushNotification/Providers/AWSPinpointProvider/types.ts +0 -13
  682. package/src/PushNotification/Providers/AWSPinpointProvider/utils.ts +0 -79
  683. package/src/PushNotification/PushNotification.native.ts +0 -386
  684. package/src/PushNotification/PushNotification.ts +0 -107
  685. package/src/PushNotification/index.ts +0 -9
  686. package/src/PushNotification/types.ts +0 -115
  687. package/src/PushNotification/utils.ts +0 -112
  688. package/src/common/AWSPinpointProviderCommon/index.ts +0 -291
  689. package/src/common/AWSPinpointProviderCommon/types.ts +0 -29
  690. package/src/common/constants.ts +0 -7
  691. package/src/types.ts +0 -56
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.initializePushNotifications = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Initialize and set up the push notification category. The category must be first initialized before all other
9
+ * functionalities become available.
10
+ *
11
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
12
+ * only React Native is supported by this API.
13
+ * @remarks
14
+ * It is recommended that this be called as early in your app as possible at the root of your application to allow
15
+ * background processing of notifications.
16
+ * @example
17
+ * ```ts
18
+ * Amplify.configure(config);
19
+ * initializePushNotifications();
20
+ * ```
21
+ */
22
+ const initializePushNotifications = () => {
23
+ throw new utils_1.PlatformNotSupportedError();
24
+ };
25
+ exports.initializePushNotifications = initializePushNotifications;
@@ -0,0 +1 @@
1
+ export declare const initializePushNotifications: () => void;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.initializePushNotifications = void 0;
6
+ const core_1 = require("@aws-amplify/core");
7
+ const utils_1 = require("@aws-amplify/core/internals/utils");
8
+ const pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
9
+ const react_native_1 = require("@aws-amplify/react-native");
10
+ const eventListeners_1 = require("../../../../eventListeners");
11
+ const utils_2 = require("../../../utils");
12
+ const utils_3 = require("../utils");
13
+ const { addMessageEventListener, addTokenEventListener, completeNotification, getConstants, registerHeadlessTask, } = (0, react_native_1.loadAmplifyPushNotification)();
14
+ const logger = new core_1.ConsoleLogger('Notifications.PushNotification');
15
+ const BACKGROUND_TASK_TIMEOUT = 25; // seconds
16
+ const initializePushNotifications = () => {
17
+ if ((0, utils_2.isInitialized)()) {
18
+ logger.info('Push notifications have already been enabled');
19
+ return;
20
+ }
21
+ addNativeListeners();
22
+ addAnalyticsListeners();
23
+ (0, utils_2.initialize)();
24
+ };
25
+ exports.initializePushNotifications = initializePushNotifications;
26
+ const addNativeListeners = () => {
27
+ let launchNotificationOpenedListener;
28
+ const { NativeEvent, NativeHeadlessTaskKey } = getConstants();
29
+ const { BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED, TOKEN_RECEIVED, } = NativeEvent;
30
+ // on platforms that can handle headless tasks, register one to broadcast background message received to
31
+ // library listeners
32
+ if (NativeHeadlessTaskKey) {
33
+ registerHeadlessTask(async (message) => {
34
+ // keep headless task running until handlers have completed their work
35
+ await (0, eventListeners_1.notifyEventListenersAndAwaitHandlers)('backgroundMessageReceived', message);
36
+ });
37
+ }
38
+ else if (BACKGROUND_MESSAGE_RECEIVED) {
39
+ // on platforms that can't handle headless tasks, listen for native background message received event and
40
+ // broadcast to library listeners
41
+ addMessageEventListener(BACKGROUND_MESSAGE_RECEIVED, async (message, completionHandlerId) => {
42
+ // keep background task running until handlers have completed their work
43
+ try {
44
+ await Promise.race([
45
+ (0, eventListeners_1.notifyEventListenersAndAwaitHandlers)('backgroundMessageReceived', message),
46
+ // background tasks will get suspended and all future tasks be deprioritized by the OS if they run for
47
+ // more than 30 seconds so we reject with a error in a shorter amount of time to prevent this from
48
+ // happening
49
+ new Promise((_, reject) => {
50
+ setTimeout(() => reject(`onNotificationReceivedInBackground handlers should complete their work within ${BACKGROUND_TASK_TIMEOUT} seconds, but they did not.`), BACKGROUND_TASK_TIMEOUT * 1000);
51
+ }),
52
+ ]);
53
+ }
54
+ catch (err) {
55
+ logger.error(err);
56
+ }
57
+ finally {
58
+ // notify native module that handlers have completed their work (or timed out)
59
+ if (completionHandlerId) {
60
+ completeNotification(completionHandlerId);
61
+ }
62
+ }
63
+ });
64
+ }
65
+ addMessageEventListener(
66
+ // listen for native foreground message received event and broadcast to library listeners
67
+ FOREGROUND_MESSAGE_RECEIVED, message => {
68
+ (0, eventListeners_1.notifyEventListeners)('foregroundMessageReceived', message);
69
+ });
70
+ launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
71
+ ? addMessageEventListener(
72
+ // listen for native notification opened app (user tapped on notification, opening the app from quit -
73
+ // not background - state) event. This is broadcasted to an internal listener only as it is not intended
74
+ // for use otherwise as it produces inconsistent results when used within React Native app context
75
+ LAUNCH_NOTIFICATION_OPENED, message => {
76
+ (0, eventListeners_1.notifyEventListeners)('launchNotificationOpened', message);
77
+ // once we are done with it we can remove the listener
78
+ launchNotificationOpenedListener?.remove();
79
+ })
80
+ : null;
81
+ addMessageEventListener(
82
+ // listen for native notification opened (user tapped on notification, opening the app from background -
83
+ // not quit - state) event and broadcast to library listeners
84
+ NOTIFICATION_OPENED, message => {
85
+ (0, eventListeners_1.notifyEventListeners)('notificationOpened', message);
86
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
87
+ launchNotificationOpenedListener?.remove();
88
+ });
89
+ addTokenEventListener(
90
+ // listen for native new token event, automatically re-register device with provider using new token and
91
+ // broadcast to library listeners
92
+ TOKEN_RECEIVED, async (token) => {
93
+ // avoid a race condition where two endpoints are created with the same token on a fresh install
94
+ if ((0, utils_2.getToken)() === token) {
95
+ return;
96
+ }
97
+ (0, utils_2.setToken)(token);
98
+ (0, eventListeners_1.notifyEventListeners)('tokenReceived', token);
99
+ try {
100
+ await registerDevice(token);
101
+ }
102
+ catch (err) {
103
+ logger.error('Failed to register device for push notifications', err);
104
+ throw err;
105
+ }
106
+ });
107
+ };
108
+ const addAnalyticsListeners = () => {
109
+ let launchNotificationOpenedListenerRemover;
110
+ // wire up default Pinpoint message event handling
111
+ (0, eventListeners_1.addEventListener)('backgroundMessageReceived', (0, utils_3.createMessageEventRecorder)('received_background'));
112
+ (0, eventListeners_1.addEventListener)('foregroundMessageReceived', (0, utils_3.createMessageEventRecorder)('received_foreground'));
113
+ launchNotificationOpenedListenerRemover = (0, eventListeners_1.addEventListener)('launchNotificationOpened', (0, utils_3.createMessageEventRecorder)('opened_notification',
114
+ // once we are done with it we can remove the listener
115
+ launchNotificationOpenedListenerRemover?.remove));
116
+ (0, eventListeners_1.addEventListener)('notificationOpened', (0, utils_3.createMessageEventRecorder)('opened_notification',
117
+ // if we are in this state, we no longer need the listener as the app was launched via some other means
118
+ launchNotificationOpenedListenerRemover?.remove));
119
+ };
120
+ const registerDevice = async (address) => {
121
+ const { credentials, identityId } = await (0, utils_2.resolveCredentials)();
122
+ const { appId, region } = (0, utils_3.resolveConfig)();
123
+ await (0, pinpoint_1.updateEndpoint)({
124
+ address,
125
+ appId,
126
+ category: 'PushNotification',
127
+ credentials,
128
+ region,
129
+ channelType: (0, utils_3.getChannelType)(),
130
+ identityId,
131
+ userAgentValue: (0, utils_2.getPushNotificationUserAgentString)(utils_1.PushNotificationAction.InitializePushNotifications),
132
+ });
133
+ };
@@ -0,0 +1,27 @@
1
+ import { OnNotificationOpened } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a notification is opened by user.
4
+ *
5
+ * @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
6
+ * {@link PushNotificationMessage}.
7
+ * @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
8
+ * @example
9
+ * ```ts
10
+ * // Register a listener
11
+ * onNotificationOpened(message => {
12
+ * doSomething(message);
13
+ * });
14
+ * ```
15
+ * @example
16
+ * ```ts
17
+ * // Register multiple listeners
18
+ * onNotificationOpened(message => {
19
+ * doSomething(message);
20
+ * });
21
+ *
22
+ * onNotificationOpened(message => {
23
+ * doSomethingElse(message);
24
+ * });
25
+ * ```
26
+ */
27
+ export declare const onNotificationOpened: OnNotificationOpened;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onNotificationOpened = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Registers a listener that will be triggered when a notification is opened by user.
9
+ *
10
+ * @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
11
+ * {@link PushNotificationMessage}.
12
+ * @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
13
+ * @example
14
+ * ```ts
15
+ * // Register a listener
16
+ * onNotificationOpened(message => {
17
+ * doSomething(message);
18
+ * });
19
+ * ```
20
+ * @example
21
+ * ```ts
22
+ * // Register multiple listeners
23
+ * onNotificationOpened(message => {
24
+ * doSomething(message);
25
+ * });
26
+ *
27
+ * onNotificationOpened(message => {
28
+ * doSomethingElse(message);
29
+ * });
30
+ * ```
31
+ */
32
+ const onNotificationOpened = () => {
33
+ throw new utils_1.PlatformNotSupportedError();
34
+ };
35
+ exports.onNotificationOpened = onNotificationOpened;
@@ -0,0 +1,2 @@
1
+ import { OnNotificationOpened } from '../types';
2
+ export declare const onNotificationOpened: OnNotificationOpened;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onNotificationOpened = void 0;
6
+ const eventListeners_1 = require("../../../../eventListeners");
7
+ const errorHelpers_1 = require("../../../errors/errorHelpers");
8
+ const onNotificationOpened = input => {
9
+ (0, errorHelpers_1.assertIsInitialized)();
10
+ return (0, eventListeners_1.addEventListener)('notificationOpened', input);
11
+ };
12
+ exports.onNotificationOpened = onNotificationOpened;
@@ -0,0 +1,43 @@
1
+ import { OnNotificationReceivedInBackground } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a notification is received while app is in a background state.
4
+ *
5
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
6
+ * only React Native is supported by this API.
7
+ * @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
8
+ * {@link PushNotificationMessage}.
9
+ * @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
10
+ * @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
11
+ * on a background service on Android) in the background. Handlers registered via this function should return promises
12
+ * if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
13
+ * as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
14
+ * get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
15
+ * registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
16
+ * @example
17
+ * ```ts
18
+ * // Register a listener
19
+ * onNotificationReceivedInBackground(message => {
20
+ * doSomething(message);
21
+ * });
22
+ * ```
23
+ * @example
24
+ * ```ts
25
+ * // Register multiple listeners
26
+ * onNotificationReceivedInBackground(message => {
27
+ * doSomething(message);
28
+ * });
29
+ *
30
+ * onNotificationReceivedInBackground(message => {
31
+ * doSomethingElse(message);
32
+ * });
33
+ * ```
34
+ * @example
35
+ * ```ts
36
+ * // Register async listener
37
+ * onNotificationReceivedInBackground(async message => {
38
+ * await doSomething(message);
39
+ * console.log(`did something with ${message}`);
40
+ * });
41
+ * ```
42
+ */
43
+ export declare const onNotificationReceivedInBackground: OnNotificationReceivedInBackground;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onNotificationReceivedInBackground = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Registers a listener that will be triggered when a notification is received while app is in a background state.
9
+ *
10
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
11
+ * only React Native is supported by this API.
12
+ * @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
13
+ * {@link PushNotificationMessage}.
14
+ * @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
15
+ * @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
16
+ * on a background service on Android) in the background. Handlers registered via this function should return promises
17
+ * if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
18
+ * as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
19
+ * get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
20
+ * registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
21
+ * @example
22
+ * ```ts
23
+ * // Register a listener
24
+ * onNotificationReceivedInBackground(message => {
25
+ * doSomething(message);
26
+ * });
27
+ * ```
28
+ * @example
29
+ * ```ts
30
+ * // Register multiple listeners
31
+ * onNotificationReceivedInBackground(message => {
32
+ * doSomething(message);
33
+ * });
34
+ *
35
+ * onNotificationReceivedInBackground(message => {
36
+ * doSomethingElse(message);
37
+ * });
38
+ * ```
39
+ * @example
40
+ * ```ts
41
+ * // Register async listener
42
+ * onNotificationReceivedInBackground(async message => {
43
+ * await doSomething(message);
44
+ * console.log(`did something with ${message}`);
45
+ * });
46
+ * ```
47
+ */
48
+ const onNotificationReceivedInBackground = () => {
49
+ throw new utils_1.PlatformNotSupportedError();
50
+ };
51
+ exports.onNotificationReceivedInBackground = onNotificationReceivedInBackground;
@@ -0,0 +1,2 @@
1
+ import { OnNotificationReceivedInBackground } from '../types';
2
+ export declare const onNotificationReceivedInBackground: OnNotificationReceivedInBackground;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onNotificationReceivedInBackground = void 0;
6
+ const eventListeners_1 = require("../../../../eventListeners");
7
+ const errorHelpers_1 = require("../../../errors/errorHelpers");
8
+ const onNotificationReceivedInBackground = input => {
9
+ (0, errorHelpers_1.assertIsInitialized)();
10
+ return (0, eventListeners_1.addEventListener)('backgroundMessageReceived', input);
11
+ };
12
+ exports.onNotificationReceivedInBackground = onNotificationReceivedInBackground;
@@ -0,0 +1,27 @@
1
+ import { OnNotificationReceivedInForeground } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a notification is received while app is in a foreground state.
4
+ *
5
+ * @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
6
+ * {@link PushNotificationMessage}.
7
+ * @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
8
+ * @example
9
+ * ```ts
10
+ * // Register a listener
11
+ * onNotificationReceivedInForeground(message => {
12
+ * doSomething(message);
13
+ * });
14
+ * ```
15
+ * @example
16
+ * ```ts
17
+ * // Register multiple listeners
18
+ * onNotificationReceivedInForeground(message => {
19
+ * doSomething(message);
20
+ * });
21
+ *
22
+ * onNotificationReceivedInForeground(message => {
23
+ * doSomethingElse(message);
24
+ * });
25
+ * ```
26
+ */
27
+ export declare const onNotificationReceivedInForeground: OnNotificationReceivedInForeground;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onNotificationReceivedInForeground = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Registers a listener that will be triggered when a notification is received while app is in a foreground state.
9
+ *
10
+ * @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
11
+ * {@link PushNotificationMessage}.
12
+ * @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
13
+ * @example
14
+ * ```ts
15
+ * // Register a listener
16
+ * onNotificationReceivedInForeground(message => {
17
+ * doSomething(message);
18
+ * });
19
+ * ```
20
+ * @example
21
+ * ```ts
22
+ * // Register multiple listeners
23
+ * onNotificationReceivedInForeground(message => {
24
+ * doSomething(message);
25
+ * });
26
+ *
27
+ * onNotificationReceivedInForeground(message => {
28
+ * doSomethingElse(message);
29
+ * });
30
+ * ```
31
+ */
32
+ const onNotificationReceivedInForeground = () => {
33
+ throw new utils_1.PlatformNotSupportedError();
34
+ };
35
+ exports.onNotificationReceivedInForeground = onNotificationReceivedInForeground;
@@ -0,0 +1,2 @@
1
+ import { OnNotificationReceivedInForeground } from '../types';
2
+ export declare const onNotificationReceivedInForeground: OnNotificationReceivedInForeground;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onNotificationReceivedInForeground = void 0;
6
+ const eventListeners_1 = require("../../../../eventListeners");
7
+ const errorHelpers_1 = require("../../../errors/errorHelpers");
8
+ const onNotificationReceivedInForeground = input => {
9
+ (0, errorHelpers_1.assertIsInitialized)();
10
+ return (0, eventListeners_1.addEventListener)('foregroundMessageReceived', input);
11
+ };
12
+ exports.onNotificationReceivedInForeground = onNotificationReceivedInForeground;
@@ -0,0 +1,28 @@
1
+ import { OnTokenReceived } from '../types';
2
+ /**
3
+ * Registers a listener that will be triggered when a token is received. A token will be received:
4
+ * 1. On every app launch, including the first install
5
+ * 2. When a token changes (this may happen if the service invalidates the token for any reason)
6
+ *
7
+ * @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
8
+ * @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
9
+ * @example
10
+ * ```ts
11
+ * // Register a listener
12
+ * onTokenReceived(message => {
13
+ * doSomething(message);
14
+ * });
15
+ * ```
16
+ * @example
17
+ * ```ts
18
+ * // Register multiple listeners
19
+ * onTokenReceived(message => {
20
+ * doSomething(message);
21
+ * });
22
+ *
23
+ * onTokenReceived(message => {
24
+ * doSomethingElse(message);
25
+ * });
26
+ * ```
27
+ */
28
+ export declare const onTokenReceived: OnTokenReceived;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onTokenReceived = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Registers a listener that will be triggered when a token is received. A token will be received:
9
+ * 1. On every app launch, including the first install
10
+ * 2. When a token changes (this may happen if the service invalidates the token for any reason)
11
+ *
12
+ * @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
13
+ * @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
14
+ * @example
15
+ * ```ts
16
+ * // Register a listener
17
+ * onTokenReceived(message => {
18
+ * doSomething(message);
19
+ * });
20
+ * ```
21
+ * @example
22
+ * ```ts
23
+ * // Register multiple listeners
24
+ * onTokenReceived(message => {
25
+ * doSomething(message);
26
+ * });
27
+ *
28
+ * onTokenReceived(message => {
29
+ * doSomethingElse(message);
30
+ * });
31
+ * ```
32
+ */
33
+ const onTokenReceived = () => {
34
+ throw new utils_1.PlatformNotSupportedError();
35
+ };
36
+ exports.onTokenReceived = onTokenReceived;
@@ -0,0 +1,2 @@
1
+ import { OnTokenReceived } from '../types';
2
+ export declare const onTokenReceived: OnTokenReceived;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.onTokenReceived = void 0;
6
+ const eventListeners_1 = require("../../../../eventListeners");
7
+ const errorHelpers_1 = require("../../../errors/errorHelpers");
8
+ const onTokenReceived = input => {
9
+ (0, errorHelpers_1.assertIsInitialized)();
10
+ return (0, eventListeners_1.addEventListener)('tokenReceived', input);
11
+ };
12
+ exports.onTokenReceived = onTokenReceived;
@@ -0,0 +1,32 @@
1
+ import { RequestPermissions } from '../types';
2
+ /**
3
+ * Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
4
+ * choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
5
+ * granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
6
+ * your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
7
+ *
8
+ * * `alert`: When set to true, requests the ability to display notifications to the user.
9
+ *
10
+ * * `sound`: When set to true, requests the ability to play a sound in response to notifications.
11
+ *
12
+ * * `badge`: When set to true, requests the ability to update the app's badge.
13
+ *
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 resolves to true if requested permissions are granted or have already previously been
17
+ * granted or false otherwise.
18
+ * @example
19
+ * ```ts
20
+ * // Request all permissions by default
21
+ * const arePermissionsGranted = await requestPermissions();
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * // Prevent requesting specific permissions
26
+ * const arePermissionsGranted = await requestPermissions({
27
+ * sound: false,
28
+ * badge: false
29
+ * });
30
+ * ```
31
+ */
32
+ export declare const requestPermissions: RequestPermissions;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.requestPermissions = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
9
+ * choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
10
+ * granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
11
+ * your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
12
+ *
13
+ * * `alert`: When set to true, requests the ability to display notifications to the user.
14
+ *
15
+ * * `sound`: When set to true, requests the ability to play a sound in response to notifications.
16
+ *
17
+ * * `badge`: When set to true, requests the ability to update the app's badge.
18
+ *
19
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
20
+ * only React Native is supported by this API.
21
+ * @returns A promise that resolves to true if requested permissions are granted or have already previously been
22
+ * granted or false otherwise.
23
+ * @example
24
+ * ```ts
25
+ * // Request all permissions by default
26
+ * const arePermissionsGranted = await requestPermissions();
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * // Prevent requesting specific permissions
31
+ * const arePermissionsGranted = await requestPermissions({
32
+ * sound: false,
33
+ * badge: false
34
+ * });
35
+ * ```
36
+ */
37
+ const requestPermissions = async () => {
38
+ throw new utils_1.PlatformNotSupportedError();
39
+ };
40
+ exports.requestPermissions = requestPermissions;
@@ -0,0 +1,2 @@
1
+ import { RequestPermissions } from '../types';
2
+ export declare const requestPermissions: RequestPermissions;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.requestPermissions = void 0;
6
+ const react_native_1 = require("@aws-amplify/react-native");
7
+ const errorHelpers_1 = require("../../../errors/errorHelpers");
8
+ const { requestPermissions: requestPermissionsNative } = (0, react_native_1.loadAmplifyPushNotification)();
9
+ const requestPermissions = async (input) => {
10
+ (0, errorHelpers_1.assertIsInitialized)();
11
+ return requestPermissionsNative(input);
12
+ };
13
+ exports.requestPermissions = requestPermissions;
@@ -0,0 +1,14 @@
1
+ import { SetBadgeCount } from '../types';
2
+ /**
3
+ * Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
4
+ * to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
5
+ * when your React Native app is running on platforms where badges are not supported.
6
+ *
7
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
8
+ * only React Native is supported by this API.
9
+ * @example
10
+ * ```ts
11
+ * setBadgeCount(42);
12
+ * ```
13
+ */
14
+ export declare const setBadgeCount: SetBadgeCount;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.setBadgeCount = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ /**
8
+ * Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
9
+ * to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
10
+ * when your React Native app is running on platforms where badges are not supported.
11
+ *
12
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
13
+ * only React Native is supported by this API.
14
+ * @example
15
+ * ```ts
16
+ * setBadgeCount(42);
17
+ * ```
18
+ */
19
+ const setBadgeCount = () => {
20
+ throw new utils_1.PlatformNotSupportedError();
21
+ };
22
+ exports.setBadgeCount = setBadgeCount;