@aws-amplify/notifications 2.0.1-api-v6-models.9351bcf.0 → 2.0.1-api-v6-models.891fe0d.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 (287) hide show
  1. package/in-app-messaging/package.json +4 -4
  2. package/lib/eventListeners/eventListeners.js +19 -37
  3. package/lib/eventListeners/index.js +4 -3
  4. package/lib/eventListeners/types.d.ts +2 -2
  5. package/lib/inAppMessaging/errors/InAppMessagingError.js +8 -11
  6. package/lib/inAppMessaging/errors/assertServiceError.js +3 -2
  7. package/lib/inAppMessaging/errors/assertValidationError.js +5 -4
  8. package/lib/inAppMessaging/errors/index.js +6 -5
  9. package/lib/inAppMessaging/errors/validation.js +7 -7
  10. package/lib/inAppMessaging/index.d.ts +2 -1
  11. package/lib/inAppMessaging/index.js +12 -10
  12. package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
  13. package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.js +26 -0
  14. package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +26 -38
  15. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
  16. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +24 -35
  17. package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
  18. package/lib/inAppMessaging/providers/pinpoint/apis/index.js +13 -10
  19. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +21 -21
  20. package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +6 -6
  21. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +5 -4
  22. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +5 -4
  23. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +5 -4
  24. package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +5 -4
  25. package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +6 -6
  26. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +46 -76
  27. package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
  28. package/lib/inAppMessaging/providers/pinpoint/index.js +12 -10
  29. package/lib/inAppMessaging/providers/pinpoint/types/index.js +2 -1
  30. package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
  31. package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
  32. package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
  33. package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
  34. package/lib/inAppMessaging/providers/pinpoint/types/types.js +1 -0
  35. package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +1 -0
  36. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +3 -3
  37. package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +114 -110
  38. package/lib/inAppMessaging/providers/pinpoint/utils/index.js +11 -10
  39. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +116 -191
  40. package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +9 -8
  41. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +1 -1
  42. package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +9 -15
  43. package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +6 -5
  44. package/lib/inAppMessaging/types/event.d.ts +2 -2
  45. package/lib/inAppMessaging/types/inputs.d.ts +1 -1
  46. package/lib/inAppMessaging/types/message.d.ts +3 -3
  47. package/lib/inAppMessaging/types/options.d.ts +1 -1
  48. package/lib/inAppMessaging/utils/index.js +4 -3
  49. package/lib/inAppMessaging/utils/statusHelpers.js +8 -5
  50. package/lib/index.js +1 -0
  51. package/lib/pushNotifications/errors/PushNotificationError.js +8 -11
  52. package/lib/pushNotifications/errors/errorHelpers.js +14 -13
  53. package/lib/pushNotifications/errors/index.js +4 -3
  54. package/lib/pushNotifications/index.d.ts +1 -1
  55. package/lib/pushNotifications/index.js +13 -12
  56. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +4 -2
  57. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +9 -10
  58. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +4 -2
  59. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +7 -5
  60. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +4 -2
  61. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +7 -5
  62. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +4 -2
  63. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +25 -36
  64. package/lib/pushNotifications/providers/pinpoint/apis/index.js +12 -11
  65. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +4 -2
  66. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -1
  67. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +90 -115
  68. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +4 -2
  69. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +7 -5
  70. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +4 -2
  71. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +7 -5
  72. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +4 -2
  73. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +7 -5
  74. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +4 -2
  75. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +7 -5
  76. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +4 -2
  77. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +7 -5
  78. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +4 -2
  79. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +7 -5
  80. package/lib/pushNotifications/providers/pinpoint/index.d.ts +1 -1
  81. package/lib/pushNotifications/providers/pinpoint/index.js +12 -11
  82. package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
  83. package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
  84. package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
  85. package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
  86. package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
  87. package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
  88. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
  89. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +33 -49
  90. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
  91. package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +17 -13
  92. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
  93. package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +9 -7
  94. package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
  95. package/lib/pushNotifications/providers/pinpoint/utils/index.js +7 -4
  96. package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.js +17 -0
  97. package/lib/pushNotifications/types/errors.js +1 -0
  98. package/lib/pushNotifications/types/index.d.ts +1 -0
  99. package/lib/pushNotifications/types/index.js +20 -2
  100. package/lib/pushNotifications/types/inputs.d.ts +9 -8
  101. package/lib/pushNotifications/types/module.d.ts +31 -0
  102. package/lib/pushNotifications/types/options.d.ts +1 -1
  103. package/lib/pushNotifications/types/outputs.d.ts +8 -8
  104. package/lib/pushNotifications/types/pushNotifications.d.ts +4 -5
  105. package/lib/pushNotifications/utils/getPushNotificationUserAgentString.js +11 -0
  106. package/lib/pushNotifications/utils/index.d.ts +1 -1
  107. package/lib/pushNotifications/utils/index.js +8 -7
  108. package/lib/pushNotifications/utils/initializationManager.js +8 -9
  109. package/lib/pushNotifications/utils/resolveCredentials.d.ts +1 -1
  110. package/lib/pushNotifications/utils/resolveCredentials.js +9 -15
  111. package/lib/pushNotifications/utils/tokenManager.js +6 -3
  112. package/lib/tsconfig.tsbuildinfo +1 -0
  113. package/lib-esm/eventListeners/eventListeners.js +15 -37
  114. package/lib-esm/eventListeners/types.d.ts +2 -2
  115. package/lib-esm/eventListeners/types.js +1 -0
  116. package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +6 -11
  117. package/lib-esm/inAppMessaging/errors/assertValidationError.js +2 -2
  118. package/lib-esm/inAppMessaging/errors/validation.js +6 -7
  119. package/lib-esm/inAppMessaging/index.d.ts +2 -1
  120. package/lib-esm/inAppMessaging/index.js +1 -1
  121. package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
  122. package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.js +22 -0
  123. package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +15 -31
  124. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
  125. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +18 -31
  126. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
  127. package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +1 -0
  128. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +5 -6
  129. package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +1 -2
  130. package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +4 -5
  131. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +38 -69
  132. package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
  133. package/lib-esm/inAppMessaging/providers/pinpoint/index.js +1 -1
  134. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
  135. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +1 -0
  136. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
  137. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +1 -0
  138. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
  139. package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +1 -0
  140. package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
  141. package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +4 -4
  142. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +3 -3
  143. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +85 -97
  144. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +111 -187
  145. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +3 -4
  146. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +1 -1
  147. package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +5 -13
  148. package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +2 -2
  149. package/lib-esm/inAppMessaging/types/event.d.ts +2 -2
  150. package/lib-esm/inAppMessaging/types/event.js +1 -0
  151. package/lib-esm/inAppMessaging/types/index.js +1 -0
  152. package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -1
  153. package/lib-esm/inAppMessaging/types/inputs.js +1 -0
  154. package/lib-esm/inAppMessaging/types/message.d.ts +3 -3
  155. package/lib-esm/inAppMessaging/types/message.js +1 -0
  156. package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
  157. package/lib-esm/inAppMessaging/types/options.js +1 -0
  158. package/lib-esm/inAppMessaging/utils/statusHelpers.js +3 -3
  159. package/lib-esm/index.js +1 -0
  160. package/lib-esm/pushNotifications/errors/PushNotificationError.js +6 -11
  161. package/lib-esm/pushNotifications/errors/errorHelpers.js +8 -9
  162. package/lib-esm/pushNotifications/index.d.ts +1 -1
  163. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +1 -1
  164. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +5 -8
  165. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +1 -1
  166. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +2 -2
  167. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +1 -1
  168. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +2 -2
  169. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +1 -1
  170. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +20 -33
  171. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +1 -1
  172. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -1
  173. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +76 -103
  174. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +1 -1
  175. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +1 -1
  176. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +1 -1
  177. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +1 -1
  178. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +1 -1
  179. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +1 -1
  180. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +1 -1
  181. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +1 -1
  182. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +1 -1
  183. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +2 -2
  184. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +1 -1
  185. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +2 -2
  186. package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +1 -1
  187. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
  188. package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +1 -0
  189. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
  190. package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +1 -0
  191. package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +1 -0
  192. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
  193. package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +1 -0
  194. package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
  195. package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +1 -0
  196. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
  197. package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +1 -0
  198. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
  199. package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +1 -0
  200. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
  201. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +27 -45
  202. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
  203. package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +15 -13
  204. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
  205. package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +5 -5
  206. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
  207. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +2 -1
  208. package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +4 -5
  209. package/lib-esm/pushNotifications/types/index.d.ts +1 -0
  210. package/lib-esm/pushNotifications/types/index.js +5 -0
  211. package/lib-esm/pushNotifications/types/inputs.d.ts +9 -8
  212. package/lib-esm/pushNotifications/types/inputs.js +1 -0
  213. package/lib-esm/pushNotifications/types/module.d.ts +31 -0
  214. package/lib-esm/pushNotifications/{Platform/types.js → types/module.js} +1 -0
  215. package/lib-esm/pushNotifications/types/options.d.ts +1 -1
  216. package/lib-esm/pushNotifications/types/options.js +1 -0
  217. package/lib-esm/pushNotifications/types/outputs.d.ts +8 -8
  218. package/lib-esm/pushNotifications/types/outputs.js +1 -0
  219. package/lib-esm/pushNotifications/types/pushNotifications.d.ts +4 -5
  220. package/lib-esm/pushNotifications/types/pushNotifications.js +1 -0
  221. package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +4 -6
  222. package/lib-esm/pushNotifications/utils/index.d.ts +1 -1
  223. package/lib-esm/pushNotifications/utils/index.js +1 -1
  224. package/lib-esm/pushNotifications/utils/initializationManager.js +5 -9
  225. package/lib-esm/pushNotifications/utils/resolveCredentials.d.ts +1 -1
  226. package/lib-esm/pushNotifications/utils/resolveCredentials.js +5 -13
  227. package/lib-esm/pushNotifications/utils/tokenManager.js +3 -3
  228. package/lib-esm/tsconfig.tsbuildinfo +1 -0
  229. package/package.json +63 -30
  230. package/src/inAppMessaging/index.ts +12 -0
  231. package/src/inAppMessaging/providers/pinpoint/apis/clearMessages.ts +26 -0
  232. package/src/inAppMessaging/providers/pinpoint/apis/index.ts +1 -0
  233. package/src/inAppMessaging/providers/pinpoint/index.ts +1 -0
  234. package/src/inAppMessaging/providers/pinpoint/utils/helpers.ts +38 -28
  235. package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +25 -9
  236. package/src/inAppMessaging/providers/pinpoint/utils/resolveConfig.ts +1 -1
  237. package/src/pushNotifications/index.ts +1 -0
  238. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +1 -1
  239. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +1 -1
  240. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +1 -1
  241. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +1 -1
  242. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +1 -1
  243. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +5 -2
  244. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +1 -1
  245. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +51 -41
  246. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +1 -1
  247. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +1 -1
  248. package/src/pushNotifications/providers/pinpoint/index.ts +1 -0
  249. package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +5 -4
  250. package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +7 -4
  251. package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +1 -1
  252. package/src/pushNotifications/providers/pinpoint/utils/index.ts +2 -1
  253. package/src/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.ts +2 -2
  254. package/src/pushNotifications/types/index.ts +1 -0
  255. package/src/pushNotifications/types/inputs.ts +1 -1
  256. package/src/pushNotifications/types/module.ts +42 -0
  257. package/src/pushNotifications/types/outputs.ts +1 -1
  258. package/src/pushNotifications/types/pushNotifications.ts +2 -7
  259. package/src/pushNotifications/utils/index.ts +1 -1
  260. package/lib/inAppMessaging/providers/index.d.ts +0 -2
  261. package/lib/inAppMessaging/providers/index.js +0 -15
  262. package/lib/pushNotifications/Platform/index.d.ts +0 -2
  263. package/lib/pushNotifications/Platform/index.js +0 -25
  264. package/lib/pushNotifications/Platform/index.native.d.ts +0 -2
  265. package/lib/pushNotifications/Platform/index.native.js +0 -7
  266. package/lib/pushNotifications/Platform/types.d.ts +0 -5
  267. package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +0 -11
  268. package/lib/pushNotifications/utils/resolveConfig.js +0 -16
  269. package/lib/tsconfig.build.tsbuildinfo +0 -8667
  270. package/lib-esm/inAppMessaging/providers/index.d.ts +0 -2
  271. package/lib-esm/inAppMessaging/providers/index.js +0 -3
  272. package/lib-esm/pushNotifications/Platform/index.d.ts +0 -2
  273. package/lib-esm/pushNotifications/Platform/index.js +0 -23
  274. package/lib-esm/pushNotifications/Platform/index.native.d.ts +0 -2
  275. package/lib-esm/pushNotifications/Platform/index.native.js +0 -5
  276. package/lib-esm/pushNotifications/Platform/types.d.ts +0 -5
  277. package/lib-esm/tsconfig.build.tsbuildinfo +0 -7115
  278. package/src/inAppMessaging/providers/index.ts +0 -38
  279. package/src/pushNotifications/Platform/index.native.ts +0 -9
  280. package/src/pushNotifications/Platform/index.ts +0 -22
  281. package/src/pushNotifications/Platform/types.ts +0 -15
  282. /package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
  283. /package/lib/pushNotifications/{Platform/types.js → types/module.js} +0 -0
  284. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
  285. /package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
  286. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
  287. /package/src/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.ts +0 -0
