@aws-amplify/core 6.0.1-console-preview.5f040a2.0 → 6.0.1-console-preview.23dc225.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 (260) hide show
  1. package/lib/Cache/StorageCache.d.ts +14 -31
  2. package/lib/Cache/StorageCache.js +97 -102
  3. package/lib/Cache/StorageCache.native.d.ts +19 -0
  4. package/lib/Cache/StorageCache.native.js +164 -0
  5. package/lib/Cache/{AsyncStorageCache.d.ts → StorageCacheCommon.d.ts} +124 -99
  6. package/lib/Cache/{AsyncStorageCache.js → StorageCacheCommon.js} +497 -432
  7. package/lib/Cache/constants.d.ts +6 -0
  8. package/lib/Cache/constants.js +17 -0
  9. package/lib/Cache/index.d.ts +2 -0
  10. package/lib/Cache/index.js +7 -0
  11. package/lib/Cache/types/cache.d.ts +38 -0
  12. package/lib/Cache/types/index.d.ts +1 -1
  13. package/lib/Cache/types/index.js +1 -1
  14. package/lib/Cache/{Utils → utils}/CacheList.d.ts +1 -1
  15. package/lib/Cache/{Utils → utils}/CacheList.js +2 -1
  16. package/lib/Cache/utils/cacheHelpers.d.ts +14 -0
  17. package/lib/Cache/utils/cacheHelpers.js +51 -0
  18. package/lib/Cache/{Utils → utils}/errorHelpers.d.ts +0 -1
  19. package/lib/Cache/{Utils → utils}/errorHelpers.js +0 -4
  20. package/lib/Cache/utils/index.d.ts +2 -0
  21. package/lib/Cache/utils/index.js +12 -0
  22. package/lib/Hub/index.d.ts +7 -0
  23. package/lib/Hub/index.js +8 -1
  24. package/lib/Platform/customUserAgent.d.ts +16 -0
  25. package/lib/Platform/customUserAgent.js +70 -0
  26. package/lib/Platform/index.js +10 -1
  27. package/lib/Platform/types.d.ts +33 -1
  28. package/lib/Platform/types.js +1 -0
  29. package/lib/Platform/version.d.ts +1 -1
  30. package/lib/Platform/version.js +1 -1
  31. package/lib/Reachability/Reachability.d.ts +1 -0
  32. package/lib/Reachability/Reachability.js +36 -0
  33. package/lib/Signer/Signer.js +3 -2
  34. package/lib/awsClients/cognitoIdentity/base.js +2 -1
  35. package/lib/awsClients/pinpoint/base.js +2 -1
  36. package/lib/awsClients/pinpoint/getInAppMessages.js +2 -1
  37. package/lib/awsClients/pinpoint/putEvents.js +2 -1
  38. package/lib/awsClients/pinpoint/updateEndpoint.js +2 -1
  39. package/lib/clients/middleware/signing/signer/signatureV4/index.d.ts +0 -1
  40. package/lib/clients/middleware/signing/signer/signatureV4/index.js +0 -1
  41. package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +2 -1
  42. package/lib/index.d.ts +2 -5
  43. package/lib/index.js +3 -6
  44. package/lib/libraryUtils.d.ts +7 -5
  45. package/lib/libraryUtils.js +11 -6
  46. package/lib/parseAWSExports.js +75 -14
  47. package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -2
  48. package/lib/providers/pinpoint/apis/record.js +3 -3
  49. package/lib/providers/pinpoint/apis/updateEndpoint.js +6 -6
  50. package/lib/singleton/API/types.d.ts +4 -3
  51. package/lib/singleton/Amplify.d.ts +2 -2
  52. package/lib/singleton/Amplify.js +6 -5
  53. package/lib/singleton/Auth/types.d.ts +28 -1
  54. package/lib/singleton/Cache/types.d.ts +18 -0
  55. package/lib/singleton/Cache/types.js +4 -0
  56. package/lib/singleton/types.d.ts +3 -1
  57. package/lib/storage/DefaultStorage.js +1 -1
  58. package/lib/storage/utils.d.ts +1 -1
  59. package/lib/storage/utils.js +3 -3
  60. package/lib/tsconfig.tsbuildinfo +1 -1
  61. package/lib/utils/amplifyUrl/index.d.ts +13 -0
  62. package/lib/utils/amplifyUrl/index.js +10 -0
  63. package/lib/utils/amplifyUrl/polyfill.d.ts +0 -0
  64. package/lib/utils/amplifyUrl/polyfill.js +4 -0
  65. package/lib/utils/amplifyUrl/polyfill.native.d.ts +1 -0
  66. package/lib/utils/amplifyUuid/index.d.ts +3 -0
  67. package/lib/utils/amplifyUuid/index.js +9 -0
  68. package/lib/utils/amplifyUuid/polyfill.d.ts +0 -0
  69. package/lib/utils/amplifyUuid/polyfill.js +4 -0
  70. package/lib/utils/amplifyUuid/polyfill.native.d.ts +1 -0
  71. package/lib/utils/amplifyUuid/polyfill.native.js +6 -0
  72. package/lib/utils/deepFreeze.d.ts +1 -0
  73. package/lib/utils/deepFreeze.js +38 -0
  74. package/lib/{ClientDevice/android.d.ts → utils/getClientInfo/getClientInfo.android.d.ts} +1 -1
  75. package/lib/{ClientDevice/android.js → utils/getClientInfo/getClientInfo.android.js} +4 -4
  76. package/lib/{ClientDevice/browser.d.ts → utils/getClientInfo/getClientInfo.d.ts} +1 -9
  77. package/lib/{ClientDevice/ios.d.ts → utils/getClientInfo/getClientInfo.ios.d.ts} +1 -1
  78. package/lib/{ClientDevice/ios.js → utils/getClientInfo/getClientInfo.ios.js} +4 -4
  79. package/lib/{ClientDevice/browser.js → utils/getClientInfo/getClientInfo.js} +6 -18
  80. package/lib/utils/getClientInfo/index.d.ts +1 -0
  81. package/lib/utils/getClientInfo/index.js +7 -0
  82. package/lib/utils/index.d.ts +2 -0
  83. package/lib/utils/index.js +5 -1
  84. package/lib-esm/Cache/StorageCache.d.ts +14 -31
  85. package/lib-esm/Cache/StorageCache.js +97 -102
  86. package/lib-esm/Cache/StorageCache.native.d.ts +19 -0
  87. package/lib-esm/Cache/StorageCache.native.js +161 -0
  88. package/lib-esm/Cache/{AsyncStorageCache.d.ts → StorageCacheCommon.d.ts} +124 -99
  89. package/lib-esm/Cache/{AsyncStorageCache.js → StorageCacheCommon.js} +496 -430
  90. package/lib-esm/Cache/constants.d.ts +6 -0
  91. package/lib-esm/Cache/constants.js +14 -0
  92. package/lib-esm/Cache/index.d.ts +2 -0
  93. package/lib-esm/Cache/index.js +4 -0
  94. package/lib-esm/Cache/types/cache.d.ts +38 -0
  95. package/lib-esm/Cache/types/index.d.ts +1 -1
  96. package/lib-esm/Cache/types/index.js +1 -1
  97. package/lib-esm/Cache/{Utils → utils}/CacheList.d.ts +1 -1
  98. package/lib-esm/Cache/{Utils → utils}/CacheList.js +1 -1
  99. package/lib-esm/Cache/utils/cacheHelpers.d.ts +14 -0
  100. package/lib-esm/Cache/utils/cacheHelpers.js +44 -0
  101. package/lib-esm/Cache/{Utils → utils}/errorHelpers.d.ts +0 -1
  102. package/lib-esm/Cache/{Utils → utils}/errorHelpers.js +0 -4
  103. package/lib-esm/Cache/utils/index.d.ts +2 -0
  104. package/lib-esm/Cache/utils/index.js +4 -0
  105. package/lib-esm/Hub/index.d.ts +7 -0
  106. package/lib-esm/Hub/index.js +7 -0
  107. package/lib-esm/Platform/customUserAgent.d.ts +16 -0
  108. package/lib-esm/Platform/customUserAgent.js +65 -0
  109. package/lib-esm/Platform/index.js +10 -1
  110. package/lib-esm/Platform/types.d.ts +33 -1
  111. package/lib-esm/Platform/types.js +1 -0
  112. package/lib-esm/Platform/version.d.ts +1 -1
  113. package/lib-esm/Platform/version.js +1 -1
  114. package/lib-esm/Reachability/Reachability.d.ts +1 -0
  115. package/lib-esm/Reachability/Reachability.js +36 -0
  116. package/lib-esm/Signer/Signer.js +3 -2
  117. package/lib-esm/awsClients/cognitoIdentity/base.js +2 -1
  118. package/lib-esm/awsClients/pinpoint/base.js +2 -1
  119. package/lib-esm/awsClients/pinpoint/getInAppMessages.js +2 -1
  120. package/lib-esm/awsClients/pinpoint/putEvents.js +2 -1
  121. package/lib-esm/awsClients/pinpoint/updateEndpoint.js +2 -1
  122. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.d.ts +0 -1
  123. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +0 -1
  124. package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +2 -1
  125. package/lib-esm/index.d.ts +2 -5
  126. package/lib-esm/index.js +1 -4
  127. package/lib-esm/libraryUtils.d.ts +7 -5
  128. package/lib-esm/libraryUtils.js +5 -3
  129. package/lib-esm/parseAWSExports.js +75 -14
  130. package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -2
  131. package/lib-esm/providers/pinpoint/apis/record.js +3 -3
  132. package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +6 -6
  133. package/lib-esm/singleton/API/types.d.ts +4 -3
  134. package/lib-esm/singleton/Amplify.d.ts +2 -2
  135. package/lib-esm/singleton/Amplify.js +6 -5
  136. package/lib-esm/singleton/Auth/types.d.ts +28 -1
  137. package/lib-esm/singleton/Cache/types.d.ts +18 -0
  138. package/lib-esm/singleton/Cache/types.js +3 -0
  139. package/lib-esm/singleton/types.d.ts +3 -1
  140. package/lib-esm/storage/DefaultStorage.js +2 -2
  141. package/lib-esm/storage/utils.d.ts +1 -1
  142. package/lib-esm/storage/utils.js +1 -1
  143. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  144. package/lib-esm/utils/amplifyUrl/index.d.ts +13 -0
  145. package/lib-esm/utils/amplifyUrl/index.js +6 -0
  146. package/lib-esm/utils/amplifyUuid/index.d.ts +3 -0
  147. package/lib-esm/utils/amplifyUuid/index.js +6 -0
  148. package/lib-esm/utils/amplifyUuid/polyfill.native.js +4 -0
  149. package/lib-esm/utils/deepFreeze.d.ts +1 -0
  150. package/lib-esm/utils/deepFreeze.js +34 -0
  151. package/lib-esm/{ClientDevice/android.d.ts → utils/getClientInfo/getClientInfo.android.d.ts} +1 -1
  152. package/lib-esm/{ClientDevice/android.js → utils/getClientInfo/getClientInfo.android.js} +2 -2
  153. package/lib-esm/{ClientDevice/browser.d.ts → utils/getClientInfo/getClientInfo.d.ts} +1 -9
  154. package/lib-esm/{ClientDevice/ios.d.ts → utils/getClientInfo/getClientInfo.ios.d.ts} +1 -1
  155. package/lib-esm/{ClientDevice/ios.js → utils/getClientInfo/getClientInfo.ios.js} +2 -2
  156. package/lib-esm/{ClientDevice/browser.js → utils/getClientInfo/getClientInfo.js} +4 -14
  157. package/lib-esm/utils/getClientInfo/index.d.ts +1 -0
  158. package/lib-esm/utils/getClientInfo/index.js +3 -0
  159. package/lib-esm/utils/index.d.ts +2 -0
  160. package/lib-esm/utils/index.js +2 -0
  161. package/package.json +7 -17
  162. package/src/Cache/StorageCache.native.ts +65 -0
  163. package/src/Cache/StorageCache.ts +61 -158
  164. package/src/Cache/StorageCacheCommon.ts +581 -0
  165. package/src/Cache/constants.ts +18 -0
  166. package/src/Cache/index.ts +6 -0
  167. package/src/Cache/types/cache.ts +51 -0
  168. package/src/Cache/types/index.ts +1 -1
  169. package/src/Cache/{Utils → utils}/CacheList.ts +185 -185
  170. package/src/Cache/utils/cacheHelpers.ts +52 -0
  171. package/src/Cache/{Utils → utils}/errorHelpers.ts +0 -4
  172. package/src/Cache/{Utils → utils}/index.ts +4 -5
  173. package/src/Hub/index.ts +8 -0
  174. package/src/Platform/customUserAgent.ts +75 -0
  175. package/src/Platform/index.ts +14 -1
  176. package/src/Platform/types.ts +45 -1
  177. package/src/Platform/version.ts +1 -1
  178. package/src/Reachability/Reachability.ts +14 -0
  179. package/src/Signer/Signer.ts +3 -2
  180. package/src/awsClients/cognitoIdentity/base.ts +4 -1
  181. package/src/awsClients/pinpoint/base.ts +2 -1
  182. package/src/awsClients/pinpoint/getInAppMessages.ts +2 -1
  183. package/src/awsClients/pinpoint/putEvents.ts +2 -1
  184. package/src/awsClients/pinpoint/updateEndpoint.ts +2 -1
  185. package/src/clients/middleware/signing/signer/signatureV4/index.ts +0 -2
  186. package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +2 -1
  187. package/src/index.ts +3 -4
  188. package/src/libraryUtils.ts +17 -10
  189. package/src/parseAWSExports.ts +76 -13
  190. package/src/providers/pinpoint/apis/flushEvents.ts +2 -2
  191. package/src/providers/pinpoint/apis/record.ts +3 -3
  192. package/src/providers/pinpoint/apis/updateEndpoint.ts +6 -6
  193. package/src/singleton/API/types.ts +4 -3
  194. package/src/singleton/Amplify.ts +10 -8
  195. package/src/singleton/Auth/types.ts +50 -1
  196. package/src/singleton/Cache/types.ts +27 -0
  197. package/src/singleton/types.ts +3 -1
  198. package/src/storage/DefaultStorage.ts +2 -2
  199. package/src/storage/utils.ts +1 -1
  200. package/src/utils/amplifyUrl/index.ts +9 -0
  201. package/src/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.ts → utils/amplifyUrl/polyfill.native.ts} +1 -0
  202. package/src/utils/amplifyUuid/index.ts +9 -0
  203. package/src/utils/amplifyUuid/polyfill.native.ts +6 -0
  204. package/src/utils/amplifyUuid/polyfill.ts +4 -0
  205. package/src/utils/deepFreeze.ts +16 -0
  206. package/src/{ClientDevice/android.ts → utils/getClientInfo/getClientInfo.android.ts} +2 -2
  207. package/src/{ClientDevice/ios.ts → utils/getClientInfo/getClientInfo.ios.ts} +3 -3
  208. package/src/{ClientDevice/browser.ts → utils/getClientInfo/getClientInfo.ts} +4 -16
  209. package/src/utils/getClientInfo/index.ts +4 -0
  210. package/src/utils/index.ts +2 -0
  211. package/lib/Cache/BrowserStorageCache.d.ts +0 -166
  212. package/lib/Cache/BrowserStorageCache.js +0 -456
  213. package/lib/Cache/InMemoryCache.d.ts +0 -129
  214. package/lib/Cache/InMemoryCache.js +0 -342
  215. package/lib/Cache/Utils/CacheUtils.d.ts +0 -25
  216. package/lib/Cache/Utils/CacheUtils.js +0 -86
  217. package/lib/Cache/Utils/index.d.ts +0 -2
  218. package/lib/Cache/Utils/index.js +0 -16
  219. package/lib/Cache/reactnative.d.ts +0 -3
  220. package/lib/Cache/reactnative.js +0 -8
  221. package/lib/Cache/types/Cache.d.ts +0 -55
  222. package/lib/ClientDevice/index.d.ts +0 -23
  223. package/lib/ClientDevice/index.js +0 -18
  224. package/lib/ClientDevice/reactnative.d.ts +0 -7
  225. package/lib/ClientDevice/reactnative.js +0 -24
  226. package/lib-esm/Cache/BrowserStorageCache.d.ts +0 -166
  227. package/lib-esm/Cache/BrowserStorageCache.js +0 -453
  228. package/lib-esm/Cache/InMemoryCache.d.ts +0 -129
  229. package/lib-esm/Cache/InMemoryCache.js +0 -339
  230. package/lib-esm/Cache/Utils/CacheUtils.d.ts +0 -25
  231. package/lib-esm/Cache/Utils/CacheUtils.js +0 -79
  232. package/lib-esm/Cache/Utils/index.d.ts +0 -2
  233. package/lib-esm/Cache/Utils/index.js +0 -4
  234. package/lib-esm/Cache/reactnative.d.ts +0 -3
  235. package/lib-esm/Cache/reactnative.js +0 -6
  236. package/lib-esm/Cache/types/Cache.d.ts +0 -55
  237. package/lib-esm/ClientDevice/index.d.ts +0 -23
  238. package/lib-esm/ClientDevice/index.js +0 -15
  239. package/lib-esm/ClientDevice/reactnative.d.ts +0 -7
  240. package/lib-esm/ClientDevice/reactnative.js +0 -21
  241. package/src/Cache/AsyncStorageCache.ts +0 -495
  242. package/src/Cache/BrowserStorageCache.ts +0 -504
  243. package/src/Cache/CHANGELOG.md +0 -1239
  244. package/src/Cache/InMemoryCache.ts +0 -347
  245. package/src/Cache/Utils/CacheUtils.ts +0 -90
  246. package/src/Cache/reactnative.ts +0 -9
  247. package/src/Cache/types/Cache.ts +0 -75
  248. package/src/ClientDevice/index.ts +0 -14
  249. package/src/ClientDevice/reactnative.ts +0 -18
  250. package/lib/Cache/types/{Cache.js → cache.js} +0 -0
  251. package/lib/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.js → utils/amplifyUrl/polyfill.native.js} +1 -1
  252. /package/lib-esm/Cache/types/{Cache.js → cache.js} +0 -0
  253. /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.d.ts → utils/amplifyUrl/polyfill.d.ts} +0 -0
  254. /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.js → utils/amplifyUrl/polyfill.js} +0 -0
  255. /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.d.ts → utils/amplifyUrl/polyfill.native.d.ts} +0 -0
  256. /package/lib-esm/{clients/middleware/signing/signer/signatureV4/polyfills/index.native.js → utils/amplifyUrl/polyfill.native.js} +0 -0
  257. /package/{lib/clients/middleware/signing/signer/signatureV4/polyfills/index.d.ts → lib-esm/utils/amplifyUuid/polyfill.d.ts} +0 -0
  258. /package/{lib/clients/middleware/signing/signer/signatureV4/polyfills/index.js → lib-esm/utils/amplifyUuid/polyfill.js} +0 -0
  259. /package/{lib/clients/middleware/signing/signer/signatureV4/polyfills/index.native.d.ts → lib-esm/utils/amplifyUuid/polyfill.native.d.ts} +0 -0
  260. /package/src/{clients/middleware/signing/signer/signatureV4/polyfills/index.ts → utils/amplifyUrl/polyfill.ts} +0 -0
