@aws-amplify/core 5.8.6-unstable.7762f1a.0 → 6.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 (1181) hide show
  1. package/README.md +3 -0
  2. package/internals/adapter-core/package.json +8 -0
  3. package/internals/aws-clients/pinpoint/package.json +4 -4
  4. package/internals/providers/pinpoint/package.json +8 -0
  5. package/internals/utils/package.json +7 -0
  6. package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  7. package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.js +11 -0
  8. package/lib/BackgroundProcessManager/BackgroundProcessManager.d.ts +182 -0
  9. package/lib/BackgroundProcessManager/BackgroundProcessManager.js +287 -0
  10. package/lib/BackgroundProcessManager/index.d.ts +1 -0
  11. package/lib/BackgroundProcessManager/index.js +7 -0
  12. package/lib/BackgroundProcessManager/types.d.ts +41 -0
  13. package/lib/BackgroundProcessManager/types.js +23 -0
  14. package/lib/Cache/StorageCache.d.ts +22 -0
  15. package/lib/Cache/StorageCache.js +56 -0
  16. package/lib/Cache/StorageCache.native.d.ts +19 -0
  17. package/lib/Cache/StorageCache.native.js +62 -0
  18. package/lib/Cache/StorageCacheCommon.d.ts +179 -0
  19. package/lib/Cache/StorageCacheCommon.js +468 -0
  20. package/lib/Cache/constants.d.ts +6 -0
  21. package/lib/Cache/constants.js +17 -0
  22. package/lib/Cache/index.d.ts +2 -0
  23. package/lib/Cache/index.js +7 -0
  24. package/lib/Cache/types/cache.d.ts +38 -0
  25. package/lib/Cache/types/index.d.ts +1 -0
  26. package/lib/Cache/types/index.js +19 -0
  27. package/lib/Cache/utils/CacheList.d.ts +89 -0
  28. package/lib/Cache/utils/CacheList.js +160 -0
  29. package/lib/Cache/utils/cacheHelpers.d.ts +14 -0
  30. package/lib/Cache/utils/cacheHelpers.js +49 -0
  31. package/lib/Cache/utils/errorHelpers.d.ts +7 -0
  32. package/lib/Cache/utils/errorHelpers.js +24 -0
  33. package/lib/Cache/utils/index.d.ts +2 -0
  34. package/lib/Cache/utils/index.js +12 -0
  35. package/lib/Hub/index.d.ts +46 -0
  36. package/lib/Hub/index.js +118 -0
  37. package/lib/Hub/types/AuthTypes.d.ts +36 -0
  38. package/lib/Hub/types/AuthTypes.js +4 -0
  39. package/lib/Hub/types/HubTypes.d.ts +28 -0
  40. package/lib/Hub/types/HubTypes.js +4 -0
  41. package/lib/Hub/types/index.d.ts +2 -0
  42. package/lib/Hub/types/index.js +20 -0
  43. package/lib/I18n/I18n.d.ts +14 -10
  44. package/lib/I18n/I18n.js +29 -40
  45. package/lib/I18n/errorHelpers.d.ts +5 -0
  46. package/lib/I18n/errorHelpers.js +16 -0
  47. package/lib/I18n/index.d.ts +6 -5
  48. package/lib/I18n/index.js +32 -30
  49. package/lib/I18n/types.d.ts +2 -2
  50. package/lib/I18n/types.js +5 -6
  51. package/lib/Logger/ConsoleLogger.d.ts +11 -11
  52. package/lib/Logger/ConsoleLogger.js +54 -130
  53. package/lib/Mutex/Mutex.d.ts +32 -0
  54. package/lib/Mutex/Mutex.js +70 -0
  55. package/lib/Mutex/index.d.ts +1 -0
  56. package/lib/Mutex/index.js +7 -0
  57. package/lib/Mutex/types.d.ts +13 -0
  58. package/lib/Mutex/types.js +4 -0
  59. package/lib/Platform/customUserAgent.d.ts +16 -0
  60. package/lib/Platform/customUserAgent.js +57 -0
  61. package/lib/Platform/detectFramework.js +12 -12
  62. package/lib/Platform/detection/Angular.js +4 -5
  63. package/lib/Platform/detection/Expo.js +1 -1
  64. package/lib/Platform/detection/Next.d.ts +1 -1
  65. package/lib/Platform/detection/Next.js +1 -1
  66. package/lib/Platform/detection/Nuxt.js +1 -1
  67. package/lib/Platform/detection/React.js +6 -5
  68. package/lib/Platform/detection/Svelte.js +2 -2
  69. package/lib/Platform/detection/Vue.js +1 -1
  70. package/lib/Platform/detection/Web.js +1 -1
  71. package/lib/Platform/detection/helpers.js +7 -7
  72. package/lib/Platform/detection/index.js +13 -13
  73. package/lib/Platform/index.js +32 -52
  74. package/lib/Platform/types.d.ts +75 -8
  75. package/lib/Platform/types.js +40 -39
  76. package/lib/Platform/version.d.ts +1 -1
  77. package/lib/Platform/version.js +1 -1
  78. package/lib/Reachability/Reachability.d.ts +7 -0
  79. package/lib/Reachability/Reachability.js +42 -0
  80. package/lib/Reachability/Reachability.native.d.ts +6 -0
  81. package/lib/Reachability/Reachability.native.js +38 -0
  82. package/lib/Reachability/index.d.ts +1 -0
  83. package/lib/Reachability/index.js +7 -0
  84. package/lib/Reachability/types.d.ts +3 -0
  85. package/lib/Reachability/types.js +4 -0
  86. package/lib/ServiceWorker/ServiceWorker.d.ts +4 -4
  87. package/lib/ServiceWorker/ServiceWorker.js +93 -93
  88. package/lib/ServiceWorker/errorHelpers.d.ts +7 -0
  89. package/lib/ServiceWorker/errorHelpers.js +24 -0
  90. package/lib/ServiceWorker/index.d.ts +0 -12
  91. package/lib/ServiceWorker/index.js +0 -12
  92. package/lib/Signer/DateUtils.d.ts +27 -0
  93. package/lib/Signer/DateUtils.js +66 -0
  94. package/lib/Signer/Signer.d.ts +63 -0
  95. package/lib/Signer/Signer.js +135 -0
  96. package/lib/Signer/index.d.ts +1 -0
  97. package/lib/Signer/index.js +7 -0
  98. package/lib/adapterCore/error/AmplifyServerContextError.d.ts +8 -0
  99. package/lib/adapterCore/error/AmplifyServerContextError.js +17 -0
  100. package/lib/adapterCore/error/index.d.ts +1 -0
  101. package/lib/adapterCore/error/index.js +7 -0
  102. package/lib/adapterCore/index.d.ts +2 -0
  103. package/lib/adapterCore/index.js +11 -0
  104. package/lib/adapterCore/serverContext/index.d.ts +2 -0
  105. package/lib/adapterCore/serverContext/index.js +9 -0
  106. package/lib/adapterCore/serverContext/serverContext.d.ts +20 -0
  107. package/lib/adapterCore/serverContext/serverContext.js +42 -0
  108. package/lib/adapterCore/serverContext/serverContextRegistry.d.ts +6 -0
  109. package/lib/adapterCore/serverContext/serverContextRegistry.js +24 -0
  110. package/lib/adapterCore/serverContext/types/amplifyServer.d.ts +16 -0
  111. package/lib/adapterCore/serverContext/types/amplifyServer.js +4 -0
  112. package/lib/adapterCore/serverContext/types/cookieStorage.d.ts +31 -0
  113. package/lib/adapterCore/serverContext/types/cookieStorage.js +4 -0
  114. package/lib/adapterCore/serverContext/types/index.d.ts +4 -0
  115. package/lib/adapterCore/serverContext/types/index.js +4 -0
  116. package/lib/awsClients/cognitoIdentity/base.d.ts +29 -0
  117. package/lib/awsClients/cognitoIdentity/base.js +67 -0
  118. package/lib/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +22 -0
  119. package/lib/awsClients/cognitoIdentity/getCredentialsForIdentity.js +39 -0
  120. package/lib/awsClients/cognitoIdentity/getId.d.ts +22 -0
  121. package/lib/awsClients/cognitoIdentity/getId.js +30 -0
  122. package/lib/awsClients/cognitoIdentity/types.js +4 -0
  123. package/lib/awsClients/pinpoint/base.d.ts +17 -0
  124. package/lib/awsClients/pinpoint/base.js +37 -0
  125. package/lib/awsClients/pinpoint/errorHelpers.d.ts +5 -0
  126. package/lib/awsClients/pinpoint/errorHelpers.js +16 -0
  127. package/lib/awsClients/pinpoint/getInAppMessages.d.ts +24 -0
  128. package/lib/awsClients/pinpoint/getInAppMessages.js +34 -0
  129. package/lib/awsClients/pinpoint/index.d.ts +4 -0
  130. package/lib/awsClients/pinpoint/putEvents.d.ts +24 -0
  131. package/lib/awsClients/pinpoint/putEvents.js +37 -0
  132. package/lib/awsClients/pinpoint/updateEndpoint.d.ts +24 -0
  133. package/lib/awsClients/pinpoint/updateEndpoint.js +38 -0
  134. package/lib/clients/endpoints/getDnsSuffix.js +7 -29
  135. package/lib/clients/handlers/authenticated.d.ts +1 -1
  136. package/lib/clients/handlers/authenticated.js +5 -5
  137. package/lib/clients/handlers/fetch.d.ts +0 -1
  138. package/lib/clients/handlers/fetch.js +42 -97
  139. package/lib/clients/handlers/unauthenticated.d.ts +1 -1
  140. package/lib/clients/handlers/unauthenticated.js +4 -4
  141. package/lib/clients/internal/composeServiceApi.d.ts +8 -3
  142. package/lib/clients/internal/composeServiceApi.js +17 -67
  143. package/lib/clients/internal/composeTransferHandler.js +9 -11
  144. package/lib/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
  145. package/lib/clients/middleware/retry/defaultRetryDecider.js +18 -71
  146. package/lib/clients/middleware/retry/isClockSkewError.js +2 -4
  147. package/lib/clients/middleware/retry/jitteredBackoff.js +5 -5
  148. package/lib/clients/middleware/retry/middleware.d.ts +1 -1
  149. package/lib/clients/middleware/retry/middleware.js +61 -125
  150. package/lib/clients/middleware/signing/middleware.js +24 -86
  151. package/lib/clients/middleware/signing/signer/signatureV4/index.js +0 -1
  152. package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +21 -55
  153. package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js +14 -25
  154. package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +7 -7
  155. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +8 -30
  156. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +11 -38
  157. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +13 -17
  158. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +5 -8
  159. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +2 -2
  160. package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -3
  161. package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +7 -11
  162. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +9 -10
  163. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +4 -6
  164. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +8 -8
  165. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +15 -16
  166. package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +2 -4
  167. package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.js +3 -5
  168. package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.js +1 -3
  169. package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +2 -2
  170. package/lib/clients/middleware/signing/utils/isClockSkewed.js +4 -6
  171. package/lib/clients/middleware/userAgent/middleware.js +14 -63
  172. package/lib/clients/serde/json.js +30 -96
  173. package/lib/clients/serde/responseInfo.js +12 -18
  174. package/lib/clients/types/aws.d.ts +1 -1
  175. package/lib/clients/types/http.d.ts +25 -1
  176. package/lib/clients/utils/memoization.js +3 -3
  177. package/lib/constants.d.ts +2 -0
  178. package/lib/constants.js +6 -2
  179. package/lib/errors/AmplifyError.d.ts +14 -0
  180. package/lib/errors/AmplifyError.js +26 -0
  181. package/lib/errors/PlatformNotSupportedError.d.ts +4 -0
  182. package/lib/errors/PlatformNotSupportedError.js +16 -0
  183. package/lib/errors/createAssertionFunction.d.ts +3 -0
  184. package/lib/errors/createAssertionFunction.js +19 -0
  185. package/lib/errors/errorHelpers.d.ts +2 -0
  186. package/lib/errors/errorHelpers.js +19 -0
  187. package/lib/errors/index.d.ts +4 -0
  188. package/lib/errors/index.js +13 -0
  189. package/lib/index.d.ts +12 -28
  190. package/lib/index.js +28 -99
  191. package/lib/libraryUtils.d.ts +30 -0
  192. package/lib/libraryUtils.js +102 -0
  193. package/lib/parseAWSExports.d.ts +10 -2
  194. package/lib/parseAWSExports.js +195 -54
  195. package/lib/providers/kinesis/types/index.d.ts +1 -0
  196. package/lib/providers/kinesis/types/index.js +19 -0
  197. package/lib/providers/kinesis/types/kinesis.d.ts +9 -0
  198. package/lib/providers/kinesis/types/kinesis.js +4 -0
  199. package/lib/providers/kinesis-firehose/types/index.d.ts +1 -0
  200. package/lib/providers/kinesis-firehose/types/index.js +4 -0
  201. package/lib/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
  202. package/lib/providers/kinesis-firehose/types/kinesis-firehose.js +4 -0
  203. package/lib/providers/personalize/types/index.d.ts +1 -0
  204. package/lib/providers/personalize/types/index.js +4 -0
  205. package/lib/providers/personalize/types/personalize.d.ts +8 -0
  206. package/lib/providers/personalize/types/personalize.js +4 -0
  207. package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -0
  208. package/lib/providers/pinpoint/apis/flushEvents.js +21 -0
  209. package/lib/providers/pinpoint/apis/index.d.ts +3 -0
  210. package/lib/providers/pinpoint/apis/index.js +11 -0
  211. package/lib/providers/pinpoint/apis/record.d.ts +5 -0
  212. package/lib/providers/pinpoint/apis/record.js +69 -0
  213. package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +5 -0
  214. package/lib/providers/pinpoint/apis/updateEndpoint.js +75 -0
  215. package/lib/providers/pinpoint/index.d.ts +3 -0
  216. package/lib/providers/pinpoint/index.js +24 -0
  217. package/lib/providers/pinpoint/types/buffer.d.ts +25 -0
  218. package/lib/providers/pinpoint/types/buffer.js +4 -0
  219. package/lib/providers/pinpoint/types/errors.d.ts +9 -0
  220. package/lib/providers/pinpoint/types/errors.js +15 -0
  221. package/lib/providers/pinpoint/types/index.d.ts +2 -0
  222. package/lib/providers/pinpoint/types/index.js +22 -0
  223. package/lib/providers/pinpoint/types/pinpoint.d.ts +43 -0
  224. package/lib/providers/pinpoint/types/pinpoint.js +4 -0
  225. package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +24 -0
  226. package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +192 -0
  227. package/lib/providers/pinpoint/utils/cacheEndpointId.d.ts +7 -0
  228. package/lib/providers/pinpoint/utils/cacheEndpointId.js +24 -0
  229. package/lib/providers/pinpoint/utils/constants.d.ts +4 -0
  230. package/lib/providers/pinpoint/utils/constants.js +10 -0
  231. package/lib/providers/pinpoint/utils/getCacheKey.d.ts +7 -0
  232. package/lib/providers/pinpoint/utils/getCacheKey.js +13 -0
  233. package/lib/providers/pinpoint/utils/getEndpointId.d.ts +7 -0
  234. package/lib/providers/pinpoint/utils/getEndpointId.js +18 -0
  235. package/lib/providers/pinpoint/utils/getEventBuffer.d.ts +8 -0
  236. package/lib/providers/pinpoint/utils/getEventBuffer.js +46 -0
  237. package/lib/providers/pinpoint/utils/index.d.ts +4 -0
  238. package/lib/providers/pinpoint/utils/index.js +13 -0
  239. package/lib/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
  240. package/lib/providers/pinpoint/utils/isAppInForeground.js +7 -0
  241. package/lib/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
  242. package/lib/providers/pinpoint/utils/isAppInForeground.native.js +9 -0
  243. package/lib/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
  244. package/lib/providers/pinpoint/utils/resolveEndpointId.js +34 -0
  245. package/lib/server.d.ts +1 -0
  246. package/lib/server.js +7 -0
  247. package/lib/singleton/API/types.d.ts +73 -0
  248. package/lib/singleton/Amplify.d.ts +40 -0
  249. package/lib/singleton/Amplify.js +65 -0
  250. package/lib/singleton/Analytics/types.d.ts +9 -0
  251. package/lib/singleton/Analytics/types.js +4 -0
  252. package/lib/singleton/Auth/index.d.ts +24 -0
  253. package/lib/singleton/Auth/index.js +67 -0
  254. package/lib/singleton/Auth/types.d.ts +155 -0
  255. package/lib/singleton/Auth/types.js +6 -0
  256. package/lib/singleton/Auth/utils/errorHelpers.d.ts +8 -0
  257. package/lib/singleton/Auth/utils/errorHelpers.js +32 -0
  258. package/lib/singleton/Auth/utils/index.d.ts +5 -0
  259. package/lib/singleton/Auth/utils/index.js +60 -0
  260. package/lib/singleton/Cache/types.d.ts +18 -0
  261. package/lib/singleton/Cache/types.js +4 -0
  262. package/lib/singleton/Geo/types.d.ts +17 -0
  263. package/lib/singleton/Geo/types.js +4 -0
  264. package/lib/singleton/Interactions/types.d.ts +21 -0
  265. package/lib/singleton/Interactions/types.js +4 -0
  266. package/lib/singleton/Notifications/InAppMessaging/types.d.ts +2 -0
  267. package/lib/singleton/Notifications/InAppMessaging/types.js +4 -0
  268. package/lib/singleton/Notifications/PushNotification/types.d.ts +2 -0
  269. package/lib/singleton/Notifications/PushNotification/types.js +4 -0
  270. package/lib/singleton/Notifications/types.d.ts +6 -0
  271. package/lib/singleton/Notifications/types.js +4 -0
  272. package/lib/singleton/Predictions/types.d.ts +49 -0
  273. package/lib/singleton/Predictions/types.js +4 -0
  274. package/lib/singleton/Storage/types.d.ts +25 -0
  275. package/lib/singleton/Storage/types.js +4 -0
  276. package/lib/singleton/apis/clearCredentials.d.ts +1 -0
  277. package/lib/singleton/apis/clearCredentials.js +10 -0
  278. package/lib/singleton/apis/fetchAuthSession.d.ts +2 -0
  279. package/lib/singleton/apis/fetchAuthSession.js +11 -0
  280. package/lib/singleton/apis/internal/fetchAuthSession.d.ts +3 -0
  281. package/lib/singleton/apis/internal/fetchAuthSession.js +9 -0
  282. package/lib/singleton/apis/server/fetchAuthSession.d.ts +3 -0
  283. package/lib/singleton/apis/server/fetchAuthSession.js +11 -0
  284. package/lib/singleton/index.d.ts +3 -0
  285. package/lib/singleton/index.js +12 -0
  286. package/lib/singleton/types.d.ts +31 -0
  287. package/lib/singleton/types.js +4 -0
  288. package/lib/storage/CookieStorage.d.ts +14 -0
  289. package/lib/storage/CookieStorage.js +52 -0
  290. package/lib/storage/CookieStorage.native.d.ts +7 -0
  291. package/lib/storage/CookieStorage.native.js +15 -0
  292. package/lib/storage/DefaultStorage.d.ts +7 -0
  293. package/lib/storage/DefaultStorage.js +16 -0
  294. package/lib/storage/DefaultStorage.native.d.ts +33 -0
  295. package/lib/storage/DefaultStorage.native.js +50 -0
  296. package/lib/storage/InMemoryStorage.d.ts +12 -0
  297. package/lib/storage/InMemoryStorage.js +35 -0
  298. package/lib/storage/KeyValueStorage.d.ts +33 -0
  299. package/lib/storage/KeyValueStorage.js +56 -0
  300. package/lib/storage/SessionStorage.d.ts +7 -0
  301. package/lib/storage/SessionStorage.js +16 -0
  302. package/lib/storage/index.d.ts +7 -0
  303. package/lib/storage/index.js +14 -0
  304. package/lib/storage/utils.d.ts +10 -0
  305. package/lib/storage/utils.js +22 -0
  306. package/lib/tsconfig.tsbuildinfo +1 -1
  307. package/lib/types/core.d.ts +42 -0
  308. package/lib/types/core.js +4 -0
  309. package/lib/types/errors.d.ts +22 -0
  310. package/lib/types/errors.js +11 -0
  311. package/lib/types/index.d.ts +4 -1
  312. package/lib/types/index.js +6 -3
  313. package/lib/types/logging.d.ts +13 -0
  314. package/lib/types/logging.js +4 -0
  315. package/lib/types/storage.d.ts +17 -0
  316. package/lib/types/storage.js +4 -0
  317. package/lib/utils/WordArray.d.ts +7 -0
  318. package/lib/utils/WordArray.js +49 -0
  319. package/lib/utils/amplifyUrl/index.d.ts +13 -0
  320. package/lib/utils/amplifyUrl/index.js +10 -0
  321. package/lib/utils/amplifyUrl/polyfill.d.ts +0 -0
  322. package/lib/utils/amplifyUrl/polyfill.js +4 -0
  323. package/lib/utils/amplifyUrl/polyfill.native.d.ts +1 -0
  324. package/lib/utils/amplifyUrl/polyfill.native.js +6 -0
  325. package/lib/utils/amplifyUuid/index.d.ts +3 -0
  326. package/lib/utils/amplifyUuid/index.js +9 -0
  327. package/lib/utils/amplifyUuid/polyfill.d.ts +0 -0
  328. package/lib/utils/amplifyUuid/polyfill.js +4 -0
  329. package/lib/utils/amplifyUuid/polyfill.native.d.ts +1 -0
  330. package/lib/utils/amplifyUuid/polyfill.native.js +6 -0
  331. package/lib/utils/convert/base64/base64Decoder.d.ts +2 -0
  332. package/lib/utils/convert/base64/base64Decoder.js +11 -0
  333. package/lib/utils/convert/base64/base64Encoder.d.ts +2 -0
  334. package/lib/utils/convert/base64/base64Encoder.js +17 -0
  335. package/lib/utils/convert/base64/bytesToString.d.ts +1 -0
  336. package/lib/utils/convert/base64/bytesToString.js +9 -0
  337. package/lib/utils/convert/index.d.ts +2 -0
  338. package/lib/utils/convert/index.js +9 -0
  339. package/lib/utils/convert/types.d.ts +9 -0
  340. package/lib/utils/convert/types.js +4 -0
  341. package/lib/utils/cryptoSecureRandomInt.d.ts +1 -0
  342. package/lib/utils/cryptoSecureRandomInt.js +16 -0
  343. package/lib/utils/deepFreeze.d.ts +1 -0
  344. package/lib/utils/deepFreeze.js +16 -0
  345. package/lib/utils/generateRandomString.d.ts +1 -0
  346. package/lib/utils/generateRandomString.js +14 -0
  347. package/lib/utils/getClientInfo/getClientInfo.android.d.ts +5 -0
  348. package/lib/utils/getClientInfo/getClientInfo.android.js +21 -0
  349. package/lib/utils/getClientInfo/getClientInfo.d.ts +17 -0
  350. package/lib/utils/getClientInfo/getClientInfo.ios.d.ts +7 -0
  351. package/lib/utils/getClientInfo/getClientInfo.ios.js +63 -0
  352. package/lib/utils/getClientInfo/getClientInfo.js +68 -0
  353. package/lib/utils/getClientInfo/index.d.ts +1 -0
  354. package/lib/utils/getClientInfo/index.js +7 -0
  355. package/lib/utils/globalHelpers/index.d.ts +3 -0
  356. package/lib/utils/globalHelpers/index.js +50 -0
  357. package/lib/utils/globalHelpers/index.native.d.ts +3 -0
  358. package/lib/utils/globalHelpers/index.native.js +28 -0
  359. package/lib/utils/index.d.ts +8 -0
  360. package/lib/utils/index.js +25 -0
  361. package/lib/utils/isBrowser.d.ts +1 -0
  362. package/lib/utils/isBrowser.js +7 -0
  363. package/lib/utils/isWebWorker.d.ts +1 -0
  364. package/lib/utils/isWebWorker.js +14 -0
  365. package/lib/utils/retry/NonRetryableError.d.ts +4 -0
  366. package/lib/utils/retry/NonRetryableError.js +12 -0
  367. package/lib/utils/retry/constants.d.ts +1 -0
  368. package/lib/utils/retry/constants.js +6 -0
  369. package/lib/utils/retry/index.d.ts +5 -0
  370. package/lib/utils/retry/index.js +15 -0
  371. package/lib/utils/retry/isNonRetryableError.d.ts +2 -0
  372. package/lib/utils/retry/isNonRetryableError.js +10 -0
  373. package/lib/utils/retry/jitteredBackoff.d.ts +6 -0
  374. package/lib/utils/retry/jitteredBackoff.js +19 -0
  375. package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  376. package/lib/utils/retry/jitteredExponentialRetry.js +14 -0
  377. package/lib/utils/retry/retry.d.ts +6 -0
  378. package/lib/utils/retry/retry.js +64 -0
  379. package/lib/utils/sessionListener/SessionListener.d.ts +10 -0
  380. package/lib/utils/sessionListener/SessionListener.js +53 -0
  381. package/lib/utils/sessionListener/SessionListener.native.d.ts +10 -0
  382. package/lib/utils/sessionListener/SessionListener.native.js +50 -0
  383. package/lib/utils/sessionListener/constants.d.ts +2 -0
  384. package/lib/utils/sessionListener/constants.js +8 -0
  385. package/lib/utils/sessionListener/index.d.ts +3 -0
  386. package/lib/utils/sessionListener/index.js +10 -0
  387. package/lib/utils/sessionListener/types.d.ts +6 -0
  388. package/lib/utils/sessionListener/types.js +4 -0
  389. package/lib/utils/urlSafeDecode.d.ts +1 -0
  390. package/lib/utils/urlSafeDecode.js +10 -0
  391. package/lib/utils/urlSafeEncode.d.ts +1 -0
  392. package/lib/utils/urlSafeEncode.js +12 -0
  393. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  394. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.js +7 -0
  395. package/lib-esm/BackgroundProcessManager/BackgroundProcessManager.d.ts +182 -0
  396. package/lib-esm/BackgroundProcessManager/BackgroundProcessManager.js +283 -0
  397. package/lib-esm/BackgroundProcessManager/index.d.ts +1 -0
  398. package/lib-esm/BackgroundProcessManager/index.js +3 -0
  399. package/lib-esm/BackgroundProcessManager/types.d.ts +41 -0
  400. package/lib-esm/BackgroundProcessManager/types.js +20 -0
  401. package/lib-esm/Cache/StorageCache.d.ts +22 -0
  402. package/lib-esm/Cache/StorageCache.js +52 -0
  403. package/lib-esm/Cache/StorageCache.native.d.ts +19 -0
  404. package/lib-esm/Cache/StorageCache.native.js +58 -0
  405. package/lib-esm/Cache/StorageCacheCommon.d.ts +179 -0
  406. package/lib-esm/Cache/StorageCacheCommon.js +464 -0
  407. package/lib-esm/Cache/constants.d.ts +6 -0
  408. package/lib-esm/Cache/constants.js +14 -0
  409. package/lib-esm/Cache/index.d.ts +2 -0
  410. package/lib-esm/Cache/index.js +4 -0
  411. package/lib-esm/Cache/types/cache.d.ts +38 -0
  412. package/lib-esm/Cache/types/index.d.ts +1 -0
  413. package/lib-esm/Cache/types/index.js +3 -0
  414. package/lib-esm/Cache/utils/CacheList.d.ts +89 -0
  415. package/lib-esm/Cache/utils/CacheList.js +156 -0
  416. package/lib-esm/Cache/utils/cacheHelpers.d.ts +14 -0
  417. package/lib-esm/Cache/utils/cacheHelpers.js +42 -0
  418. package/lib-esm/Cache/utils/errorHelpers.d.ts +7 -0
  419. package/lib-esm/Cache/utils/errorHelpers.js +21 -0
  420. package/lib-esm/Cache/utils/index.d.ts +2 -0
  421. package/lib-esm/Cache/utils/index.js +4 -0
  422. package/lib-esm/Hub/index.d.ts +46 -0
  423. package/lib-esm/Hub/index.js +114 -0
  424. package/lib-esm/Hub/types/AuthTypes.d.ts +36 -0
  425. package/lib-esm/Hub/types/AuthTypes.js +3 -0
  426. package/lib-esm/Hub/types/HubTypes.d.ts +28 -0
  427. package/lib-esm/Hub/types/HubTypes.js +3 -0
  428. package/lib-esm/Hub/types/index.d.ts +2 -0
  429. package/lib-esm/Hub/types/index.js +4 -0
  430. package/lib-esm/I18n/I18n.d.ts +14 -10
  431. package/lib-esm/I18n/I18n.js +28 -40
  432. package/lib-esm/I18n/errorHelpers.d.ts +5 -0
  433. package/lib-esm/I18n/errorHelpers.js +13 -0
  434. package/lib-esm/I18n/index.d.ts +6 -5
  435. package/lib-esm/I18n/index.js +30 -29
  436. package/lib-esm/I18n/types.d.ts +2 -2
  437. package/lib-esm/I18n/types.js +3 -5
  438. package/lib-esm/Logger/ConsoleLogger.d.ts +11 -11
  439. package/lib-esm/Logger/ConsoleLogger.js +53 -129
  440. package/lib-esm/Mutex/Mutex.d.ts +32 -0
  441. package/lib-esm/Mutex/Mutex.js +66 -0
  442. package/lib-esm/Mutex/index.d.ts +1 -0
  443. package/lib-esm/Mutex/index.js +3 -0
  444. package/lib-esm/Mutex/types.d.ts +13 -0
  445. package/lib-esm/Mutex/types.js +3 -0
  446. package/lib-esm/Platform/customUserAgent.d.ts +16 -0
  447. package/lib-esm/Platform/customUserAgent.js +52 -0
  448. package/lib-esm/Platform/detectFramework.js +11 -11
  449. package/lib-esm/Platform/detection/Angular.js +3 -4
  450. package/lib-esm/Platform/detection/Next.d.ts +1 -1
  451. package/lib-esm/Platform/detection/React.js +5 -4
  452. package/lib-esm/Platform/detection/Svelte.js +1 -1
  453. package/lib-esm/Platform/detection/helpers.js +7 -7
  454. package/lib-esm/Platform/detection/index.js +3 -3
  455. package/lib-esm/Platform/index.js +30 -50
  456. package/lib-esm/Platform/types.d.ts +75 -8
  457. package/lib-esm/Platform/types.js +40 -39
  458. package/lib-esm/Platform/version.d.ts +1 -1
  459. package/lib-esm/Platform/version.js +1 -1
  460. package/lib-esm/Reachability/Reachability.d.ts +7 -0
  461. package/lib-esm/Reachability/Reachability.js +39 -0
  462. package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
  463. package/lib-esm/Reachability/Reachability.native.js +34 -0
  464. package/lib-esm/Reachability/index.d.ts +1 -0
  465. package/lib-esm/Reachability/index.js +3 -0
  466. package/lib-esm/Reachability/types.d.ts +3 -0
  467. package/lib-esm/Reachability/types.js +3 -0
  468. package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -4
  469. package/lib-esm/ServiceWorker/ServiceWorker.js +90 -91
  470. package/lib-esm/ServiceWorker/errorHelpers.d.ts +7 -0
  471. package/lib-esm/ServiceWorker/errorHelpers.js +21 -0
  472. package/lib-esm/ServiceWorker/index.d.ts +0 -12
  473. package/lib-esm/ServiceWorker/index.js +0 -12
  474. package/lib-esm/Signer/DateUtils.d.ts +27 -0
  475. package/lib-esm/Signer/DateUtils.js +63 -0
  476. package/lib-esm/Signer/Signer.d.ts +63 -0
  477. package/lib-esm/Signer/Signer.js +131 -0
  478. package/lib-esm/Signer/index.d.ts +1 -0
  479. package/lib-esm/Signer/index.js +3 -0
  480. package/lib-esm/adapterCore/error/AmplifyServerContextError.d.ts +8 -0
  481. package/lib-esm/adapterCore/error/AmplifyServerContextError.js +13 -0
  482. package/lib-esm/adapterCore/error/index.d.ts +1 -0
  483. package/lib-esm/adapterCore/error/index.js +3 -0
  484. package/lib-esm/adapterCore/index.d.ts +2 -0
  485. package/lib-esm/adapterCore/index.js +4 -0
  486. package/lib-esm/adapterCore/serverContext/index.d.ts +2 -0
  487. package/lib-esm/adapterCore/serverContext/index.js +3 -0
  488. package/lib-esm/adapterCore/serverContext/serverContext.d.ts +20 -0
  489. package/lib-esm/adapterCore/serverContext/serverContext.js +36 -0
  490. package/lib-esm/adapterCore/serverContext/serverContextRegistry.d.ts +6 -0
  491. package/lib-esm/adapterCore/serverContext/serverContextRegistry.js +21 -0
  492. package/lib-esm/adapterCore/serverContext/types/amplifyServer.d.ts +16 -0
  493. package/lib-esm/adapterCore/serverContext/types/amplifyServer.js +3 -0
  494. package/lib-esm/adapterCore/serverContext/types/cookieStorage.d.ts +31 -0
  495. package/lib-esm/adapterCore/serverContext/types/cookieStorage.js +3 -0
  496. package/lib-esm/adapterCore/serverContext/types/index.d.ts +4 -0
  497. package/lib-esm/adapterCore/serverContext/types/index.js +3 -0
  498. package/lib-esm/awsClients/cognitoIdentity/base.d.ts +29 -0
  499. package/lib-esm/awsClients/cognitoIdentity/base.js +62 -0
  500. package/lib-esm/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +22 -0
  501. package/lib-esm/awsClients/cognitoIdentity/getCredentialsForIdentity.js +36 -0
  502. package/lib-esm/awsClients/cognitoIdentity/getId.d.ts +22 -0
  503. package/lib-esm/awsClients/cognitoIdentity/getId.js +27 -0
  504. package/lib-esm/awsClients/cognitoIdentity/types.js +3 -0
  505. package/lib-esm/awsClients/pinpoint/base.d.ts +17 -0
  506. package/lib-esm/awsClients/pinpoint/base.js +33 -0
  507. package/lib-esm/awsClients/pinpoint/errorHelpers.d.ts +5 -0
  508. package/lib-esm/awsClients/pinpoint/errorHelpers.js +13 -0
  509. package/lib-esm/awsClients/pinpoint/getInAppMessages.d.ts +24 -0
  510. package/lib-esm/awsClients/pinpoint/getInAppMessages.js +31 -0
  511. package/lib-esm/awsClients/pinpoint/index.d.ts +4 -0
  512. package/lib-esm/awsClients/pinpoint/putEvents.d.ts +24 -0
  513. package/lib-esm/awsClients/pinpoint/putEvents.js +34 -0
  514. package/lib-esm/awsClients/pinpoint/updateEndpoint.d.ts +24 -0
  515. package/lib-esm/awsClients/pinpoint/updateEndpoint.js +35 -0
  516. package/lib-esm/clients/endpoints/getDnsSuffix.js +6 -28
  517. package/lib-esm/clients/endpoints/partitions.js +2 -2
  518. package/lib-esm/clients/handlers/authenticated.d.ts +1 -1
  519. package/lib-esm/clients/handlers/authenticated.js +1 -1
  520. package/lib-esm/clients/handlers/fetch.d.ts +0 -1
  521. package/lib-esm/clients/handlers/fetch.js +41 -96
  522. package/lib-esm/clients/handlers/unauthenticated.d.ts +1 -1
  523. package/lib-esm/clients/handlers/unauthenticated.js +1 -1
  524. package/lib-esm/clients/internal/composeServiceApi.d.ts +8 -3
  525. package/lib-esm/clients/internal/composeServiceApi.js +17 -67
  526. package/lib-esm/clients/internal/composeTransferHandler.js +9 -11
  527. package/lib-esm/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
  528. package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +17 -70
  529. package/lib-esm/clients/middleware/retry/isClockSkewError.js +2 -4
  530. package/lib-esm/clients/middleware/retry/jitteredBackoff.js +5 -5
  531. package/lib-esm/clients/middleware/retry/middleware.d.ts +1 -1
  532. package/lib-esm/clients/middleware/retry/middleware.js +61 -125
  533. package/lib-esm/clients/middleware/signing/middleware.js +21 -83
  534. package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js +17 -17
  535. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +0 -1
  536. package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +18 -52
  537. package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js +10 -21
  538. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +6 -6
  539. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +8 -30
  540. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +11 -38
  541. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +8 -12
  542. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +5 -8
  543. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +1 -1
  544. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -3
  545. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +5 -9
  546. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +5 -6
  547. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +4 -6
  548. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +6 -6
  549. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +13 -14
  550. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +1 -3
  551. package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.js +3 -5
  552. package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.js +1 -3
  553. package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +1 -1
  554. package/lib-esm/clients/middleware/signing/utils/isClockSkewed.js +3 -5
  555. package/lib-esm/clients/middleware/userAgent/middleware.js +14 -63
  556. package/lib-esm/clients/serde/json.js +29 -95
  557. package/lib-esm/clients/serde/responseInfo.js +11 -17
  558. package/lib-esm/clients/types/aws.d.ts +1 -1
  559. package/lib-esm/clients/types/http.d.ts +25 -1
  560. package/lib-esm/clients/utils/memoization.js +3 -3
  561. package/lib-esm/constants.d.ts +2 -0
  562. package/lib-esm/constants.js +7 -3
  563. package/lib-esm/errors/AmplifyError.d.ts +14 -0
  564. package/lib-esm/errors/AmplifyError.js +22 -0
  565. package/lib-esm/errors/PlatformNotSupportedError.d.ts +4 -0
  566. package/lib-esm/errors/PlatformNotSupportedError.js +12 -0
  567. package/lib-esm/errors/createAssertionFunction.d.ts +3 -0
  568. package/lib-esm/errors/createAssertionFunction.js +15 -0
  569. package/lib-esm/errors/errorHelpers.d.ts +2 -0
  570. package/lib-esm/errors/errorHelpers.js +16 -0
  571. package/lib-esm/errors/index.d.ts +4 -0
  572. package/lib-esm/errors/index.js +6 -0
  573. package/lib-esm/index.d.ts +12 -28
  574. package/lib-esm/index.js +15 -27
  575. package/lib-esm/libraryUtils.d.ts +30 -0
  576. package/lib-esm/libraryUtils.js +39 -0
  577. package/lib-esm/parseAWSExports.d.ts +10 -2
  578. package/lib-esm/parseAWSExports.js +194 -53
  579. package/lib-esm/providers/kinesis/types/index.d.ts +1 -0
  580. package/lib-esm/providers/kinesis/types/index.js +3 -0
  581. package/lib-esm/providers/kinesis/types/kinesis.d.ts +9 -0
  582. package/lib-esm/providers/kinesis/types/kinesis.js +3 -0
  583. package/lib-esm/providers/kinesis-firehose/types/index.d.ts +1 -0
  584. package/lib-esm/providers/kinesis-firehose/types/index.js +3 -0
  585. package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
  586. package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.js +3 -0
  587. package/lib-esm/providers/personalize/types/index.d.ts +1 -0
  588. package/lib-esm/providers/personalize/types/index.js +3 -0
  589. package/lib-esm/providers/personalize/types/personalize.d.ts +8 -0
  590. package/lib-esm/providers/personalize/types/personalize.js +3 -0
  591. package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -0
  592. package/lib-esm/providers/pinpoint/apis/flushEvents.js +17 -0
  593. package/lib-esm/providers/pinpoint/apis/index.d.ts +3 -0
  594. package/lib-esm/providers/pinpoint/apis/index.js +5 -0
  595. package/lib-esm/providers/pinpoint/apis/record.d.ts +5 -0
  596. package/lib-esm/providers/pinpoint/apis/record.js +65 -0
  597. package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +5 -0
  598. package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +71 -0
  599. package/lib-esm/providers/pinpoint/index.d.ts +3 -0
  600. package/lib-esm/providers/pinpoint/index.js +5 -0
  601. package/lib-esm/providers/pinpoint/types/buffer.d.ts +25 -0
  602. package/lib-esm/providers/pinpoint/types/buffer.js +3 -0
  603. package/lib-esm/providers/pinpoint/types/errors.d.ts +9 -0
  604. package/lib-esm/providers/pinpoint/types/errors.js +12 -0
  605. package/lib-esm/providers/pinpoint/types/index.d.ts +2 -0
  606. package/lib-esm/providers/pinpoint/types/index.js +4 -0
  607. package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +43 -0
  608. package/lib-esm/providers/pinpoint/types/pinpoint.js +3 -0
  609. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +24 -0
  610. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +188 -0
  611. package/lib-esm/providers/pinpoint/utils/cacheEndpointId.d.ts +7 -0
  612. package/lib-esm/providers/pinpoint/utils/cacheEndpointId.js +20 -0
  613. package/lib-esm/providers/pinpoint/utils/constants.d.ts +4 -0
  614. package/lib-esm/providers/pinpoint/utils/constants.js +7 -0
  615. package/lib-esm/providers/pinpoint/utils/getCacheKey.d.ts +7 -0
  616. package/lib-esm/providers/pinpoint/utils/getCacheKey.js +9 -0
  617. package/lib-esm/providers/pinpoint/utils/getEndpointId.d.ts +7 -0
  618. package/lib-esm/providers/pinpoint/utils/getEndpointId.js +14 -0
  619. package/lib-esm/providers/pinpoint/utils/getEventBuffer.d.ts +8 -0
  620. package/lib-esm/providers/pinpoint/utils/getEventBuffer.js +42 -0
  621. package/lib-esm/providers/pinpoint/utils/index.d.ts +4 -0
  622. package/lib-esm/providers/pinpoint/utils/index.js +6 -0
  623. package/lib-esm/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
  624. package/lib-esm/providers/pinpoint/utils/isAppInForeground.js +3 -0
  625. package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
  626. package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.js +5 -0
  627. package/lib-esm/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
  628. package/lib-esm/providers/pinpoint/utils/resolveEndpointId.js +30 -0
  629. package/lib-esm/server.d.ts +1 -0
  630. package/lib-esm/server.js +3 -0
  631. package/lib-esm/singleton/API/types.d.ts +73 -0
  632. package/lib-esm/singleton/Amplify.d.ts +40 -0
  633. package/lib-esm/singleton/Amplify.js +61 -0
  634. package/lib-esm/singleton/Analytics/types.d.ts +9 -0
  635. package/lib-esm/singleton/Analytics/types.js +3 -0
  636. package/lib-esm/singleton/Auth/index.d.ts +24 -0
  637. package/lib-esm/singleton/Auth/index.js +62 -0
  638. package/lib-esm/singleton/Auth/types.d.ts +155 -0
  639. package/lib-esm/singleton/Auth/types.js +5 -0
  640. package/lib-esm/singleton/Auth/utils/errorHelpers.d.ts +8 -0
  641. package/lib-esm/singleton/Auth/utils/errorHelpers.js +29 -0
  642. package/lib-esm/singleton/Auth/utils/index.d.ts +5 -0
  643. package/lib-esm/singleton/Auth/utils/index.js +53 -0
  644. package/lib-esm/singleton/Cache/types.d.ts +18 -0
  645. package/lib-esm/singleton/Cache/types.js +3 -0
  646. package/lib-esm/singleton/Geo/types.d.ts +17 -0
  647. package/lib-esm/singleton/Geo/types.js +3 -0
  648. package/lib-esm/singleton/Interactions/types.d.ts +21 -0
  649. package/lib-esm/singleton/Interactions/types.js +3 -0
  650. package/lib-esm/singleton/Notifications/InAppMessaging/types.d.ts +2 -0
  651. package/lib-esm/singleton/Notifications/InAppMessaging/types.js +3 -0
  652. package/lib-esm/singleton/Notifications/PushNotification/types.d.ts +2 -0
  653. package/lib-esm/singleton/Notifications/PushNotification/types.js +3 -0
  654. package/lib-esm/singleton/Notifications/types.d.ts +6 -0
  655. package/lib-esm/singleton/Notifications/types.js +3 -0
  656. package/lib-esm/singleton/Predictions/types.d.ts +49 -0
  657. package/lib-esm/singleton/Predictions/types.js +3 -0
  658. package/lib-esm/singleton/Storage/types.d.ts +25 -0
  659. package/lib-esm/singleton/Storage/types.js +3 -0
  660. package/lib-esm/singleton/apis/clearCredentials.d.ts +1 -0
  661. package/lib-esm/singleton/apis/clearCredentials.js +6 -0
  662. package/lib-esm/singleton/apis/fetchAuthSession.d.ts +2 -0
  663. package/lib-esm/singleton/apis/fetchAuthSession.js +7 -0
  664. package/lib-esm/singleton/apis/internal/fetchAuthSession.d.ts +3 -0
  665. package/lib-esm/singleton/apis/internal/fetchAuthSession.js +5 -0
  666. package/lib-esm/singleton/apis/server/fetchAuthSession.d.ts +3 -0
  667. package/lib-esm/singleton/apis/server/fetchAuthSession.js +7 -0
  668. package/lib-esm/singleton/index.d.ts +3 -0
  669. package/lib-esm/singleton/index.js +5 -0
  670. package/lib-esm/singleton/types.d.ts +31 -0
  671. package/lib-esm/singleton/types.js +3 -0
  672. package/lib-esm/storage/CookieStorage.d.ts +14 -0
  673. package/lib-esm/storage/CookieStorage.js +45 -0
  674. package/lib-esm/storage/CookieStorage.native.d.ts +7 -0
  675. package/lib-esm/storage/CookieStorage.native.js +11 -0
  676. package/lib-esm/storage/DefaultStorage.d.ts +7 -0
  677. package/lib-esm/storage/DefaultStorage.js +12 -0
  678. package/lib-esm/storage/DefaultStorage.native.d.ts +33 -0
  679. package/lib-esm/storage/DefaultStorage.native.js +46 -0
  680. package/lib-esm/storage/InMemoryStorage.d.ts +12 -0
  681. package/lib-esm/storage/InMemoryStorage.js +31 -0
  682. package/lib-esm/storage/KeyValueStorage.d.ts +33 -0
  683. package/lib-esm/storage/KeyValueStorage.js +52 -0
  684. package/lib-esm/storage/SessionStorage.d.ts +7 -0
  685. package/lib-esm/storage/SessionStorage.js +12 -0
  686. package/lib-esm/storage/index.d.ts +7 -0
  687. package/lib-esm/storage/index.js +10 -0
  688. package/lib-esm/storage/utils.d.ts +10 -0
  689. package/lib-esm/storage/utils.js +17 -0
  690. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  691. package/lib-esm/types/core.d.ts +42 -0
  692. package/lib-esm/types/core.js +3 -0
  693. package/lib-esm/types/errors.d.ts +22 -0
  694. package/lib-esm/types/errors.js +8 -0
  695. package/lib-esm/types/index.d.ts +4 -1
  696. package/lib-esm/types/index.js +4 -1
  697. package/lib-esm/types/logging.d.ts +13 -0
  698. package/lib-esm/types/logging.js +3 -0
  699. package/lib-esm/types/storage.d.ts +17 -0
  700. package/lib-esm/types/storage.js +3 -0
  701. package/lib-esm/utils/WordArray.d.ts +7 -0
  702. package/lib-esm/utils/WordArray.js +46 -0
  703. package/lib-esm/utils/amplifyUrl/index.d.ts +13 -0
  704. package/lib-esm/utils/amplifyUrl/index.js +6 -0
  705. package/lib-esm/utils/amplifyUrl/polyfill.d.ts +0 -0
  706. package/lib-esm/utils/amplifyUrl/polyfill.js +4 -0
  707. package/lib-esm/utils/amplifyUrl/polyfill.native.d.ts +1 -0
  708. package/lib-esm/utils/amplifyUrl/polyfill.native.js +4 -0
  709. package/lib-esm/utils/amplifyUuid/index.d.ts +3 -0
  710. package/lib-esm/utils/amplifyUuid/index.js +6 -0
  711. package/lib-esm/utils/amplifyUuid/polyfill.d.ts +0 -0
  712. package/lib-esm/utils/amplifyUuid/polyfill.js +4 -0
  713. package/lib-esm/utils/amplifyUuid/polyfill.native.d.ts +1 -0
  714. package/lib-esm/utils/amplifyUuid/polyfill.native.js +4 -0
  715. package/lib-esm/utils/convert/base64/base64Decoder.d.ts +2 -0
  716. package/lib-esm/utils/convert/base64/base64Decoder.js +8 -0
  717. package/lib-esm/utils/convert/base64/base64Encoder.d.ts +2 -0
  718. package/lib-esm/utils/convert/base64/base64Encoder.js +14 -0
  719. package/lib-esm/utils/convert/base64/bytesToString.d.ts +1 -0
  720. package/lib-esm/utils/convert/base64/bytesToString.js +5 -0
  721. package/lib-esm/utils/convert/index.d.ts +2 -0
  722. package/lib-esm/utils/convert/index.js +4 -0
  723. package/lib-esm/utils/convert/types.d.ts +9 -0
  724. package/lib-esm/utils/convert/types.js +3 -0
  725. package/lib-esm/utils/cryptoSecureRandomInt.d.ts +1 -0
  726. package/lib-esm/utils/cryptoSecureRandomInt.js +12 -0
  727. package/lib-esm/utils/deepFreeze.d.ts +1 -0
  728. package/lib-esm/utils/deepFreeze.js +12 -0
  729. package/lib-esm/utils/generateRandomString.d.ts +1 -0
  730. package/lib-esm/utils/generateRandomString.js +10 -0
  731. package/lib-esm/utils/getClientInfo/getClientInfo.android.d.ts +5 -0
  732. package/lib-esm/utils/getClientInfo/getClientInfo.android.js +17 -0
  733. package/lib-esm/utils/getClientInfo/getClientInfo.d.ts +17 -0
  734. package/lib-esm/utils/getClientInfo/getClientInfo.ios.d.ts +7 -0
  735. package/lib-esm/utils/getClientInfo/getClientInfo.ios.js +59 -0
  736. package/lib-esm/utils/getClientInfo/getClientInfo.js +64 -0
  737. package/lib-esm/utils/getClientInfo/index.d.ts +1 -0
  738. package/lib-esm/utils/getClientInfo/index.js +3 -0
  739. package/lib-esm/utils/globalHelpers/index.d.ts +3 -0
  740. package/lib-esm/utils/globalHelpers/index.js +44 -0
  741. package/lib-esm/utils/globalHelpers/index.native.d.ts +3 -0
  742. package/lib-esm/utils/globalHelpers/index.native.js +22 -0
  743. package/lib-esm/utils/index.d.ts +8 -0
  744. package/lib-esm/utils/index.js +10 -0
  745. package/lib-esm/utils/isBrowser.d.ts +1 -0
  746. package/lib-esm/utils/isBrowser.js +3 -0
  747. package/lib-esm/utils/isWebWorker.d.ts +1 -0
  748. package/lib-esm/utils/isWebWorker.js +10 -0
  749. package/lib-esm/utils/retry/NonRetryableError.d.ts +4 -0
  750. package/lib-esm/utils/retry/NonRetryableError.js +8 -0
  751. package/lib-esm/utils/retry/constants.d.ts +1 -0
  752. package/lib-esm/utils/retry/constants.js +3 -0
  753. package/lib-esm/utils/retry/index.d.ts +5 -0
  754. package/lib-esm/utils/retry/index.js +7 -0
  755. package/lib-esm/utils/retry/isNonRetryableError.d.ts +2 -0
  756. package/lib-esm/utils/retry/isNonRetryableError.js +6 -0
  757. package/lib-esm/utils/retry/jitteredBackoff.d.ts +6 -0
  758. package/lib-esm/utils/retry/jitteredBackoff.js +15 -0
  759. package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  760. package/lib-esm/utils/retry/jitteredExponentialRetry.js +10 -0
  761. package/lib-esm/utils/retry/retry.d.ts +6 -0
  762. package/lib-esm/utils/retry/retry.js +60 -0
  763. package/lib-esm/utils/sessionListener/SessionListener.d.ts +10 -0
  764. package/lib-esm/utils/sessionListener/SessionListener.js +49 -0
  765. package/lib-esm/utils/sessionListener/SessionListener.native.d.ts +10 -0
  766. package/lib-esm/utils/sessionListener/SessionListener.native.js +46 -0
  767. package/lib-esm/utils/sessionListener/constants.d.ts +2 -0
  768. package/lib-esm/utils/sessionListener/constants.js +5 -0
  769. package/lib-esm/utils/sessionListener/index.d.ts +3 -0
  770. package/lib-esm/utils/sessionListener/index.js +5 -0
  771. package/lib-esm/utils/sessionListener/types.d.ts +6 -0
  772. package/lib-esm/utils/sessionListener/types.js +3 -0
  773. package/lib-esm/utils/urlSafeDecode.d.ts +1 -0
  774. package/lib-esm/utils/urlSafeDecode.js +6 -0
  775. package/lib-esm/utils/urlSafeEncode.d.ts +1 -0
  776. package/lib-esm/utils/urlSafeEncode.js +8 -0
  777. package/package.json +39 -70
  778. package/server/package.json +8 -0
  779. package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
  780. package/src/BackgroundProcessManager/BackgroundProcessManager.ts +421 -0
  781. package/src/BackgroundProcessManager/index.ts +4 -0
  782. package/src/BackgroundProcessManager/types.ts +49 -0
  783. package/src/Cache/StorageCache.native.ts +65 -0
  784. package/src/Cache/StorageCache.ts +61 -0
  785. package/src/Cache/StorageCacheCommon.ts +577 -0
  786. package/src/Cache/constants.ts +18 -0
  787. package/src/Cache/index.ts +6 -0
  788. package/src/Cache/types/cache.ts +51 -0
  789. package/src/Cache/types/index.ts +4 -0
  790. package/src/Cache/utils/CacheList.ts +185 -0
  791. package/src/Cache/utils/cacheHelpers.ts +52 -0
  792. package/src/Cache/utils/errorHelpers.ts +26 -0
  793. package/src/Cache/utils/index.ts +10 -0
  794. package/src/Hub/index.ts +213 -0
  795. package/src/Hub/types/AuthTypes.ts +23 -0
  796. package/src/Hub/types/HubTypes.ts +46 -0
  797. package/src/Hub/types/index.ts +5 -0
  798. package/src/I18n/I18n.ts +19 -12
  799. package/src/I18n/errorHelpers.ts +18 -0
  800. package/src/I18n/index.ts +20 -11
  801. package/src/I18n/types.ts +1 -1
  802. package/src/Logger/ConsoleLogger.ts +12 -13
  803. package/src/Mutex/Mutex.ts +78 -0
  804. package/src/Mutex/index.ts +4 -0
  805. package/src/Mutex/types.ts +20 -0
  806. package/src/Platform/customUserAgent.ts +75 -0
  807. package/src/Platform/detectFramework.ts +1 -1
  808. package/src/Platform/detection/React.ts +5 -3
  809. package/src/Platform/index.ts +14 -1
  810. package/src/Platform/types.ts +84 -39
  811. package/src/Platform/version.ts +1 -1
  812. package/src/Reachability/Reachability.native.ts +46 -0
  813. package/src/Reachability/Reachability.ts +55 -0
  814. package/src/Reachability/index.ts +4 -0
  815. package/src/Reachability/types.ts +6 -0
  816. package/src/ServiceWorker/ServiceWorker.ts +67 -36
  817. package/src/ServiceWorker/errorHelpers.ts +26 -0
  818. package/src/ServiceWorker/index.ts +0 -12
  819. package/src/Signer/DateUtils.ts +103 -0
  820. package/src/Signer/Signer.ts +203 -0
  821. package/src/Signer/index.ts +4 -0
  822. package/src/adapterCore/error/AmplifyServerContextError.ts +23 -0
  823. package/src/adapterCore/error/index.ts +4 -0
  824. package/src/adapterCore/index.ts +11 -0
  825. package/src/adapterCore/serverContext/index.ts +10 -0
  826. package/src/adapterCore/serverContext/serverContext.ts +54 -0
  827. package/src/adapterCore/serverContext/serverContextRegistry.ts +31 -0
  828. package/src/adapterCore/serverContext/types/amplifyServer.ts +29 -0
  829. package/src/adapterCore/serverContext/types/cookieStorage.ts +43 -0
  830. package/src/adapterCore/serverContext/types/index.ts +9 -0
  831. package/src/awsClients/cognitoIdentity/base.ts +97 -0
  832. package/src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts +74 -0
  833. package/src/awsClients/pinpoint/base.ts +42 -0
  834. package/src/awsClients/pinpoint/errorHelpers.ts +19 -0
  835. package/src/awsClients/pinpoint/getInAppMessages.ts +57 -0
  836. package/src/awsClients/pinpoint/index.ts +15 -0
  837. package/src/awsClients/pinpoint/putEvents.ts +58 -0
  838. package/src/awsClients/pinpoint/updateEndpoint.ts +61 -0
  839. package/src/clients/handlers/authenticated.ts +2 -1
  840. package/src/clients/handlers/fetch.ts +9 -4
  841. package/src/clients/handlers/unauthenticated.ts +2 -1
  842. package/src/clients/internal/composeServiceApi.ts +22 -6
  843. package/src/clients/middleware/retry/defaultRetryDecider.ts +12 -6
  844. package/src/clients/middleware/retry/isClockSkewError.ts +1 -1
  845. package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
  846. package/src/clients/middleware/retry/middleware.ts +9 -9
  847. package/src/clients/middleware/signing/middleware.ts +1 -1
  848. package/src/clients/middleware/signing/signer/signatureV4/index.ts +0 -1
  849. package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +2 -1
  850. package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +2 -2
  851. package/src/clients/serde/responseInfo.ts +2 -1
  852. package/src/clients/types/aws.ts +4 -1
  853. package/src/clients/types/http.ts +27 -1
  854. package/src/constants.ts +7 -0
  855. package/src/errors/AmplifyError.ts +34 -0
  856. package/src/errors/PlatformNotSupportedError.ts +14 -0
  857. package/src/errors/createAssertionFunction.ts +23 -0
  858. package/src/errors/errorHelpers.ts +20 -0
  859. package/src/errors/index.ts +7 -0
  860. package/src/global.d.ts +11 -0
  861. package/src/index.ts +62 -82
  862. package/src/libraryUtils.ts +113 -0
  863. package/src/parseAWSExports.ts +272 -56
  864. package/src/providers/kinesis/types/index.ts +4 -0
  865. package/src/providers/kinesis/types/kinesis.ts +12 -0
  866. package/src/providers/kinesis-firehose/types/index.ts +4 -0
  867. package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +12 -0
  868. package/src/providers/personalize/types/index.ts +4 -0
  869. package/src/providers/personalize/types/personalize.ts +11 -0
  870. package/src/providers/pinpoint/apis/flushEvents.ts +31 -0
  871. package/src/providers/pinpoint/apis/index.ts +6 -0
  872. package/src/providers/pinpoint/apis/record.ts +93 -0
  873. package/src/providers/pinpoint/apis/updateEndpoint.ts +98 -0
  874. package/src/providers/pinpoint/index.ts +10 -0
  875. package/src/providers/pinpoint/types/buffer.ts +32 -0
  876. package/src/providers/pinpoint/types/errors.ts +12 -0
  877. package/src/providers/pinpoint/types/index.ts +5 -0
  878. package/src/providers/pinpoint/types/pinpoint.ts +60 -0
  879. package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +256 -0
  880. package/src/providers/pinpoint/utils/cacheEndpointId.ts +27 -0
  881. package/src/providers/pinpoint/utils/constants.ts +8 -0
  882. package/src/providers/pinpoint/utils/getCacheKey.ts +16 -0
  883. package/src/providers/pinpoint/utils/getEndpointId.ts +20 -0
  884. package/src/providers/pinpoint/utils/getEventBuffer.ts +60 -0
  885. package/src/providers/pinpoint/utils/index.ts +7 -0
  886. package/src/providers/pinpoint/utils/isAppInForeground.native.ts +7 -0
  887. package/src/providers/pinpoint/utils/isAppInForeground.ts +4 -0
  888. package/src/providers/pinpoint/utils/resolveEndpointId.ts +46 -0
  889. package/src/server.ts +4 -0
  890. package/src/singleton/API/types.ts +90 -0
  891. package/src/singleton/Amplify.ts +89 -0
  892. package/src/singleton/Analytics/types.ts +17 -0
  893. package/src/singleton/Auth/index.ts +103 -0
  894. package/src/singleton/Auth/types.ts +225 -0
  895. package/src/singleton/Auth/utils/errorHelpers.ts +37 -0
  896. package/src/singleton/Auth/utils/index.ts +106 -0
  897. package/src/singleton/Cache/types.ts +27 -0
  898. package/src/singleton/Geo/types.ts +20 -0
  899. package/src/singleton/Interactions/types.ts +29 -0
  900. package/src/singleton/Notifications/InAppMessaging/types.ts +6 -0
  901. package/src/singleton/Notifications/PushNotification/types.ts +6 -0
  902. package/src/singleton/Notifications/types.ts +10 -0
  903. package/src/singleton/Predictions/types.ts +61 -0
  904. package/src/singleton/Storage/types.ts +30 -0
  905. package/src/singleton/apis/clearCredentials.ts +8 -0
  906. package/src/singleton/apis/fetchAuthSession.ts +12 -0
  907. package/src/singleton/apis/internal/fetchAuthSession.ts +12 -0
  908. package/src/singleton/apis/server/fetchAuthSession.ts +16 -0
  909. package/src/singleton/index.ts +6 -0
  910. package/src/singleton/types.ts +64 -0
  911. package/src/storage/CookieStorage.native.ts +13 -0
  912. package/src/storage/CookieStorage.ts +68 -0
  913. package/src/storage/DefaultStorage.native.ts +58 -0
  914. package/src/storage/DefaultStorage.ts +14 -0
  915. package/src/storage/InMemoryStorage.ts +36 -0
  916. package/src/storage/KeyValueStorage.ts +57 -0
  917. package/src/storage/SessionStorage.ts +14 -0
  918. package/src/storage/index.ts +13 -0
  919. package/src/storage/utils.ts +22 -0
  920. package/src/types/core.ts +51 -0
  921. package/src/types/errors.ts +33 -0
  922. package/src/types/index.ts +5 -1
  923. package/src/types/logging.ts +24 -0
  924. package/src/types/storage.ts +23 -0
  925. package/src/utils/WordArray.ts +57 -0
  926. package/src/utils/amplifyUrl/index.ts +9 -0
  927. package/src/utils/amplifyUrl/polyfill.native.ts +6 -0
  928. package/src/utils/amplifyUrl/polyfill.ts +4 -0
  929. package/src/utils/amplifyUuid/index.ts +9 -0
  930. package/src/utils/amplifyUuid/polyfill.native.ts +6 -0
  931. package/src/utils/amplifyUuid/polyfill.ts +4 -0
  932. package/src/utils/convert/base64/base64Decoder.ts +11 -0
  933. package/src/utils/convert/base64/base64Encoder.ts +18 -0
  934. package/src/utils/convert/base64/bytesToString.ts +6 -0
  935. package/src/utils/convert/index.ts +5 -0
  936. package/src/utils/convert/types.ts +17 -0
  937. package/src/utils/cryptoSecureRandomInt.ts +14 -0
  938. package/src/utils/deepFreeze.ts +16 -0
  939. package/src/utils/generateRandomString.ts +16 -0
  940. package/src/utils/getClientInfo/getClientInfo.android.ts +21 -0
  941. package/src/utils/getClientInfo/getClientInfo.ios.ts +64 -0
  942. package/src/utils/getClientInfo/getClientInfo.ts +81 -0
  943. package/src/utils/getClientInfo/index.ts +4 -0
  944. package/src/utils/globalHelpers/index.native.ts +30 -0
  945. package/src/utils/globalHelpers/index.ts +54 -0
  946. package/src/utils/index.ts +17 -0
  947. package/src/utils/isBrowser.ts +5 -0
  948. package/src/utils/isWebWorker.ts +13 -0
  949. package/src/utils/retry/NonRetryableError.ts +9 -0
  950. package/src/utils/retry/constants.ts +4 -0
  951. package/src/utils/retry/index.ts +8 -0
  952. package/src/utils/retry/isNonRetryableError.ts +9 -0
  953. package/src/utils/retry/jitteredBackoff.ts +21 -0
  954. package/src/utils/retry/jitteredExponentialRetry.ts +18 -0
  955. package/src/utils/retry/retry.ts +82 -0
  956. package/src/utils/sessionListener/SessionListener.native.ts +70 -0
  957. package/src/utils/sessionListener/SessionListener.ts +74 -0
  958. package/src/utils/sessionListener/constants.ts +6 -0
  959. package/src/utils/sessionListener/index.ts +7 -0
  960. package/src/utils/sessionListener/types.ts +11 -0
  961. package/src/utils/urlSafeDecode.ts +7 -0
  962. package/src/utils/urlSafeEncode.ts +9 -0
  963. package/lib/Amplify.d.ts +0 -28
  964. package/lib/Amplify.js +0 -109
  965. package/lib/AwsClients/CognitoIdentity/base.d.ts +0 -28
  966. package/lib/AwsClients/CognitoIdentity/base.js +0 -113
  967. package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +0 -23
  968. package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +0 -83
  969. package/lib/AwsClients/CognitoIdentity/getId.d.ts +0 -23
  970. package/lib/AwsClients/CognitoIdentity/getId.js +0 -73
  971. package/lib/AwsClients/Pinpoint/base.d.ts +0 -17
  972. package/lib/AwsClients/Pinpoint/base.js +0 -39
  973. package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +0 -23
  974. package/lib/AwsClients/Pinpoint/getInAppMessages.js +0 -77
  975. package/lib/AwsClients/Pinpoint/index.d.ts +0 -4
  976. package/lib/AwsClients/Pinpoint/putEvents.d.ts +0 -23
  977. package/lib/AwsClients/Pinpoint/putEvents.js +0 -78
  978. package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +0 -23
  979. package/lib/AwsClients/Pinpoint/updateEndpoint.js +0 -81
  980. package/lib/ClientDevice/android.d.ts +0 -5
  981. package/lib/ClientDevice/android.js +0 -20
  982. package/lib/ClientDevice/browser.d.ts +0 -25
  983. package/lib/ClientDevice/browser.js +0 -80
  984. package/lib/ClientDevice/index.d.ts +0 -23
  985. package/lib/ClientDevice/index.js +0 -18
  986. package/lib/ClientDevice/ios.d.ts +0 -7
  987. package/lib/ClientDevice/ios.js +0 -62
  988. package/lib/ClientDevice/reactnative.d.ts +0 -7
  989. package/lib/ClientDevice/reactnative.js +0 -23
  990. package/lib/Credentials.d.ts +0 -47
  991. package/lib/Credentials.js +0 -678
  992. package/lib/Errors.d.ts +0 -2
  993. package/lib/Errors.js +0 -13
  994. package/lib/Hub.d.ts +0 -55
  995. package/lib/Hub.js +0 -219
  996. package/lib/JS.d.ts +0 -32
  997. package/lib/JS.js +0 -221
  998. package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
  999. package/lib/OAuthHelper/FacebookOAuth.js +0 -124
  1000. package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
  1001. package/lib/OAuthHelper/GoogleOAuth.js +0 -133
  1002. package/lib/OAuthHelper/index.d.ts +0 -4
  1003. package/lib/OAuthHelper/index.js +0 -9
  1004. package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
  1005. package/lib/Providers/AWSCloudWatchProvider.js +0 -596
  1006. package/lib/Providers/index.d.ts +0 -1
  1007. package/lib/Providers/index.js +0 -7
  1008. package/lib/RNComponents/index.d.ts +0 -5
  1009. package/lib/RNComponents/index.js +0 -15
  1010. package/lib/RNComponents/reactnative.d.ts +0 -3
  1011. package/lib/RNComponents/reactnative.js +0 -13
  1012. package/lib/Signer.d.ts +0 -41
  1013. package/lib/Signer.js +0 -130
  1014. package/lib/StorageHelper/index.d.ts +0 -41
  1015. package/lib/StorageHelper/index.js +0 -75
  1016. package/lib/StorageHelper/reactnative.d.ts +0 -13
  1017. package/lib/StorageHelper/reactnative.js +0 -106
  1018. package/lib/UniversalStorage/index.d.ts +0 -23
  1019. package/lib/UniversalStorage/index.js +0 -112
  1020. package/lib/Util/BackgroundProcessManager.d.ts +0 -204
  1021. package/lib/Util/BackgroundProcessManager.js +0 -448
  1022. package/lib/Util/Constants.d.ts +0 -8
  1023. package/lib/Util/Constants.js +0 -23
  1024. package/lib/Util/DateUtils.d.ts +0 -7
  1025. package/lib/Util/DateUtils.js +0 -75
  1026. package/lib/Util/Mutex.d.ts +0 -45
  1027. package/lib/Util/Mutex.js +0 -73
  1028. package/lib/Util/Reachability.d.ts +0 -13
  1029. package/lib/Util/Reachability.js +0 -70
  1030. package/lib/Util/Reachability.native.d.ts +0 -11
  1031. package/lib/Util/Reachability.native.js +0 -44
  1032. package/lib/Util/Retry.d.ts +0 -21
  1033. package/lib/Util/Retry.js +0 -205
  1034. package/lib/Util/StringUtils.d.ts +0 -2
  1035. package/lib/Util/StringUtils.js +0 -24
  1036. package/lib/Util/index.d.ts +0 -7
  1037. package/lib/Util/index.js +0 -35
  1038. package/lib/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -5
  1039. package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +0 -15
  1040. package/lib/types/types.d.ts +0 -46
  1041. package/lib-esm/Amplify.d.ts +0 -28
  1042. package/lib-esm/Amplify.js +0 -106
  1043. package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +0 -28
  1044. package/lib-esm/AwsClients/CognitoIdentity/base.js +0 -108
  1045. package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +0 -23
  1046. package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +0 -80
  1047. package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +0 -23
  1048. package/lib-esm/AwsClients/CognitoIdentity/getId.js +0 -70
  1049. package/lib-esm/AwsClients/Pinpoint/base.d.ts +0 -17
  1050. package/lib-esm/AwsClients/Pinpoint/base.js +0 -35
  1051. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +0 -23
  1052. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +0 -74
  1053. package/lib-esm/AwsClients/Pinpoint/index.d.ts +0 -4
  1054. package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +0 -23
  1055. package/lib-esm/AwsClients/Pinpoint/putEvents.js +0 -75
  1056. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +0 -23
  1057. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +0 -78
  1058. package/lib-esm/ClientDevice/android.d.ts +0 -5
  1059. package/lib-esm/ClientDevice/android.js +0 -16
  1060. package/lib-esm/ClientDevice/browser.d.ts +0 -25
  1061. package/lib-esm/ClientDevice/browser.js +0 -74
  1062. package/lib-esm/ClientDevice/index.d.ts +0 -23
  1063. package/lib-esm/ClientDevice/index.js +0 -15
  1064. package/lib-esm/ClientDevice/ios.d.ts +0 -7
  1065. package/lib-esm/ClientDevice/ios.js +0 -58
  1066. package/lib-esm/ClientDevice/reactnative.d.ts +0 -7
  1067. package/lib-esm/ClientDevice/reactnative.js +0 -20
  1068. package/lib-esm/Credentials.d.ts +0 -47
  1069. package/lib-esm/Credentials.js +0 -675
  1070. package/lib-esm/Errors.d.ts +0 -2
  1071. package/lib-esm/Errors.js +0 -8
  1072. package/lib-esm/Hub.d.ts +0 -55
  1073. package/lib-esm/Hub.js +0 -216
  1074. package/lib-esm/JS.d.ts +0 -32
  1075. package/lib-esm/JS.js +0 -206
  1076. package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +0 -6
  1077. package/lib-esm/OAuthHelper/FacebookOAuth.js +0 -121
  1078. package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +0 -6
  1079. package/lib-esm/OAuthHelper/GoogleOAuth.js +0 -130
  1080. package/lib-esm/OAuthHelper/index.d.ts +0 -4
  1081. package/lib-esm/OAuthHelper/index.js +0 -6
  1082. package/lib-esm/Providers/AWSCloudWatchProvider.d.ts +0 -34
  1083. package/lib-esm/Providers/AWSCloudWatchProvider.js +0 -593
  1084. package/lib-esm/Providers/index.d.ts +0 -1
  1085. package/lib-esm/Providers/index.js +0 -3
  1086. package/lib-esm/RNComponents/index.d.ts +0 -5
  1087. package/lib-esm/RNComponents/index.js +0 -12
  1088. package/lib-esm/RNComponents/reactnative.d.ts +0 -3
  1089. package/lib-esm/RNComponents/reactnative.js +0 -5
  1090. package/lib-esm/Signer.d.ts +0 -41
  1091. package/lib-esm/Signer.js +0 -127
  1092. package/lib-esm/StorageHelper/index.d.ts +0 -41
  1093. package/lib-esm/StorageHelper/index.js +0 -72
  1094. package/lib-esm/StorageHelper/reactnative.d.ts +0 -13
  1095. package/lib-esm/StorageHelper/reactnative.js +0 -100
  1096. package/lib-esm/UniversalStorage/index.d.ts +0 -23
  1097. package/lib-esm/UniversalStorage/index.js +0 -106
  1098. package/lib-esm/Util/BackgroundProcessManager.d.ts +0 -204
  1099. package/lib-esm/Util/BackgroundProcessManager.js +0 -445
  1100. package/lib-esm/Util/Constants.d.ts +0 -8
  1101. package/lib-esm/Util/Constants.js +0 -14
  1102. package/lib-esm/Util/DateUtils.d.ts +0 -7
  1103. package/lib-esm/Util/DateUtils.js +0 -72
  1104. package/lib-esm/Util/Mutex.d.ts +0 -45
  1105. package/lib-esm/Util/Mutex.js +0 -71
  1106. package/lib-esm/Util/Reachability.d.ts +0 -13
  1107. package/lib-esm/Util/Reachability.js +0 -65
  1108. package/lib-esm/Util/Reachability.native.d.ts +0 -11
  1109. package/lib-esm/Util/Reachability.native.js +0 -39
  1110. package/lib-esm/Util/Retry.d.ts +0 -21
  1111. package/lib-esm/Util/Retry.js +0 -198
  1112. package/lib-esm/Util/StringUtils.d.ts +0 -2
  1113. package/lib-esm/Util/StringUtils.js +0 -19
  1114. package/lib-esm/Util/index.d.ts +0 -7
  1115. package/lib-esm/Util/index.js +0 -9
  1116. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -5
  1117. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +0 -8
  1118. package/lib-esm/types/types.d.ts +0 -46
  1119. package/polyfills/URL/index.js +0 -1
  1120. package/polyfills/URL/index.ts +0 -14
  1121. package/polyfills/URL/tsconfig.json +0 -10
  1122. package/polyfills/URL/webpack.config.js +0 -43
  1123. package/src/Amplify.ts +0 -100
  1124. package/src/AwsClients/CognitoIdentity/base.ts +0 -93
  1125. package/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +0 -67
  1126. package/src/AwsClients/Pinpoint/base.ts +0 -41
  1127. package/src/AwsClients/Pinpoint/getInAppMessages.ts +0 -56
  1128. package/src/AwsClients/Pinpoint/index.ts +0 -15
  1129. package/src/AwsClients/Pinpoint/putEvents.ts +0 -55
  1130. package/src/AwsClients/Pinpoint/updateEndpoint.ts +0 -60
  1131. package/src/ClientDevice/android.ts +0 -21
  1132. package/src/ClientDevice/browser.ts +0 -93
  1133. package/src/ClientDevice/index.ts +0 -14
  1134. package/src/ClientDevice/ios.ts +0 -64
  1135. package/src/ClientDevice/reactnative.ts +0 -18
  1136. package/src/Credentials.ts +0 -634
  1137. package/src/Errors.ts +0 -9
  1138. package/src/Hub.ts +0 -235
  1139. package/src/JS.ts +0 -259
  1140. package/src/OAuthHelper/FacebookOAuth.ts +0 -83
  1141. package/src/OAuthHelper/GoogleOAuth.ts +0 -94
  1142. package/src/OAuthHelper/index.ts +0 -7
  1143. package/src/Providers/AWSCloudWatchProvider.ts +0 -515
  1144. package/src/Providers/index.ts +0 -3
  1145. package/src/RNComponents/index.ts +0 -15
  1146. package/src/RNComponents/reactnative.ts +0 -6
  1147. package/src/Signer.ts +0 -176
  1148. package/src/StorageHelper/index.ts +0 -73
  1149. package/src/StorageHelper/reactnative.ts +0 -102
  1150. package/src/UniversalStorage/index.ts +0 -119
  1151. package/src/Util/BackgroundProcessManager.ts +0 -451
  1152. package/src/Util/Constants.ts +0 -24
  1153. package/src/Util/DateUtils.ts +0 -86
  1154. package/src/Util/Mutex.ts +0 -96
  1155. package/src/Util/Reachability.native.ts +0 -50
  1156. package/src/Util/Reachability.ts +0 -60
  1157. package/src/Util/Retry.ts +0 -121
  1158. package/src/Util/StringUtils.ts +0 -20
  1159. package/src/Util/index.ts +0 -27
  1160. package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +0 -10
  1161. package/src/types/types.ts +0 -67
  1162. /package/lib/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
  1163. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
  1164. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
  1165. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
  1166. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
  1167. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
  1168. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
  1169. /package/lib/{types → singleton/API}/types.js +0 -0
  1170. /package/lib-esm/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
  1171. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
  1172. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
  1173. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
  1174. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
  1175. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
  1176. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
  1177. /package/lib-esm/{types → singleton/API}/types.js +0 -0
  1178. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.ts +0 -0
  1179. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.ts +0 -0
  1180. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.ts +0 -0
  1181. /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/types.ts +0 -0