@@ -1,6 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { __awaiter, __generator } from "tslib";
4
3
  import { PINPOINT_KEY_PREFIX, STORAGE_KEY_SUFFIX, processInAppMessages, } from '../utils';
5
4
  import flatten from 'lodash/flatten';
6
5
  import { defaultStorage } from '@aws-amplify/core';
@@ -32,34 +31,19 @@ import { assertIsInitialized } from '../../../utils';
32
31
  * await dispatchEvent({ name: 'test_event' });
33
32
  * ```
34
33
  */
35
- export function dispatchEvent(input) {
36
- return __awaiter(this, void 0, void 0, function () {
37
- var key, cachedMessages, messages, flattenedMessages, error_1;
38
- return __generator(this, function (_a) {
39
- switch (_a.label) {
40
- case 0:
41
- assertIsInitialized();
42
- _a.label = 1;
43
- case 1:
44
- _a.trys.push([1, 4, , 5]);
45
- key = "" + PINPOINT_KEY_PREFIX + STORAGE_KEY_SUFFIX;
46
- return [4 /*yield*/, defaultStorage.getItem(key)];
47
- case 2:
48
- cachedMessages = _a.sent();
49
- return [4 /*yield*/, processInAppMessages(cachedMessages ? JSON.parse(cachedMessages) : [], input)];
50
- case 3:
51
- messages = _a.sent();
52
- flattenedMessages = flatten(messages);
53
- if (flattenedMessages.length > 0) {
54
- notifyEventListeners('messageReceived', conflictHandler(flattenedMessages));
55
- }
56
- return [3 /*break*/, 5];
57
- case 4:
58
- error_1 = _a.sent();
59
- assertServiceError(error_1);
60
- throw error_1;
61
- case 5: return [2 /*return*/];
62
- }
63
- });
64
- });
34
+ export async function dispatchEvent(input) {
35
+ assertIsInitialized();
36
+ try {
37
+ const key = `${PINPOINT_KEY_PREFIX}${STORAGE_KEY_SUFFIX}`;
38
+ const cachedMessages = await defaultStorage.getItem(key);
39
+ const messages = await processInAppMessages(cachedMessages ? JSON.parse(cachedMessages) : [], input);
40
+ const flattenedMessages = flatten(messages);
41
+ if (flattenedMessages.length > 0) {
42
+ notifyEventListeners('messageReceived', conflictHandler(flattenedMessages));
43
+ }
44
+ }
45
+ catch (error) {
46
+ assertServiceError(error);
47
+ throw error;
48
+ }
65
49
  }
@@ -1,3 +1,4 @@
1
+ import { IdentifyUserInput } from '../types';
1
2
  /**
2
3
  * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
3
4
  * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
@@ -47,4 +48,4 @@
47
48
  * },
48
49
  * });
49
50
  */
50
- export declare const identifyUser: ({ userId, userProfile, options, }: import("../../../types").InAppMessagingIdentifyUserInput<import("@aws-amplify/core/lib-esm/providers/pinpoint").PinpointServiceOptions>) => Promise<void>;
51
+ export declare const identifyUser: ({ userId, userProfile, options, }: IdentifyUserInput) => Promise<void>;
@@ -1,6 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { __awaiter, __generator } from "tslib";
4
3
  import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
5
4
  import { updateEndpoint, } from '@aws-amplify/core/internals/providers/pinpoint';
6
5
  import { CATEGORY, CHANNEL_TYPE, getInAppMessagingUserAgentString, resolveConfig, resolveCredentials, } from '../utils';
@@ -54,35 +53,23 @@ import { assertIsInitialized } from '../../../utils';
54
53
  * },
55
54
  * });
56
55
  */
57
- export var identifyUser = function (_a) {
58
- var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
59
- return __awaiter(void 0, void 0, void 0, function () {
60
- var _b, credentials, identityId, _c, appId, region, _d, address, optOut, userAttributes;
61
- return __generator(this, function (_e) {
62
- switch (_e.label) {
63
- case 0:
64
- assertIsInitialized();
65
- return [4 /*yield*/, resolveCredentials()];
66
- case 1:
67
- _b = _e.sent(), credentials = _b.credentials, identityId = _b.identityId;
68
- _c = resolveConfig(), appId = _c.appId, region = _c.region;
69
- _d = options !== null && options !== void 0 ? options : {}, address = _d.address, optOut = _d.optOut, userAttributes = _d.userAttributes;
70
- updateEndpoint({
71
- address: address,
72
- channelType: CHANNEL_TYPE,
73
- optOut: optOut,
74
- appId: appId,
75
- category: CATEGORY,
76
- credentials: credentials,
77
- identityId: identityId,
78
- region: region,
79
- userAttributes: userAttributes,
80
- userId: userId,
81
- userProfile: userProfile,
82
- userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.IdentifyUser),
83
- });
84
- return [2 /*return*/];
85
- }
86
- });
56
+ export const identifyUser = async ({ userId, userProfile, options, }) => {
57
+ assertIsInitialized();
58
+ const { credentials, identityId } = await resolveCredentials();
59
+ const { appId, region } = resolveConfig();
60
+ const { address, optOut, userAttributes } = options ?? {};
61
+ updateEndpoint({
62
+ address,
63
+ channelType: CHANNEL_TYPE,
64
+ optOut,
65
+ appId,
66
+ category: CATEGORY,
67
+ credentials,
68
+ identityId,
69
+ region,
70
+ userAttributes,
71
+ userId,
72
+ userProfile,
73
+ userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.IdentifyUser),
87
74
  });
88
75
  };
@@ -8,3 +8,4 @@ export { onMessageDismissed } from './onMessageDismissed';
8
8
  export { onMessageDisplayed } from './onMessageDisplayed';
9
9
  export { onMessageActionTaken } from './onMessageActionTaken';
10
10
  export { notifyMessageInteraction } from './notifyMessageInteraction';
11
+ export { clearMessages } from './clearMessages';
@@ -10,3 +10,4 @@ export { onMessageDismissed } from './onMessageDismissed';
10
10
  export { onMessageDisplayed } from './onMessageDisplayed';
11
11
  export { onMessageActionTaken } from './onMessageActionTaken';
12
12
  export { notifyMessageInteraction } from './notifyMessageInteraction';
13
+ export { clearMessages } from './clearMessages';
@@ -26,23 +26,22 @@ export function initializeInAppMessaging() {
26
26
  // register with the session listener
27
27
  sessionListener.addStateChangeListener(sessionStateChangeHandler, true);
28
28
  // wire up default Pinpoint message event handling
29
- addEventListener('messageDisplayed', function (message) {
29
+ addEventListener('messageDisplayed', (message) => {
30
30
  recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_DISPLAYED, message);
31
31
  incrementMessageCounts(message.id);
32
32
  });
33
- addEventListener('messageDismissed', function (message) {
33
+ addEventListener('messageDismissed', (message) => {
34
34
  recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_DISMISSED, message);
35
35
  });
36
- addEventListener('messageActionTaken', function (message) {
36
+ addEventListener('messageActionTaken', (message) => {
37
37
  recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_ACTION_TAKEN, message);
38
38
  });
39
39
  // listen to analytics hub events
40
40
  Hub.listen('analytics', analyticsListener);
41
41
  initialize();
42
42
  }
43
- function analyticsListener(_a) {
44
- var payload = _a.payload;
45
- var event = payload.event, data = payload.data;
43
+ function analyticsListener({ payload, }) {
44
+ const { event, data } = payload;
46
45
  switch (event) {
47
46
  case 'record': {
48
47
  dispatchEvent(data);
@@ -16,8 +16,7 @@ import { assertIsInitialized } from '../../../utils';
16
16
  * });
17
17
  * ```
