@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
@@ -0,0 +1,6 @@
1
+ import { CacheConfig } from './types';
2
+ /**
3
+ * Default cache config
4
+ */
5
+ export declare const defaultConfig: Omit<CacheConfig, 'storage'>;
6
+ export declare const currentSizeKey = "CurSize";
@@ -0,0 +1,14 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * Default cache config
5
+ */
6
+ export var defaultConfig = {
7
+ keyPrefix: 'aws-amplify-cache',
8
+ capacityInBytes: 1048576,
9
+ itemMaxSize: 210000,
10
+ defaultTTL: 259200000,
11
+ defaultPriority: 5,
12
+ warningThreshold: 0.8,
13
+ };
14
+ export var currentSizeKey = 'CurSize';
@@ -0,0 +1,2 @@
1
+ import { StorageCache } from './StorageCache';
2
+ export declare const Cache: StorageCache;
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { StorageCache } from './StorageCache';
4
+ export var Cache = new StorageCache();
@@ -0,0 +1,38 @@
1
+ import { CacheConfig } from '../../singleton/Cache/types';
2
+ export { CacheConfig };
3
+ /**
4
+ * Cache Interface
5
+ */
6
+ export interface Cache {
7
+ /** Put item into cache */
8
+ setItem(key: string, value: any, options?: CacheItemOptions): Promise<void>;
9
+ /** Get item from cache */
10
+ getItem(key: string, options?: CacheItemOptions): Promise<CacheItem['data']>;
11
+ /** Remove item from cache */
12
+ removeItem(key: string): Promise<void>;
13
+ /** Remove all items from cache */
14
+ clear(): Promise<void>;
15
+ /** Get all keys form cache */
16
+ getAllKeys(): Promise<string[]>;
17
+ /** Get current size of the cache */
18
+ getCurrentCacheSize(): Promise<number>;
19
+ /** create a new instance with customized config */
20
+ createInstance(config: CacheConfig): Cache;
21
+ /** change current configuration */
22
+ configure(config: CacheConfig): CacheConfig;
23
+ }
24
+ export interface CacheItem {
25
+ key: string;
26
+ data: any;
27
+ timestamp: number;
28
+ visitedTime: number;
29
+ priority: number;
30
+ expires: number;
31
+ type: string;
32
+ byteSize: number;
33
+ }
34
+ export interface CacheItemOptions {
35
+ priority?: number;
36
+ expires?: number;
37
+ callback?: Function;
38
+ }
@@ -1 +1 @@
1
- export * from './Cache';
1
+ export * from './cache';
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export * from './Cache';
3
+ export * from './cache';
@@ -9,7 +9,7 @@
9
9
  * @member hashtable - the hashtable which maps cache key to list node
10
10
  * @member length - length of the list
11
11
  */