@@ -1,15 +1,17 @@
1
1
  export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
2
2
  export { parseAWSExports } from './parseAWSExports';
3
3
  export { LegacyConfig } from './singleton/types';
4
- export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, } from './singleton/Auth/types';
4
+ export { amplifyUuid } from './utils/amplifyUuid';
5
+ export { AmplifyUrl, AmplifyUrlSearchParams } from './utils/amplifyUrl';
5
6
  export { decodeJWT, assertTokenProviderConfig, assertIdentityPoolIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
6
7
  export { isTokenExpired } from './singleton/Auth';
7
- export { APIAuthMode, DocumentType } from './singleton/API/types';
8
+ export { GraphQLAuthMode, DocumentType } from './singleton/API/types';
8
9
  export { Signer } from './Signer';
10
+ export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, AuthStandardAttributeKey, AuthVerifiableAttributeKey, AWSCredentials } from './singleton/Auth/types';
9
11
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
10
- export { ClientDevice } from './ClientDevice';
11
12
  export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
12
- export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
13
+ export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, SetCustomUserAgentInput, } from './Platform/types';
14
+ export { setCustomUserAgent } from './Platform/customUserAgent';
13
15
  export { ServiceWorker } from './ServiceWorker';
14
16
  export { BackgroundProcessManager } from './BackgroundProcessManager';