18
18
  */
19
- export function notifyMessageInteraction(_a) {
20
- var type = _a.type, message = _a.message;
19
+ export function notifyMessageInteraction({ type, message, }) {
21
20
  assertIsInitialized();
22
21
  notifyEventListeners(type, message);
23
22
  }
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { assertIsInitialized } from '../../../utils';
4
- export var conflictHandler = defaultConflictHandler;
4
+ export let conflictHandler = defaultConflictHandler;
5
5
  /**
6
6
  * Set a conflict handler that will be used to resolve conflicts that may emerge
7
7
  * when matching events with synced messages.
@@ -38,10 +38,9 @@ export function setConflictHandler(input) {
38
38
  function defaultConflictHandler(messages) {
39
39
  // default behavior is to return the message closest to expiry
40
40
  // this function assumes that messages processed by providers already filters out expired messages
41
- var sorted = messages.sort(function (a, b) {
42
- var _a, _b;
43
- var endDateA = (_a = a.metadata) === null || _a === void 0 ? void 0 : _a.endDate;
44
- var endDateB = (_b = b.metadata) === null || _b === void 0 ? void 0 : _b.endDate;
41
+ const sorted = messages.sort((a, b) => {
42
+ const endDateA = a.metadata?.endDate;
43
+ const endDateB = b.metadata?.endDate;
45
44
  // if both message end dates are falsy or have the same date string, treat them as equal
46
45
  if (endDateA === endDateB) {
47
46
  return 0;
@@ -1,6 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { __awaiter, __generator } from "tslib";
4
3
  import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
5
4
  import { resolveEndpointId } from '@aws-amplify/core/internals/providers/pinpoint';
6
5
  import { defaultStorage } from '@aws-amplify/core';
@@ -23,74 +22,44 @@ import { assertIsInitialized } from '../../../utils';
23
22
  *
24
23
  * ```
25
24
  */
26
- export function syncMessages() {
27
- return __awaiter(this, void 0, void 0, function () {
28
- var messages, key, error_1;
29
- return __generator(this, function (_a) {
30
- switch (_a.label) {
31
- case 0:
32
- assertIsInitialized();
33
- return [4 /*yield*/, fetchInAppMessages()];
34
- case 1:
35
- messages = _a.sent();
36
- if (!messages || messages.length === 0) {
37
- return [2 /*return*/];
38
- }
39
- _a.label = 2;
40
- case 2:
41
- _a.trys.push([2, 4, , 5]);
42
- key = "" + PINPOINT_KEY_PREFIX + STORAGE_KEY_SUFFIX;
43
- return [4 /*yield*/, defaultStorage.setItem(key, JSON.stringify(messages))];
44
- case 3:
45
- _a.sent();
46
- return [3 /*break*/, 5];
47
- case 4:
48
- error_1 = _a.sent();
49
- assertServiceError(error_1);
50
- throw error_1;
51
- case 5: return [2 /*return*/];
52
- }
53
- });
54
- });
25
+ export async function syncMessages() {
26
+ assertIsInitialized();
27
+ const messages = await fetchInAppMessages();
28
+ if (!messages || messages.length === 0) {
29
+ return;
30
+ }
31
+ try {
32
+ const key = `${PINPOINT_KEY_PREFIX}${STORAGE_KEY_SUFFIX}`;
33
+ await defaultStorage.setItem(key, JSON.stringify(messages));
34
+ }
35
+ catch (error) {
36
+ assertServiceError(error);
37
+ throw error;
38
+ }
55
39
  }
56
- function fetchInAppMessages() {
57
- var _a;
58
- return __awaiter(this, void 0, void 0, function () {
59
- var _b, credentials, identityId, _c, appId, region, endpointId, input, response, messages, error_2;
60
- return __generator(this, function (_d) {
61
- switch (_d.label) {
62
- case 0:
63
- _d.trys.push([0, 4, , 5]);
64
- return [4 /*yield*/, resolveCredentials()];
65
- case 1:
66
- _b = _d.sent(), credentials = _b.credentials, identityId = _b.identityId;
67
- _c = resolveConfig(), appId = _c.appId, region = _c.region;
68
- return [4 /*yield*/, resolveEndpointId({
69
- appId: appId,
70
- category: CATEGORY,
71
- channelType: CHANNEL_TYPE,
72
- credentials: credentials,
73
- identityId: identityId,
74
- region: region,
75
- userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.SyncMessages),
76
- })];
77
- case 2:
78
- endpointId = _d.sent();
79
- input = {
80
- ApplicationId: appId,
81
- EndpointId: endpointId,
82
- };
83
- return [4 /*yield*/, getInAppMessages({ credentials: credentials, region: region }, input)];
84
- case 3:
85
- response = _d.sent();
86
- messages = ((_a = response.InAppMessagesResponse) !== null && _a !== void 0 ? _a : {}).InAppMessageCampaigns;
87
- return [2 /*return*/, messages];
88
- case 4:
89
- error_2 = _d.sent();
90
- assertServiceError(error_2);
91
- throw error_2;
92
- case 5: return [2 /*return*/];
93
- }
40
+ async function fetchInAppMessages() {
41
+ try {
42
+ const { credentials, identityId } = await resolveCredentials();
43
+ const { appId, region } = resolveConfig();
44
+ const endpointId = await resolveEndpointId({
45
+ appId,
46
+ category: CATEGORY,
47
+ channelType: CHANNEL_TYPE,
48
+ credentials,
49
+ identityId,
50
+ region,
51
+ userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.SyncMessages),
94
52
  });
95
- });
53
+ const input = {
54
+ ApplicationId: appId,
55
+ EndpointId: endpointId,
56
+ };
57
+ const response = await getInAppMessages({ credentials, region }, input);
58
+ const { InAppMessageCampaigns: messages } = response.InAppMessagesResponse ?? {};
59
+ return messages;
60
+ }
61
+ catch (error) {
62
+ assertServiceError(error);
63
+ throw error;
64
+ }
96
65
  }
@@ -1,2 +1,2 @@
1
- export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, } from './apis';
1
+ export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, clearMessages, } from './apis';
2
2
  export { IdentifyUserInput, DispatchEventInput, SetConflictHandlerInput, OnMessageActionTakenInput, OnMessageDismissedInput, OnMessageDisplayedInput, OnMessageReceivedInput, NotifyMessageInteractionInput, OnMessageReceivedOutput, OnMessageActionTakenOutput, OnMessageDismissedOutput, OnMessageDisplayedOutput, } from './types';
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, } from './apis';
3
+ export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, clearMessages, } from './apis';
@@ -3,35 +3,35 @@ import { InAppMessage, InAppMessageInteractionEvent, InAppMessagingEvent, InAppM
3
3
  /**
4
4
  * Input type for Pinpoint identifyUser API.
5
5
  */
6
- export declare type IdentifyUserInput = InAppMessagingIdentifyUserInput<IdentifyUserOptions>;
6
+ export type IdentifyUserInput = InAppMessagingIdentifyUserInput<IdentifyUserOptions>;
7
7
  /**
8
8
  * Input type for Pinpoint dispatchEvent API.
9
9
  */
10
- export declare type DispatchEventInput = InAppMessagingEvent;
10
+ export type DispatchEventInput = InAppMessagingEvent;
11
11
  /**
12
12
  * Input type for Pinpoint SetConflictHandler API.
13
13
  */
14
- export declare type SetConflictHandlerInput = InAppMessageConflictHandler;
14
+ export type SetConflictHandlerInput = InAppMessageConflictHandler;
15
15
  /**
16
16
  * Input type for OnMessageReceived API.
17
17
  */
18
- export declare type OnMessageReceivedInput = OnMessageInteractionEventHandler;
18
+ export type OnMessageReceivedInput = OnMessageInteractionEventHandler;
19
19
  /**
20
20
  * Input type for OnMessageDisplayed API.
21
21
  */
22
- export declare type OnMessageDisplayedInput = OnMessageInteractionEventHandler;
22
+ export type OnMessageDisplayedInput = OnMessageInteractionEventHandler;
23
23
  /**
24
24
  * Input type for OnMessageDismissed API.
25
25
  */
26
- export declare type OnMessageDismissedInput = OnMessageInteractionEventHandler;
26
+ export type OnMessageDismissedInput = OnMessageInteractionEventHandler;
27
27
  /**
28
28
  * Input type for OnMessageActionTaken API.
29
29
  */
30
- export declare type OnMessageActionTakenInput = OnMessageInteractionEventHandler;
30
+ export type OnMessageActionTakenInput = OnMessageInteractionEventHandler;
31
31
  /**
32
32
  * Input type for NotifyMessageInteraction API.
33
33
  */
34
- export declare type NotifyMessageInteractionInput = {
34
+ export type NotifyMessageInteractionInput = {
35
35
  message: InAppMessage;
36
36
  type: InAppMessageInteractionEvent;
37
37
  };
@@ -1,2 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -2,4 +2,4 @@ import { PinpointServiceOptions } from '@aws-amplify/core/internals/providers/pi
2
2
  /**
3
3
  * Options specific to Pinpoint identityUser.
4
4
  */
5
- export declare type IdentifyUserOptions = PinpointServiceOptions;
5
+ export type IdentifyUserOptions = PinpointServiceOptions;
@@ -1,2 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -2,16 +2,16 @@ import { EventListenerRemover } from '../../../../eventListeners';
2
2
  /**
3
3
  * Output type for OnMessageReceived API.
4
4
  */
5
- export declare type OnMessageReceivedOutput = EventListenerRemover;
5
+ export type OnMessageReceivedOutput = EventListenerRemover;
6
6
  /**
7
7
  * Output type for OnMessageDisplayed API.
8
8
  */
9
- export declare type OnMessageDisplayedOutput = EventListenerRemover;
9
+ export type OnMessageDisplayedOutput = EventListenerRemover;
10
10
  /**
11
11
  * Output type for OnMessageDismissed API.
12
12
  */
13
- export declare type OnMessageDismissedOutput = EventListenerRemover;
13
+ export type OnMessageDismissedOutput = EventListenerRemover;
14
14
  /**
15
15
  * Output type for OnMessageActionTaken API.
16
16
  */
17
- export declare type OnMessageActionTakenOutput = EventListenerRemover;
17
+ export type OnMessageActionTakenOutput = EventListenerRemover;
@@ -1,2 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -1,19 +1,19 @@
1
1
  import { InAppMessage } from '../../../types';
2
- export declare type InAppMessageCountMap = Record<string, number>;
3
- export declare type DailyInAppMessageCounter = {
2
+ export type InAppMessageCountMap = Record<string, number>;
3
+ export type DailyInAppMessageCounter = {
4
4
  count: number;
5
5
  lastCountTimestamp: string;
6
6
  };
7
- export declare type InAppMessageCounts = {
7
+ export type InAppMessageCounts = {
8
8
  sessionCount: number;
9
9
  dailyCount: number;
10
10
  totalCount: number;
11
11
  };
12
- export declare type MetricsComparator = (metricsVal: number, eventVal: number) => boolean;
12
+ export type MetricsComparator = (metricsVal: number, eventVal: number) => boolean;
13
13
  export declare enum PinpointMessageEvent {
14
14
  MESSAGE_DISPLAYED = "_inapp.message_displayed",
15
15
  MESSAGE_DISMISSED = "_inapp.message_dismissed",
16
16
  MESSAGE_ACTION_TAKEN = "_inapp.message_clicked"
17
17
  }
18
- export declare type InAppMessageConflictHandler = (messages: InAppMessage[]) => InAppMessage;
19
- export declare type OnMessageInteractionEventHandler = (message: InAppMessage) => void;
18
+ export type InAppMessageConflictHandler = (messages: InAppMessage[]) => InAppMessage;
19
+ export type OnMessageInteractionEventHandler = (message: InAppMessage) => void;
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export var PINPOINT_KEY_PREFIX = 'Pinpoint';
4
- export var STORAGE_KEY_SUFFIX = '_inAppMessages';
5
- export var CATEGORY = 'InAppMessaging';
6
- export var CHANNEL_TYPE = 'IN_APP';
3
+ export const PINPOINT_KEY_PREFIX = 'Pinpoint';
4
+ export const STORAGE_KEY_SUFFIX = '_inAppMessages';
5
+ export const CATEGORY = 'InAppMessaging';
6
+ export const CHANNEL_TYPE = 'IN_APP';
@@ -5,13 +5,13 @@ import { MetricsComparator, PinpointMessageEvent } from '../types';
5
5
  export declare const logger: ConsoleLogger;
6
6
  export declare const recordAnalyticsEvent: (event: PinpointMessageEvent, message: InAppMessage) => void;
7
7
  export declare const getStartOfDay: () => string;
8
- export declare const matchesEventType: ({ CampaignId, Schedule }: PinpointInAppMessage, { name: eventType }: InAppMessagingEvent) => any;
8
+ export declare const matchesEventType: ({ CampaignId, Schedule }: PinpointInAppMessage, { name: eventType }: InAppMessagingEvent) => boolean;
9
9
  export declare const matchesAttributes: ({ CampaignId, Schedule }: PinpointInAppMessage, { attributes }: InAppMessagingEvent) => boolean;
10
10
  export declare const matchesMetrics: ({ CampaignId, Schedule }: PinpointInAppMessage, { metrics }: InAppMessagingEvent) => boolean;
11
- export declare const getComparator: (operator: string) => MetricsComparator;
11
+ export declare const getComparator: (operator?: string) => MetricsComparator | undefined;
12
12
  export declare const isBeforeEndDate: ({ Schedule, }: PinpointInAppMessage) => boolean;
13
13
  export declare const isQuietTime: (message: PinpointInAppMessage) => boolean;
14
14
  export declare const clearMemo: () => void;
15
- export declare const interpretLayout: (layout: string) => InAppMessageLayout;
15
+ export declare const interpretLayout: (layout: NonNullable<PinpointInAppMessage['InAppMessage']>['Layout']) => InAppMessageLayout;
16
16
  export declare const extractContent: ({ InAppMessage: message, }: PinpointInAppMessage) => InAppMessageContent[];
17
17
  export declare const extractMetadata: ({ InAppMessage, Priority, Schedule, TreatmentId, }: PinpointInAppMessage) => any;