@@ -1,596 +0,0 @@
1
- "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
4
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
- return new (P || (P = Promise))(function (resolve, reject) {
7
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
- step((generator = generator.apply(thisArg, _arguments || [])).next());
11
- });
12
- };
13
- var __generator = (this && this.__generator) || function (thisArg, body) {
14
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
15
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
16
- function verb(n) { return function (v) { return step([n, v]); }; }
17
- function step(op) {
18
- if (f) throw new TypeError("Generator is already executing.");
19
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
20
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
21
- if (y = 0, t) op = [op[0] & 2, t.value];
22
- switch (op[0]) {
23
- case 0: case 1: t = op; break;
24
- case 4: _.label++; return { value: op[1], done: false };
25
- case 5: _.label++; y = op[1]; op = [0]; continue;
26
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
27
- default:
28
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
29
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
30
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
31
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
32
- if (t[2]) _.ops.pop();
33
- _.trys.pop(); continue;
34
- }
35
- op = body.call(thisArg, _);
36
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
37
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
38
- }
39
- };
40
- var __read = (this && this.__read) || function (o, n) {
41
- var m = typeof Symbol === "function" && o[Symbol.iterator];
42
- if (!m) return o;
43
- var i = m.call(o), r, ar = [], e;
44
- try {
45
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
46
- }
47
- catch (error) { e = { error: error }; }
48
- finally {
49
- try {
50
- if (r && !r.done && (m = i["return"])) m.call(i);
51
- }
52
- finally { if (e) throw e.error; }
53
- }
54
- return ar;
55
- };
56
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
57
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
58
- if (ar || !(i in from)) {
59
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
60
- ar[i] = from[i];
61
- }
62
- }
63
- return to.concat(ar || Array.prototype.slice.call(from));
64
- };
65
- Object.defineProperty(exports, "__esModule", { value: true });
66
- exports.AWSCloudWatchProvider = void 0;
67
- var client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
68
- var __1 = require("../..");
69
- var Logger_1 = require("../Logger");
70
- var Platform_1 = require("../Platform");
71
- var parseAWSExports_1 = require("../parseAWSExports");
72
- var Constants_1 = require("../Util/Constants");
73
- var logger = new Logger_1.ConsoleLogger('AWSCloudWatch');
74
- var AWSCloudWatchProvider = /** @class */ (function () {
75
- function AWSCloudWatchProvider(config) {
76
- this.configure(config);
77
- this._dataTracker = {
78
- eventUploadInProgress: false,
79
- logEvents: [],
80
- };
81
- this._currentLogBatch = [];
82
- this._initiateLogPushInterval();
83
- }
84
- AWSCloudWatchProvider.prototype.getProviderName = function () {
85
- return AWSCloudWatchProvider.PROVIDER_NAME;
86
- };
87
- AWSCloudWatchProvider.prototype.getCategoryName = function () {
88
- return AWSCloudWatchProvider.CATEGORY;
89
- };
90
- AWSCloudWatchProvider.prototype.getLogQueue = function () {
91
- return this._dataTracker.logEvents;
92
- };
93
- AWSCloudWatchProvider.prototype.configure = function (config) {
94
- if (!config)
95
- return this._config || {};
96
- var conf = Object.assign({}, this._config, (0, parseAWSExports_1.parseAWSExports)(config).Logging, config);
97
- this._config = conf;
98
- return this._config;
99
- };
100
- AWSCloudWatchProvider.prototype.createLogGroup = function (params) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var cmd, credentialsOK, client, output, error_1;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0:
106
- logger.debug('creating new log group in CloudWatch - ', params.logGroupName);
107
- cmd = new client_cloudwatch_logs_1.CreateLogGroupCommand(params);
108
- _a.label = 1;
109
- case 1:
110
- _a.trys.push([1, 4, , 5]);
111
- return [4 /*yield*/, this._ensureCredentials()];
112
- case 2:
113
- credentialsOK = _a.sent();
114
- if (!credentialsOK) {
115
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
116
- }
117
- client = this._initCloudWatchLogs();
118
- return [4 /*yield*/, client.send(cmd)];
119
- case 3:
120
- output = _a.sent();
121
- return [2 /*return*/, output];
122
- case 4:
123
- error_1 = _a.sent();
124
- logger.error("error creating log group - ".concat(error_1));
125
- throw error_1;
126
- case 5: return [2 /*return*/];
127
- }
128
- });
129
- });
130
- };
131
- AWSCloudWatchProvider.prototype.getLogGroups = function (params) {
132
- return __awaiter(this, void 0, void 0, function () {
133
- var cmd, credentialsOK, client, output, error_2;
134
- return __generator(this, function (_a) {
135
- switch (_a.label) {
136
- case 0:
137
- logger.debug('getting list of log groups');
138
- cmd = new client_cloudwatch_logs_1.DescribeLogGroupsCommand(params);
139
- _a.label = 1;
140
- case 1:
141
- _a.trys.push([1, 4, , 5]);
142
- return [4 /*yield*/, this._ensureCredentials()];
143
- case 2:
144
- credentialsOK = _a.sent();
145
- if (!credentialsOK) {
146
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
147
- }
148
- client = this._initCloudWatchLogs();
149
- return [4 /*yield*/, client.send(cmd)];
150
- case 3:
151
- output = _a.sent();
152
- return [2 /*return*/, output];
153
- case 4:
154
- error_2 = _a.sent();
155
- logger.error("error getting log group - ".concat(error_2));
156
- throw error_2;
157
- case 5: return [2 /*return*/];
158
- }
159
- });
160
- });
161
- };
162
- AWSCloudWatchProvider.prototype.createLogStream = function (params) {
163
- return __awaiter(this, void 0, void 0, function () {
164
- var cmd, credentialsOK, client, output, error_3;
165
- return __generator(this, function (_a) {
166
- switch (_a.label) {
167
- case 0:
168
- logger.debug('creating new log stream in CloudWatch - ', params.logStreamName);
169
- cmd = new client_cloudwatch_logs_1.CreateLogStreamCommand(params);
170
- _a.label = 1;
171
- case 1:
172
- _a.trys.push([1, 4, , 5]);
173
- return [4 /*yield*/, this._ensureCredentials()];
174
- case 2:
175
- credentialsOK = _a.sent();
176
- if (!credentialsOK) {
177
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
178
- }
179
- client = this._initCloudWatchLogs();
180
- return [4 /*yield*/, client.send(cmd)];
181
- case 3:
182
- output = _a.sent();
183
- return [2 /*return*/, output];
184
- case 4:
185
- error_3 = _a.sent();
186
- logger.error("error creating log stream - ".concat(error_3));
187
- throw error_3;
188
- case 5: return [2 /*return*/];
189
- }
190
- });
191
- });
192
- };
193
- AWSCloudWatchProvider.prototype.getLogStreams = function (params) {
194
- return __awaiter(this, void 0, void 0, function () {
195
- var cmd, credentialsOK, client, output, error_4;
196
- return __generator(this, function (_a) {
197
- switch (_a.label) {
198
- case 0:
199
- logger.debug('getting list of log streams');
200
- cmd = new client_cloudwatch_logs_1.DescribeLogStreamsCommand(params);
201
- _a.label = 1;
202
- case 1:
203
- _a.trys.push([1, 4, , 5]);
204
- return [4 /*yield*/, this._ensureCredentials()];
205
- case 2:
206
- credentialsOK = _a.sent();
207
- if (!credentialsOK) {
208
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
209
- }
210
- client = this._initCloudWatchLogs();
211
- return [4 /*yield*/, client.send(cmd)];
212
- case 3:
213
- output = _a.sent();
214
- return [2 /*return*/, output];
215
- case 4:
216
- error_4 = _a.sent();
217
- logger.error("error getting log stream - ".concat(error_4));
218
- throw error_4;
219
- case 5: return [2 /*return*/];
220
- }
221
- });
222
- });
223
- };
224
- AWSCloudWatchProvider.prototype.getLogEvents = function (params) {
225
- return __awaiter(this, void 0, void 0, function () {
226
- var cmd, credentialsOK, client, output, error_5;
227
- return __generator(this, function (_a) {
228
- switch (_a.label) {
229
- case 0:
230
- logger.debug('getting log events from stream - ', params.logStreamName);
231
- cmd = new client_cloudwatch_logs_1.GetLogEventsCommand(params);
232
- _a.label = 1;
233
- case 1:
234
- _a.trys.push([1, 4, , 5]);
235
- return [4 /*yield*/, this._ensureCredentials()];
236
- case 2:
237
- credentialsOK = _a.sent();
238
- if (!credentialsOK) {
239
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
240
- }
241
- client = this._initCloudWatchLogs();
242
- return [4 /*yield*/, client.send(cmd)];
243
- case 3:
244
- output = _a.sent();
245
- return [2 /*return*/, output];
246
- case 4:
247
- error_5 = _a.sent();
248
- logger.error("error getting log events - ".concat(error_5));
249
- throw error_5;
250
- case 5: return [2 /*return*/];
251
- }
252
- });
253
- });
254
- };
255
- AWSCloudWatchProvider.prototype.pushLogs = function (logs) {
256
- logger.debug('pushing log events to Cloudwatch...');
257
- this._dataTracker.logEvents = __spreadArray(__spreadArray([], __read(this._dataTracker.logEvents), false), __read(logs), false);
258
- };
259
- AWSCloudWatchProvider.prototype._validateLogGroupExistsAndCreate = function (logGroupName) {
260
- return __awaiter(this, void 0, void 0, function () {
261
- var credentialsOK, currGroups, foundGroups, err_1, errString;
262
- return __generator(this, function (_a) {
263
- switch (_a.label) {
264
- case 0:
265
- if (this._dataTracker.verifiedLogGroup) {
266
- return [2 /*return*/, this._dataTracker.verifiedLogGroup];
267
- }
268
- _a.label = 1;
269
- case 1:
270
- _a.trys.push([1, 5, , 6]);
271
- return [4 /*yield*/, this._ensureCredentials()];
272
- case 2:
273
- credentialsOK = _a.sent();
274
- if (!credentialsOK) {
275
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
276
- }
277
- return [4 /*yield*/, this.getLogGroups({
278
- logGroupNamePrefix: logGroupName,
279
- })];
280
- case 3:
281
- currGroups = _a.sent();
282
- if (!(typeof currGroups === 'string') && currGroups.logGroups) {
283
- foundGroups = currGroups.logGroups.filter(function (group) { return group.logGroupName === logGroupName; });
284
- if (foundGroups.length > 0) {
285
- this._dataTracker.verifiedLogGroup = foundGroups[0];
286
- return [2 /*return*/, foundGroups[0]];
287
- }
288
- }
289
- /**
290
- * If we get to this point, it means that the specified log group does not exist
291
- * and we should create it.
292
- */
293
- return [4 /*yield*/, this.createLogGroup({ logGroupName: logGroupName })];
294
- case 4:
295
- /**
296
- * If we get to this point, it means that the specified log group does not exist
297
- * and we should create it.
298
- */
299
- _a.sent();
300
- return [2 /*return*/, null];
301
- case 5:
302
- err_1 = _a.sent();
303
- errString = "failure during log group search: ".concat(err_1);
304
- logger.error(errString);
305
- throw err_1;
306
- case 6: return [2 /*return*/];
307
- }
308
- });
309
- });
310
- };
311
- AWSCloudWatchProvider.prototype._validateLogStreamExists = function (logGroupName, logStreamName) {
312
- return __awaiter(this, void 0, void 0, function () {
313
- var credentialsOK, currStreams, foundStreams, err_2, errString;
314
- return __generator(this, function (_a) {
315
- switch (_a.label) {
316
- case 0:
317
- _a.trys.push([0, 4, , 5]);
318
- return [4 /*yield*/, this._ensureCredentials()];
319
- case 1:
320
- credentialsOK = _a.sent();
321
- if (!credentialsOK) {
322
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
323
- }
324
- return [4 /*yield*/, this.getLogStreams({
325
- logGroupName: logGroupName,
326
- logStreamNamePrefix: logStreamName,
327
- })];
328
- case 2:
329
- currStreams = _a.sent();
330
- if (currStreams.logStreams) {
331
- foundStreams = currStreams.logStreams.filter(function (stream) { return stream.logStreamName === logStreamName; });
332
- if (foundStreams.length > 0) {
333
- this._nextSequenceToken = foundStreams[0].uploadSequenceToken;
334
- return [2 /*return*/, foundStreams[0]];
335
- }
336
- }
337
- /**
338
- * If we get to this point, it means that the specified stream does not
339
- * exist, and we should create it now.
340
- */
341
- return [4 /*yield*/, this.createLogStream({
342
- logGroupName: logGroupName,
343
- logStreamName: logStreamName,
344
- })];
345
- case 3:
346
- /**
347
- * If we get to this point, it means that the specified stream does not
348
- * exist, and we should create it now.
349
- */
350
- _a.sent();
351
- return [2 /*return*/, null];
352
- case 4:
353
- err_2 = _a.sent();
354
- errString = "failure during log stream search: ".concat(err_2);
355
- logger.error(errString);
356
- throw err_2;
357
- case 5: return [2 /*return*/];
358
- }
359
- });
360
- });
361
- };
362
- AWSCloudWatchProvider.prototype._sendLogEvents = function (params) {
363
- return __awaiter(this, void 0, void 0, function () {
364
- var credentialsOK, cmd, client, output, err_3, errString;
365
- return __generator(this, function (_a) {
366
- switch (_a.label) {
367
- case 0:
368
- _a.trys.push([0, 3, , 4]);
369
- return [4 /*yield*/, this._ensureCredentials()];
370
- case 1:
371
- credentialsOK = _a.sent();
372
- if (!credentialsOK) {
373
- throw new Error(Constants_1.NO_CREDS_ERROR_STRING);
374
- }
375
- logger.debug('sending log events to stream - ', params.logStreamName);
376
- cmd = new client_cloudwatch_logs_1.PutLogEventsCommand(params);
377
- client = this._initCloudWatchLogs();
378
- return [4 /*yield*/, client.send(cmd)];
379
- case 2:
380
- output = _a.sent();
381
- return [2 /*return*/, output];
382
- case 3:
383
- err_3 = _a.sent();
384
- errString = "failure during log push: ".concat(err_3);
385
- logger.error(errString);
386
- return [3 /*break*/, 4];
387
- case 4: return [2 /*return*/];
388
- }
389
- });
390
- });
391
- };
392
- AWSCloudWatchProvider.prototype._initCloudWatchLogs = function () {
393
- return new client_cloudwatch_logs_1.CloudWatchLogsClient({
394
- region: this._config.region,
395
- credentials: this._config.credentials,
396
- customUserAgent: (0, Platform_1.getAmplifyUserAgentObject)(),
397
- endpoint: this._config.endpoint,
398
- });
399
- };
400
- AWSCloudWatchProvider.prototype._ensureCredentials = function () {
401
- return __awaiter(this, void 0, void 0, function () {
402
- var _this = this;
403
- return __generator(this, function (_a) {
404
- switch (_a.label) {
405
- case 0: return [4 /*yield*/, __1.Credentials.get()
406
- .then(function (credentials) {
407
- if (!credentials)
408
- return false;
409
- var cred = __1.Credentials.shear(credentials);
410
- logger.debug('set credentials for logging', cred);
411
- _this._config.credentials = cred;
412
- return true;
413
- })
414
- .catch(function (error) {
415
- logger.warn('ensure credentials error', error);
416
- return false;
417
- })];
418
- case 1: return [2 /*return*/, _a.sent()];
419
- }
420
- });
421
- });
422
- };
423
- AWSCloudWatchProvider.prototype._getNextSequenceToken = function () {
424
- return __awaiter(this, void 0, void 0, function () {
425
- var logStream, err_4;
426
- return __generator(this, function (_a) {
427
- switch (_a.label) {
428
- case 0:
429
- if (this._nextSequenceToken && this._nextSequenceToken.length > 0) {
430
- return [2 /*return*/, this._nextSequenceToken];
431
- }
432
- _a.label = 1;
433
- case 1:
434
- _a.trys.push([1, 4, , 5]);
435
- return [4 /*yield*/, this._validateLogGroupExistsAndCreate(this._config.logGroupName)];
436
- case 2:
437
- _a.sent();
438
- this._nextSequenceToken = undefined;
439
- return [4 /*yield*/, this._validateLogStreamExists(this._config.logGroupName, this._config.logStreamName)];
440
- case 3:
441
- logStream = _a.sent();
442
- if (logStream) {
443
- this._nextSequenceToken = logStream.uploadSequenceToken;
444
- }
445
- return [2 /*return*/, this._nextSequenceToken];
446
- case 4:
447
- err_4 = _a.sent();
448
- logger.error("failure while getting next sequence token: ".concat(err_4));
449
- throw err_4;
450
- case 5: return [2 /*return*/];
451
- }
452
- });
453
- });
454
- };
455
- AWSCloudWatchProvider.prototype._safeUploadLogEvents = function () {
456
- return __awaiter(this, void 0, void 0, function () {
457
- var seqToken, logBatch, putLogsPayload, sendLogEventsResponse, err_5;
458
- return __generator(this, function (_a) {
459
- switch (_a.label) {
460
- case 0:
461
- _a.trys.push([0, 3, , 4]);
462
- return [4 /*yield*/, this._getNextSequenceToken()];
463
- case 1:
464
- seqToken = _a.sent();
465
- logBatch = this._currentLogBatch.length === 0
466
- ? this._getBufferedBatchOfLogs()
467
- : this._currentLogBatch;
468
- putLogsPayload = {
469
- logGroupName: this._config.logGroupName,
470
- logStreamName: this._config.logStreamName,
471
- logEvents: logBatch,
472
- sequenceToken: seqToken,
473
- };
474
- this._dataTracker.eventUploadInProgress = true;
475
- return [4 /*yield*/, this._sendLogEvents(putLogsPayload)];
476
- case 2:
477
- sendLogEventsResponse = _a.sent();
478
- this._nextSequenceToken = sendLogEventsResponse.nextSequenceToken;
479
- this._dataTracker.eventUploadInProgress = false;
480
- this._currentLogBatch = [];
481
- return [2 /*return*/, sendLogEventsResponse];
482
- case 3:
483
- err_5 = _a.sent();
484
- logger.error("error during _safeUploadLogEvents: ".concat(err_5));
485
- if (Constants_1.RETRY_ERROR_CODES.includes(err_5.name)) {
486
- this._getNewSequenceTokenAndSubmit({
487
- logEvents: this._currentLogBatch,
488
- logGroupName: this._config.logGroupName,
489
- logStreamName: this._config.logStreamName,
490
- });
491
- }
492
- else {
493
- this._dataTracker.eventUploadInProgress = false;
494
- throw err_5;
495
- }
496
- return [3 /*break*/, 4];
497
- case 4: return [2 /*return*/];
498
- }
499
- });
500
- });
501
- };
502
- AWSCloudWatchProvider.prototype._getBufferedBatchOfLogs = function () {
503
- /**
504
- * CloudWatch has restrictions on the size of the log events that get sent up.
505
- * We need to track both the size of each event and the total size of the batch
506
- * of logs.
507
- *
508
- * We also need to ensure that the logs in the batch are sorted in chronological order.
509
- * https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html
510
- */
511
- var currentEventIdx = 0;
512
- var totalByteSize = 0;
513
- while (currentEventIdx < this._dataTracker.logEvents.length) {
514
- var currentEvent = this._dataTracker.logEvents[currentEventIdx];
515
- var eventSize = currentEvent
516
- ? new TextEncoder().encode(currentEvent.message).length +
517
- Constants_1.AWS_CLOUDWATCH_BASE_BUFFER_SIZE
518
- : 0;
519
- if (eventSize > Constants_1.AWS_CLOUDWATCH_MAX_EVENT_SIZE) {
520
- var errString = "Log entry exceeds maximum size for CloudWatch logs. Log size: ".concat(eventSize, ". Truncating log message.");
521
- logger.warn(errString);
522
- currentEvent.message = currentEvent.message.substring(0, eventSize);
523
- }
524
- if (totalByteSize + eventSize > Constants_1.AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE)
525
- break;
526
- totalByteSize += eventSize;
527
- currentEventIdx++;
528
- }
529
- this._currentLogBatch = this._dataTracker.logEvents.splice(0, currentEventIdx);
530
- return this._currentLogBatch;
531
- };
532
- AWSCloudWatchProvider.prototype._getNewSequenceTokenAndSubmit = function (payload) {
533
- return __awaiter(this, void 0, void 0, function () {
534
- var seqToken, sendLogEventsRepsonse, err_6;
535
- return __generator(this, function (_a) {
536
- switch (_a.label) {
537
- case 0:
538
- _a.trys.push([0, 3, , 4]);
539
- this._nextSequenceToken = undefined;
540
- this._dataTracker.eventUploadInProgress = true;
541
- return [4 /*yield*/, this._getNextSequenceToken()];
542
- case 1:
543
- seqToken = _a.sent();
544
- payload.sequenceToken = seqToken;
545
- return [4 /*yield*/, this._sendLogEvents(payload)];
546
- case 2:
547
- sendLogEventsRepsonse = _a.sent();
548
- this._dataTracker.eventUploadInProgress = false;
549
- this._currentLogBatch = [];
550
- return [2 /*return*/, sendLogEventsRepsonse];
551
- case 3:
552
- err_6 = _a.sent();
553
- logger.error("error when retrying log submission with new sequence token: ".concat(err_6));
554
- this._dataTracker.eventUploadInProgress = false;
555
- throw err_6;
556
- case 4: return [2 /*return*/];
557
- }
558
- });
559
- });
560
- };
561
- AWSCloudWatchProvider.prototype._initiateLogPushInterval = function () {
562
- var _this = this;
563
- if (this._timer) {
564
- clearInterval(this._timer);
565
- }
566
- this._timer = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
567
- var err_7;
568
- return __generator(this, function (_a) {
569
- switch (_a.label) {
570
- case 0:
571
- _a.trys.push([0, 3, , 4]);
572
- if (!this._getDocUploadPermissibility()) return [3 /*break*/, 2];
573
- return [4 /*yield*/, this._safeUploadLogEvents()];
574
- case 1:
575
- _a.sent();
576
- _a.label = 2;
577
- case 2: return [3 /*break*/, 4];
578
- case 3:
579
- err_7 = _a.sent();
580
- logger.error("error when calling _safeUploadLogEvents in the timer interval - ".concat(err_7));
581
- return [3 /*break*/, 4];
582
- case 4: return [2 /*return*/];
583
- }
584
- });
585
- }); }, 2000);
586
- };
587
- AWSCloudWatchProvider.prototype._getDocUploadPermissibility = function () {
588
- return ((this._dataTracker.logEvents.length !== 0 ||
589
- this._currentLogBatch.length !== 0) &&
590
- !this._dataTracker.eventUploadInProgress);
591
- };
592
- AWSCloudWatchProvider.PROVIDER_NAME = Constants_1.AWS_CLOUDWATCH_PROVIDER_NAME;
593
- AWSCloudWatchProvider.CATEGORY = Constants_1.AWS_CLOUDWATCH_CATEGORY;
594
- return AWSCloudWatchProvider;
595
- }());
596
- exports.AWSCloudWatchProvider = AWSCloudWatchProvider;
@@ -1 +0,0 @@
1
- export { AWSCloudWatchProvider } from './AWSCloudWatchProvider';
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AWSCloudWatchProvider = void 0;
4
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
- // SPDX-License-Identifier: Apache-2.0
6
- var AWSCloudWatchProvider_1 = require("./AWSCloudWatchProvider");
7
- Object.defineProperty(exports, "AWSCloudWatchProvider", { enumerable: true, get: function () { return AWSCloudWatchProvider_1.AWSCloudWatchProvider; } });
@@ -1,5 +0,0 @@
1
- export declare const Linking: {};
2
- export declare const AppState: {
3
- addEventListener: (action: any, handler: any) => any;
4
- };
5
- export declare const AsyncStorage: any;
@@ -1,15 +0,0 @@
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.AsyncStorage = exports.AppState = exports.Linking = void 0;
6
- var JS_1 = require("../JS");
7
- var StorageHelper_1 = require("../StorageHelper");
8
- exports.Linking = {};
9
- exports.AppState = {
10
- addEventListener: function (action, handler) { return undefined; },
11
- };
12
- // if not in react native, just use local storage
13
- exports.AsyncStorage = (0, JS_1.browserOrNode)().isBrowser
14
- ? new StorageHelper_1.StorageHelper().getStorage()
15
- : undefined;
@@ -1,3 +0,0 @@
1
- import { Linking, AppState } from 'react-native';
2
- import AsyncStorage from '@react-native-async-storage/async-storage';
3
- export { Linking, AppState, AsyncStorage };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AsyncStorage = exports.AppState = exports.Linking = void 0;
9
- var react_native_1 = require("react-native");
10
- Object.defineProperty(exports, "Linking", { enumerable: true, get: function () { return react_native_1.Linking; } });
11
- Object.defineProperty(exports, "AppState", { enumerable: true, get: function () { return react_native_1.AppState; } });
12
- var async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
13
- exports.AsyncStorage = async_storage_1.default;