15
17
  export { Mutex } from './Mutex';
@@ -21,4 +23,4 @@ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
21
23
  export { AMPLIFY_SYMBOL } from './Hub';
22
24
  export { base64Decoder, base64Encoder } from './utils/convert';
23
25
  export { getCrypto } from './utils/globalHelpers';
24
- export { HubClass } from './Hub';
26
+ export { HubInternal } from './Hub';
@@ -7,16 +7,18 @@ utils for use throughout the library.
7
7
  // Core utilities
8
8
  export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
9
9
  export { parseAWSExports } from './parseAWSExports';
10
+ export { amplifyUuid } from './utils/amplifyUuid';
11
+ export { AmplifyUrl, AmplifyUrlSearchParams } from './utils/amplifyUrl';
10
12
  // Auth utilities
11
13
  export { decodeJWT, assertTokenProviderConfig, assertIdentityPoolIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
12
14
  export { isTokenExpired } from './singleton/Auth';
13
15
  export { Signer } from './Signer';
14
16
  // Logging utilities
15
17
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
16
- // Platform & device utils
17
- export { ClientDevice } from './ClientDevice';
18
+ // Platform & user-agent utilities
18
19
  export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
19
20
  export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
21
+ export { setCustomUserAgent } from './Platform/customUserAgent';
20
22
  // Service worker
21
23
  export { ServiceWorker } from './ServiceWorker';
22
24
  // Other utilities & constants
@@ -31,4 +33,4 @@ export { AMPLIFY_SYMBOL } from './Hub';
31
33
  export { base64Decoder, base64Encoder } from './utils/convert';
32
34
  export { getCrypto } from './utils/globalHelpers';
33
35
  // Hub
34
- export { HubClass } from './Hub';
36
+ export { HubInternal } from './Hub';
@@ -9,6 +9,31 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
28
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
29
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
+ if (ar || !(i in from)) {
31
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
+ ar[i] = from[i];
33
+ }
34
+ }
35
+ return to.concat(ar || Array.prototype.slice.call(from));
36
+ };
12
37
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
38
  // SPDX-License-Identifier: Apache-2.0