12
- export default class CacheList {
12
+ export declare class CacheList {
13
13
  private head;
14
14
  private tail;
15
15
  private hashtable;
@@ -178,4 +178,4 @@ var CacheList = /** @class */ (function () {
178
178
  };
179
179
  return CacheList;
180
180
  }());
181
- export default CacheList;
181
+ export { CacheList };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * return the byte size of the string
3
+ * @param str
4
+ */
5
+ export declare function getByteLength(str: string): number;
6
+ /**
7
+ * get current time
8
+ */
9
+ export declare function getCurrentTime(): number;
10
+ /**
11
+ * check if passed value is an integer
12
+ */
13
+ export declare function isInteger(value?: number): boolean;
14
+ export declare const getCurrentSizeKey: (keyPrefix: string) => string;
@@ -0,0 +1,44 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { currentSizeKey } from '../constants';
4
+ /**
5
+ * return the byte size of the string
6
+ * @param str
7
+ */
8
+ export function getByteLength(str) {
9
+ var ret = 0;
10
+ ret = str.length;
11
+ for (var i = str.length; i >= 0; i -= 1) {
12
+ var charCode = str.charCodeAt(i);
13
+ if (charCode > 0x7f && charCode <= 0x7ff) {
14
+ ret += 1;
15
+ }
16
+ else if (charCode > 0x7ff && charCode <= 0xffff) {
17
+ ret += 2;
18
+ }
19
+ // trail surrogate
20
+ if (charCode >= 0xdc00 && charCode <= 0xdfff) {
21
+ i -= 1;
22
+ }
23
+ }
24
+ return ret;
25
+ }
26
+ /**
27
+ * get current time
28
+ */
29
+ export function getCurrentTime() {
30
+ var currentTime = new Date();
31
+ return currentTime.getTime();
32
+ }
33
+ /**
34
+ * check if passed value is an integer
35
+ */
36
+ export function isInteger(value) {
37
+ if (Number.isInteger) {
38
+ return Number.isInteger(value);
39
+ }
40
+ return (typeof value === 'number' && isFinite(value) && Math.floor(value) === value);
41
+ }
42
+ export var getCurrentSizeKey = function (keyPrefix) {
43
+ return "".concat(keyPrefix).concat(currentSizeKey);
44
+ };
@@ -1,7 +1,6 @@
1
1
  import { AssertionFunction } from '../../types';
2
2
  export declare enum CacheErrorCode {
3
3
  NoCacheItem = "NoCacheItem",
4
- NoCacheStorage = "NoCacheStorage",
5
4
  NullNextNode = "NullNextNode",
6
5
  NullPreviousNode = "NullPreviousNode"
7
6
  }
@@ -5,7 +5,6 @@ import { createAssertionFunction } from '../../errors';
5
5
  export var CacheErrorCode;
6
6
  (function (CacheErrorCode) {
7
7
  CacheErrorCode["NoCacheItem"] = "NoCacheItem";
8
- CacheErrorCode["NoCacheStorage"] = "NoCacheStorage";
9
8
  CacheErrorCode["NullNextNode"] = "NullNextNode";
10
9
  CacheErrorCode["NullPreviousNode"] = "NullPreviousNode";
11
10
  })(CacheErrorCode || (CacheErrorCode = {}));
@@ -13,9 +12,6 @@ var cacheErrorMap = (_a = {},
13
12
  _a[CacheErrorCode.NoCacheItem] = {
14
13
  message: 'Item not found in the cache storage.',
15
14
  },
16
- _a[CacheErrorCode.NoCacheStorage] = {
17
- message: 'Storage is not defined in the cache config.',
18
- },
19
15
  _a[CacheErrorCode.NullNextNode] = {
20
16
  message: 'Next node is null.',
21
17
  },
@@ -0,0 +1,2 @@
1
+ export { getByteLength, getCurrentSizeKey, getCurrentTime, isInteger, } from './cacheHelpers';
2
+ export { CacheList } from './CacheList';
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { getByteLength, getCurrentSizeKey, getCurrentTime, isInteger, } from './cacheHelpers';
4
+ export { CacheList } from './CacheList';
@@ -37,3 +37,10 @@ export declare class HubClass {
37
37
  private _toListeners;
38
38
  }
39
39
  export declare const Hub: HubClass;
40
+ /**
41
+ * @internal
42
+ *
43
+ * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
44
+ *
45
+ */
46
+ export declare const HubInternal: HubClass;
@@ -146,3 +146,10 @@ export { HubClass };
146
146
  pseudo Singleton for the main messaging bus, however you can still create
147
147
  your own instance of HubClass() for a separate "private bus" of events.*/
148
148
  export var Hub = new HubClass('__default__');
149
+ /**
150
+ * @internal
151
+ *
152
+ * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
153
+ *
154
+ */
155
+ export var HubInternal = new HubClass('internal-hub');
@@ -0,0 +1,16 @@
1
+ import { AdditionalDetails, SetCustomUserAgentInput } from './types';
2
+ /**
3
+ * Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
4
+ * clean up any custom state set with this API.
5
+ *
6
+ * @note
7
+ * This API operates globally. Calling this API multiple times will result in the most recently set values for a
8
+ * particular API being used.
9
+ *
10
+ * @note
11
+ * This utility IS NOT compatible with SSR.
12
+ *
13
+ * @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
14
+ */
15
+ export declare const setCustomUserAgent: (input: SetCustomUserAgentInput) => (() => void);
16
+ export declare const getCustomUserAgent: (category: string, api: string) => AdditionalDetails | undefined;
@@ -0,0 +1,65 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ // Maintains custom user-agent state set by external consumers.
15
+ var customUserAgentState = {};
16
+ /**
17
+ * Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
18
+ * clean up any custom state set with this API.
19
+ *
20
+ * @note
21
+ * This API operates globally. Calling this API multiple times will result in the most recently set values for a
22
+ * particular API being used.
23
+ *
24
+ * @note
25
+ * This utility IS NOT compatible with SSR.
26
+ *
27
+ * @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
28
+ */
29
+ export var setCustomUserAgent = function (input) {
30
+ var _a;
31
+ // Save custom user-agent state & increment reference counter
32
+ // TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373
33
+ customUserAgentState[input.category] = input.apis.reduce(function (acc, api) {
34
+ var _a;
35
+ var _b;
36
+ return (__assign(__assign({}, acc), (_a = {}, _a[api] = {
37
+ refCount: ((_b = acc[api]) === null || _b === void 0 ? void 0 : _b.refCount) ? acc[api].refCount + 1 : 1,
38
+ additionalDetails: input.additionalDetails,
39
+ }, _a)));
40
+ }, (_a = customUserAgentState[input.category]) !== null && _a !== void 0 ? _a : {});
41
+ // Callback that cleans up state for APIs recorded by this call
42
+ var cleanUpCallbackCalled = false;
43
+ var cleanUpCallback = function () {
44
+ // Only allow the cleanup callback to be called once
45
+ if (cleanUpCallbackCalled) {
46
+ return;
47
+ }
48
+ cleanUpCallbackCalled = true;
49
+ input.apis.forEach(function (api) {
50
+ var apiRefCount = customUserAgentState[input.category][api].refCount;
51
+ if (apiRefCount > 1) {
52
+ customUserAgentState[input.category][api].refCount = apiRefCount - 1;
53
+ }
54
+ else {
55
+ delete customUserAgentState[input.category][api];
56
+ // Clean up category if no more APIs set
57
+ if (!Object.keys(customUserAgentState[input.category]).length) {
58
+ delete customUserAgentState[input.category];
59
+ }
60
+ }
61
+ });
62
+ };
63
+ return cleanUpCallback;
64
+ };
65
+ export var getCustomUserAgent = function (category, api) { var _a, _b; return (_b = (_a = customUserAgentState[category]) === null || _a === void 0 ? void 0 : _a[api]) === null || _b === void 0 ? void 0 : _b.additionalDetails; };
@@ -19,6 +19,7 @@ var __read = (this && this.__read) || function (o, n) {
19
19
  import { Framework } from './types';
20
20
  import { version } from './version';
21
21
  import { detectFramework, observeFrameworkChanges } from './detectFramework';
22
+ import { getCustomUserAgent } from './customUserAgent';
22
23
  var BASE_USER_AGENT = "aws-amplify";
23
24
  var PlatformBuilder = /** @class */ (function () {
24
25
  function PlatformBuilder() {
@@ -52,6 +53,14 @@ export var getAmplifyUserAgentObject = function (_a) {
52
53
  userAgent.push([category, action]);
53
54
  }
54
55
  userAgent.push(['framework', detectFramework()]);
56
+ if (category && action) {
57
+ var customState = getCustomUserAgent(category, action);
58
+ if (customState) {
59
+ customState.forEach(function (state) {
60
+ userAgent.push(state);
61
+ });
62
+ }
63
+ }
55
64
  return userAgent;
56
65
  };
57
66
  export var getAmplifyUserAgent = function (customUserAgentDetails) {
@@ -59,7 +68,7 @@ export var getAmplifyUserAgent = function (customUserAgentDetails) {
59
68
  var userAgentString = userAgent
60
69
  .map(function (_a) {
61
70
  var _b = __read(_a, 2), agentKey = _b[0], agentValue = _b[1];
62
- return "".concat(agentKey, "/").concat(agentValue);
71
+ return agentKey && agentValue ? "".concat(agentKey, "/").concat(agentValue) : agentKey;
63
72
  })
64
73
  .join(' ');
65
74
  return userAgentString;
@@ -77,7 +77,8 @@ export declare enum GeoAction {
77
77
  }
78
78
  export declare enum InAppMessagingAction {
79
79
  SyncMessages = "1",
80
- IdentifyUser = "2"
80
+ IdentifyUser = "2",
81
+ DispatchEvent = "3"
81
82
  }
82
83
  export declare enum InteractionsAction {
83
84
  None = "0"
@@ -126,4 +127,35 @@ export type CustomUserAgentDetails = (CustomUserAgentDetailsBase & {
126
127
  category?: never;
127
128
  action?: never;
128
129
  }) | UserAgentDetailsWithCategory<Category.API> | UserAgentDetailsWithCategory<Category.Auth> | UserAgentDetailsWithCategory<Category.Analytics> | UserAgentDetailsWithCategory<Category.DataStore> | UserAgentDetailsWithCategory<Category.Geo> | UserAgentDetailsWithCategory<Category.Interactions> | UserAgentDetailsWithCategory<Category.InAppMessaging> | UserAgentDetailsWithCategory<Category.Predictions> | UserAgentDetailsWithCategory<Category.PubSub> | UserAgentDetailsWithCategory<Category.PushNotification> | UserAgentDetailsWithCategory<Category.Storage>;
130
+ /**
131
+ * `refCount` tracks how many consumers have set state for a particular API to avoid it being cleared before all
132
+ * consumers are done using it.
133
+ *
134
+ * Category -> Action -> Custom State
135
+ */
136
+ export type CategoryUserAgentStateMap = Record<string, {
137
+ refCount: number;
138
+ additionalDetails: AdditionalDetails;
139
+ }>;
140
+ export type CustomUserAgentStateMap = Record<string, CategoryUserAgentStateMap>;
141
+ export type AdditionalDetails = [string, string?][];
142
+ type StorageUserAgentInput = {
143
+ category: Category.Storage;
144
+ apis: StorageAction[];
145
+ };
146
+ type AuthUserAgentInput = {
147
+ category: Category.Auth;
148
+ apis: AuthAction[];
149
+ };
150
+ type InAppMessagingUserAgentInput = {
151
+ category: Category.InAppMessaging;
152
+ apis: InAppMessagingAction[];
153
+ };
154
+ type GeoUserAgentInput = {
155
+ category: Category.Geo;
156
+ apis: GeoAction[];
157
+ };
158
+ export type SetCustomUserAgentInput = (StorageUserAgentInput | AuthUserAgentInput | InAppMessagingUserAgentInput | GeoUserAgentInput) & {
159
+ additionalDetails: AdditionalDetails;
160
+ };
129
161
  export {};
@@ -91,6 +91,7 @@ export var InAppMessagingAction;
91
91
  (function (InAppMessagingAction) {
92
92
  InAppMessagingAction["SyncMessages"] = "1";
93
93
  InAppMessagingAction["IdentifyUser"] = "2";
94
+ InAppMessagingAction["DispatchEvent"] = "3";
94
95
  })(InAppMessagingAction || (InAppMessagingAction = {}));
95
96
  export var InteractionsAction;
96
97
  (function (InteractionsAction) {
@@ -1 +1 @@
1
- export declare const version = "6.0.1-console-preview.5f040a2.0+5f040a2";
1
+ export declare const version = "6.0.1-console-preview.23dc225.0+23dc225";
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export var version = '6.0.1-console-preview.5f040a2.0+5f040a2';
2
+ export var version = '6.0.1-console-preview.23dc225.0+23dc225';
@@ -3,4 +3,5 @@ import { NetworkStatus } from './types';
3
3
  export declare class Reachability {
4
4
  private static _observers;
5
5
  networkMonitor(_?: unknown): Observable<NetworkStatus>;
6
+ private static _observerOverride;
6
7
  }
@@ -1,5 +1,16 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ var __values = (this && this.__values) || function(o) {
4
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
5
+ if (m) return m.call(o);
6
+ if (o && typeof o.length === "number") return {
7
+ next: function () {
8
+ if (o && i >= o.length) o = void 0;
9
+ return { value: o && o[i++], done: !o };
10
+ }
11
+ };
12
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
13
+ };
3
14
  import { Observable } from 'rxjs';
4
15
  import { isWebWorker } from '../libraryUtils';
5
16
  export var Reachability = /** @class */ (function () {
@@ -21,6 +32,31 @@ export var Reachability = /** @class */ (function () {
21
32
  };
22
33
  });
23
34
  };
35
+ // expose observers to simulate offline mode for integration testing
36
+ Reachability._observerOverride = function (status) {
37
+ var e_1, _a;
38
+ var _loop_1 = function (observer) {
39
+ if (observer.closed) {
40
+ this_1._observers = this_1._observers.filter(function (_observer) { return _observer !== observer; });
41
+ return "continue";
42
+ }
43
+ (observer === null || observer === void 0 ? void 0 : observer.next) && observer.next(status);
44
+ };
45
+ var this_1 = this;
46
+ try {
47
+ for (var _b = __values(this._observers), _c = _b.next(); !_c.done; _c = _b.next()) {
48
+ var observer = _c.value;
49
+ _loop_1(observer);
50
+ }
51
+ }
52
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
53
+ finally {
54
+ try {
55
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
56
+ }
57
+ finally { if (e_1) throw e_1.error; }
58
+ }
59
+ };
24
60
  Reachability._observers = [];
25
61
  return Reachability;
26
62
  }());
@@ -13,6 +13,7 @@ var __assign = (this && this.__assign) || function () {
13
13
  };
14
14
  import { DateUtils } from './DateUtils';
15
15
  import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '../clients/middleware/signing/signer/signatureV4';
16
+ import { AmplifyUrl } from '../utils/amplifyUrl';
16
17
  var IOT_SERVICE_NAME = 'iotdevicegateway';
17
18
  // Best practice regex to parse the service and region from an AWS endpoint
18
19
  var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
@@ -60,7 +61,7 @@ var Signer = /** @class */ (function () {
60
61
  if (request.body && !request.data) {
61
62
  throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');
62
63
  }
63
- var requestToSign = __assign(__assign({}, request), { body: request.data, url: new URL(request.url) });
64
+ var requestToSign = __assign(__assign({}, request), { body: request.data, url: new AmplifyUrl(request.url) });
64
65
  var options = getOptions(requestToSign, accessInfo, serviceInfo);
65
66
  var signedRequest = signRequest(requestToSign, options);
66
67
  // Prior to using `signRequest`, Signer accepted urls as strings and outputted urls as string. Coerce the property
@@ -82,7 +83,7 @@ var Signer = /** @class */ (function () {
82
83
  var presignable = {
83
84
  body: body,
84
85
  method: method,
85
- url: new URL(urlToSign),
86
+ url: new AmplifyUrl(urlToSign),
86
87
  };
87
88
  var options = getOptions(presignable, accessInfo, serviceInfo, expiration);
88
89
  var signedUrl = presignUrl(presignable, options);
@@ -41,6 +41,7 @@ import { composeTransferHandler } from '../../clients/internal/composeTransferHa
41
41
  import { jitteredBackoff, getRetryDecider, } from '../../clients/middleware/retry';
42
42
  import { getAmplifyUserAgent } from '../../Platform';
43
43
  import { observeFrameworkChanges } from '../../Platform/detectFramework';
44
+ import { AmplifyUrl } from '../../utils/amplifyUrl';
44
45
  /**
45
46
  * The service name used to sign requests if the API requires authentication.
46
47
  */
@@ -51,7 +52,7 @@ var SERVICE_NAME = 'cognito-identity';
51
52
  var endpointResolver = function (_a) {
52
53
  var region = _a.region;
53
54
  return ({
54
- url: new URL("https://cognito-identity.".concat(region, ".").concat(getDnsSuffix(region))),
55
+ url: new AmplifyUrl("https://cognito-identity.".concat(region, ".").concat(getDnsSuffix(region))),
55
56
  });
56
57
  };
57
58
  /**
@@ -4,6 +4,7 @@ import { getDnsSuffix } from '../../clients/endpoints';
4
4
  import { jitteredBackoff, getRetryDecider, } from '../../clients/middleware/retry';
5
5
  import { parseJsonError } from '../../clients/serde/json';
6
6
  import { getAmplifyUserAgent } from '../../Platform';
7
+ import { AmplifyUrl } from '../../utils/amplifyUrl';
7
8
  /**
8
9
  * The service name used to sign requests if the API requires authentication.
9
10
  */
@@ -14,7 +15,7 @@ var SERVICE_NAME = 'mobiletargeting';
14
15
  var endpointResolver = function (_a) {
15
16
  var region = _a.region;
16
17
  return ({
17
- url: new URL("https://pinpoint.".concat(region, ".").concat(getDnsSuffix(region))),
18
+ url: new AmplifyUrl("https://pinpoint.".concat(region, ".").concat(getDnsSuffix(region))),
18
19
  });
19
20
  };
20
21
  /**
@@ -41,10 +41,11 @@ import { composeServiceApi } from '../../clients/internal/composeServiceApi';
41
41
  import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
42
42
  import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
43
43
  import { defaultConfig, getSharedHeaders } from './base';
44
+ import { AmplifyUrl } from '../../utils/amplifyUrl';
44
45
  var getInAppMessagesSerializer = function (_a, endpoint) {
45
46
  var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c;
46
47
  var headers = getSharedHeaders();
47
- var url = new URL(endpoint.url);
48
+ var url = new AmplifyUrl(endpoint.url);
48
49
  url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/endpoints/").concat(extendedEncodeURIComponent(EndpointId), "/inappmessages");
49
50
  return { method: 'GET', headers: headers, url: url };
50
51
  };
@@ -42,11 +42,12 @@ import { extendedEncodeURIComponent } from '../../clients/middleware/signing/uti
42
42
  import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
43
43
  import { defaultConfig, getSharedHeaders } from './base';
44
44
  import { assert, PinpointValidationErrorCode } from './errorHelpers';
45
+ import { AmplifyUrl } from '../../utils/amplifyUrl';
45
46
  var putEventsSerializer = function (_a, endpoint) {
46
47
  var ApplicationId = _a.ApplicationId, EventsRequest = _a.EventsRequest;
47
48
  assert(!!ApplicationId, PinpointValidationErrorCode.NoAppId);
48
49
  var headers = getSharedHeaders();
49
- var url = new URL(endpoint.url);
50
+ var url = new AmplifyUrl(endpoint.url);
50
51
  url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/events");
51
52
  var body = JSON.stringify(EventsRequest !== null && EventsRequest !== void 0 ? EventsRequest : {});
52
53
  return { method: 'POST', headers: headers, url: url, body: body };
@@ -41,10 +41,11 @@ import { composeServiceApi } from '../../clients/internal/composeServiceApi';
41
41
  import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent';
42
42
  import { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients/serde';
43
43
  import { defaultConfig, getSharedHeaders } from './base';
44
+ import { AmplifyUrl } from '../../utils/amplifyUrl';
44
45
  var updateEndpointSerializer = function (_a, endpoint) {
45
46
  var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c, EndpointRequest = _a.EndpointRequest;
46
47
  var headers = getSharedHeaders();
47
- var url = new URL(endpoint.url);
48
+ var url = new AmplifyUrl(endpoint.url);
48
49
  url.pathname = "v1/apps/".concat(extendedEncodeURIComponent(ApplicationId), "/endpoints/").concat(extendedEncodeURIComponent(EndpointId));
49
50
  var body = JSON.stringify(EndpointRequest);
50
51
  return { method: 'PUT', headers: headers, url: url, body: body };
@@ -1,4 +1,3 @@
1
- import './polyfills';
2
1
  export { signRequest } from './signRequest';
3
2
  export { presignUrl } from './presignUrl';
4
3
  export { TOKEN_QUERY_PARAM } from './constants';
@@ -1,6 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import './polyfills';
4
3
  // TODO: V6 replace Signer
5
4
  export { signRequest } from './signRequest';
6
5
  export { presignUrl } from './presignUrl';
@@ -41,6 +41,7 @@ var __read = (this && this.__read) || function (o, n) {
41
41
  import { ALGORITHM_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, EXPIRES_QUERY_PARAM, HOST_HEADER, SHA256_ALGORITHM_IDENTIFIER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_QUERY_PARAM, } from './constants';
42
42
  import { getSigningValues } from './utils/getSigningValues';
43
43
  import { getSignature } from './utils/getSignature';
44
+ import { AmplifyUrl } from '../../../../../utils/amplifyUrl';
44
45
  /**
45
46
  * Given a `Presignable` object, returns a Signature Version 4 presigned `URL` object.
46
47
  *
@@ -56,7 +57,7 @@ export var presignUrl = function (_a, _b) {
56
57
  var accessKeyId = signingValues.accessKeyId, credentialScope = signingValues.credentialScope, longDate = signingValues.longDate, sessionToken = signingValues.sessionToken;
57
58
  // create the request to sign
58
59
  // @ts-ignore URL constructor accepts a URL object
59
- var presignedUrl = new URL(url);
60
+ var presignedUrl = new AmplifyUrl(url);
60
61
  Object.entries(__assign(__assign((_c = {}, _c[ALGORITHM_QUERY_PARAM] = SHA256_ALGORITHM_IDENTIFIER, _c[CREDENTIAL_QUERY_PARAM] = "".concat(accessKeyId, "/").concat(credentialScope), _c[AMZ_DATE_QUERY_PARAM] = longDate, _c[SIGNED_HEADERS_QUERY_PARAM] = HOST_HEADER, _c), (expiration && (_d = {}, _d[EXPIRES_QUERY_PARAM] = expiration.toString(), _d))), (sessionToken && (_e = {}, _e[TOKEN_QUERY_PARAM] = sessionToken, _e)))).forEach(function (_a) {
61
62
  var _b = __read(_a, 2), key = _b[0], value = _b[1];
62
63
  presignedUrl.searchParams.append(key, value);
@@ -1,14 +1,11 @@
1
1
  export { Hub } from './Hub';
2
2
  export { HubCapsule, HubCallback, HubPayload } from './Hub/types';
3
3
  export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, OAuthConfig, CognitoUserPoolConfig, } from './singleton/Auth/types';
4
- export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, GeoConfig, } from './singleton/types';
4
+ export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, APIConfig, CacheConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, GeoConfig, } from './singleton/types';
5
5
  export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
6
6
  export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './awsClients/cognitoIdentity';
7
7
  export { UserProfile } from './types';
8
8
  export { CookieStorage, defaultStorage, sessionStorage, sharedInMemoryStorage, } from './storage';
9
9
  export { KeyValueStorageInterface } from './types';
10
- import { BrowserStorageCache } from './Cache/BrowserStorageCache';
11
- export { InMemoryCache } from './Cache/InMemoryCache';
12
- export { BrowserStorageCache };
13
- export { BrowserStorageCache as Cache };
10
+ export { Cache } from './Cache';
14
11
  export { I18n } from './I18n';
package/lib-esm/index.js CHANGED
@@ -11,9 +11,6 @@ export { getCredentialsForIdentity, getId, } from './awsClients/cognitoIdentity'
11
11
  // Storage helpers
12
12
  export { CookieStorage, defaultStorage, sessionStorage, sharedInMemoryStorage, } from './storage';
13
13
  // Cache exports
14
- import { BrowserStorageCache } from './Cache/BrowserStorageCache';
15
- export { InMemoryCache } from './Cache/InMemoryCache';
16
- export { BrowserStorageCache };
17
- export { BrowserStorageCache as Cache }; // Maintain interoperability with React Native
14
+ export { Cache } from './Cache';
18
15
  // Internationalization utilities
19
16
  export { I18n } from './I18n';