@aws-amplify/core 6.0.1-preview-testing.be90020.0 → 6.0.1-ssr-api.df60e41.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 (947) hide show
  1. package/internals/aws-clients/pinpoint/package.json +4 -4
  2. package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  3. package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.js +11 -0
  4. package/lib/{Util → BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
  5. package/lib/BackgroundProcessManager/BackgroundProcessManager.js +287 -0
  6. package/lib/BackgroundProcessManager/index.d.ts +1 -0
  7. package/lib/BackgroundProcessManager/index.js +7 -0
  8. package/lib/BackgroundProcessManager/types.d.ts +41 -0
  9. package/lib/BackgroundProcessManager/types.js +23 -0
  10. package/lib/Cache/StorageCache.d.ts +14 -31
  11. package/lib/Cache/StorageCache.js +41 -106
  12. package/lib/Cache/StorageCache.native.d.ts +19 -0
  13. package/lib/Cache/StorageCache.native.js +62 -0
  14. package/lib/Cache/{AsyncStorageCache.d.ts → StorageCacheCommon.d.ts} +124 -99
  15. package/lib/Cache/StorageCacheCommon.js +468 -0
  16. package/lib/Cache/constants.d.ts +6 -0
  17. package/lib/Cache/constants.js +17 -0
  18. package/lib/Cache/index.d.ts +2 -0
  19. package/lib/Cache/index.js +7 -0
  20. package/lib/Cache/types/cache.d.ts +38 -0
  21. package/lib/Cache/types/index.d.ts +1 -1
  22. package/lib/Cache/types/index.js +1 -1
  23. package/lib/Cache/{Utils → utils}/CacheList.d.ts +1 -1
  24. package/lib/Cache/utils/CacheList.js +160 -0
  25. package/lib/Cache/utils/cacheHelpers.d.ts +14 -0
  26. package/lib/Cache/utils/cacheHelpers.js +49 -0
  27. package/lib/Cache/utils/errorHelpers.d.ts +7 -0
  28. package/lib/Cache/utils/errorHelpers.js +24 -0
  29. package/lib/Cache/utils/index.d.ts +2 -0
  30. package/lib/Cache/utils/index.js +12 -0
  31. package/lib/Hub/index.d.ts +7 -0
  32. package/lib/Hub/index.js +44 -77
  33. package/lib/Hub/types/AuthTypes.d.ts +19 -0
  34. package/lib/I18n/I18n.d.ts +3 -19
  35. package/lib/I18n/I18n.js +25 -60
  36. package/lib/I18n/errorHelpers.d.ts +5 -0
  37. package/lib/I18n/errorHelpers.js +16 -0
  38. package/lib/I18n/index.d.ts +3 -15
  39. package/lib/I18n/index.js +28 -56
  40. package/lib/I18n/types.d.ts +1 -4
  41. package/lib/I18n/types.js +5 -9
  42. package/lib/Logger/ConsoleLogger.js +54 -130
  43. package/{lib-esm/Util → lib/Mutex}/Mutex.d.ts +2 -15
  44. package/lib/{Util → Mutex}/Mutex.js +17 -20
  45. package/lib/Mutex/index.d.ts +1 -0
  46. package/lib/Mutex/index.js +7 -0
  47. package/lib/Mutex/types.d.ts +13 -0
  48. package/lib/Platform/customUserAgent.d.ts +16 -0
  49. package/lib/Platform/customUserAgent.js +57 -0
  50. package/lib/Platform/detectFramework.js +12 -13
  51. package/lib/Platform/detection/Angular.js +4 -5
  52. package/lib/Platform/detection/Expo.js +1 -1
  53. package/lib/Platform/detection/Next.js +1 -1
  54. package/lib/Platform/detection/Nuxt.js +1 -1
  55. package/lib/Platform/detection/React.js +5 -5
  56. package/lib/Platform/detection/Svelte.js +2 -2
  57. package/lib/Platform/detection/Vue.js +1 -1
  58. package/lib/Platform/detection/Web.js +1 -1
  59. package/lib/Platform/detection/helpers.js +7 -7
  60. package/lib/Platform/detection/index.js +13 -13
  61. package/lib/Platform/index.js +32 -52
  62. package/lib/Platform/types.d.ts +75 -8
  63. package/lib/Platform/types.js +40 -39
  64. package/lib/Platform/version.d.ts +1 -1
  65. package/lib/Platform/version.js +1 -1
  66. package/lib/Reachability/Reachability.d.ts +7 -0
  67. package/lib/Reachability/Reachability.js +42 -0
  68. package/lib/Reachability/Reachability.native.d.ts +6 -0
  69. package/lib/{Util → Reachability}/Reachability.native.js +14 -20
  70. package/lib/Reachability/index.d.ts +1 -0
  71. package/lib/Reachability/index.js +7 -0
  72. package/lib/Reachability/types.d.ts +3 -0
  73. package/lib/Reachability/types.js +4 -0
  74. package/lib/ServiceWorker/ServiceWorker.js +86 -112
  75. package/lib/ServiceWorker/errorHelpers.d.ts +7 -0
  76. package/lib/ServiceWorker/errorHelpers.js +24 -0
  77. package/lib/ServiceWorker/index.d.ts +0 -12
  78. package/lib/ServiceWorker/index.js +0 -12
  79. package/lib/{Util → Signer}/DateUtils.js +10 -27
  80. package/lib/{Signer.js → Signer/Signer.js} +50 -52
  81. package/lib/Signer/index.d.ts +1 -0
  82. package/lib/Signer/index.js +7 -0
  83. package/lib/adapterCore/error/AmplifyServerContextError.d.ts +1 -1
  84. package/lib/adapterCore/error/AmplifyServerContextError.js +9 -27
  85. package/lib/adapterCore/serverContext/serverContext.js +8 -8
  86. package/lib/adapterCore/serverContext/serverContextRegistry.js +6 -6
  87. package/lib/awsClients/cognitoIdentity/base.js +67 -0
  88. package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.d.ts +2 -1
  89. package/lib/awsClients/cognitoIdentity/getCredentialsForIdentity.js +39 -0
  90. package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.d.ts +2 -1
  91. package/lib/awsClients/cognitoIdentity/getId.js +30 -0
  92. package/lib/awsClients/cognitoIdentity/types.js +4 -0
  93. package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/base.js +12 -14
  94. package/lib/awsClients/pinpoint/errorHelpers.d.ts +5 -0
  95. package/lib/awsClients/pinpoint/errorHelpers.js +16 -0
  96. package/{lib-esm/AwsClients/Pinpoint → lib/awsClients/pinpoint}/getInAppMessages.d.ts +4 -3
  97. package/lib/awsClients/pinpoint/getInAppMessages.js +34 -0
  98. package/{lib-esm/AwsClients/Pinpoint → lib/awsClients/pinpoint}/putEvents.d.ts +4 -3
  99. package/lib/awsClients/pinpoint/putEvents.js +37 -0
  100. package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.d.ts +4 -3
  101. package/lib/awsClients/pinpoint/updateEndpoint.js +38 -0
  102. package/lib/clients/endpoints/getDnsSuffix.js +7 -29
  103. package/lib/clients/handlers/authenticated.js +5 -5
  104. package/lib/clients/handlers/fetch.js +41 -97
  105. package/lib/clients/handlers/unauthenticated.js +4 -4
  106. package/lib/clients/internal/composeServiceApi.js +17 -67
  107. package/lib/clients/internal/composeTransferHandler.js +9 -11
  108. package/lib/clients/middleware/retry/defaultRetryDecider.js +18 -75
  109. package/lib/clients/middleware/retry/isClockSkewError.js +2 -4
  110. package/lib/clients/middleware/retry/jitteredBackoff.js +5 -5
  111. package/lib/clients/middleware/retry/middleware.js +61 -125
  112. package/lib/clients/middleware/signing/middleware.js +24 -86
  113. package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +21 -55
  114. package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js +14 -25
  115. package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +7 -7
  116. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +8 -30
  117. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +11 -38
  118. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +13 -17
  119. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +5 -8
  120. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +2 -2
  121. package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -3
  122. package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +7 -11
  123. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +9 -10
  124. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +4 -6
  125. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +8 -8
  126. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +15 -16
  127. package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +2 -4
  128. package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.js +3 -5
  129. package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.js +1 -3
  130. package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +2 -2
  131. package/lib/clients/middleware/signing/utils/isClockSkewed.js +4 -6
  132. package/lib/clients/middleware/userAgent/middleware.js +14 -63
  133. package/lib/clients/serde/json.js +30 -96
  134. package/lib/clients/serde/responseInfo.js +12 -18
  135. package/lib/clients/types/http.d.ts +17 -1
  136. package/lib/clients/utils/memoization.js +3 -3
  137. package/lib/constants.d.ts +4 -0
  138. package/lib/constants.js +18 -0
  139. package/lib/{Util/Errors.d.ts → errors/AmplifyError.d.ts} +2 -9
  140. package/lib/errors/AmplifyError.js +26 -0
  141. package/lib/errors/PlatformNotSupportedError.d.ts +4 -0
  142. package/lib/errors/PlatformNotSupportedError.js +16 -0
  143. package/lib/errors/createAssertionFunction.d.ts +3 -0
  144. package/lib/errors/createAssertionFunction.js +19 -0
  145. package/lib/errors/errorHelpers.d.ts +2 -0
  146. package/lib/errors/errorHelpers.js +19 -0
  147. package/lib/errors/index.d.ts +4 -0
  148. package/lib/errors/index.js +13 -0
  149. package/lib/index.d.ts +7 -7
  150. package/lib/index.js +17 -16
  151. package/lib/libraryUtils.d.ts +20 -16
  152. package/lib/libraryUtils.js +60 -69
  153. package/lib/parseAWSExports.js +172 -35
  154. package/lib/providers/kinesis/types/index.d.ts +1 -0
  155. package/lib/providers/kinesis/types/index.js +19 -0
  156. package/lib/providers/kinesis/types/kinesis.d.ts +9 -0
  157. package/lib/providers/kinesis/types/kinesis.js +4 -0
  158. package/lib/providers/kinesis-firehose/types/index.d.ts +1 -0
  159. package/lib/providers/kinesis-firehose/types/index.js +4 -0
  160. package/lib/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
  161. package/lib/providers/kinesis-firehose/types/kinesis-firehose.js +4 -0
  162. package/lib/providers/personalize/types/index.d.ts +1 -0
  163. package/lib/providers/personalize/types/index.js +4 -0
  164. package/lib/providers/personalize/types/personalize.d.ts +8 -0
  165. package/lib/providers/personalize/types/personalize.js +4 -0
  166. package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -0
  167. package/lib/providers/pinpoint/apis/flushEvents.js +21 -0
  168. package/lib/providers/pinpoint/apis/index.d.ts +1 -0
  169. package/lib/providers/pinpoint/apis/index.js +3 -1
  170. package/lib/providers/pinpoint/apis/record.d.ts +1 -1
  171. package/lib/providers/pinpoint/apis/record.js +58 -109
  172. package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
  173. package/lib/providers/pinpoint/apis/updateEndpoint.js +65 -110
  174. package/lib/providers/pinpoint/index.d.ts +2 -1
  175. package/lib/providers/pinpoint/index.js +5 -0
  176. package/lib/providers/pinpoint/types/errors.d.ts +9 -0
  177. package/lib/providers/pinpoint/types/errors.js +15 -0
  178. package/lib/providers/pinpoint/types/index.d.ts +1 -0
  179. package/lib/providers/pinpoint/types/index.js +3 -0
  180. package/lib/providers/pinpoint/types/pinpoint.d.ts +7 -4
  181. package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
  182. package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +111 -197
  183. package/lib/providers/pinpoint/utils/cacheEndpointId.js +12 -49
  184. package/lib/providers/pinpoint/utils/getCacheKey.js +2 -2
  185. package/lib/providers/pinpoint/utils/getEndpointId.js +7 -51
  186. package/lib/providers/pinpoint/utils/getEventBuffer.js +19 -21
  187. package/lib/providers/pinpoint/utils/index.d.ts +1 -0
  188. package/lib/providers/pinpoint/utils/index.js +3 -1
  189. package/lib/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
  190. package/lib/{RNComponents → providers/pinpoint/utils}/isAppInForeground.js +1 -4
  191. package/lib/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
  192. package/lib/providers/pinpoint/utils/isAppInForeground.native.js +9 -0
  193. package/lib/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
  194. package/lib/providers/pinpoint/utils/resolveEndpointId.js +34 -0
  195. package/lib/singleton/API/types.d.ts +73 -0
  196. package/lib/singleton/API/types.js +2 -0
  197. package/lib/singleton/Amplify.d.ts +2 -2
  198. package/lib/singleton/Amplify.js +34 -93
  199. package/lib/singleton/Analytics/types.d.ts +4 -1
  200. package/lib/singleton/Auth/index.js +48 -115
  201. package/lib/singleton/Auth/types.d.ts +31 -4
  202. package/lib/singleton/Auth/utils/errorHelpers.d.ts +8 -0
  203. package/lib/singleton/Auth/utils/errorHelpers.js +32 -0
  204. package/lib/singleton/Auth/utils/index.d.ts +1 -1
  205. package/lib/singleton/Auth/utils/index.js +30 -46
  206. package/lib/singleton/Cache/types.d.ts +18 -0
  207. package/lib/singleton/Cache/types.js +4 -0
  208. package/lib/singleton/Geo/types.d.ts +17 -0
  209. package/lib/singleton/Geo/types.js +4 -0
  210. package/lib/singleton/Interactions/types.d.ts +21 -0
  211. package/lib/singleton/Interactions/types.js +4 -0
  212. package/lib/singleton/Notifications/InAppMessaging/types.d.ts +2 -0
  213. package/lib/singleton/Notifications/InAppMessaging/types.js +4 -0
  214. package/lib/singleton/Notifications/PushNotification/types.d.ts +2 -0
  215. package/lib/singleton/Notifications/PushNotification/types.js +4 -0
  216. package/lib/singleton/Notifications/types.d.ts +6 -0
  217. package/lib/singleton/Notifications/types.js +4 -0
  218. package/lib/singleton/Predictions/types.d.ts +49 -0
  219. package/lib/singleton/Predictions/types.js +4 -0
  220. package/lib/singleton/apis/clearCredentials.js +1 -1
  221. package/lib/singleton/apis/fetchAuthSession.js +3 -3
  222. package/lib/singleton/apis/internal/fetchAuthSession.js +1 -1
  223. package/lib/singleton/apis/server/fetchAuthSession.js +3 -3
  224. package/lib/singleton/types.d.ts +12 -1
  225. package/{lib-esm/StorageHelper/cookieStorage.d.ts → lib/storage/CookieStorage.d.ts} +4 -3
  226. package/lib/storage/CookieStorage.js +52 -0
  227. package/lib/storage/CookieStorage.native.d.ts +7 -0
  228. package/lib/storage/CookieStorage.native.js +15 -0
  229. package/lib/storage/DefaultStorage.d.ts +7 -0
  230. package/lib/storage/DefaultStorage.js +16 -0
  231. package/{lib-esm/StorageHelper/localStorage.d.ts → lib/storage/DefaultStorage.native.d.ts} +6 -5
  232. package/lib/storage/DefaultStorage.native.js +50 -0
  233. package/lib/storage/InMemoryStorage.d.ts +12 -0
  234. package/lib/storage/InMemoryStorage.js +35 -0
  235. package/lib/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
  236. package/lib/storage/KeyValueStorage.js +56 -0
  237. package/lib/storage/SessionStorage.d.ts +7 -0
  238. package/lib/storage/SessionStorage.js +16 -0
  239. package/lib/storage/index.d.ts +7 -0
  240. package/lib/storage/index.js +14 -0
  241. package/lib/storage/utils.d.ts +10 -0
  242. package/lib/storage/utils.js +22 -0
  243. package/lib/tsconfig.tsbuildinfo +1 -1
  244. package/lib/types/core.d.ts +4 -1
  245. package/lib/types/errors.d.ts +9 -3
  246. package/lib/types/errors.js +7 -0
  247. package/lib/types/storage.d.ts +3 -0
  248. package/lib/utils/amplifyUrl/index.d.ts +13 -0
  249. package/lib/utils/amplifyUrl/index.js +10 -0
  250. package/lib/utils/amplifyUrl/polyfill.d.ts +0 -0
  251. package/lib/utils/amplifyUrl/polyfill.js +4 -0
  252. package/lib/utils/amplifyUrl/polyfill.native.d.ts +1 -0
  253. package/lib/utils/amplifyUrl/polyfill.native.js +6 -0
  254. package/lib/utils/amplifyUuid/index.d.ts +3 -0
  255. package/lib/utils/amplifyUuid/index.js +9 -0
  256. package/lib/utils/amplifyUuid/polyfill.d.ts +0 -0
  257. package/lib/utils/amplifyUuid/polyfill.js +4 -0
  258. package/lib/utils/amplifyUuid/polyfill.native.d.ts +1 -0
  259. package/lib/utils/amplifyUuid/polyfill.native.js +6 -0
  260. package/lib/utils/convert/base64/base64Decoder.d.ts +2 -0
  261. package/lib/utils/convert/base64/base64Decoder.js +11 -0
  262. package/lib/utils/convert/base64/base64Encoder.d.ts +2 -0
  263. package/lib/utils/convert/base64/base64Encoder.js +17 -0
  264. package/lib/utils/convert/base64/bytesToString.d.ts +1 -0
  265. package/lib/utils/convert/base64/bytesToString.js +9 -0
  266. package/lib/utils/convert/index.d.ts +2 -0
  267. package/lib/utils/convert/index.js +9 -0
  268. package/lib/utils/convert/types.d.ts +9 -0
  269. package/lib/utils/convert/types.js +4 -0
  270. package/lib/utils/deepFreeze.d.ts +1 -0
  271. package/lib/utils/deepFreeze.js +16 -0
  272. package/lib/utils/generateRandomString.d.ts +1 -0
  273. package/lib/utils/generateRandomString.js +14 -0
  274. package/lib/{ClientDevice/android.d.ts → utils/getClientInfo/getClientInfo.android.d.ts} +1 -1
  275. package/lib/{ClientDevice/android.js → utils/getClientInfo/getClientInfo.android.js} +9 -9
  276. package/{lib-esm/ClientDevice/browser.d.ts → lib/utils/getClientInfo/getClientInfo.d.ts} +1 -9
  277. package/lib/{ClientDevice/ios.d.ts → utils/getClientInfo/getClientInfo.ios.d.ts} +1 -1
  278. package/lib/{ClientDevice/ios.js → utils/getClientInfo/getClientInfo.ios.js} +14 -14
  279. package/lib/utils/getClientInfo/getClientInfo.js +68 -0
  280. package/lib/utils/getClientInfo/index.d.ts +1 -0
  281. package/lib/utils/getClientInfo/index.js +7 -0
  282. package/lib/utils/globalHelpers/index.d.ts +3 -0
  283. package/lib/utils/globalHelpers/index.js +50 -0
  284. package/lib/utils/globalHelpers/index.native.d.ts +3 -0
  285. package/lib/utils/globalHelpers/index.native.js +28 -0
  286. package/lib/utils/index.d.ts +8 -0
  287. package/lib/utils/index.js +25 -0
  288. package/lib/utils/isBrowser.d.ts +1 -0
  289. package/lib/utils/isBrowser.js +7 -0
  290. package/lib/utils/isWebWorker.d.ts +1 -0
  291. package/lib/utils/isWebWorker.js +14 -0
  292. package/lib/utils/retry/NonRetryableError.d.ts +4 -0
  293. package/lib/utils/retry/NonRetryableError.js +12 -0
  294. package/lib/utils/retry/constants.d.ts +1 -0
  295. package/lib/utils/retry/constants.js +6 -0
  296. package/lib/utils/retry/index.d.ts +5 -0
  297. package/lib/utils/retry/index.js +15 -0
  298. package/lib/utils/retry/isNonRetryableError.d.ts +2 -0
  299. package/lib/utils/retry/isNonRetryableError.js +10 -0
  300. package/lib/utils/retry/jitteredBackoff.d.ts +6 -0
  301. package/lib/utils/retry/jitteredBackoff.js +19 -0
  302. package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  303. package/lib/utils/retry/jitteredExponentialRetry.js +14 -0
  304. package/lib/utils/retry/retry.d.ts +6 -0
  305. package/lib/utils/retry/retry.js +64 -0
  306. package/lib/utils/sessionListener/SessionListener.d.ts +10 -0
  307. package/lib/utils/sessionListener/SessionListener.js +53 -0
  308. package/lib/utils/sessionListener/SessionListener.native.d.ts +10 -0
  309. package/lib/utils/sessionListener/SessionListener.native.js +50 -0
  310. package/lib/utils/sessionListener/constants.d.ts +2 -0
  311. package/lib/utils/sessionListener/constants.js +8 -0
  312. package/lib/utils/sessionListener/index.d.ts +3 -0
  313. package/lib/utils/sessionListener/index.js +10 -0
  314. package/lib/utils/sessionListener/types.d.ts +6 -0
  315. package/lib/utils/sessionListener/types.js +4 -0
  316. package/lib/utils/urlSafeDecode.d.ts +1 -0
  317. package/lib/utils/urlSafeDecode.js +10 -0
  318. package/lib/utils/urlSafeEncode.d.ts +1 -0
  319. package/lib/utils/urlSafeEncode.js +12 -0
  320. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
  321. package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.js +7 -0
  322. package/lib-esm/{Util → BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
  323. package/lib-esm/BackgroundProcessManager/BackgroundProcessManager.js +283 -0
  324. package/lib-esm/BackgroundProcessManager/index.d.ts +1 -0
  325. package/lib-esm/BackgroundProcessManager/index.js +3 -0
  326. package/lib-esm/BackgroundProcessManager/types.d.ts +41 -0
  327. package/lib-esm/BackgroundProcessManager/types.js +20 -0
  328. package/lib-esm/Cache/StorageCache.d.ts +14 -31
  329. package/lib-esm/Cache/StorageCache.js +40 -106
  330. package/lib-esm/Cache/StorageCache.native.d.ts +19 -0
  331. package/lib-esm/Cache/StorageCache.native.js +58 -0
  332. package/lib-esm/Cache/{AsyncStorageCache.d.ts → StorageCacheCommon.d.ts} +124 -99
  333. package/lib-esm/Cache/StorageCacheCommon.js +464 -0
  334. package/lib-esm/Cache/constants.d.ts +6 -0
  335. package/lib-esm/Cache/constants.js +14 -0
  336. package/lib-esm/Cache/index.d.ts +2 -0
  337. package/lib-esm/Cache/index.js +4 -0
  338. package/lib-esm/Cache/types/cache.d.ts +38 -0
  339. package/lib-esm/Cache/types/index.d.ts +1 -1
  340. package/lib-esm/Cache/types/index.js +1 -1
  341. package/lib-esm/Cache/{Utils → utils}/CacheList.d.ts +1 -1
  342. package/lib-esm/Cache/{Utils → utils}/CacheList.js +46 -84
  343. package/lib-esm/Cache/utils/cacheHelpers.d.ts +14 -0
  344. package/lib-esm/Cache/utils/cacheHelpers.js +42 -0
  345. package/lib-esm/Cache/utils/errorHelpers.d.ts +7 -0
  346. package/lib-esm/Cache/utils/errorHelpers.js +21 -0
  347. package/lib-esm/Cache/utils/index.d.ts +2 -0
  348. package/lib-esm/Cache/utils/index.js +4 -0
  349. package/lib-esm/Hub/index.d.ts +7 -0
  350. package/lib-esm/Hub/index.js +42 -76
  351. package/lib-esm/Hub/types/AuthTypes.d.ts +19 -0
  352. package/lib-esm/I18n/I18n.d.ts +3 -19
  353. package/lib-esm/I18n/I18n.js +24 -60
  354. package/lib-esm/I18n/errorHelpers.d.ts +5 -0
  355. package/lib-esm/I18n/errorHelpers.js +13 -0
  356. package/lib-esm/I18n/index.d.ts +3 -15
  357. package/lib-esm/I18n/index.js +26 -55
  358. package/lib-esm/I18n/types.d.ts +1 -4
  359. package/lib-esm/I18n/types.js +3 -8
  360. package/lib-esm/Logger/ConsoleLogger.js +53 -129
  361. package/{lib/Util → lib-esm/Mutex}/Mutex.d.ts +2 -15
  362. package/lib-esm/{Util → Mutex}/Mutex.js +15 -20
  363. package/lib-esm/Mutex/index.d.ts +1 -0
  364. package/lib-esm/Mutex/index.js +3 -0
  365. package/lib-esm/Mutex/types.d.ts +13 -0
  366. package/lib-esm/Platform/customUserAgent.d.ts +16 -0
  367. package/lib-esm/Platform/customUserAgent.js +52 -0
  368. package/lib-esm/Platform/detectFramework.js +11 -12
  369. package/lib-esm/Platform/detection/Angular.js +3 -4
  370. package/lib-esm/Platform/detection/React.js +4 -4
  371. package/lib-esm/Platform/detection/Svelte.js +1 -1
  372. package/lib-esm/Platform/detection/helpers.js +7 -7
  373. package/lib-esm/Platform/detection/index.js +3 -3
  374. package/lib-esm/Platform/index.js +30 -50
  375. package/lib-esm/Platform/types.d.ts +75 -8
  376. package/lib-esm/Platform/types.js +40 -39
  377. package/lib-esm/Platform/version.d.ts +1 -1
  378. package/lib-esm/Platform/version.js +1 -1
  379. package/lib-esm/Reachability/Reachability.d.ts +7 -0
  380. package/lib-esm/Reachability/Reachability.js +39 -0
  381. package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
  382. package/lib-esm/{Util → Reachability}/Reachability.native.js +11 -16
  383. package/lib-esm/Reachability/index.d.ts +1 -0
  384. package/lib-esm/Reachability/index.js +3 -0
  385. package/lib-esm/Reachability/types.d.ts +3 -0
  386. package/lib-esm/Reachability/types.js +3 -0
  387. package/lib-esm/ServiceWorker/ServiceWorker.js +78 -105
  388. package/lib-esm/ServiceWorker/errorHelpers.d.ts +7 -0
  389. package/lib-esm/ServiceWorker/errorHelpers.js +21 -0
  390. package/lib-esm/ServiceWorker/index.d.ts +0 -12
  391. package/lib-esm/ServiceWorker/index.js +0 -12
  392. package/lib-esm/{Util → Signer}/DateUtils.js +11 -28
  393. package/lib-esm/Signer/Signer.js +124 -0
  394. package/lib-esm/Signer/index.d.ts +1 -0
  395. package/lib-esm/Signer/index.js +3 -0
  396. package/lib-esm/adapterCore/error/AmplifyServerContextError.d.ts +1 -1
  397. package/lib-esm/adapterCore/error/AmplifyServerContextError.js +9 -28
  398. package/lib-esm/adapterCore/serverContext/serverContext.js +6 -6
  399. package/lib-esm/adapterCore/serverContext/serverContextRegistry.js +7 -7
  400. package/lib-esm/awsClients/cognitoIdentity/base.js +62 -0
  401. package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.d.ts +2 -1
  402. package/lib-esm/awsClients/cognitoIdentity/getCredentialsForIdentity.js +36 -0
  403. package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.d.ts +2 -1
  404. package/lib-esm/awsClients/cognitoIdentity/getId.js +27 -0
  405. package/lib-esm/awsClients/cognitoIdentity/types.js +3 -0
  406. package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/base.js +9 -11
  407. package/lib-esm/awsClients/pinpoint/errorHelpers.d.ts +5 -0
  408. package/lib-esm/awsClients/pinpoint/errorHelpers.js +13 -0
  409. package/{lib/AwsClients/Pinpoint → lib-esm/awsClients/pinpoint}/getInAppMessages.d.ts +4 -3
  410. package/lib-esm/awsClients/pinpoint/getInAppMessages.js +31 -0
  411. package/{lib/AwsClients/Pinpoint → lib-esm/awsClients/pinpoint}/putEvents.d.ts +4 -3
  412. package/lib-esm/awsClients/pinpoint/putEvents.js +34 -0
  413. package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.d.ts +4 -3
  414. package/lib-esm/awsClients/pinpoint/updateEndpoint.js +35 -0
  415. package/lib-esm/clients/endpoints/getDnsSuffix.js +6 -28
  416. package/lib-esm/clients/endpoints/partitions.js +2 -2
  417. package/lib-esm/clients/handlers/authenticated.js +1 -1
  418. package/lib-esm/clients/handlers/fetch.js +40 -96
  419. package/lib-esm/clients/handlers/unauthenticated.js +1 -1
  420. package/lib-esm/clients/internal/composeServiceApi.js +17 -67
  421. package/lib-esm/clients/internal/composeTransferHandler.js +9 -11
  422. package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +17 -74
  423. package/lib-esm/clients/middleware/retry/isClockSkewError.js +2 -4
  424. package/lib-esm/clients/middleware/retry/jitteredBackoff.js +5 -5
  425. package/lib-esm/clients/middleware/retry/middleware.js +61 -125
  426. package/lib-esm/clients/middleware/signing/middleware.js +21 -83
  427. package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js +17 -17
  428. package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +18 -52
  429. package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js +10 -21
  430. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +5 -5
  431. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +8 -30
  432. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +11 -38
  433. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +8 -12
  434. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +5 -8
  435. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +1 -1
  436. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -3
  437. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +5 -9
  438. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +5 -6
  439. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +4 -6
  440. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +6 -6
  441. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +13 -14
  442. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +1 -3
  443. package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.js +3 -5
  444. package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.js +1 -3
  445. package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +1 -1
  446. package/lib-esm/clients/middleware/signing/utils/isClockSkewed.js +3 -5
  447. package/lib-esm/clients/middleware/userAgent/middleware.js +14 -63
  448. package/lib-esm/clients/serde/json.js +29 -95
  449. package/lib-esm/clients/serde/responseInfo.js +11 -17
  450. package/lib-esm/clients/types/http.d.ts +17 -1
  451. package/lib-esm/clients/utils/memoization.js +3 -3
  452. package/lib-esm/constants.d.ts +4 -0
  453. package/lib-esm/constants.js +15 -0
  454. package/lib-esm/{Util/Errors.d.ts → errors/AmplifyError.d.ts} +2 -9
  455. package/lib-esm/errors/AmplifyError.js +22 -0
  456. package/lib-esm/errors/PlatformNotSupportedError.d.ts +4 -0
  457. package/lib-esm/errors/PlatformNotSupportedError.js +12 -0
  458. package/lib-esm/errors/createAssertionFunction.d.ts +3 -0
  459. package/lib-esm/errors/createAssertionFunction.js +15 -0
  460. package/lib-esm/errors/errorHelpers.d.ts +2 -0
  461. package/lib-esm/errors/errorHelpers.js +16 -0
  462. package/lib-esm/errors/index.d.ts +4 -0
  463. package/lib-esm/errors/index.js +6 -0
  464. package/lib-esm/index.d.ts +7 -7
  465. package/lib-esm/index.js +7 -6
  466. package/lib-esm/libraryUtils.d.ts +20 -16
  467. package/lib-esm/libraryUtils.js +21 -18
  468. package/lib-esm/parseAWSExports.js +171 -34
  469. package/lib-esm/providers/kinesis/types/index.d.ts +1 -0
  470. package/lib-esm/providers/kinesis/types/index.js +3 -0
  471. package/lib-esm/providers/kinesis/types/kinesis.d.ts +9 -0
  472. package/lib-esm/providers/kinesis/types/kinesis.js +3 -0
  473. package/lib-esm/providers/kinesis-firehose/types/index.d.ts +1 -0
  474. package/lib-esm/providers/kinesis-firehose/types/index.js +3 -0
  475. package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
  476. package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.js +3 -0
  477. package/lib-esm/providers/personalize/types/index.d.ts +1 -0
  478. package/lib-esm/providers/personalize/types/index.js +3 -0
  479. package/lib-esm/providers/personalize/types/personalize.d.ts +8 -0
  480. package/lib-esm/providers/personalize/types/personalize.js +3 -0
  481. package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -0
  482. package/lib-esm/providers/pinpoint/apis/flushEvents.js +17 -0
  483. package/lib-esm/providers/pinpoint/apis/index.d.ts +1 -0
  484. package/lib-esm/providers/pinpoint/apis/index.js +1 -0
  485. package/lib-esm/providers/pinpoint/apis/record.d.ts +1 -1
  486. package/lib-esm/providers/pinpoint/apis/record.js +56 -107
  487. package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
  488. package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +64 -109
  489. package/lib-esm/providers/pinpoint/index.d.ts +2 -1
  490. package/lib-esm/providers/pinpoint/index.js +2 -0
  491. package/lib-esm/providers/pinpoint/types/errors.d.ts +9 -0
  492. package/lib-esm/providers/pinpoint/types/errors.js +12 -0
  493. package/lib-esm/providers/pinpoint/types/index.d.ts +1 -0
  494. package/lib-esm/providers/pinpoint/types/index.js +1 -0
  495. package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +7 -4
  496. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
  497. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +110 -197
  498. package/lib-esm/providers/pinpoint/utils/cacheEndpointId.js +10 -47
  499. package/lib-esm/providers/pinpoint/utils/constants.js +4 -4
  500. package/lib-esm/providers/pinpoint/utils/getCacheKey.js +2 -2
  501. package/lib-esm/providers/pinpoint/utils/getEndpointId.js +5 -49
  502. package/lib-esm/providers/pinpoint/utils/getEventBuffer.js +17 -19
  503. package/lib-esm/providers/pinpoint/utils/index.d.ts +1 -0
  504. package/lib-esm/providers/pinpoint/utils/index.js +1 -0
  505. package/lib-esm/providers/pinpoint/utils/isAppInForeground.js +3 -0
  506. package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.js +5 -0
  507. package/lib-esm/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
  508. package/lib-esm/providers/pinpoint/utils/resolveEndpointId.js +30 -0
  509. package/lib-esm/singleton/API/types.d.ts +73 -0
  510. package/lib-esm/singleton/API/types.js +1 -0
  511. package/lib-esm/singleton/Amplify.d.ts +2 -2
  512. package/lib-esm/singleton/Amplify.js +32 -92
  513. package/lib-esm/singleton/Analytics/types.d.ts +4 -1
  514. package/lib-esm/singleton/Auth/index.js +48 -116
  515. package/lib-esm/singleton/Auth/types.d.ts +31 -4
  516. package/lib-esm/singleton/Auth/utils/errorHelpers.d.ts +8 -0
  517. package/lib-esm/singleton/Auth/utils/errorHelpers.js +29 -0
  518. package/lib-esm/singleton/Auth/utils/index.d.ts +1 -1
  519. package/lib-esm/singleton/Auth/utils/index.js +28 -44
  520. package/lib-esm/singleton/Cache/types.d.ts +18 -0
  521. package/lib-esm/singleton/Cache/types.js +3 -0
  522. package/lib-esm/singleton/Geo/types.d.ts +17 -0
  523. package/lib-esm/singleton/Geo/types.js +3 -0
  524. package/lib-esm/singleton/Interactions/types.d.ts +21 -0
  525. package/lib-esm/singleton/Interactions/types.js +3 -0
  526. package/lib-esm/singleton/Notifications/InAppMessaging/types.d.ts +2 -0
  527. package/lib-esm/singleton/Notifications/InAppMessaging/types.js +3 -0
  528. package/lib-esm/singleton/Notifications/PushNotification/types.d.ts +2 -0
  529. package/lib-esm/singleton/Notifications/PushNotification/types.js +3 -0
  530. package/lib-esm/singleton/Notifications/types.d.ts +6 -0
  531. package/lib-esm/singleton/Notifications/types.js +3 -0
  532. package/lib-esm/singleton/Predictions/types.d.ts +49 -0
  533. package/lib-esm/singleton/Predictions/types.js +3 -0
  534. package/lib-esm/singleton/apis/fetchAuthSession.js +1 -1
  535. package/lib-esm/singleton/apis/internal/fetchAuthSession.js +1 -1
  536. package/lib-esm/singleton/apis/server/fetchAuthSession.js +1 -1
  537. package/lib-esm/singleton/types.d.ts +12 -1
  538. package/{lib/StorageHelper/cookieStorage.d.ts → lib-esm/storage/CookieStorage.d.ts} +4 -3
  539. package/lib-esm/storage/CookieStorage.js +45 -0
  540. package/lib-esm/storage/CookieStorage.native.d.ts +7 -0
  541. package/lib-esm/storage/CookieStorage.native.js +11 -0
  542. package/lib-esm/storage/DefaultStorage.d.ts +7 -0
  543. package/lib-esm/storage/DefaultStorage.js +12 -0
  544. package/{lib/StorageHelper/localStorage.d.ts → lib-esm/storage/DefaultStorage.native.d.ts} +6 -5
  545. package/lib-esm/storage/DefaultStorage.native.js +46 -0
  546. package/lib-esm/storage/InMemoryStorage.d.ts +12 -0
  547. package/lib-esm/storage/InMemoryStorage.js +31 -0
  548. package/lib-esm/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
  549. package/lib-esm/storage/KeyValueStorage.js +52 -0
  550. package/lib-esm/storage/SessionStorage.d.ts +7 -0
  551. package/lib-esm/storage/SessionStorage.js +12 -0
  552. package/lib-esm/storage/index.d.ts +7 -0
  553. package/lib-esm/storage/index.js +10 -0
  554. package/lib-esm/storage/utils.d.ts +10 -0
  555. package/lib-esm/storage/utils.js +17 -0
  556. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  557. package/lib-esm/types/core.d.ts +4 -1
  558. package/lib-esm/types/errors.d.ts +9 -3
  559. package/lib-esm/types/errors.js +6 -1
  560. package/lib-esm/types/storage.d.ts +3 -0
  561. package/lib-esm/utils/amplifyUrl/index.d.ts +13 -0
  562. package/lib-esm/utils/amplifyUrl/index.js +6 -0
  563. package/lib-esm/utils/amplifyUrl/polyfill.d.ts +0 -0
  564. package/lib-esm/utils/amplifyUrl/polyfill.js +4 -0
  565. package/lib-esm/utils/amplifyUrl/polyfill.native.d.ts +1 -0
  566. package/lib-esm/utils/amplifyUrl/polyfill.native.js +4 -0
  567. package/lib-esm/utils/amplifyUuid/index.d.ts +3 -0
  568. package/lib-esm/utils/amplifyUuid/index.js +6 -0
  569. package/lib-esm/utils/amplifyUuid/polyfill.d.ts +0 -0
  570. package/lib-esm/utils/amplifyUuid/polyfill.js +4 -0
  571. package/lib-esm/utils/amplifyUuid/polyfill.native.d.ts +1 -0
  572. package/lib-esm/utils/amplifyUuid/polyfill.native.js +4 -0
  573. package/lib-esm/utils/convert/base64/base64Decoder.d.ts +2 -0
  574. package/lib-esm/utils/convert/base64/base64Decoder.js +8 -0
  575. package/lib-esm/utils/convert/base64/base64Encoder.d.ts +2 -0
  576. package/lib-esm/utils/convert/base64/base64Encoder.js +14 -0
  577. package/lib-esm/utils/convert/base64/bytesToString.d.ts +1 -0
  578. package/lib-esm/utils/convert/base64/bytesToString.js +5 -0
  579. package/lib-esm/utils/convert/index.d.ts +2 -0
  580. package/lib-esm/utils/convert/index.js +4 -0
  581. package/lib-esm/utils/convert/types.d.ts +9 -0
  582. package/lib-esm/utils/convert/types.js +3 -0
  583. package/lib-esm/utils/deepFreeze.d.ts +1 -0
  584. package/lib-esm/utils/deepFreeze.js +12 -0
  585. package/lib-esm/utils/generateRandomString.d.ts +1 -0
  586. package/lib-esm/utils/generateRandomString.js +10 -0
  587. package/lib-esm/{ClientDevice/android.d.ts → utils/getClientInfo/getClientInfo.android.d.ts} +1 -1
  588. package/lib-esm/{ClientDevice/android.js → utils/getClientInfo/getClientInfo.android.js} +6 -6
  589. package/{lib/ClientDevice/browser.d.ts → lib-esm/utils/getClientInfo/getClientInfo.d.ts} +1 -9
  590. package/lib-esm/{ClientDevice/ios.d.ts → utils/getClientInfo/getClientInfo.ios.d.ts} +1 -1
  591. package/lib-esm/{ClientDevice/ios.js → utils/getClientInfo/getClientInfo.ios.js} +11 -11
  592. package/lib-esm/{ClientDevice/browser.js → utils/getClientInfo/getClientInfo.js} +18 -28
  593. package/lib-esm/utils/getClientInfo/index.d.ts +1 -0
  594. package/lib-esm/utils/getClientInfo/index.js +3 -0
  595. package/lib-esm/utils/globalHelpers/index.d.ts +3 -0
  596. package/lib-esm/utils/globalHelpers/index.js +44 -0
  597. package/lib-esm/utils/globalHelpers/index.native.d.ts +3 -0
  598. package/lib-esm/utils/globalHelpers/index.native.js +22 -0
  599. package/lib-esm/utils/index.d.ts +8 -0
  600. package/lib-esm/utils/index.js +10 -0
  601. package/lib-esm/utils/isBrowser.d.ts +1 -0
  602. package/lib-esm/utils/isBrowser.js +3 -0
  603. package/lib-esm/utils/isWebWorker.d.ts +1 -0
  604. package/lib-esm/utils/isWebWorker.js +10 -0
  605. package/lib-esm/utils/retry/NonRetryableError.d.ts +4 -0
  606. package/lib-esm/utils/retry/NonRetryableError.js +8 -0
  607. package/lib-esm/utils/retry/constants.d.ts +1 -0
  608. package/lib-esm/utils/retry/constants.js +3 -0
  609. package/lib-esm/utils/retry/index.d.ts +5 -0
  610. package/lib-esm/utils/retry/index.js +7 -0
  611. package/lib-esm/utils/retry/isNonRetryableError.d.ts +2 -0
  612. package/lib-esm/utils/retry/isNonRetryableError.js +6 -0
  613. package/lib-esm/utils/retry/jitteredBackoff.d.ts +6 -0
  614. package/lib-esm/utils/retry/jitteredBackoff.js +15 -0
  615. package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
  616. package/lib-esm/utils/retry/jitteredExponentialRetry.js +10 -0
  617. package/lib-esm/utils/retry/retry.d.ts +6 -0
  618. package/lib-esm/utils/retry/retry.js +60 -0
  619. package/lib-esm/utils/sessionListener/SessionListener.d.ts +10 -0
  620. package/lib-esm/utils/sessionListener/SessionListener.js +49 -0
  621. package/lib-esm/utils/sessionListener/SessionListener.native.d.ts +10 -0
  622. package/lib-esm/utils/sessionListener/SessionListener.native.js +46 -0
  623. package/lib-esm/utils/sessionListener/constants.d.ts +2 -0
  624. package/lib-esm/utils/sessionListener/constants.js +5 -0
  625. package/lib-esm/utils/sessionListener/index.d.ts +3 -0
  626. package/lib-esm/utils/sessionListener/index.js +5 -0
  627. package/lib-esm/utils/sessionListener/types.d.ts +6 -0
  628. package/lib-esm/utils/sessionListener/types.js +3 -0
  629. package/lib-esm/{Util/StringUtils.d.ts → utils/urlSafeDecode.d.ts} +0 -1
  630. package/lib-esm/utils/urlSafeDecode.js +6 -0
  631. package/{lib/Util/StringUtils.d.ts → lib-esm/utils/urlSafeEncode.d.ts} +0 -1
  632. package/lib-esm/utils/urlSafeEncode.js +8 -0
  633. package/package.json +18 -45
  634. package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
  635. package/src/{Util → BackgroundProcessManager}/BackgroundProcessManager.ts +4 -58
  636. package/src/BackgroundProcessManager/index.ts +4 -0
  637. package/src/BackgroundProcessManager/types.ts +49 -0
  638. package/src/Cache/StorageCache.native.ts +65 -0
  639. package/src/Cache/StorageCache.ts +61 -158
  640. package/src/Cache/StorageCacheCommon.ts +577 -0
  641. package/src/Cache/constants.ts +18 -0
  642. package/src/Cache/index.ts +6 -0
  643. package/src/Cache/types/cache.ts +51 -0
  644. package/src/Cache/types/index.ts +1 -1
  645. package/src/Cache/{Utils → utils}/CacheList.ts +185 -198
  646. package/src/Cache/utils/cacheHelpers.ts +52 -0
  647. package/src/Cache/utils/errorHelpers.ts +26 -0
  648. package/src/Cache/{Utils → utils}/index.ts +4 -5
  649. package/src/Hub/index.ts +11 -2
  650. package/src/Hub/types/AuthTypes.ts +12 -1
  651. package/src/I18n/I18n.ts +4 -25
  652. package/src/I18n/errorHelpers.ts +18 -0
  653. package/src/I18n/index.ts +9 -33
  654. package/src/I18n/types.ts +1 -4
  655. package/src/Logger/ConsoleLogger.ts +1 -1
  656. package/src/{Util → Mutex}/Mutex.ts +2 -20
  657. package/src/Mutex/index.ts +4 -0
  658. package/src/Mutex/types.ts +20 -0
  659. package/src/Platform/customUserAgent.ts +75 -0
  660. package/src/Platform/index.ts +14 -1
  661. package/src/Platform/types.ts +84 -39
  662. package/src/Platform/version.ts +1 -1
  663. package/src/{Util → Reachability}/Reachability.native.ts +7 -12
  664. package/src/Reachability/Reachability.ts +55 -0
  665. package/src/Reachability/index.ts +4 -0
  666. package/src/Reachability/types.ts +6 -0
  667. package/src/ServiceWorker/ServiceWorker.ts +39 -48
  668. package/src/ServiceWorker/errorHelpers.ts +26 -0
  669. package/src/ServiceWorker/index.ts +0 -12
  670. package/src/{Util → Signer}/DateUtils.ts +1 -1
  671. package/src/{Signer.ts → Signer/Signer.ts} +5 -4
  672. package/src/Signer/index.ts +4 -0
  673. package/src/adapterCore/error/AmplifyServerContextError.ts +1 -1
  674. package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.ts +4 -1
  675. package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/base.ts +2 -1
  676. package/src/awsClients/pinpoint/errorHelpers.ts +19 -0
  677. package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.ts +2 -1
  678. package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.ts +4 -7
  679. package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.ts +2 -1
  680. package/src/clients/handlers/fetch.ts +5 -1
  681. package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
  682. package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +2 -1
  683. package/src/clients/types/http.ts +19 -1
  684. package/src/{Util/Constants.ts → constants.ts} +0 -11
  685. package/src/{Util/Errors.ts → errors/AmplifyError.ts} +2 -18
  686. package/src/errors/PlatformNotSupportedError.ts +14 -0
  687. package/src/errors/createAssertionFunction.ts +23 -0
  688. package/src/errors/errorHelpers.ts +20 -0
  689. package/src/errors/index.ts +7 -0
  690. package/src/index.ts +16 -11
  691. package/src/libraryUtils.ts +61 -57
  692. package/src/parseAWSExports.ts +214 -14
  693. package/src/providers/kinesis/types/index.ts +4 -0
  694. package/src/providers/kinesis/types/kinesis.ts +12 -0
  695. package/src/providers/kinesis-firehose/types/index.ts +4 -0
  696. package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +12 -0
  697. package/src/providers/personalize/types/index.ts +4 -0
  698. package/src/providers/personalize/types/personalize.ts +11 -0
  699. package/src/providers/pinpoint/apis/flushEvents.ts +31 -0
  700. package/src/providers/pinpoint/apis/index.ts +1 -0
  701. package/src/providers/pinpoint/apis/record.ts +36 -33
  702. package/src/providers/pinpoint/apis/updateEndpoint.ts +26 -10
  703. package/src/providers/pinpoint/index.ts +6 -1
  704. package/src/providers/pinpoint/types/errors.ts +12 -0
  705. package/src/providers/pinpoint/types/index.ts +1 -0
  706. package/src/providers/pinpoint/types/pinpoint.ts +7 -3
  707. package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +21 -13
  708. package/src/providers/pinpoint/utils/index.ts +1 -0
  709. package/src/providers/pinpoint/utils/isAppInForeground.native.ts +7 -0
  710. package/src/providers/pinpoint/utils/isAppInForeground.ts +4 -0
  711. package/src/providers/pinpoint/utils/resolveEndpointId.ts +46 -0
  712. package/src/singleton/API/types.ts +90 -0
  713. package/src/singleton/Amplify.ts +10 -8
  714. package/src/singleton/Analytics/types.ts +7 -1
  715. package/src/singleton/Auth/types.ts +53 -4
  716. package/src/singleton/Auth/utils/errorHelpers.ts +37 -0
  717. package/src/singleton/Auth/utils/index.ts +35 -38
  718. package/src/singleton/Cache/types.ts +27 -0
  719. package/src/singleton/Geo/types.ts +20 -0
  720. package/src/singleton/Interactions/types.ts +29 -0
  721. package/src/singleton/Notifications/InAppMessaging/types.ts +6 -0
  722. package/src/singleton/Notifications/PushNotification/types.ts +6 -0
  723. package/src/singleton/Notifications/types.ts +10 -0
  724. package/src/singleton/Predictions/types.ts +61 -0
  725. package/src/singleton/types.ts +15 -7
  726. package/src/storage/CookieStorage.native.ts +13 -0
  727. package/src/storage/CookieStorage.ts +68 -0
  728. package/src/storage/DefaultStorage.native.ts +58 -0
  729. package/src/storage/DefaultStorage.ts +14 -0
  730. package/src/storage/InMemoryStorage.ts +36 -0
  731. package/src/{StorageHelper/sessionStorage.ts → storage/KeyValueStorage.ts} +15 -18
  732. package/src/storage/SessionStorage.ts +14 -0
  733. package/src/storage/index.ts +13 -0
  734. package/src/storage/utils.ts +22 -0
  735. package/src/types/core.ts +4 -1
  736. package/src/types/errors.ts +15 -3
  737. package/src/types/storage.ts +4 -0
  738. package/src/utils/amplifyUrl/index.ts +9 -0
  739. package/src/utils/amplifyUrl/polyfill.native.ts +6 -0
  740. package/src/utils/amplifyUrl/polyfill.ts +4 -0
  741. package/src/utils/amplifyUuid/index.ts +9 -0
  742. package/src/utils/amplifyUuid/polyfill.native.ts +6 -0
  743. package/src/utils/amplifyUuid/polyfill.ts +4 -0
  744. package/src/utils/convert/base64/base64Decoder.ts +11 -0
  745. package/src/utils/convert/base64/base64Encoder.ts +18 -0
  746. package/src/utils/convert/base64/bytesToString.ts +6 -0
  747. package/src/utils/convert/index.ts +5 -0
  748. package/src/utils/convert/types.ts +17 -0
  749. package/src/utils/deepFreeze.ts +16 -0
  750. package/src/utils/generateRandomString.ts +16 -0
  751. package/src/{ClientDevice/android.ts → utils/getClientInfo/getClientInfo.android.ts} +2 -2
  752. package/src/{ClientDevice/ios.ts → utils/getClientInfo/getClientInfo.ios.ts} +3 -3
  753. package/src/{ClientDevice/browser.ts → utils/getClientInfo/getClientInfo.ts} +4 -16
  754. package/src/utils/getClientInfo/index.ts +4 -0
  755. package/src/utils/globalHelpers/index.native.ts +30 -0
  756. package/src/utils/globalHelpers/index.ts +54 -0
  757. package/src/utils/index.ts +17 -0
  758. package/src/utils/isBrowser.ts +5 -0
  759. package/src/utils/isWebWorker.ts +13 -0
  760. package/src/utils/retry/NonRetryableError.ts +9 -0
  761. package/src/utils/retry/constants.ts +4 -0
  762. package/src/utils/retry/index.ts +8 -0
  763. package/src/utils/retry/isNonRetryableError.ts +9 -0
  764. package/src/utils/retry/jitteredBackoff.ts +21 -0
  765. package/src/utils/retry/jitteredExponentialRetry.ts +18 -0
  766. package/src/{Util/Retry.ts → utils/retry/retry.ts} +4 -44
  767. package/src/utils/sessionListener/SessionListener.native.ts +70 -0
  768. package/src/utils/sessionListener/SessionListener.ts +74 -0
  769. package/src/utils/sessionListener/constants.ts +6 -0
  770. package/src/utils/sessionListener/index.ts +7 -0
  771. package/src/utils/sessionListener/types.ts +11 -0
  772. package/src/{Util/StringUtils.ts → utils/urlSafeDecode.ts} +0 -6
  773. package/src/utils/urlSafeEncode.ts +9 -0
  774. package/lib/Amplify.d.ts +0 -29
  775. package/lib/Amplify.js +0 -118
  776. package/lib/AwsClients/CognitoIdentity/base.js +0 -114
  777. package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +0 -83
  778. package/lib/AwsClients/CognitoIdentity/getId.js +0 -73
  779. package/lib/AwsClients/Pinpoint/getInAppMessages.js +0 -77
  780. package/lib/AwsClients/Pinpoint/putEvents.js +0 -84
  781. package/lib/AwsClients/Pinpoint/updateEndpoint.js +0 -81
  782. package/lib/Cache/AsyncStorageCache.js +0 -744
  783. package/lib/Cache/BrowserStorageCache.d.ts +0 -166
  784. package/lib/Cache/BrowserStorageCache.js +0 -469
  785. package/lib/Cache/InMemoryCache.d.ts +0 -129
  786. package/lib/Cache/InMemoryCache.js +0 -349
  787. package/lib/Cache/Utils/CacheList.js +0 -196
  788. package/lib/Cache/Utils/CacheUtils.d.ts +0 -25
  789. package/lib/Cache/Utils/CacheUtils.js +0 -88
  790. package/lib/Cache/Utils/index.d.ts +0 -2
  791. package/lib/Cache/Utils/index.js +0 -16
  792. package/lib/Cache/reactnative.d.ts +0 -3
  793. package/lib/Cache/reactnative.js +0 -8
  794. package/lib/Cache/types/Cache.d.ts +0 -55
  795. package/lib/ClientDevice/browser.js +0 -80
  796. package/lib/ClientDevice/index.d.ts +0 -23
  797. package/lib/ClientDevice/index.js +0 -18
  798. package/lib/ClientDevice/reactnative.d.ts +0 -7
  799. package/lib/ClientDevice/reactnative.js +0 -24
  800. package/lib/RNComponents/index.d.ts +0 -6
  801. package/lib/RNComponents/index.js +0 -16
  802. package/lib/RNComponents/reactnative.d.ts +0 -3
  803. package/lib/RNComponents/reactnative.js +0 -14
  804. package/lib/StorageHelper/cookieStorage.js +0 -167
  805. package/lib/StorageHelper/inMemoryStorage.d.ts +0 -10
  806. package/lib/StorageHelper/inMemoryStorage.js +0 -82
  807. package/lib/StorageHelper/index.d.ts +0 -45
  808. package/lib/StorageHelper/index.js +0 -83
  809. package/lib/StorageHelper/localStorage.js +0 -114
  810. package/lib/StorageHelper/reactnative.d.ts +0 -83
  811. package/lib/StorageHelper/reactnative.js +0 -250
  812. package/lib/StorageHelper/sessionStorage.js +0 -114
  813. package/lib/Util/BackgroundProcessManager.js +0 -449
  814. package/lib/Util/Constants.d.ts +0 -12
  815. package/lib/Util/Constants.js +0 -29
  816. package/lib/Util/Errors.js +0 -62
  817. package/lib/Util/JS.d.ts +0 -29
  818. package/lib/Util/JS.js +0 -214
  819. package/lib/Util/Reachability.d.ts +0 -13
  820. package/lib/Util/Reachability.js +0 -69
  821. package/lib/Util/Reachability.native.d.ts +0 -12
  822. package/lib/Util/Retry.d.ts +0 -21
  823. package/lib/Util/Retry.js +0 -205
  824. package/lib/Util/StringUtils.js +0 -17
  825. package/lib/Util/errors/AssertError.d.ts +0 -2
  826. package/lib/Util/errors/AssertError.js +0 -11
  827. package/lib/Util/index.d.ts +0 -7
  828. package/lib/Util/index.js +0 -31
  829. package/lib/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -5
  830. package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +0 -15
  831. package/lib-esm/Amplify.d.ts +0 -29
  832. package/lib-esm/Amplify.js +0 -115
  833. package/lib-esm/AwsClients/CognitoIdentity/base.js +0 -109
  834. package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +0 -80
  835. package/lib-esm/AwsClients/CognitoIdentity/getId.js +0 -70
  836. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +0 -74
  837. package/lib-esm/AwsClients/Pinpoint/putEvents.js +0 -81
  838. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +0 -78
  839. package/lib-esm/Cache/AsyncStorageCache.js +0 -737
  840. package/lib-esm/Cache/BrowserStorageCache.d.ts +0 -166
  841. package/lib-esm/Cache/BrowserStorageCache.js +0 -466
  842. package/lib-esm/Cache/InMemoryCache.d.ts +0 -129
  843. package/lib-esm/Cache/InMemoryCache.js +0 -346
  844. package/lib-esm/Cache/Utils/CacheUtils.d.ts +0 -25
  845. package/lib-esm/Cache/Utils/CacheUtils.js +0 -81
  846. package/lib-esm/Cache/Utils/index.d.ts +0 -2
  847. package/lib-esm/Cache/Utils/index.js +0 -4
  848. package/lib-esm/Cache/reactnative.d.ts +0 -3
  849. package/lib-esm/Cache/reactnative.js +0 -6
  850. package/lib-esm/Cache/types/Cache.d.ts +0 -55
  851. package/lib-esm/ClientDevice/index.d.ts +0 -23
  852. package/lib-esm/ClientDevice/index.js +0 -15
  853. package/lib-esm/ClientDevice/reactnative.d.ts +0 -7
  854. package/lib-esm/ClientDevice/reactnative.js +0 -21
  855. package/lib-esm/RNComponents/index.d.ts +0 -6
  856. package/lib-esm/RNComponents/index.js +0 -13
  857. package/lib-esm/RNComponents/isAppInForeground.js +0 -6
  858. package/lib-esm/RNComponents/reactnative.d.ts +0 -3
  859. package/lib-esm/RNComponents/reactnative.js +0 -6
  860. package/lib-esm/Signer.js +0 -127
  861. package/lib-esm/StorageHelper/cookieStorage.js +0 -141
  862. package/lib-esm/StorageHelper/inMemoryStorage.d.ts +0 -10
  863. package/lib-esm/StorageHelper/inMemoryStorage.js +0 -79
  864. package/lib-esm/StorageHelper/index.d.ts +0 -45
  865. package/lib-esm/StorageHelper/index.js +0 -76
  866. package/lib-esm/StorageHelper/localStorage.js +0 -111
  867. package/lib-esm/StorageHelper/reactnative.d.ts +0 -83
  868. package/lib-esm/StorageHelper/reactnative.js +0 -244
  869. package/lib-esm/StorageHelper/sessionStorage.js +0 -111
  870. package/lib-esm/Util/BackgroundProcessManager.js +0 -446
  871. package/lib-esm/Util/Constants.d.ts +0 -12
  872. package/lib-esm/Util/Constants.js +0 -26
  873. package/lib-esm/Util/Errors.js +0 -57
  874. package/lib-esm/Util/JS.d.ts +0 -29
  875. package/lib-esm/Util/JS.js +0 -199
  876. package/lib-esm/Util/Reachability.d.ts +0 -13
  877. package/lib-esm/Util/Reachability.js +0 -64
  878. package/lib-esm/Util/Reachability.native.d.ts +0 -12
  879. package/lib-esm/Util/Retry.d.ts +0 -21
  880. package/lib-esm/Util/Retry.js +0 -198
  881. package/lib-esm/Util/StringUtils.js +0 -12
  882. package/lib-esm/Util/errors/AssertError.d.ts +0 -2
  883. package/lib-esm/Util/errors/AssertError.js +0 -7
  884. package/lib-esm/Util/index.d.ts +0 -7
  885. package/lib-esm/Util/index.js +0 -9
  886. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -5
  887. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +0 -8
  888. package/polyfills/URL/index.ts +0 -14
  889. package/polyfills/URL/tsconfig.json +0 -10
  890. package/polyfills/URL/webpack.config.js +0 -43
  891. package/src/Amplify.ts +0 -106
  892. package/src/Cache/AsyncStorageCache.ts +0 -500
  893. package/src/Cache/BrowserStorageCache.ts +0 -517
  894. package/src/Cache/CHANGELOG.md +0 -1239
  895. package/src/Cache/InMemoryCache.ts +0 -354
  896. package/src/Cache/Utils/CacheUtils.ts +0 -92
  897. package/src/Cache/reactnative.ts +0 -9
  898. package/src/Cache/types/Cache.ts +0 -75
  899. package/src/ClientDevice/index.ts +0 -14
  900. package/src/ClientDevice/reactnative.ts +0 -18
  901. package/src/RNComponents/index.ts +0 -16
  902. package/src/RNComponents/isAppInForeground.ts +0 -8
  903. package/src/RNComponents/reactnative.ts +0 -6
  904. package/src/StorageHelper/cookieStorage.ts +0 -99
  905. package/src/StorageHelper/inMemoryStorage.ts +0 -32
  906. package/src/StorageHelper/index.ts +0 -78
  907. package/src/StorageHelper/localStorage.ts +0 -60
  908. package/src/StorageHelper/reactnative.ts +0 -182
  909. package/src/Util/JS.ts +0 -255
  910. package/src/Util/Reachability.ts +0 -58
  911. package/src/Util/errors/AssertError.ts +0 -11
  912. package/src/Util/index.ts +0 -23
  913. package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +0 -10
  914. /package/lib/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
  915. /package/lib/{Cache/types/Cache.js → Mutex/types.js} +0 -0
  916. /package/lib/{Util → Signer}/DateUtils.d.ts +0 -0
  917. /package/lib/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
  918. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.d.ts +0 -0
  919. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
  920. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
  921. /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
  922. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/base.d.ts +0 -0
  923. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.d.ts +0 -0
  924. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
  925. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
  926. /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
  927. /package/lib-esm/{AwsClients/CognitoIdentity/types.js → Cache/types/cache.js} +0 -0
  928. /package/lib-esm/{Cache/types/Cache.js → Mutex/types.js} +0 -0
  929. /package/lib-esm/{Util → Signer}/DateUtils.d.ts +0 -0
  930. /package/lib-esm/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
  931. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.d.ts +0 -0
  932. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
  933. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
  934. /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
  935. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/base.d.ts +0 -0
  936. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.d.ts +0 -0
  937. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
  938. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
  939. /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
  940. /package/lib-esm/{RNComponents → providers/pinpoint/utils}/isAppInForeground.d.ts +0 -0
  941. /package/{lib/RNComponents/isAppInForeground.d.ts → lib-esm/providers/pinpoint/utils/isAppInForeground.native.d.ts} +0 -0
  942. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.ts +0 -0
  943. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.ts +0 -0
  944. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.ts +0 -0
  945. /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.ts +0 -0
  946. /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/index.ts +0 -0
  947. /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/types.ts +0 -0
@@ -1,199 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- var MIME_MAP = [
4
- { type: 'text/plain', ext: 'txt' },
5
- { type: 'text/html', ext: 'html' },
6
- { type: 'text/javascript', ext: 'js' },
7
- { type: 'text/css', ext: 'css' },
8
- { type: 'text/csv', ext: 'csv' },
9
- { type: 'text/yaml', ext: 'yml' },
10
- { type: 'text/yaml', ext: 'yaml' },
11
- { type: 'text/calendar', ext: 'ics' },
12
- { type: 'text/calendar', ext: 'ical' },
13
- { type: 'image/apng', ext: 'apng' },
14
- { type: 'image/bmp', ext: 'bmp' },
15
- { type: 'image/gif', ext: 'gif' },
16
- { type: 'image/x-icon', ext: 'ico' },
17
- { type: 'image/x-icon', ext: 'cur' },
18
- { type: 'image/jpeg', ext: 'jpg' },
19
- { type: 'image/jpeg', ext: 'jpeg' },
20
- { type: 'image/jpeg', ext: 'jfif' },
21
- { type: 'image/jpeg', ext: 'pjp' },
22
- { type: 'image/jpeg', ext: 'pjpeg' },
23
- { type: 'image/png', ext: 'png' },
24
- { type: 'image/svg+xml', ext: 'svg' },
25
- { type: 'image/tiff', ext: 'tif' },
26
- { type: 'image/tiff', ext: 'tiff' },
27
- { type: 'image/webp', ext: 'webp' },
28
- { type: 'application/json', ext: 'json' },
29
- { type: 'application/xml', ext: 'xml' },
30
- { type: 'application/x-sh', ext: 'sh' },
31
- { type: 'application/zip', ext: 'zip' },
32
- { type: 'application/x-rar-compressed', ext: 'rar' },
33
- { type: 'application/x-tar', ext: 'tar' },
34
- { type: 'application/x-bzip', ext: 'bz' },
35
- { type: 'application/x-bzip2', ext: 'bz2' },
36
- { type: 'application/pdf', ext: 'pdf' },
37
- { type: 'application/java-archive', ext: 'jar' },
38
- { type: 'application/msword', ext: 'doc' },
39
- { type: 'application/vnd.ms-excel', ext: 'xls' },
40
- { type: 'application/vnd.ms-excel', ext: 'xlsx' },
41
- { type: 'message/rfc822', ext: 'eml' },
42
- ];
43
- export var isEmpty = function (obj) {
44
- if (obj === void 0) { obj = {}; }
45
- return Object.keys(obj).length === 0;
46
- };
47
- export var sortByField = function (list, field, dir) {
48
- if (!list || !list.sort) {
49
- return false;
50
- }
51
- var dirX = dir && dir === 'desc' ? -1 : 1;
52
- list.sort(function (a, b) {
53
- var a_val = a[field];
54
- var b_val = b[field];
55
- if (typeof b_val === 'undefined') {
56
- return typeof a_val === 'undefined' ? 0 : 1 * dirX;
57
- }
58
- if (typeof a_val === 'undefined') {
59
- return -1 * dirX;
60
- }
61
- if (a_val < b_val) {
62
- return -1 * dirX;
63
- }
64
- if (a_val > b_val) {
65
- return 1 * dirX;
66
- }
67
- return 0;
68
- });
69
- return true;
70
- };
71
- export var objectLessAttributes = function (obj, less) {
72
- var ret = Object.assign({}, obj);
73
- if (less) {
74
- if (typeof less === 'string') {
75
- delete ret[less];
76
- }
77
- else {
78
- less.forEach(function (attr) {
79
- delete ret[attr];
80
- });
81
- }
82
- }
83
- return ret;
84
- };
85
- export var filenameToContentType = function (filename, defVal) {
86
- if (defVal === void 0) { defVal = 'application/octet-stream'; }
87
- var name = filename.toLowerCase();
88
- var filtered = MIME_MAP.filter(function (mime) { return name.endsWith('.' + mime.ext); });
89
- return filtered.length > 0 ? filtered[0].type : defVal;
90
- };
91
- export var isTextFile = function (contentType) {
92
- var type = contentType.toLowerCase();
93
- if (type.startsWith('text/')) {
94
- return true;
95
- }
96
- return ('application/json' === type ||
97
- 'application/xml' === type ||
98
- 'application/sh' === type);
99
- };
100
- export var generateRandomString = function () {
101
- var result = '';
102
- var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
103
- for (var i = 32; i > 0; i -= 1) {
104
- result += chars[Math.floor(Math.random() * chars.length)];
105
- }
106
- return result;
107
- };
108
- export var makeQuerablePromise = function (promise) {
109
- if (promise.isResolved)
110
- return promise;
111
- var isPending = true;
112
- var isRejected = false;
113
- var isFullfilled = false;
114
- var result = promise.then(function (data) {
115
- isFullfilled = true;
116
- isPending = false;
117
- return data;
118
- }, function (e) {
119
- isRejected = true;
120
- isPending = false;
121
- throw e;
122
- });
123
- result.isFullfilled = function () { return isFullfilled; };
124
- result.isPending = function () { return isPending; };
125
- result.isRejected = function () { return isRejected; };
126
- return result;
127
- };
128
- export var isWebWorker = function () {
129
- if (typeof self === 'undefined') {
130
- return false;
131
- }
132
- var selfContext = self;
133
- return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&
134
- self instanceof selfContext.WorkerGlobalScope);
135
- };
136
- export var isBrowser = function () {
137
- return typeof window !== 'undefined' && typeof window.document !== 'undefined';
138
- };
139
- /**
140
- * transfer the first letter of the keys to lowercase
141
- * @param {Object} obj - the object need to be transferred
142
- * @param {Array} whiteListForItself - whitelist itself from being transferred
143
- * @param {Array} whiteListForChildren - whitelist its children keys from being transferred
144
- */
145
- export var transferKeyToLowerCase = function (obj, whiteListForItself, whiteListForChildren) {
146
- if (whiteListForItself === void 0) { whiteListForItself = []; }
147
- if (whiteListForChildren === void 0) { whiteListForChildren = []; }
148
- if (!isStrictObject(obj))
149
- return obj;
150
- var ret = {};
151
- for (var key in obj) {
152
- if (obj.hasOwnProperty(key)) {
153
- var transferedKey = whiteListForItself.includes(key)
154
- ? key
155
- : key[0].toLowerCase() + key.slice(1);
156
- ret[transferedKey] = whiteListForChildren.includes(key)
157
- ? obj[key]
158
- : transferKeyToLowerCase(obj[key], whiteListForItself, whiteListForChildren);
159
- }
160
- }
161
- return ret;
162
- };
163
- /**
164
- * transfer the first letter of the keys to lowercase
165
- * @param {Object} obj - the object need to be transferred
166
- * @param {Array} whiteListForItself - whitelist itself from being transferred
167
- * @param {Array} whiteListForChildren - whitelist its children keys from being transferred
168
- */
169
- export var transferKeyToUpperCase = function (obj, whiteListForItself, whiteListForChildren) {
170
- if (whiteListForItself === void 0) { whiteListForItself = []; }
171
- if (whiteListForChildren === void 0) { whiteListForChildren = []; }
172
- if (!isStrictObject(obj))
173
- return obj;
174
- var ret = {};
175
- for (var key in obj) {
176
- if (obj.hasOwnProperty(key)) {
177
- var transferredKey = whiteListForItself.includes(key)
178
- ? key
179
- : key[0].toUpperCase() + key.slice(1);
180
- ret[transferredKey] = whiteListForChildren.includes(key)
181
- ? obj[key]
182
- : transferKeyToUpperCase(obj[key], whiteListForItself, whiteListForChildren);
183
- }
184
- }
185
- return ret;
186
- };
187
- /**
188
- * Return true if the object is a strict object
189
- * which means it's not Array, Function, Number, String, Boolean or Null
190
- * @param obj the Object
191
- */
192
- export var isStrictObject = function (obj) {
193
- return (obj instanceof Object &&
194
- !(obj instanceof Array) &&
195
- !(obj instanceof Function) &&
196
- !(obj instanceof Number) &&
197
- !(obj instanceof String) &&
198
- !(obj instanceof Boolean));
199
- };
@@ -1,13 +0,0 @@
1
- import Observable from 'zen-observable-ts';
2
- type NetworkStatus = {
3
- online: boolean;
4
- };
5
- export default class ReachabilityNavigator implements Reachability {
6
- private static _observers;
7
- networkMonitor(netInfo?: any): Observable<NetworkStatus>;
8
- private static _observerOverride;
9
- }
10
- interface Reachability {
11
- networkMonitor(netInfo?: any): Observable<NetworkStatus>;
12
- }
13
- export {};
@@ -1,64 +0,0 @@
1
- var __values = (this && this.__values) || function(o) {
2
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
- if (m) return m.call(o);
4
- if (o && typeof o.length === "number") return {
5
- next: function () {
6
- if (o && i >= o.length) o = void 0;
7
- return { value: o && o[i++], done: !o };
8
- }
9
- };
10
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
- };
12
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
- // SPDX-License-Identifier: Apache-2.0
14
- import Observable from 'zen-observable-ts';
15
- import { isWebWorker } from './JS';
16
- var ReachabilityNavigator = /** @class */ (function () {
17
- function ReachabilityNavigator() {
18
- }
19
- ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
20
- var globalObj = isWebWorker() ? self : window;
21
- return new Observable(function (observer) {
22
- observer.next({ online: globalObj.navigator.onLine });
23
- var notifyOnline = function () { return observer.next({ online: true }); };
24
- var notifyOffline = function () { return observer.next({ online: false }); };
25
- globalObj.addEventListener('online', notifyOnline);
26
- globalObj.addEventListener('offline', notifyOffline);
27
- ReachabilityNavigator._observers.push(observer);
28
- return function () {
29
- globalObj.removeEventListener('online', notifyOnline);
30
- globalObj.removeEventListener('offline', notifyOffline);
31
- ReachabilityNavigator._observers =
32
- ReachabilityNavigator._observers.filter(function (_observer) { return _observer !== observer; });
33
- };
34
- });
35
- };
36
- // expose observers to simulate offline mode for integration testing
37
- ReachabilityNavigator._observerOverride = function (status) {
38
- var e_1, _a;
39
- var _loop_1 = function (observer) {
40
- if (observer.closed) {
41
- ReachabilityNavigator._observers =
42
- ReachabilityNavigator._observers.filter(function (_observer) { return _observer !== observer; });
43
- return "continue";
44
- }
45
- observer.next(status);
46
- };
47
- try {
48
- for (var _b = __values(ReachabilityNavigator._observers), _c = _b.next(); !_c.done; _c = _b.next()) {
49
- var observer = _c.value;
50
- _loop_1(observer);
51
- }
52
- }
53
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
54
- finally {
55
- try {
56
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
57
- }
58
- finally { if (e_1) throw e_1.error; }
59
- }
60
- };
61
- ReachabilityNavigator._observers = [];
62
- return ReachabilityNavigator;
63
- }());
64
- export default ReachabilityNavigator;
@@ -1,12 +0,0 @@
1
- import Observable from 'zen-observable-ts';
2
- import type NetInfo from '@react-native-community/netinfo';
3
- type NetworkStatus = {
4
- online: boolean;
5
- };
6
- export default class ReachabilityNavigator implements Reachability {
7
- networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
8
- }
9
- interface Reachability {
10
- networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
11
- }
12
- export {};
@@ -1,21 +0,0 @@
1
- import { DelayFunction } from '../types';
2
- export declare class NonRetryableError extends Error {
3
- readonly nonRetryable = true;
4
- constructor(message: string);
5
- }
6
- export declare const isNonRetryableError: (obj: any) => obj is NonRetryableError;
7
- /**
8
- * @private
9
- * Internal use of Amplify only
10
- */
11
- export declare function retry<T>(functionToRetry: (...args: any[]) => T, args: any[], delayFn: DelayFunction, onTerminate?: Promise<void>): Promise<T>;
12
- /**
13
- * @private
14
- * Internal use of Amplify only
15
- */
16
- export declare function jitteredBackoff(maxDelayMs?: number): DelayFunction;
17
- /**
18
- * @private
19
- * Internal use of Amplify only
20
- */
21
- export declare const jitteredExponentialRetry: <T>(functionToRetry: (...args: any[]) => T, args: any[], maxDelayMs?: number, onTerminate?: Promise<void>) => Promise<T>;
@@ -1,198 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- };
25
- var __generator = (this && this.__generator) || function (thisArg, body) {
26
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
- function verb(n) { return function (v) { return step([n, v]); }; }
29
- function step(op) {
30
- if (f) throw new TypeError("Generator is already executing.");
31
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
- 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;
33
- if (y = 0, t) op = [op[0] & 2, t.value];
34
- switch (op[0]) {
35
- case 0: case 1: t = op; break;
36
- case 4: _.label++; return { value: op[1], done: false };
37
- case 5: _.label++; y = op[1]; op = [0]; continue;
38
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
- default:
40
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
- if (t[2]) _.ops.pop();
45
- _.trys.pop(); continue;
46
- }
47
- op = body.call(thisArg, _);
48
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
- }
51
- };
52
- var __read = (this && this.__read) || function (o, n) {
53
- var m = typeof Symbol === "function" && o[Symbol.iterator];
54
- if (!m) return o;
55
- var i = m.call(o), r, ar = [], e;
56
- try {
57
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
58
- }
59
- catch (error) { e = { error: error }; }
60
- finally {
61
- try {
62
- if (r && !r.done && (m = i["return"])) m.call(i);
63
- }
64
- finally { if (e) throw e.error; }
65
- }
66
- return ar;
67
- };
68
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
69
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
70
- if (ar || !(i in from)) {
71
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
72
- ar[i] = from[i];
73
- }
74
- }
75
- return to.concat(ar || Array.prototype.slice.call(from));
76
- };
77
- import { ConsoleLogger as Logger } from '../Logger/ConsoleLogger';
78
- var logger = new Logger('Util');
79
- var NonRetryableError = /** @class */ (function (_super) {
80
- __extends(NonRetryableError, _super);
81
- function NonRetryableError(message) {
82
- var _this = _super.call(this, message) || this;
83
- _this.nonRetryable = true;
84
- return _this;
85
- }
86
- return NonRetryableError;
87
- }(Error));
88
- export { NonRetryableError };
89
- export var isNonRetryableError = function (obj) {
90
- var key = 'nonRetryable';
91
- return obj && obj[key];
92
- };
93
- /**
94
- * @private
95
- * Internal use of Amplify only
96
- */
97
- export function retry(functionToRetry, args, delayFn, onTerminate) {
98
- return __awaiter(this, void 0, void 0, function () {
99
- var _this = this;
100
- return __generator(this, function (_a) {
101
- if (typeof functionToRetry !== 'function') {
102
- throw Error('functionToRetry must be a function');
103
- }
104
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
105
- var attempt, terminated, timeout, wakeUp, lastError, _loop_1, state_1;
106
- return __generator(this, function (_a) {
107
- switch (_a.label) {
108
- case 0:
109
- attempt = 0;
110
- terminated = false;
111
- wakeUp = function () { };
112
- onTerminate &&
113
- onTerminate.then(function () {
114
- // signal not to try anymore.
115
- terminated = true;
116
- // stop sleeping if we're sleeping.
117
- clearTimeout(timeout);
118
- wakeUp();
119
- });
120
- _loop_1 = function () {
121
- var _b, _c, err_1, retryIn_1;
122
- return __generator(this, function (_d) {
123
- switch (_d.label) {
124
- case 0:
125
- attempt++;
126
- logger.debug("".concat(functionToRetry.name, " attempt #").concat(attempt, " with this vars: ").concat(JSON.stringify(args)));
127
- _d.label = 1;
128
- case 1:
129
- _d.trys.push([1, 3, , 7]);
130
- _b = {};
131
- _c = resolve;
132
- return [4 /*yield*/, functionToRetry.apply(void 0, __spreadArray([], __read(args), false))];
133
- case 2: return [2 /*return*/, (_b.value = _c.apply(void 0, [_d.sent()]), _b)];
134
- case 3:
135
- err_1 = _d.sent();
136
- lastError = err_1;
137
- logger.debug("error on ".concat(functionToRetry.name), err_1);
138
- if (isNonRetryableError(err_1)) {
139
- logger.debug("".concat(functionToRetry.name, " non retryable error"), err_1);
140
- return [2 /*return*/, { value: reject(err_1) }];
141
- }
142
- retryIn_1 = delayFn(attempt, args, err_1);
143
- logger.debug("".concat(functionToRetry.name, " retrying in ").concat(retryIn_1, " ms"));
144
- if (!(retryIn_1 === false || terminated)) return [3 /*break*/, 4];
145
- return [2 /*return*/, { value: reject(err_1) }];
146
- case 4: return [4 /*yield*/, new Promise(function (r) {
147
- wakeUp = r; // export wakeUp for onTerminate handling
148
- timeout = setTimeout(wakeUp, retryIn_1);
149
- })];
150
- case 5:
151
- _d.sent();
152
- _d.label = 6;
153
- case 6: return [3 /*break*/, 7];
154
- case 7: return [2 /*return*/];
155
- }
156
- });
157
- };
158
- _a.label = 1;
159
- case 1:
160
- if (!!terminated) return [3 /*break*/, 3];
161
- return [5 /*yield**/, _loop_1()];
162
- case 2:
163
- state_1 = _a.sent();
164
- if (typeof state_1 === "object")
165
- return [2 /*return*/, state_1.value];
166
- return [3 /*break*/, 1];
167
- case 3:
168
- // reached if terminated while waiting for a timer.
169
- reject(lastError);
170
- return [2 /*return*/];
171
- }
172
- });
173
- }); })];
174
- });
175
- });
176
- }
177
- var MAX_DELAY_MS = 5 * 60 * 1000;
178
- /**
179
- * @private
180
- * Internal use of Amplify only
181
- */
182
- export function jitteredBackoff(maxDelayMs) {
183
- if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }
184
- var BASE_TIME_MS = 100;
185
- var JITTER_FACTOR = 100;
186
- return function (attempt) {
187
- var delay = Math.pow(2, attempt) * BASE_TIME_MS + JITTER_FACTOR * Math.random();
188
- return delay > maxDelayMs ? false : delay;
189
- };
190
- }
191
- /**
192
- * @private
193
- * Internal use of Amplify only
194
- */
195
- export var jitteredExponentialRetry = function (functionToRetry, args, maxDelayMs, onTerminate) {
196
- if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }
197
- return retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);
198
- };
@@ -1,12 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export function urlSafeEncode(str) {
4
- return str
5
- .split('')
6
- .map(function (char) { return char.charCodeAt(0).toString(16).padStart(2, '0'); })
7
- .join('');
8
- }
9
- export function urlSafeDecode(hex) {
10
- var matchArr = hex.match(/.{2}/g) || [];
11
- return matchArr.map(function (char) { return String.fromCharCode(parseInt(char, 16)); }).join('');
12
- }
@@ -1,2 +0,0 @@
1
- import { ErrorParams } from '../../types';
2
- export declare function asserts(assertion: boolean, errorParams: ErrorParams): asserts assertion;
@@ -1,7 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { AmplifyError } from '../Errors';
4
- export function asserts(assertion, errorParams) {
5
- if (!assertion)
6
- throw new AmplifyError(errorParams);
7
- }
@@ -1,7 +0,0 @@
1
- export { NonRetryableError, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, } from './Retry';
2
- export { default as Mutex } from './Mutex';
3
- export { default as Reachability } from './Reachability';
4
- export { DateUtils } from './DateUtils';
5
- export { urlSafeDecode, urlSafeEncode } from './StringUtils';
6
- export { AWS_CLOUDWATCH_CATEGORY, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
7
- export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
@@ -1,9 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export { NonRetryableError, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, } from './Retry';
4
- export { default as Mutex } from './Mutex';
5
- export { default as Reachability } from './Reachability';
6
- export { DateUtils } from './DateUtils';
7
- export { urlSafeDecode, urlSafeEncode } from './StringUtils';
8
- export { AWS_CLOUDWATCH_CATEGORY, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
9
- export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
@@ -1,5 +0,0 @@
1
- import '@aws-amplify/core/polyfills/URL';
2
- export { signRequest } from './signRequest';
3
- export { presignUrl } from './presignUrl';
4
- export { TOKEN_QUERY_PARAM } from './constants';
5
- export { getHashedPayload } from './utils/getHashedPayload';
@@ -1,8 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import '@aws-amplify/core/polyfills/URL';
4
- // TODO: V6 replace Signer
5
- export { signRequest } from './signRequest';
6
- export { presignUrl } from './presignUrl';
7
- export { TOKEN_QUERY_PARAM } from './constants';
8
- export { getHashedPayload } from './utils/getHashedPayload';
@@ -1,14 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * TODO: [v6] remove this polyfill.
5
- *
6
- * The `react-native-url-polyfill` package needs to be bundled because it's
7
- * a commonjs package that would break the users' Jest unit tests, where MJS
8
- * is not supported by default.
9
- */
10
- /*if (process?.env?.NODE_ENV !== 'test') {
11
- // Loading this polyfill in customers' unit tests will cause undefined
12
- // variable error in un-mocked react-native package.
13
- require('react-native-url-polyfill/auto');
14
- }*/
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowSyntheticDefaultImports": true,
4
- "noImplicitAny": true,
5
- "module": "es6",
6
- "target": "es5",
7
- "allowJs": true
8
- },
9
- "files": ["index.ts"]
10
- }
@@ -1,43 +0,0 @@
1
- const path = require('path');
2
-
3
- const rnUrlPolyfillPath = require.resolve('react-native-url-polyfill');
4
- const rnUrlPolyfillMeta = require(path.join(
5
- path.dirname(rnUrlPolyfillPath),
6
- 'package.json'
7
- ));
8
- const rnUrlPolyfillDeps = Object.keys({
9
- ...rnUrlPolyfillMeta.dependencies,
10
- ...rnUrlPolyfillMeta.peerDependencies,
11
- });
12
- const rnUrlPolyfillDepsRegex = rnUrlPolyfillDeps.map(
13
- name => new RegExp(`^${name}\/?`) // match name with optional trailing slash
14
- );
15
-
16
- module.exports = {
17
- name: 'index',
18
- context: path.resolve(__dirname),
19
- entry: {
20
- index: path.join(__dirname, 'index.ts'),
21
- },
22
- output: {
23
- path: path.resolve(__dirname),
24
- filename: '[name].js',
25
- library: {
26
- type: 'commonjs',
27
- },
28
- },
29
- module: {
30
- rules: [
31
- {
32
- test: /\.(ts|tsx)$/i,
33
- loader: 'ts-loader',
34
- exclude: ['/node_modules/'],
35
- },
36
- ],
37
- },
38
- resolve: {
39
- extensions: ['.tsx', '.ts', '.jsx', '.js'],
40
- },
41
- externals: rnUrlPolyfillDepsRegex,
42
- mode: 'production',
43
- };