@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,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,32 @@
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
+ * Registers a listener that will be triggered when a token is received. A token will be received:
6
+ * 1. On every app launch, including the first install
7
+ * 2. When a token changes (this may happen if the service invalidates the token for any reason)
8
+ *
9
+ * @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
10
+ * @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
11
+ * @example
12
+ * ```ts
13
+ * // Register a listener
14
+ * onTokenReceived(message => {
15
+ * doSomething(message);
16
+ * });
17
+ * ```
18
+ * @example
19
+ * ```ts
20
+ * // Register multiple listeners
21
+ * onTokenReceived(message => {
22
+ * doSomething(message);
23
+ * });
24
+ *
25
+ * onTokenReceived(message => {
26
+ * doSomethingElse(message);
27
+ * });
28
+ * ```
29
+ */
30
+ export const onTokenReceived = () => {
31
+ throw new PlatformNotSupportedError();
32
+ };
@@ -0,0 +1,2 @@
1
+ import { OnTokenReceived } from '../types';
2
+ export declare const onTokenReceived: OnTokenReceived;
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { addEventListener } from '../../../../eventListeners';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
5
+ export const onTokenReceived = input => {
6
+ assertIsInitialized();
7
+ return addEventListener('tokenReceived', input);
8
+ };
@@ -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,36 @@
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
+ * Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
6
+ * choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
7
+ * granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
8
+ * your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
9
+ *
10
+ * * `alert`: When set to true, requests the ability to display notifications to the user.
11
+ *
12
+ * * `sound`: When set to true, requests the ability to play a sound in response to notifications.
13
+ *
14
+ * * `badge`: When set to true, requests the ability to update the app's badge.
15
+ *
16
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
17
+ * only React Native is supported by this API.
18
+ * @returns A promise that resolves to true if requested permissions are granted or have already previously been
19
+ * granted or false otherwise.
20
+ * @example
21
+ * ```ts
22
+ * // Request all permissions by default
23
+ * const arePermissionsGranted = await requestPermissions();
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * // Prevent requesting specific permissions
28
+ * const arePermissionsGranted = await requestPermissions({
29
+ * sound: false,
30
+ * badge: false
31
+ * });
32
+ * ```
33
+ */
34
+ export const requestPermissions = async () => {
35
+ throw new PlatformNotSupportedError();
36
+ };
@@ -0,0 +1,2 @@
1
+ import { RequestPermissions } from '../types';
2
+ export declare const requestPermissions: RequestPermissions;
@@ -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
+ const { requestPermissions: requestPermissionsNative } = loadAmplifyPushNotification();
6
+ export const requestPermissions = async (input) => {
7
+ assertIsInitialized();
8
+ return requestPermissionsNative(input);
9
+ };
@@ -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,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
+ * Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
6
+ * to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
7
+ * when your React Native app is running on platforms where badges are not supported.
8
+ *
9
+ * @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
10
+ * only React Native is supported by this API.
11
+ * @example
12
+ * ```ts
13
+ * setBadgeCount(42);
14
+ * ```
15
+ */
16
+ export const setBadgeCount = () => {
17
+ throw new PlatformNotSupportedError();
18
+ };
@@ -0,0 +1,2 @@
1
+ import { SetBadgeCount } from '../types';
2
+ export declare const setBadgeCount: SetBadgeCount;
@@ -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
+ const { setBadgeCount: setBadgeCountNative } = loadAmplifyPushNotification();
6
+ export const setBadgeCount = input => {
7
+ assertIsInitialized();
8
+ setBadgeCountNative(input);
9
+ };
@@ -0,0 +1,3 @@
1
+ export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
2
+ export { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput, } from './types/inputs';
3
+ export { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './types/outputs';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
@@ -0,0 +1,6 @@
1
+ export type PinpointMessageEvent = 'opened_notification' | 'received_background' | 'received_foreground';
2
+ export type PinpointMessageEventSource = '_campaign' | '_journey';
3
+ export type AnalyticsEventAttributes = {
4
+ source: PinpointMessageEventSource;
5
+ attributes: Record<string, string>;
6
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,13 @@
1
+ import { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput } from './inputs';
2
+ import { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, RequestPermissionsOutput } from './outputs';
3
+ export type GetBadgeCount = () => Promise<void | GetBadgeCountOutput>;
4
+ export type GetLaunchNotification = () => Promise<GetLaunchNotificationOutput>;
5
+ export type GetPermissionStatus = () => Promise<GetPermissionStatusOutput>;
6
+ export type IdentifyUser = (input: IdentifyUserInput) => Promise<void>;
7
+ export type InitializePushNotifications = () => void;
8
+ export type RequestPermissions = (input?: RequestPermissionsInput) => Promise<RequestPermissionsOutput>;
9
+ export type SetBadgeCount = (input: SetBadgeCountInput) => void;
10
+ export type OnNotificationOpened = (input: OnNotificationOpenedInput) => OnNotificationOpenedOutput;
11
+ export type OnNotificationReceivedInBackground = (input: OnNotificationReceivedInBackgroundInput) => OnNotificationReceivedInBackgroundOutput;
12
+ export type OnNotificationReceivedInForeground = (input: OnNotificationReceivedInForegroundInput) => OnNotificationReceivedInForegroundOutput;
13
+ export type OnTokenReceived = (input: OnTokenReceivedInput) => OnTokenReceivedOutput;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,6 @@
1
+ export { AnalyticsEventAttributes, PinpointMessageEvent, PinpointMessageEventSource, } from './analytics';
2
+ export { GetBadgeCount, GetLaunchNotification, GetPermissionStatus, IdentifyUser, InitializePushNotifications, OnNotificationOpened, OnNotificationReceivedInBackground, OnNotificationReceivedInForeground, OnTokenReceived, RequestPermissions, SetBadgeCount, } from './apis';
3
+ export { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput, } from './inputs';
4
+ export { GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './outputs';
5
+ export { IdentifyUserOptions } from './options';
6
+ export { ChannelType } from './pushNotifications';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,9 @@
1
+ import { IdentifyUserOptions } from './options';
2
+ import { PushNotificationIdentifyUserInput, PushNotificationRequestPermissionsInput, PushNotificationSetBadgeCountInput, PushNotificationOnNotificationOpenedInput, PushNotificationOnNotificationReceivedInBackgroundInput, PushNotificationOnNotificationReceivedInForegroundInput, PushNotificationOnTokenReceivedInput } from '../../../types';
3
+ export type IdentifyUserInput = PushNotificationIdentifyUserInput<IdentifyUserOptions>;
4
+ export type RequestPermissionsInput = PushNotificationRequestPermissionsInput;
5
+ export type SetBadgeCountInput = PushNotificationSetBadgeCountInput;
6
+ export type OnNotificationOpenedInput = PushNotificationOnNotificationOpenedInput;
7
+ export type OnNotificationReceivedInBackgroundInput = PushNotificationOnNotificationReceivedInBackgroundInput;
8
+ export type OnNotificationReceivedInForegroundInput = PushNotificationOnNotificationReceivedInForegroundInput;
9
+ export type OnTokenReceivedInput = PushNotificationOnTokenReceivedInput;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,5 @@
1
+ import { PinpointServiceOptions } from '@aws-amplify/core/internals/providers/pinpoint';
2
+ /**
3
+ * Options specific to Pinpoint identityUser.
4
+ */
5
+ export type IdentifyUserOptions = PinpointServiceOptions;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,9 @@
1
+ import { PushNotificationGetBadgeCountOutput, PushNotificationGetLaunchNotificationOutput, PushNotificationGetPermissionStatusOutput, PushNotificationOnNotificationOpenedOutput, PushNotificationOnNotificationReceivedInBackgroundOutput, PushNotificationOnNotificationReceivedInForegroundOutput, PushNotificationOnTokenReceivedOutput, PushNotificationRequestPermissionsOutput } from '../../../types';
2
+ export type GetBadgeCountOutput = PushNotificationGetBadgeCountOutput;
3
+ export type GetLaunchNotificationOutput = PushNotificationGetLaunchNotificationOutput;
4
+ export type GetPermissionStatusOutput = PushNotificationGetPermissionStatusOutput;
5
+ export type RequestPermissionsOutput = PushNotificationRequestPermissionsOutput;
6
+ export type OnNotificationOpenedOutput = PushNotificationOnNotificationOpenedOutput;
7
+ export type OnNotificationReceivedInBackgroundOutput = PushNotificationOnNotificationReceivedInBackgroundOutput;
8
+ export type OnNotificationReceivedInForegroundOutput = PushNotificationOnNotificationReceivedInForegroundOutput;
9
+ export type OnTokenReceivedOutput = PushNotificationOnTokenReceivedOutput;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,2 @@
1
+ import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
2
+ export type ChannelType = Parameters<typeof updateEndpoint>[0]['channelType'];
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PinpointMessageEvent } from '../types';
2
+ import { OnPushNotificationMessageHandler } from '../../../types';
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare const createMessageEventRecorder: (event: PinpointMessageEvent, callback?: Function) => OnPushNotificationMessageHandler;
@@ -0,0 +1,39 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { record } from '@aws-amplify/core/internals/providers/pinpoint';
4
+ import { ConsoleLogger } from '@aws-amplify/core';
5
+ import { resolveCredentials } from '../../../utils';
6
+ import { getAnalyticsEvent } from './getAnalyticsEvent';
7
+ import { getChannelType } from './getChannelType';
8
+ import { resolveConfig } from './resolveConfig';
9
+ const logger = new ConsoleLogger('PushNotification.recordMessageEvent');
10
+ /**
11
+ * @internal
12
+ */
13
+ export const createMessageEventRecorder = (event, callback) => async (message) => {
14
+ const { credentials } = await resolveCredentials();
15
+ const { appId, region } = resolveConfig();
16
+ await recordMessageEvent({
17
+ appId,
18
+ credentials,
19
+ event,
20
+ message,
21
+ region,
22
+ });
23
+ callback?.();
24
+ };
25
+ const recordMessageEvent = async ({ appId, credentials, event, message, region, }) => {
26
+ const analyticsEvent = getAnalyticsEvent(message, event);
27
+ if (!analyticsEvent) {
28
+ logger.debug('A notification missing event information was not recorded');
29
+ return;
30
+ }
31
+ return record({
32
+ appId,
33
+ category: 'PushNotification',
34
+ channelType: getChannelType(),
35
+ credentials,
36
+ event: analyticsEvent,
37
+ region,
38
+ });
39
+ };
@@ -0,0 +1,7 @@
1
+ import { PinpointAnalyticsEvent } from '@aws-amplify/core/internals/providers/pinpoint';
2
+ import { PinpointMessageEvent } from '../types';
3
+ import { PushNotificationMessage } from '../../../types';
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare const getAnalyticsEvent: ({ data }: PushNotificationMessage, event: PinpointMessageEvent) => PinpointAnalyticsEvent | null;
@@ -0,0 +1,52 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ const ANDROID_CAMPAIGN_ACTIVITY_ID_KEY = 'pinpoint.campaign.campaign_activity_id';
4
+ const ANDROID_CAMPAIGN_ID_KEY = 'pinpoint.campaign.campaign_id';
5
+ const ANDROID_CAMPAIGN_TREATMENT_ID_KEY = 'pinpoint.campaign.treatment_id';
6
+ /**
7
+ * @internal
8
+ */
9
+ export const getAnalyticsEvent = ({ data }, event) => {
10
+ if (!data) {
11
+ return null;
12
+ }
13
+ const eventAttributes = getAnalyticsEventAttributes(data);
14
+ if (!eventAttributes) {
15
+ return null;
16
+ }
17
+ const { source, attributes } = eventAttributes;
18
+ return {
19
+ attributes,
20
+ name: `${source}.${event}`,
21
+ };
22
+ };
23
+ const getAnalyticsEventAttributes = (data) => {
24
+ if (!data) {
25
+ return;
26
+ }
27
+ if (data.hasOwnProperty(ANDROID_CAMPAIGN_ID_KEY)) {
28
+ return {
29
+ source: '_campaign',
30
+ attributes: {
31
+ campaign_activity_id: data[ANDROID_CAMPAIGN_ACTIVITY_ID_KEY],
32
+ campaign_id: data[ANDROID_CAMPAIGN_ID_KEY],
33
+ treatment_id: data[ANDROID_CAMPAIGN_TREATMENT_ID_KEY],
34
+ },
35
+ };
36
+ }
37
+ const pinpoint = typeof data.pinpoint === 'string'
38
+ ? JSON.parse(data.pinpoint)
39
+ : data.pinpoint;
40
+ if (pinpoint?.campaign) {
41
+ return {
42
+ source: '_campaign',
43
+ attributes: pinpoint.campaign,
44
+ };
45
+ }
46
+ if (pinpoint?.journey) {
47
+ return {
48
+ source: '_journey',
49
+ attributes: pinpoint.journey,
50
+ };
51
+ }
52
+ };
@@ -0,0 +1,5 @@
1
+ import { ChannelType } from '../types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const getChannelType: () => ChannelType;
@@ -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
+ import { getOperatingSystem } from '@aws-amplify/react-native';
5
+ const operatingSystem = getOperatingSystem();
6
+ const isAndroid = operatingSystem === 'android';
7
+ const isIos = operatingSystem === 'ios';
8
+ /**
9
+ * @internal
10
+ */
11
+ export const getChannelType = () => {
12
+ if (isAndroid) {
13
+ // FCM was previously known as GCM and continues to be the channel type in Pinpoint
14
+ return 'GCM';
15
+ }
16
+ if (isIos) {
17
+ // If building in debug mode, use the APNs sandbox
18
+ return __DEV__ ? 'APNS_SANDBOX' : 'APNS';
19
+ }
20
+ throw new PlatformNotSupportedError();
21
+ };
@@ -0,0 +1,4 @@
1
+ export { createMessageEventRecorder } from './createMessageEventRecorder';
2
+ export { getAnalyticsEvent } from './getAnalyticsEvent';
3
+ export { getChannelType } from './getChannelType';
4
+ export { resolveConfig } from './resolveConfig';
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { createMessageEventRecorder } from './createMessageEventRecorder';
4
+ export { getAnalyticsEvent } from './getAnalyticsEvent';
5
+ export { getChannelType } from './getChannelType';
6
+ export { resolveConfig } from './resolveConfig';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveConfig: () => {
5
+ appId: string;
6
+ region: string;
7
+ };
@@ -0,0 +1,13 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { Amplify } from '@aws-amplify/core';
4
+ import { assert, PushNotificationValidationErrorCode } from '../../../errors';
5
+ /**
6
+ * @internal
7
+ */
8
+ export const resolveConfig = () => {
9
+ const { appId, region } = Amplify.getConfig().Notifications?.PushNotification?.Pinpoint ?? {};
10
+ assert(!!appId, PushNotificationValidationErrorCode.NoAppId);
11
+ assert(!!region, PushNotificationValidationErrorCode.NoRegion);
12
+ return { appId, region };
13
+ };
@@ -0,0 +1,3 @@
1
+ export declare enum PushNotificationErrorCode {
2
+ NotInitialized = "NotInitialized"
3
+ }
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export var PushNotificationErrorCode;
4
+ (function (PushNotificationErrorCode) {
5
+ PushNotificationErrorCode["NotInitialized"] = "NotInitialized";
6
+ })(PushNotificationErrorCode || (PushNotificationErrorCode = {}));
@@ -0,0 +1,6 @@
1
+ export * from './errors';
2
+ export * from './inputs';
3
+ export * from './module';
4
+ export * from './options';
5
+ export * from './outputs';
6
+ export * from './pushNotifications';
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export * from './errors';
4
+ export * from './inputs';
5
+ export * from './module';
6
+ export * from './options';
7
+ export * from './outputs';
8
+ export * from './pushNotifications';
@@ -0,0 +1,24 @@
1
+ import { UserProfile } from '@aws-amplify/core';
2
+ import { PushNotificationServiceOptions } from './options';
3
+ import { PushNotificationPermissions } from './module';
4
+ import { OnPushNotificationMessageHandler, OnTokenReceivedHandler } from './pushNotifications';
5
+ export type PushNotificationIdentifyUserInput<ServiceOptions extends PushNotificationServiceOptions = PushNotificationServiceOptions> = {
6
+ /**
7
+ * A User ID associated to the current device.
8
+ */
9
+ userId: string;
10
+ /**
11
+ * Additional information about the user and their device.
12
+ */
13
+ userProfile: UserProfile;
14
+ /**
15
+ * Options to be passed to the API.
16
+ */
17
+ options?: ServiceOptions;
18
+ };
19
+ export type PushNotificationRequestPermissionsInput = PushNotificationPermissions;
20
+ export type PushNotificationSetBadgeCountInput = number;
21
+ export type PushNotificationOnNotificationOpenedInput = OnPushNotificationMessageHandler;
22
+ export type PushNotificationOnNotificationReceivedInBackgroundInput = OnPushNotificationMessageHandler;
23
+ export type PushNotificationOnNotificationReceivedInForegroundInput = OnPushNotificationMessageHandler;
24
+ export type PushNotificationOnTokenReceivedInput = OnTokenReceivedHandler;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Types here are duplicated from `rtn-push-notifications` as it is not possible to share a source of truth
3
+ * with a package that may conditionally not exist for developers not using push notifications. Modifications
4
+ * made to these types should be reflected in the native module package and vice-versa!
5
+ */
6
+ interface ApnsPlatformOptions {
7
+ subtitle?: string;
8
+ }
9
+ interface FcmPlatformOptions {
10
+ channelId: string;
11
+ messageId: string;
12
+ senderId: string;
13
+ sendTime: Date;
14
+ }
15
+ export interface PushNotificationMessage {
16
+ title?: string;
17
+ body?: string;
18
+ imageUrl?: string;
19
+ deeplinkUrl?: string;
20
+ goToUrl?: string;
21
+ fcmOptions?: FcmPlatformOptions;
22
+ apnsOptions?: ApnsPlatformOptions;
23
+ data?: Record<string, unknown>;
24
+ }
25
+ export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
26
+ export interface PushNotificationPermissions extends Partial<Record<string, boolean>> {
27
+ alert?: boolean;
28
+ badge?: boolean;
29
+ sound?: boolean;
30
+ }
31
+ export {};
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Base type for service options.
3
+ */
4
+ export type PushNotificationServiceOptions = Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,10 @@
1
+ import { EventListenerRemover } from '../../eventListeners';
2
+ import { PushNotificationMessage, PushNotificationPermissionStatus } from '../types';
3
+ export type PushNotificationGetBadgeCountOutput = number | null;
4
+ export type PushNotificationGetLaunchNotificationOutput = PushNotificationMessage | null;
5
+ export type PushNotificationGetPermissionStatusOutput = PushNotificationPermissionStatus;
6
+ export type PushNotificationRequestPermissionsOutput = boolean;
7
+ export type PushNotificationOnNotificationOpenedOutput = EventListenerRemover;
8
+ export type PushNotificationOnNotificationReceivedInBackgroundOutput = EventListenerRemover;
9
+ export type PushNotificationOnNotificationReceivedInForegroundOutput = EventListenerRemover;
10
+ export type PushNotificationOnTokenReceivedOutput = EventListenerRemover;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};