@aws-amplify/notifications 1.6.6-unstable.7762f1a.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,2 @@
1
+ import { SetBadgeCount } from '../types';
2
+ export declare const setBadgeCount: SetBadgeCount;
@@ -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.setBadgeCount = void 0;
6
+ const react_native_1 = require("@aws-amplify/react-native");
7
+ const errorHelpers_1 = require("../../../errors/errorHelpers");
8
+ const { setBadgeCount: setBadgeCountNative } = (0, react_native_1.loadAmplifyPushNotification)();
9
+ const setBadgeCount = input => {
10
+ (0, errorHelpers_1.assertIsInitialized)();
11
+ setBadgeCountNative(input);
12
+ };
13
+ exports.setBadgeCount = setBadgeCount;
@@ -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,17 @@
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 = exports.requestPermissions = exports.onTokenReceived = exports.onNotificationReceivedInForeground = exports.onNotificationReceivedInBackground = exports.onNotificationOpened = exports.initializePushNotifications = exports.identifyUser = exports.getPermissionStatus = exports.getLaunchNotification = exports.getBadgeCount = void 0;
6
+ var apis_1 = require("./apis");
7
+ Object.defineProperty(exports, "getBadgeCount", { enumerable: true, get: function () { return apis_1.getBadgeCount; } });
8
+ Object.defineProperty(exports, "getLaunchNotification", { enumerable: true, get: function () { return apis_1.getLaunchNotification; } });
9
+ Object.defineProperty(exports, "getPermissionStatus", { enumerable: true, get: function () { return apis_1.getPermissionStatus; } });
10
+ Object.defineProperty(exports, "identifyUser", { enumerable: true, get: function () { return apis_1.identifyUser; } });
11
+ Object.defineProperty(exports, "initializePushNotifications", { enumerable: true, get: function () { return apis_1.initializePushNotifications; } });
12
+ Object.defineProperty(exports, "onNotificationOpened", { enumerable: true, get: function () { return apis_1.onNotificationOpened; } });
13
+ Object.defineProperty(exports, "onNotificationReceivedInBackground", { enumerable: true, get: function () { return apis_1.onNotificationReceivedInBackground; } });
14
+ Object.defineProperty(exports, "onNotificationReceivedInForeground", { enumerable: true, get: function () { return apis_1.onNotificationReceivedInForeground; } });
15
+ Object.defineProperty(exports, "onTokenReceived", { enumerable: true, get: function () { return apis_1.onTokenReceived; } });
16
+ Object.defineProperty(exports, "requestPermissions", { enumerable: true, get: function () { return apis_1.requestPermissions; } });
17
+ Object.defineProperty(exports, "setBadgeCount", { enumerable: true, get: function () { return apis_1.setBadgeCount; } });
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -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,43 @@
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.createMessageEventRecorder = void 0;
6
+ const pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
7
+ const core_1 = require("@aws-amplify/core");
8
+ const utils_1 = require("../../../utils");
9
+ const getAnalyticsEvent_1 = require("./getAnalyticsEvent");
10
+ const getChannelType_1 = require("./getChannelType");
11
+ const resolveConfig_1 = require("./resolveConfig");
12
+ const logger = new core_1.ConsoleLogger('PushNotification.recordMessageEvent');
13
+ /**
14
+ * @internal
15
+ */
16
+ const createMessageEventRecorder = (event, callback) => async (message) => {
17
+ const { credentials } = await (0, utils_1.resolveCredentials)();
18
+ const { appId, region } = (0, resolveConfig_1.resolveConfig)();
19
+ await recordMessageEvent({
20
+ appId,
21
+ credentials,
22
+ event,
23
+ message,
24
+ region,
25
+ });
26
+ callback?.();
27
+ };
28
+ exports.createMessageEventRecorder = createMessageEventRecorder;
29
+ const recordMessageEvent = async ({ appId, credentials, event, message, region, }) => {
30
+ const analyticsEvent = (0, getAnalyticsEvent_1.getAnalyticsEvent)(message, event);
31
+ if (!analyticsEvent) {
32
+ logger.debug('A notification missing event information was not recorded');
33
+ return;
34
+ }
35
+ return (0, pinpoint_1.record)({
36
+ appId,
37
+ category: 'PushNotification',
38
+ channelType: (0, getChannelType_1.getChannelType)(),
39
+ credentials,
40
+ event: analyticsEvent,
41
+ region,
42
+ });
43
+ };
@@ -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,56 @@
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.getAnalyticsEvent = void 0;
6
+ const ANDROID_CAMPAIGN_ACTIVITY_ID_KEY = 'pinpoint.campaign.campaign_activity_id';
7
+ const ANDROID_CAMPAIGN_ID_KEY = 'pinpoint.campaign.campaign_id';
8
+ const ANDROID_CAMPAIGN_TREATMENT_ID_KEY = 'pinpoint.campaign.treatment_id';
9
+ /**
10
+ * @internal
11
+ */
12
+ const getAnalyticsEvent = ({ data }, event) => {
13
+ if (!data) {
14
+ return null;
15
+ }
16
+ const eventAttributes = getAnalyticsEventAttributes(data);
17
+ if (!eventAttributes) {
18
+ return null;
19
+ }
20
+ const { source, attributes } = eventAttributes;
21
+ return {
22
+ attributes,
23
+ name: `${source}.${event}`,
24
+ };
25
+ };
26
+ exports.getAnalyticsEvent = getAnalyticsEvent;
27
+ const getAnalyticsEventAttributes = (data) => {
28
+ if (!data) {
29
+ return;
30
+ }
31
+ if (data.hasOwnProperty(ANDROID_CAMPAIGN_ID_KEY)) {
32
+ return {
33
+ source: '_campaign',
34
+ attributes: {
35
+ campaign_activity_id: data[ANDROID_CAMPAIGN_ACTIVITY_ID_KEY],
36
+ campaign_id: data[ANDROID_CAMPAIGN_ID_KEY],
37
+ treatment_id: data[ANDROID_CAMPAIGN_TREATMENT_ID_KEY],
38
+ },
39
+ };
40
+ }
41
+ const pinpoint = typeof data.pinpoint === 'string'
42
+ ? JSON.parse(data.pinpoint)
43
+ : data.pinpoint;
44
+ if (pinpoint?.campaign) {
45
+ return {
46
+ source: '_campaign',
47
+ attributes: pinpoint.campaign,
48
+ };
49
+ }
50
+ if (pinpoint?.journey) {
51
+ return {
52
+ source: '_journey',
53
+ attributes: pinpoint.journey,
54
+ };
55
+ }
56
+ };
@@ -0,0 +1,5 @@
1
+ import { ChannelType } from '../types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const getChannelType: () => ChannelType;
@@ -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.getChannelType = void 0;
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ const react_native_1 = require("@aws-amplify/react-native");
8
+ const operatingSystem = (0, react_native_1.getOperatingSystem)();
9
+ const isAndroid = operatingSystem === 'android';
10
+ const isIos = operatingSystem === 'ios';
11
+ /**
12
+ * @internal
13
+ */
14
+ const getChannelType = () => {
15
+ if (isAndroid) {
16
+ // FCM was previously known as GCM and continues to be the channel type in Pinpoint
17
+ return 'GCM';
18
+ }
19
+ if (isIos) {
20
+ // If building in debug mode, use the APNs sandbox
21
+ return __DEV__ ? 'APNS_SANDBOX' : 'APNS';
22
+ }
23
+ throw new utils_1.PlatformNotSupportedError();
24
+ };
25
+ exports.getChannelType = getChannelType;
@@ -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,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.resolveConfig = exports.getChannelType = exports.getAnalyticsEvent = exports.createMessageEventRecorder = void 0;
6
+ var createMessageEventRecorder_1 = require("./createMessageEventRecorder");
7
+ Object.defineProperty(exports, "createMessageEventRecorder", { enumerable: true, get: function () { return createMessageEventRecorder_1.createMessageEventRecorder; } });
8
+ var getAnalyticsEvent_1 = require("./getAnalyticsEvent");
9
+ Object.defineProperty(exports, "getAnalyticsEvent", { enumerable: true, get: function () { return getAnalyticsEvent_1.getAnalyticsEvent; } });
10
+ var getChannelType_1 = require("./getChannelType");
11
+ Object.defineProperty(exports, "getChannelType", { enumerable: true, get: function () { return getChannelType_1.getChannelType; } });
12
+ var resolveConfig_1 = require("./resolveConfig");
13
+ Object.defineProperty(exports, "resolveConfig", { enumerable: true, get: function () { return resolveConfig_1.resolveConfig; } });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveConfig: () => {
5
+ appId: string;
6
+ region: string;
7
+ };
@@ -0,0 +1,17 @@
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.resolveConfig = void 0;
6
+ const core_1 = require("@aws-amplify/core");
7
+ const errors_1 = require("../../../errors");
8
+ /**
9
+ * @internal
10
+ */
11
+ const resolveConfig = () => {
12
+ const { appId, region } = core_1.Amplify.getConfig().Notifications?.PushNotification?.Pinpoint ?? {};
13
+ (0, errors_1.assert)(!!appId, errors_1.PushNotificationValidationErrorCode.NoAppId);
14
+ (0, errors_1.assert)(!!region, errors_1.PushNotificationValidationErrorCode.NoRegion);
15
+ return { appId, region };
16
+ };
17
+ exports.resolveConfig = resolveConfig;
@@ -0,0 +1,3 @@
1
+ export declare enum PushNotificationErrorCode {
2
+ NotInitialized = "NotInitialized"
3
+ }
@@ -0,0 +1,9 @@
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.PushNotificationErrorCode = void 0;
6
+ var PushNotificationErrorCode;
7
+ (function (PushNotificationErrorCode) {
8
+ PushNotificationErrorCode["NotInitialized"] = "NotInitialized";
9
+ })(PushNotificationErrorCode = exports.PushNotificationErrorCode || (exports.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,24 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./errors"), exports);
20
+ __exportStar(require("./inputs"), exports);
21
+ __exportStar(require("./module"), exports);
22
+ __exportStar(require("./options"), exports);
23
+ __exportStar(require("./outputs"), exports);
24
+ __exportStar(require("./pushNotifications"), exports);
@@ -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,4 @@
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 });
@@ -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,4 @@
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 });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Base type for service options.
3
+ */
4
+ export type PushNotificationServiceOptions = Record<string, unknown>;
@@ -0,0 +1,4 @@
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 });
@@ -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,4 @@
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 });
@@ -0,0 +1,4 @@
1
+ import { PushNotificationMessage } from './module';
2
+ export type OnTokenReceivedHandler = (token: string) => void;
3
+ export type OnPushNotificationMessageHandler = (message: PushNotificationMessage) => void;
4
+ export type PushNotificationEvent = 'backgroundMessageReceived' | 'foregroundMessageReceived' | 'launchNotificationOpened' | 'notificationOpened' | 'tokenReceived';
@@ -0,0 +1,4 @@
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 });
@@ -0,0 +1,2 @@
1
+ import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
2
+ export declare const getPushNotificationUserAgentString: (action: PushNotificationAction) => string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPushNotificationUserAgentString = void 0;
4
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+ // SPDX-License-Identifier: Apache-2.0
6
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
+ const getPushNotificationUserAgentString = (action) => (0, utils_1.getAmplifyUserAgent)({
8
+ category: utils_1.Category.PushNotification,
9
+ action,
10
+ });
11
+ exports.getPushNotificationUserAgentString = getPushNotificationUserAgentString;
@@ -0,0 +1,4 @@
1
+ export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
2
+ export { initialize, isInitialized } from './initializationManager';
3
+ export { resolveCredentials } from './resolveCredentials';
4
+ export { getToken, setToken } from './tokenManager';
@@ -0,0 +1,15 @@
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.setToken = exports.getToken = exports.resolveCredentials = exports.isInitialized = exports.initialize = exports.getPushNotificationUserAgentString = void 0;
6
+ var getPushNotificationUserAgentString_1 = require("./getPushNotificationUserAgentString");
7
+ Object.defineProperty(exports, "getPushNotificationUserAgentString", { enumerable: true, get: function () { return getPushNotificationUserAgentString_1.getPushNotificationUserAgentString; } });
8
+ var initializationManager_1 = require("./initializationManager");
9
+ Object.defineProperty(exports, "initialize", { enumerable: true, get: function () { return initializationManager_1.initialize; } });
10
+ Object.defineProperty(exports, "isInitialized", { enumerable: true, get: function () { return initializationManager_1.isInitialized; } });
11
+ var resolveCredentials_1 = require("./resolveCredentials");
12
+ Object.defineProperty(exports, "resolveCredentials", { enumerable: true, get: function () { return resolveCredentials_1.resolveCredentials; } });
13
+ var tokenManager_1 = require("./tokenManager");
14
+ Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return tokenManager_1.getToken; } });
15
+ Object.defineProperty(exports, "setToken", { enumerable: true, get: function () { return tokenManager_1.setToken; } });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Sets initialization status to true.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const initialize: () => Promise<void>;
7
+ /**
8
+ * Returns the initialization status of push notifications.
9
+ *
10
+ * @internal
11
+ */
12
+ export declare const isInitialized: () => boolean;
@@ -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.isInitialized = exports.initialize = void 0;
6
+ let initialized = false;
7
+ /**
8
+ * Sets initialization status to true.
9
+ *
10
+ * @internal
11
+ */
12
+ const initialize = async () => {
13
+ initialized = true;
14
+ };
15
+ exports.initialize = initialize;
16
+ /**
17
+ * Returns the initialization status of push notifications.
18
+ *
19
+ * @internal
20
+ */
21
+ const isInitialized = () => initialized;
22
+ exports.isInitialized = isInitialized;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveCredentials: () => Promise<{
5
+ credentials: import("@aws-amplify/core/lib-esm/libraryUtils").AWSCredentials;
6
+ identityId: string | undefined;
7
+ }>;
@@ -0,0 +1,16 @@
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.resolveCredentials = void 0;
6
+ const core_1 = require("@aws-amplify/core");
7
+ const errors_1 = require("../errors");
8
+ /**
9
+ * @internal
10
+ */
11
+ const resolveCredentials = async () => {
12
+ const { credentials, identityId } = await (0, core_1.fetchAuthSession)();
13
+ (0, errors_1.assert)(!!credentials, errors_1.PushNotificationValidationErrorCode.NoCredentials);
14
+ return { credentials, identityId };
15
+ };
16
+ exports.resolveCredentials = resolveCredentials;