14
39
  import { ConsoleLogger as Logger } from './Logger';
@@ -30,9 +55,9 @@ var authTypeMapping = {
30
55
  * @returns A {@link ResourcesConfig} object.
31
56
  */
32
57
  export var parseAWSExports = function (config) {
33
- var _a;
58
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
34
59
  if (config === void 0) { config = {}; }
35
- var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
60
+ var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_username_attributes = config.aws_cognito_username_attributes, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
36
61
  var amplifyConfig = {};
37
62
  // Analytics
38
63
  if (aws_mobile_analytics_app_id) {
@@ -46,7 +71,7 @@ export var parseAWSExports = function (config) {
46
71
  // Notifications
47
72
  if (Notifications) {
48
73
  if ((_a = Notifications.InAppMessaging) === null || _a === void 0 ? void 0 : _a.AWSPinpoint) {
49
- var _b = Notifications.InAppMessaging.AWSPinpoint, appId = _b.appId, region = _b.region;
74
+ var _p = Notifications.InAppMessaging.AWSPinpoint, appId = _p.appId, region = _p.region;
50
75
  amplifyConfig.Notifications = {
51
76
  InAppMessaging: {
52
77
  Pinpoint: {
@@ -73,12 +98,50 @@ export var parseAWSExports = function (config) {
73
98
  };
74
99
  }
75
100
  // Auth
101
+ var mfaConfig = aws_cognito_mfa_configuration
102
+ ? {
103
+ status: aws_cognito_mfa_configuration &&
104
+ aws_cognito_mfa_configuration.toLowerCase(),
105
+ totpEnabled: (_b = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('TOTP')) !== null && _b !== void 0 ? _b : false,
106
+ smsEnabled: (_c = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('SMS')) !== null && _c !== void 0 ? _c : false,
107
+ }
108
+ : undefined;
109
+ var passwordFormatConfig = aws_cognito_password_protection_settings
110
+ ? {
111
+ minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,
112
+ requireLowercase: (_e = (_d = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _d === void 0 ? void 0 : _d.includes('REQUIRES_LOWERCASE')) !== null && _e !== void 0 ? _e : false,
113
+ requireUppercase: (_g = (_f = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _f === void 0 ? void 0 : _f.includes('REQUIRES_UPPERCASE')) !== null && _g !== void 0 ? _g : false,
114
+ requireNumbers: (_j = (_h = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _h === void 0 ? void 0 : _h.includes('REQUIRES_NUMBERS')) !== null && _j !== void 0 ? _j : false,
115
+ requireSpecialCharacters: (_l = (_k = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _k === void 0 ? void 0 : _k.includes('REQUIRES_SYMBOLS')) !== null && _l !== void 0 ? _l : false,
116
+ }
117
+ : undefined;
118
+ var mergedUserAttributes = Array.from(new Set(__spreadArray(__spreadArray([], __read((aws_cognito_verification_mechanisms !== null && aws_cognito_verification_mechanisms !== void 0 ? aws_cognito_verification_mechanisms : [])), false), __read((aws_cognito_signup_attributes !== null && aws_cognito_signup_attributes !== void 0 ? aws_cognito_signup_attributes : [])), false)));
119
+ var userAttributesConfig = mergedUserAttributes.map(function (s) {
120
+ var _a;
121
+ return (_a = {},
122
+ _a[s.toLowerCase()] = {
123
+ required: true, // All user attributes generated by the CLI will be required
124
+ },
125
+ _a);
126
+ });
127
+ var loginWithEmailEnabled = (_m = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('EMAIL')) !== null && _m !== void 0 ? _m : false;
128
+ var loginWithPhoneEnabled = (_o = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('PHONE_NUMBER')) !== null && _o !== void 0 ? _o : false;
76
129
  if (aws_cognito_identity_pool_id || aws_user_pools_id) {
77
130
  amplifyConfig.Auth = {
78
- Cognito: __assign({ identityPoolId: aws_cognito_identity_pool_id, allowGuestAccess: aws_mandatory_sign_in !== 'enable', signUpVerificationMethod: aws_cognito_sign_up_verification_method, userPoolClientId: aws_user_pools_web_client_id, userPoolId: aws_user_pools_id }, (oauth &&
79
- Object.keys(oauth).length > 0 && {
80
- loginWith: getOAuthConfig(oauth),
81
- })),
131
+ Cognito: {
132
+ identityPoolId: aws_cognito_identity_pool_id,
133
+ allowGuestAccess: aws_mandatory_sign_in !== 'enable',
134
+ signUpVerificationMethod: aws_cognito_sign_up_verification_method,
135
+ userAttributes: userAttributesConfig,
136
+ userPoolClientId: aws_user_pools_web_client_id,
137
+ userPoolId: aws_user_pools_id,
138
+ mfa: mfaConfig,
139
+ passwordFormat: passwordFormatConfig,
140
+ loginWith: __assign({ username: loginWithEmailEnabled || loginWithPhoneEnabled ? false : true, email: loginWithEmailEnabled, phone: loginWithPhoneEnabled }, (oauth &&
141
+ Object.keys(oauth).length > 0 && {
142
+ oauth: getOAuthConfig(oauth),
143
+ })),
144
+ },
82
145
  };
83
146
  }
84
147
  // Storage
@@ -116,12 +179,10 @@ var getRedirectUrl = function (redirectStr) {
116
179
  var getOAuthConfig = function (_a) {
117
180
  var domain = _a.domain, scope = _a.scope, redirectSignIn = _a.redirectSignIn, redirectSignOut = _a.redirectSignOut, responseType = _a.responseType;
118
181
  return ({
119
- oauth: {
120
- domain: domain,
121
- scopes: scope,
122
- redirectSignIn: getRedirectUrl(redirectSignIn),
123
- redirectSignOut: getRedirectUrl(redirectSignOut),
124
- responseType: responseType,
125
- },
182
+ domain: domain,
183
+ scopes: scope,
184
+ redirectSignIn: getRedirectUrl(redirectSignIn),
185
+ redirectSignOut: getRedirectUrl(redirectSignOut),
186
+ responseType: responseType,
126
187
  });
127
188
  };
@@ -1,2 +1,2 @@
1
- import { Credentials } from '@aws-sdk/types';
2
- export declare const flushEvents: (appId: string, region: string, credentials: Credentials, identityId?: string, userAgentValue?: string) => void;
1
+ import { AWSCredentials } from '../../../libraryUtils';
2
+ export declare const flushEvents: (appId: string, region: string, credentials: AWSCredentials, identityId?: string, userAgentValue?: string) => void;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
37
37
  }
38
38
  };
39
- import { v4 as uuid } from 'uuid';
39
+ import { amplifyUuid } from '../../../utils/amplifyUuid';
40
40
  import { getEndpointId } from '../utils';
41
41
  import { BUFFER_SIZE, FLUSH_INTERVAL, FLUSH_SIZE, RESEND_LIMIT, } from '../utils/constants';
42
42
  import { updateEndpoint } from './updateEndpoint';
@@ -55,7 +55,7 @@ export var record = function (_a) {
55
55
  switch (_b.label) {
56
56
  case 0:
57
57
  timestampISOString = new Date().toISOString();
58
- eventId = uuid();
58
+ eventId = amplifyUuid();
59
59
  return [4 /*yield*/, getEndpointId(appId, category)];
60
60
  case 1:
61
61
  endpointId = _b.sent();
@@ -94,7 +94,7 @@ export var record = function (_a) {
94
94
  }
95
95
  // Generate session if required
96
96
  if (!session) {
97
- sessionId = uuid();
97
+ sessionId = amplifyUuid();
98
98
  session = {
99
99
  Id: sessionId,
100
100
  StartTimestamp: timestampISOString,
@@ -47,8 +47,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
48
  }
49
49
  };
50
- import { v4 as uuidv4 } from 'uuid';
51
- import { ClientDevice } from '../../../ClientDevice';
50
+ import { amplifyUuid } from '../../../utils/amplifyUuid';
51
+ import { getClientInfo } from '../../../utils/getClientInfo';
52
52
  import { updateEndpoint as clientUpdateEndpoint, } from '../../../awsClients/pinpoint';
53
53
  import { cacheEndpointId, getEndpointId } from '../utils';
54
54
  /**
@@ -63,9 +63,9 @@ export var updateEndpoint = function (_a) {
63
63
  case 0: return [4 /*yield*/, getEndpointId(appId, category)];
64
64
  case 1:
65
65
  endpointId = _c.sent();
66
- createdEndpointId = !endpointId ? uuidv4() : undefined;
66
+ createdEndpointId = !endpointId ? amplifyUuid() : undefined;
67
67
  _b = userProfile !== null && userProfile !== void 0 ? userProfile : {}, customProperties = _b.customProperties, demographic = _b.demographic, email = _b.email, location = _b.location, metrics = _b.metrics, name = _b.name, plan = _b.plan;
68
- clientInfo = ClientDevice.clientInfo();
68
+ clientInfo = getClientInfo();
69
69
  mergedDemographic = __assign({ appVersion: clientInfo.appVersion, make: clientInfo.make, model: clientInfo.model, modelVersion: clientInfo.version, platform: clientInfo.platform }, demographic);
70
70
  shouldAddAttributes = email || customProperties || name || plan;
71
71
  attributes = __assign(__assign(__assign(__assign({}, (email && { email: [email] })), (name && { name: [name] })), (plan && { plan: [plan] })), customProperties);
@@ -73,7 +73,7 @@ export var updateEndpoint = function (_a) {
73
73
  ApplicationId: appId,
74
74
  EndpointId: endpointId !== null && endpointId !== void 0 ? endpointId : createdEndpointId,
75
75
  EndpointRequest: {
76
- RequestId: uuidv4(),
76
+ RequestId: amplifyUuid(),
77
77
  EffectiveDate: new Date().toISOString(),
78
78
  ChannelType: channelType,
79
79
  Address: address,
@@ -109,7 +109,7 @@ export var updateEndpoint = function (_a) {
109
109
  _c.sent();
110
110
  // if we had to create an endpoint id, we need to now cache it
111
111
  if (!!createdEndpointId) {
112
- cacheEndpointId(appId, category, createdEndpointId);
112
+ return [2 /*return*/, cacheEndpointId(appId, category, createdEndpointId)];
113
113
  }
114
114
  return [2 /*return*/];
115
115
  }
@@ -3,8 +3,9 @@ export type LibraryAPIOptions = {
3
3
  GraphQL?: {
4
4
  headers?: (options: {
5
5
  query: string;
6
- variables: Record<string, DocumentType>;
6
+ variables?: Record<string, DocumentType>;
7
7
  }) => Promise<Headers>;
8
+ withCredentials?: boolean;
8
9
  };
9
10
  REST?: {
10
11
  headers?: (options: {
@@ -37,7 +38,7 @@ type APIGraphQLConfig = {
37
38
  /**
38
39
  * Default auth mode for all the API calls to given service.
39
40
  */
40
- defaultAuthMode: APIAuthMode;
41
+ defaultAuthMode: GraphQLAuthMode;
41
42
  };
42
43
  type APIRestConfig = {
43
44
  /**
@@ -62,7 +63,7 @@ export type APIConfig = {
62
63
  REST?: Record<string, APIRestConfig>;
63
64
  GraphQL?: APIGraphQLConfig;
64
65
  };
65
- export type APIAuthMode = 'apiKey' | 'oidc' | 'userPool' | 'iam' | 'lambda' | 'none';
66
+ export type GraphQLAuthMode = 'apiKey' | 'oidc' | 'userPool' | 'iam' | 'lambda' | 'none';
66
67
  /**
67
68
  * Type representing a plain JavaScript object that can be serialized to JSON.
68
69
  */
@@ -23,9 +23,9 @@ export declare class AmplifyClass {
23
23
  /**
24
24
  * Provides access to the current back-end resource configuration for the Library.
25
25
  *
26
- * @returns Returns the current back-end resource configuration.
26
+ * @returns Returns the immutable back-end resource configuration.
27
27
  */
28
- getConfig(): ResourcesConfig;
28
+ getConfig(): Readonly<ResourcesConfig>;
29
29
  }
30
30
  /**
31
31
  * The `Amplify` utility is used to configure the library.
@@ -25,13 +25,12 @@ var __values = (this && this.__values) || function(o) {
25
25
  import { AuthClass } from './Auth';
26
26
  import { Hub, AMPLIFY_SYMBOL } from '../Hub';
27
27
  import { parseAWSExports } from '../parseAWSExports';
28
- // TODO(v6): add default AuthTokenStore for each platform
28
+ import { deepFreeze } from '../utils';
29
29
  var AmplifyClass = /** @class */ (function () {
30
30
  function AmplifyClass() {
31
31
  this.resourcesConfig = {};
32
- this.Auth = new AuthClass();
33
- // TODO(v6): add default providers for getting started
34
32
  this.libraryOptions = {};
33
+ this.Auth = new AuthClass();
35
34
  }
36
35
  /**
37
36
  * Configures Amplify for use with your back-end resources.
@@ -53,6 +52,8 @@ var AmplifyClass = /** @class */ (function () {
53
52
  }
54
53
  this.resourcesConfig = mergeResourceConfig(this.resourcesConfig, resolvedResourceConfig);
55
54
  this.libraryOptions = mergeLibraryOptions(this.libraryOptions, libraryOptions);
55
+ // Make resource config immutable
56
+ this.resourcesConfig = deepFreeze(this.resourcesConfig);
56
57
  this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);
57
58
  Hub.dispatch('core', {
58
59
  event: 'configure',
@@ -62,10 +63,10 @@ var AmplifyClass = /** @class */ (function () {
62
63
  /**
63
64
  * Provides access to the current back-end resource configuration for the Library.
64
65
  *
65
- * @returns Returns the current back-end resource configuration.
66
+ * @returns Returns the immutable back-end resource configuration.
66
67
  */
67
68
  AmplifyClass.prototype.getConfig = function () {
68
- return JSON.parse(JSON.stringify(this.resourcesConfig));
69
+ return this.resourcesConfig;
69
70
  };
70
71
  return AmplifyClass;
71
72
  }());
@@ -50,6 +50,11 @@ export type AuthTokens = {
50
50
  idToken?: JWT;
51
51
  accessToken: JWT;
52
52
  };
53
+ export type AuthStandardAttributeKey = 'address' | 'birthdate' | 'email_verified' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number_verified' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo' | AuthVerifiableAttributeKey;
54
+ export type AuthVerifiableAttributeKey = 'email' | 'phone_number';
55
+ export type AuthConfigUserAttributes = Partial<Record<AuthStandardAttributeKey, {
56
+ required: boolean;
57
+ }>>;
53
58
  export type AuthConfig = StrictUnion<AuthIdentityPoolConfig | AuthUserPoolConfig | AuthUserPoolAndIdentityPoolConfig>;
54
59
  type UnionKeys<T> = T extends T ? keyof T : never;
55
60
  type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
@@ -59,6 +64,11 @@ export type AuthIdentityPoolConfig = {
59
64
  userPoolClientId?: never;
60
65
  userPoolId?: never;
61
66
  loginWith?: never;
67
+ signUpVerificationMethod?: never;
68
+ userAttributes?: never;
69
+ mfa?: never;
70
+ passwordFormat?: never;
71
+ endpoint?: never;
62
72
  };
63
73
  };
64
74
  export type CognitoIdentityPoolConfig = {
@@ -77,7 +87,24 @@ export type CognitoUserPoolConfig = {
77
87
  signUpVerificationMethod?: 'code' | 'link';
78
88
  loginWith?: {
79
89
  oauth?: OAuthConfig;
90
+ username?: boolean;
91
+ email?: boolean;
92
+ phone?: boolean;
80
93
  };
94
+ userAttributes?: AuthConfigUserAttributes;
95
+ mfa?: {
96
+ status?: 'on' | 'off' | 'optional';
97
+ totpEnabled?: boolean;
98
+ smsEnabled?: boolean;
99
+ };
100
+ passwordFormat?: {
101
+ minLength?: number;
102
+ requireLowercase?: boolean;
103
+ requireUppercase?: boolean;
104
+ requireNumbers?: boolean;
105
+ requireSpecialCharacters?: boolean;
106
+ };
107
+ endpoint?: string;
81
108
  };
82
109
  export type OAuthConfig = {
83
110
  domain: string;
@@ -119,7 +146,7 @@ export type AWSCredentialsAndIdentityId = {
119
146
  credentials: AWSCredentials;
120
147
  identityId?: string;
121
148
  };
122
- type AWSCredentials = {
149
+ export type AWSCredentials = {
123
150
  accessKeyId: string;
124
151
  secretAccessKey: string;
125
152
  sessionToken?: string;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Cache instance options
3
+ */
4
+ export interface CacheConfig {
5
+ /** Prepend to key to avoid conflicts */
6
+ keyPrefix: string;
7
+ /** Cache capacity, in bytes */
8
+ capacityInBytes: number;
9
+ /** Max size of one item */
10
+ itemMaxSize: number;
11
+ /** Time to live, in milliseconds */
12
+ defaultTTL: number;
13
+ /** Warn when over threshold percentage of capacity, maximum 1 */
14
+ warningThreshold: number;
15
+ /** default priority number put on cached items */
16
+ defaultPriority: number;
17
+ storage?: Storage;
18
+ }
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -1,6 +1,7 @@
1
1
  import { APIConfig, LibraryAPIOptions } from './API/types';
2
2
  import { AnalyticsConfig } from './Analytics/types';
3
3
  import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
4
+ import { CacheConfig } from './Cache/types';
4
5
  import { GeoConfig } from './Geo/types';
5
6
  import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
6
7
  import { I18nConfig } from '../I18n/types';
@@ -15,6 +16,7 @@ export type ResourcesConfig = {
15
16
  API?: APIConfig;
16
17
  Analytics?: AnalyticsConfig;
17
18
  Auth?: AuthConfig;
19
+ Cache?: CacheConfig;
18
20
  I18n?: I18nConfig;
19
21
  Notifications?: NotificationsConfig;
20
22
  Storage?: StorageConfig;
@@ -26,4 +28,4 @@ export type LibraryOptions = {
26
28
  Storage?: LibraryStorageOptions;
27
29
  ssr?: boolean;
28
30
  };
29
- export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
31
+ export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, CacheConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
@@ -16,14 +16,14 @@ var __extends = (this && this.__extends) || (function () {
16
16
  };
17
17
  })();
18
18
  import { KeyValueStorage } from './KeyValueStorage';
19
- import { getDefaultStorageWithFallback } from './utils';
19
+ import { getLocalStorageWithFallback } from './utils';
20
20
  /**
21
21
  * @internal
22
22
  */
23
23
  var DefaultStorage = /** @class */ (function (_super) {
24
24
  __extends(DefaultStorage, _super);
25
25
  function DefaultStorage() {
26
- return _super.call(this, getDefaultStorageWithFallback()) || this;
26
+ return _super.call(this, getLocalStorageWithFallback()) || this;
27
27
  }
28
28
  return DefaultStorage;
29
29
  }(KeyValueStorage));
@@ -2,7 +2,7 @@
2
2
  * @internal
3
3
  * @returns Either a reference to window.localStorage or an in-memory storage as fallback
4
4
  */
5
- export declare const getDefaultStorageWithFallback: () => Storage;
5
+ export declare const getLocalStorageWithFallback: () => Storage;
6
6
  /**
7
7
  * @internal
8
8
  * @returns Either a reference to window.sessionStorage or an in-memory storage as fallback
@@ -5,7 +5,7 @@ import { InMemoryStorage } from './InMemoryStorage';
5
5
  * @internal
6
6
  * @returns Either a reference to window.localStorage or an in-memory storage as fallback
7
7
  */
8
- export var getDefaultStorageWithFallback = function () {
8
+ export var getLocalStorageWithFallback = function () {
9
9
  return typeof window !== 'undefined' && window.localStorage
10
10
  ? window.localStorage
11
11
  : new InMemoryStorage();