@aws-amplify/core 6.0.1-console-preview.f63250a.0 → 6.0.1-console-preview.5dc0b68.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 (354) hide show
  1. package/internals/adapter-core/package.json +8 -0
  2. package/internals/providers/pinpoint/package.json +8 -0
  3. package/internals/utils/package.json +7 -0
  4. package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +1 -1
  5. package/lib/AwsClients/CognitoIdentity/getId.d.ts +1 -1
  6. package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  7. package/lib/AwsClients/Pinpoint/index.d.ts +1 -1
  8. package/lib/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  9. package/lib/AwsClients/Pinpoint/putEvents.js +2 -2
  10. package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  11. package/lib/Cache/AsyncStorageCache.js +3 -3
  12. package/lib/Cache/BrowserStorageCache.js +5 -5
  13. package/lib/Cache/InMemoryCache.js +3 -3
  14. package/lib/Cache/StorageCache.js +1 -1
  15. package/lib/Cache/Utils/CacheList.js +5 -5
  16. package/lib/Credentials.js +2 -5
  17. package/lib/{Hub.d.ts → Hub/index.d.ts} +5 -21
  18. package/lib/Hub/index.js +151 -0
  19. package/lib/Hub/types/AuthTypes.d.ts +11 -0
  20. package/lib/Hub/types/HubTypes.d.ts +28 -0
  21. package/lib/Hub/types/HubTypes.js +4 -0
  22. package/lib/Hub/types/index.d.ts +2 -0
  23. package/lib/Hub/types/index.js +20 -0
  24. package/lib/I18n/I18n.js +1 -1
  25. package/lib/I18n/index.js +5 -5
  26. package/lib/OAuthHelper/FacebookOAuth.js +1 -1
  27. package/lib/OAuthHelper/GoogleOAuth.js +1 -1
  28. package/lib/Platform/version.d.ts +1 -1
  29. package/lib/Platform/version.js +1 -1
  30. package/lib/RNComponents/index.d.ts +1 -0
  31. package/lib/RNComponents/index.js +2 -1
  32. package/lib/RNComponents/isAppInForeground.d.ts +1 -0
  33. package/lib/RNComponents/isAppInForeground.js +10 -0
  34. package/lib/ServiceWorker/ServiceWorker.js +9 -9
  35. package/lib/StorageHelper/localStorage.js +1 -1
  36. package/lib/StorageHelper/sessionStorage.js +1 -1
  37. package/lib/UniversalStorage/index.js +1 -1
  38. package/lib/Util/Constants.d.ts +12 -8
  39. package/lib/Util/Constants.js +21 -15
  40. package/lib/{Errors.d.ts → Util/Errors.d.ts} +1 -1
  41. package/lib/Util/Reachability.js +1 -1
  42. package/lib/Util/errors/AssertError.js +1 -1
  43. package/lib/Util/index.d.ts +1 -1
  44. package/lib/Util/index.js +1 -5
  45. package/lib/adapterCore/error/AmplifyServerContextError.d.ts +8 -0
  46. package/lib/adapterCore/error/AmplifyServerContextError.js +35 -0
  47. package/lib/adapterCore/error/index.d.ts +1 -0
  48. package/lib/adapterCore/error/index.js +7 -0
  49. package/lib/adapterCore/index.d.ts +2 -0
  50. package/lib/adapterCore/index.js +11 -0
  51. package/lib/adapterCore/serverContext/index.d.ts +2 -0
  52. package/lib/adapterCore/serverContext/index.js +9 -0
  53. package/lib/adapterCore/serverContext/serverContext.d.ts +20 -0
  54. package/lib/adapterCore/serverContext/serverContext.js +42 -0
  55. package/lib/adapterCore/serverContext/serverContextRegistry.d.ts +6 -0
  56. package/lib/adapterCore/serverContext/serverContextRegistry.js +24 -0
  57. package/lib/adapterCore/serverContext/types/amplifyServer.d.ts +16 -0
  58. package/lib/adapterCore/serverContext/types/amplifyServer.js +4 -0
  59. package/lib/adapterCore/serverContext/types/cookieStorage.d.ts +31 -0
  60. package/lib/adapterCore/serverContext/types/cookieStorage.js +4 -0
  61. package/lib/adapterCore/serverContext/types/index.d.ts +4 -0
  62. package/lib/adapterCore/serverContext/types/index.js +4 -0
  63. package/lib/clients/handlers/fetch.js +1 -0
  64. package/lib/clients/internal/composeServiceApi.d.ts +5 -2
  65. package/lib/index.d.ts +11 -32
  66. package/lib/index.js +19 -100
  67. package/lib/libraryUtils.d.ts +21 -0
  68. package/lib/libraryUtils.js +105 -0
  69. package/lib/providers/pinpoint/apis/index.d.ts +2 -0
  70. package/lib/providers/pinpoint/apis/index.js +9 -0
  71. package/lib/providers/pinpoint/apis/record.d.ts +5 -0
  72. package/lib/providers/pinpoint/apis/record.js +120 -0
  73. package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +5 -0
  74. package/lib/providers/pinpoint/apis/updateEndpoint.js +120 -0
  75. package/lib/providers/pinpoint/index.d.ts +2 -0
  76. package/lib/providers/pinpoint/index.js +19 -0
  77. package/lib/providers/pinpoint/types/buffer.d.ts +25 -0
  78. package/lib/providers/pinpoint/types/buffer.js +4 -0
  79. package/lib/providers/pinpoint/types/index.d.ts +1 -0
  80. package/lib/providers/pinpoint/types/index.js +19 -0
  81. package/lib/providers/pinpoint/types/pinpoint.d.ts +40 -0
  82. package/lib/providers/pinpoint/types/pinpoint.js +4 -0
  83. package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +23 -0
  84. package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +278 -0
  85. package/lib/providers/pinpoint/utils/cacheEndpointId.d.ts +7 -0
  86. package/lib/providers/pinpoint/utils/cacheEndpointId.js +61 -0
  87. package/lib/providers/pinpoint/utils/constants.d.ts +4 -0
  88. package/lib/providers/pinpoint/utils/constants.js +10 -0
  89. package/lib/providers/pinpoint/utils/getCacheKey.d.ts +7 -0
  90. package/lib/providers/pinpoint/utils/getCacheKey.js +13 -0
  91. package/lib/providers/pinpoint/utils/getEndpointId.d.ts +7 -0
  92. package/lib/providers/pinpoint/utils/getEndpointId.js +62 -0
  93. package/lib/providers/pinpoint/utils/getEventBuffer.d.ts +8 -0
  94. package/lib/providers/pinpoint/utils/getEventBuffer.js +48 -0
  95. package/lib/providers/pinpoint/utils/index.d.ts +3 -0
  96. package/lib/providers/pinpoint/utils/index.js +11 -0
  97. package/lib/server.d.ts +1 -0
  98. package/lib/server.js +7 -0
  99. package/lib/singleton/Amplify.d.ts +36 -0
  100. package/lib/singleton/Amplify.js +138 -0
  101. package/lib/singleton/Analytics/types.d.ts +2 -0
  102. package/lib/singleton/Analytics/types.js +4 -0
  103. package/lib/singleton/Auth/index.js +15 -12
  104. package/lib/singleton/Auth/types.d.ts +28 -3
  105. package/lib/singleton/Auth/utils/index.d.ts +3 -2
  106. package/lib/singleton/Auth/utils/index.js +15 -1
  107. package/lib/singleton/Storage/types.d.ts +6 -2
  108. package/lib/singleton/apis/fetchAuthSession.d.ts +2 -0
  109. package/lib/singleton/apis/fetchAuthSession.js +11 -0
  110. package/lib/singleton/apis/internal/fetchAuthSession.d.ts +3 -0
  111. package/lib/singleton/apis/internal/fetchAuthSession.js +9 -0
  112. package/lib/singleton/apis/server/fetchAuthSession.d.ts +3 -0
  113. package/lib/singleton/apis/server/fetchAuthSession.js +11 -0
  114. package/lib/singleton/index.d.ts +2 -46
  115. package/lib/singleton/index.js +7 -144
  116. package/lib/singleton/types.d.ts +3 -1
  117. package/lib/tsconfig.tsbuildinfo +1 -1
  118. package/lib/types/core.d.ts +47 -0
  119. package/lib/types/core.js +4 -0
  120. package/lib/types/errors.d.ts +16 -0
  121. package/lib/types/errors.js +4 -0
  122. package/lib/types/index.d.ts +4 -1
  123. package/lib/types/index.js +6 -3
  124. package/lib/types/logging.d.ts +13 -0
  125. package/lib/types/logging.js +4 -0
  126. package/lib/types/storage.d.ts +14 -0
  127. package/lib/types/storage.js +4 -0
  128. package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +1 -1
  129. package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +1 -1
  130. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  131. package/lib-esm/AwsClients/Pinpoint/index.d.ts +1 -1
  132. package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  133. package/lib-esm/AwsClients/Pinpoint/putEvents.js +1 -1
  134. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  135. package/lib-esm/Cache/AsyncStorageCache.js +1 -1
  136. package/lib-esm/Cache/BrowserStorageCache.js +1 -1
  137. package/lib-esm/Cache/InMemoryCache.js +1 -1
  138. package/lib-esm/Cache/StorageCache.js +2 -2
  139. package/lib-esm/Cache/Utils/CacheList.js +1 -1
  140. package/lib-esm/Credentials.js +2 -5
  141. package/lib-esm/{Hub.d.ts → Hub/index.d.ts} +5 -21
  142. package/lib-esm/Hub/index.js +148 -0
  143. package/lib-esm/Hub/types/AuthTypes.d.ts +11 -0
  144. package/lib-esm/Hub/types/HubTypes.d.ts +28 -0
  145. package/lib-esm/Hub/types/HubTypes.js +3 -0
  146. package/lib-esm/Hub/types/index.d.ts +2 -0
  147. package/lib-esm/Hub/types/index.js +4 -0
  148. package/lib-esm/I18n/I18n.js +2 -2
  149. package/lib-esm/I18n/index.js +1 -1
  150. package/lib-esm/OAuthHelper/FacebookOAuth.js +1 -1
  151. package/lib-esm/OAuthHelper/GoogleOAuth.js +1 -1
  152. package/lib-esm/Platform/version.d.ts +1 -1
  153. package/lib-esm/Platform/version.js +1 -1
  154. package/lib-esm/RNComponents/index.d.ts +1 -0
  155. package/lib-esm/RNComponents/index.js +2 -1
  156. package/lib-esm/RNComponents/isAppInForeground.d.ts +1 -0
  157. package/lib-esm/RNComponents/isAppInForeground.js +6 -0
  158. package/lib-esm/ServiceWorker/ServiceWorker.js +3 -3
  159. package/lib-esm/StorageHelper/localStorage.js +1 -1
  160. package/lib-esm/StorageHelper/sessionStorage.js +1 -1
  161. package/lib-esm/UniversalStorage/index.js +1 -1
  162. package/lib-esm/Util/Constants.d.ts +12 -8
  163. package/lib-esm/Util/Constants.js +20 -8
  164. package/lib-esm/{Errors.d.ts → Util/Errors.d.ts} +1 -1
  165. package/lib-esm/Util/Reachability.js +1 -1
  166. package/lib-esm/Util/errors/AssertError.js +1 -1
  167. package/lib-esm/Util/index.d.ts +1 -1
  168. package/lib-esm/Util/index.js +1 -1
  169. package/lib-esm/adapterCore/error/AmplifyServerContextError.d.ts +8 -0
  170. package/lib-esm/adapterCore/error/AmplifyServerContextError.js +32 -0
  171. package/lib-esm/adapterCore/error/index.d.ts +1 -0
  172. package/lib-esm/adapterCore/error/index.js +3 -0
  173. package/lib-esm/adapterCore/index.d.ts +2 -0
  174. package/lib-esm/adapterCore/index.js +4 -0
  175. package/lib-esm/adapterCore/serverContext/index.d.ts +2 -0
  176. package/lib-esm/adapterCore/serverContext/index.js +3 -0
  177. package/lib-esm/adapterCore/serverContext/serverContext.d.ts +20 -0
  178. package/lib-esm/adapterCore/serverContext/serverContext.js +36 -0
  179. package/lib-esm/adapterCore/serverContext/serverContextRegistry.d.ts +6 -0
  180. package/lib-esm/adapterCore/serverContext/serverContextRegistry.js +21 -0
  181. package/lib-esm/adapterCore/serverContext/types/amplifyServer.d.ts +16 -0
  182. package/lib-esm/adapterCore/serverContext/types/amplifyServer.js +3 -0
  183. package/lib-esm/adapterCore/serverContext/types/cookieStorage.d.ts +31 -0
  184. package/lib-esm/adapterCore/serverContext/types/cookieStorage.js +3 -0
  185. package/lib-esm/adapterCore/serverContext/types/index.d.ts +4 -0
  186. package/lib-esm/adapterCore/serverContext/types/index.js +3 -0
  187. package/lib-esm/clients/handlers/fetch.js +1 -0
  188. package/lib-esm/clients/internal/composeServiceApi.d.ts +5 -2
  189. package/lib-esm/index.d.ts +11 -32
  190. package/lib-esm/index.js +11 -29
  191. package/lib-esm/libraryUtils.d.ts +21 -0
  192. package/lib-esm/libraryUtils.js +33 -0
  193. package/lib-esm/providers/pinpoint/apis/index.d.ts +2 -0
  194. package/lib-esm/providers/pinpoint/apis/index.js +4 -0
  195. package/lib-esm/providers/pinpoint/apis/record.d.ts +5 -0
  196. package/lib-esm/providers/pinpoint/apis/record.js +116 -0
  197. package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +5 -0
  198. package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +116 -0
  199. package/lib-esm/providers/pinpoint/index.d.ts +2 -0
  200. package/lib-esm/providers/pinpoint/index.js +3 -0
  201. package/lib-esm/providers/pinpoint/types/buffer.d.ts +25 -0
  202. package/lib-esm/providers/pinpoint/types/buffer.js +3 -0
  203. package/lib-esm/providers/pinpoint/types/index.d.ts +1 -0
  204. package/lib-esm/providers/pinpoint/types/index.js +3 -0
  205. package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +40 -0
  206. package/lib-esm/providers/pinpoint/types/pinpoint.js +3 -0
  207. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +23 -0
  208. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +275 -0
  209. package/lib-esm/providers/pinpoint/utils/cacheEndpointId.d.ts +7 -0
  210. package/lib-esm/providers/pinpoint/utils/cacheEndpointId.js +57 -0
  211. package/lib-esm/providers/pinpoint/utils/constants.d.ts +4 -0
  212. package/lib-esm/providers/pinpoint/utils/constants.js +7 -0
  213. package/lib-esm/providers/pinpoint/utils/getCacheKey.d.ts +7 -0
  214. package/lib-esm/providers/pinpoint/utils/getCacheKey.js +9 -0
  215. package/lib-esm/providers/pinpoint/utils/getEndpointId.d.ts +7 -0
  216. package/lib-esm/providers/pinpoint/utils/getEndpointId.js +58 -0
  217. package/lib-esm/providers/pinpoint/utils/getEventBuffer.d.ts +8 -0
  218. package/lib-esm/providers/pinpoint/utils/getEventBuffer.js +44 -0
  219. package/lib-esm/providers/pinpoint/utils/index.d.ts +3 -0
  220. package/lib-esm/providers/pinpoint/utils/index.js +5 -0
  221. package/lib-esm/server.d.ts +1 -0
  222. package/lib-esm/server.js +3 -0
  223. package/lib-esm/singleton/Amplify.d.ts +36 -0
  224. package/lib-esm/singleton/Amplify.js +135 -0
  225. package/lib-esm/singleton/Analytics/types.d.ts +2 -0
  226. package/lib-esm/singleton/Analytics/types.js +3 -0
  227. package/lib-esm/singleton/Auth/index.js +14 -11
  228. package/lib-esm/singleton/Auth/types.d.ts +28 -3
  229. package/lib-esm/singleton/Auth/utils/index.d.ts +3 -2
  230. package/lib-esm/singleton/Auth/utils/index.js +13 -0
  231. package/lib-esm/singleton/Storage/types.d.ts +6 -2
  232. package/lib-esm/singleton/apis/fetchAuthSession.d.ts +2 -0
  233. package/lib-esm/singleton/apis/fetchAuthSession.js +7 -0
  234. package/lib-esm/singleton/apis/internal/fetchAuthSession.d.ts +3 -0
  235. package/lib-esm/singleton/apis/internal/fetchAuthSession.js +5 -0
  236. package/lib-esm/singleton/apis/server/fetchAuthSession.d.ts +3 -0
  237. package/lib-esm/singleton/apis/server/fetchAuthSession.js +7 -0
  238. package/lib-esm/singleton/index.d.ts +2 -46
  239. package/lib-esm/singleton/index.js +2 -141
  240. package/lib-esm/singleton/types.d.ts +3 -1
  241. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  242. package/lib-esm/types/core.d.ts +47 -0
  243. package/lib-esm/types/core.js +3 -0
  244. package/lib-esm/types/errors.d.ts +16 -0
  245. package/lib-esm/types/errors.js +3 -0
  246. package/lib-esm/types/index.d.ts +4 -1
  247. package/lib-esm/types/index.js +4 -1
  248. package/lib-esm/types/logging.d.ts +13 -0
  249. package/lib-esm/types/logging.js +3 -0
  250. package/lib-esm/types/storage.d.ts +14 -0
  251. package/lib-esm/types/storage.js +3 -0
  252. package/package.json +15 -12
  253. package/server/package.json +8 -0
  254. package/src/AwsClients/Pinpoint/index.ts +1 -1
  255. package/src/AwsClients/Pinpoint/putEvents.ts +1 -1
  256. package/src/Cache/AsyncStorageCache.ts +1 -1
  257. package/src/Cache/BrowserStorageCache.ts +1 -1
  258. package/src/Cache/InMemoryCache.ts +1 -1
  259. package/src/Cache/StorageCache.ts +2 -2
  260. package/src/Cache/Utils/CacheList.ts +1 -1
  261. package/src/Credentials.ts +2 -8
  262. package/src/Hub/index.ts +204 -0
  263. package/src/Hub/types/AuthTypes.ts +10 -0
  264. package/src/Hub/types/HubTypes.ts +46 -0
  265. package/src/{Providers → Hub/types}/index.ts +3 -1
  266. package/src/I18n/I18n.ts +2 -2
  267. package/src/I18n/index.ts +1 -1
  268. package/src/Logger/ConsoleLogger.ts +1 -2
  269. package/src/OAuthHelper/FacebookOAuth.ts +1 -1
  270. package/src/OAuthHelper/GoogleOAuth.ts +1 -1
  271. package/src/Platform/version.ts +1 -1
  272. package/src/RNComponents/index.ts +2 -1
  273. package/src/RNComponents/isAppInForeground.ts +8 -0
  274. package/src/ServiceWorker/ServiceWorker.ts +3 -3
  275. package/src/StorageHelper/localStorage.ts +1 -1
  276. package/src/StorageHelper/sessionStorage.ts +1 -1
  277. package/src/UniversalStorage/index.ts +1 -1
  278. package/src/Util/Constants.ts +25 -16
  279. package/src/{Errors.ts → Util/Errors.ts} +1 -1
  280. package/src/Util/Reachability.ts +1 -1
  281. package/src/Util/errors/AssertError.ts +1 -1
  282. package/src/Util/index.ts +0 -4
  283. package/src/adapterCore/error/AmplifyServerContextError.ts +23 -0
  284. package/src/adapterCore/error/index.ts +4 -0
  285. package/src/adapterCore/index.ts +11 -0
  286. package/src/adapterCore/serverContext/index.ts +10 -0
  287. package/src/adapterCore/serverContext/serverContext.ts +54 -0
  288. package/src/adapterCore/serverContext/serverContextRegistry.ts +31 -0
  289. package/src/adapterCore/serverContext/types/amplifyServer.ts +29 -0
  290. package/src/adapterCore/serverContext/types/cookieStorage.ts +43 -0
  291. package/src/adapterCore/serverContext/types/index.ts +9 -0
  292. package/src/clients/handlers/fetch.ts +1 -0
  293. package/src/clients/internal/composeServiceApi.ts +13 -4
  294. package/src/index.ts +40 -120
  295. package/src/libraryUtils.ts +102 -0
  296. package/src/providers/pinpoint/apis/index.ts +5 -0
  297. package/src/providers/pinpoint/apis/record.ts +90 -0
  298. package/src/providers/pinpoint/apis/updateEndpoint.ts +82 -0
  299. package/src/providers/pinpoint/index.ts +5 -0
  300. package/src/providers/pinpoint/types/buffer.ts +32 -0
  301. package/{lib-esm/Providers/index.js → src/providers/pinpoint/types/index.ts} +2 -1
  302. package/src/providers/pinpoint/types/pinpoint.ts +55 -0
  303. package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +248 -0
  304. package/src/providers/pinpoint/utils/cacheEndpointId.ts +27 -0
  305. package/src/providers/pinpoint/utils/constants.ts +8 -0
  306. package/src/providers/pinpoint/utils/getCacheKey.ts +16 -0
  307. package/src/providers/pinpoint/utils/getEndpointId.ts +20 -0
  308. package/src/providers/pinpoint/utils/getEventBuffer.ts +60 -0
  309. package/src/providers/pinpoint/utils/index.ts +6 -0
  310. package/src/server.ts +4 -0
  311. package/src/singleton/Amplify.ts +121 -0
  312. package/src/singleton/Analytics/types.ts +6 -0
  313. package/src/singleton/Auth/index.ts +7 -5
  314. package/src/singleton/Auth/types.ts +38 -6
  315. package/src/singleton/Auth/utils/index.ts +27 -1
  316. package/src/singleton/Storage/types.ts +6 -3
  317. package/src/singleton/apis/fetchAuthSession.ts +12 -0
  318. package/src/singleton/apis/internal/fetchAuthSession.ts +12 -0
  319. package/src/singleton/apis/server/fetchAuthSession.ts +16 -0
  320. package/src/singleton/index.ts +2 -128
  321. package/src/singleton/types.ts +4 -4
  322. package/src/types/core.ts +58 -0
  323. package/src/types/errors.ts +21 -0
  324. package/src/types/index.ts +5 -1
  325. package/src/types/logging.ts +24 -0
  326. package/src/types/storage.ts +19 -0
  327. package/lib/Hub.js +0 -220
  328. package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
  329. package/lib/Providers/AWSCloudWatchProvider.js +0 -619
  330. package/lib/Providers/index.d.ts +0 -1
  331. package/lib/Providers/index.js +0 -7
  332. package/lib/constants.d.ts +0 -9
  333. package/lib/constants.js +0 -22
  334. package/lib/types/types.d.ts +0 -76
  335. package/lib-esm/Hub.js +0 -217
  336. package/lib-esm/Providers/AWSCloudWatchProvider.d.ts +0 -34
  337. package/lib-esm/Providers/AWSCloudWatchProvider.js +0 -616
  338. package/lib-esm/Providers/index.d.ts +0 -1
  339. package/lib-esm/constants.d.ts +0 -9
  340. package/lib-esm/constants.js +0 -19
  341. package/lib-esm/types/types.d.ts +0 -76
  342. package/src/Hub.ts +0 -236
  343. package/src/Providers/AWSCloudWatchProvider.ts +0 -540
  344. package/src/constants.ts +0 -31
  345. package/src/types/types.ts +0 -104
  346. /package/lib/{types/types.js → Hub/types/AuthTypes.js} +0 -0
  347. /package/lib/{Errors.js → Util/Errors.js} +0 -0
  348. /package/lib/{JS.d.ts → Util/JS.d.ts} +0 -0
  349. /package/lib/{JS.js → Util/JS.js} +0 -0
  350. /package/lib-esm/{types/types.js → Hub/types/AuthTypes.js} +0 -0
  351. /package/lib-esm/{Errors.js → Util/Errors.js} +0 -0
  352. /package/lib-esm/{JS.d.ts → Util/JS.d.ts} +0 -0
  353. /package/lib-esm/{JS.js → Util/JS.js} +0 -0
  354. /package/src/{JS.ts → Util/JS.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { ConsoleLogger as Logger } from '../Logger';
4
- import { browserOrNode } from '../JS';
4
+ import { browserOrNode } from '../Util/JS';
5
5
  import { NonRetryableError } from '../Util';
6
6
 
7
7
  const logger = new Logger('CognitoCredentials');
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '6.0.1-console-preview.f63250a.0+f63250a';
2
+ export const version = '6.0.1-console-preview.5dc0b68.0+5dc0b68';
@@ -1,12 +1,13 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { browserOrNode } from '../JS';
4
+ import { browserOrNode } from '../Util/JS';
5
5
  import { StorageHelper } from '../StorageHelper';
6
6
 
7
7
  export const Linking = {};
8
8
  export const AppState = {
9
9
  addEventListener: (action: any, handler: any) => undefined,
10
+ currentState: 'active'
10
11
  };
11
12
 
12
13
  // if not in react native, just use local storage
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AppState } from '.';
5
+
6
+ export const isAppInForeground = () => {
7
+ return AppState.currentState === 'active';
8
+ };
@@ -13,11 +13,11 @@
13
13
  * and limitations under the License.
14
14
  */
15
15
  import { ConsoleLogger as Logger } from '../Logger';
16
- import { browserOrNode } from '../JS';
16
+ import { browserOrNode } from '../Util/JS';
17
17
  import { Amplify } from '../Amplify';
18
18
  import { asserts } from '../Util/errors/AssertError';
19
- import { AmplifyError } from '../Errors';
20
- import { SERVICE_WORKER_EXCEPTION } from '../constants';
19
+ import { AmplifyError } from '../Util/Errors';
20
+ import { SERVICE_WORKER_EXCEPTION } from '../Util/Constants';
21
21
  /**
22
22
  * Provides a means to registering a service worker in the browser
23
23
  * and communicating with it via postMessage events.
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { KeyValueStorageInterface } from "../types";
5
- import { PlatformNotSupportedError } from '../Errors';
5
+ import { PlatformNotSupportedError } from '../Util/Errors';
6
6
 
7
7
  class LocalStorageClass implements KeyValueStorageInterface {
8
8
  storage?: Storage;
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { PlatformNotSupportedError } from '../Errors';
4
+ import { PlatformNotSupportedError } from '../Util/Errors';
5
5
  import { KeyValueStorageInterface } from '../types';
6
6
 
7
7
  class SessionStorageClass implements KeyValueStorageInterface {
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import Cookies, { CookieSetOptions } from 'universal-cookie';
4
- import { browserOrNode } from '../JS';
4
+ import { browserOrNode } from '../Util/JS';
5
5
 
6
6
  type Store = Record<string, string>;
7
7
 
@@ -2,23 +2,32 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  // Logging constants
5
- const AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
6
- const AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;
7
- const AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;
8
- const AWS_CLOUDWATCH_CATEGORY = 'Logging';
9
- const AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
10
- const NO_CREDS_ERROR_STRING = 'No credentials';
11
- const RETRY_ERROR_CODES = [
5
+ export const AWS_CLOUDWATCH_CATEGORY = 'Logging';
6
+ export const NO_CREDS_ERROR_STRING = 'No credentials';
7
+ export const RETRY_ERROR_CODES = [
12
8
  'ResourceNotFoundException',
13
9
  'InvalidSequenceTokenException',
14
10
  ];
15
11
 
16
- export {
17
- AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
18
- AWS_CLOUDWATCH_CATEGORY,
19
- AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
20
- AWS_CLOUDWATCH_MAX_EVENT_SIZE,
21
- AWS_CLOUDWATCH_PROVIDER_NAME,
22
- NO_CREDS_ERROR_STRING,
23
- RETRY_ERROR_CODES,
24
- };
12
+ /**
13
+ * This Symbol is used to reference an internal-only PubSub provider that
14
+ * is used for AppSync/GraphQL subscriptions in the API category.
15
+ */
16
+ const hasSymbol =
17
+ typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';
18
+
19
+ export const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol
20
+ ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')
21
+ : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';
22
+
23
+ export const USER_AGENT_HEADER = 'x-amz-user-agent';
24
+
25
+ // Error exception code constants
26
+ export const AUTH_CONFING_EXCEPTION = 'AuthConfigException';
27
+ export const CACHE_LIST_EXCEPTION = 'CacheListException';
28
+ export const I18N_EXCEPTION = 'I18NException';
29
+ export const SERVICE_WORKER_EXCEPTION = 'ServiceWorkerException';
30
+ export const STORAGE_CACHE_EXCEPTION = 'StorageCacheException';
31
+ export const APPLICATION_ID_EXCEPTION = 'ApplicationIdException';
32
+ export const NO_HUBCALLBACK_PROVIDED_EXCEPTION =
33
+ 'NoHubcallbackProvidedException';
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ErrorParams } from './types/types';
4
+ import { ErrorParams } from '../types/errors';
5
5
 
6
6
  export function missingConfig(name: string) {
7
7
  return new Error('Missing config value of ' + name);
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import Observable, { ZenObservable } from 'zen-observable-ts';
4
- import { browserOrNode, isWebWorker } from '../JS';
4
+ import { browserOrNode, isWebWorker } from './JS';
5
5
 
6
6
  type NetworkStatus = {
7
7
  online: boolean;
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { AmplifyError } from '../../Errors';
3
+ import { AmplifyError } from '../Errors';
4
4
  import { ErrorParams } from '../../types';
5
5
 
6
6
  export function asserts(
package/src/Util/index.ts CHANGED
@@ -12,11 +12,7 @@ export { default as Reachability } from './Reachability';
12
12
  export { DateUtils } from './DateUtils';
13
13
  export { urlSafeDecode, urlSafeEncode } from './StringUtils';
14
14
  export {
15
- AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
16
15
  AWS_CLOUDWATCH_CATEGORY,
17
- AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
18
- AWS_CLOUDWATCH_MAX_EVENT_SIZE,
19
- AWS_CLOUDWATCH_PROVIDER_NAME,
20
16
  NO_CREDS_ERROR_STRING,
21
17
  RETRY_ERROR_CODES,
22
18
  } from './Constants';
@@ -0,0 +1,23 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AmplifyError } from '../../libraryUtils';
5
+
6
+ export class AmplifyServerContextError extends AmplifyError {
7
+ constructor({
8
+ message,
9
+ recoverySuggestion,
10
+ underlyingError,
11
+ }: {
12
+ message: string;
13
+ recoverySuggestion?: string;
14
+ underlyingError?: Error;
15
+ }) {
16
+ super({
17
+ name: 'AmplifyServerContextError',
18
+ message,
19
+ recoverySuggestion,
20
+ underlyingError,
21
+ });
22
+ }
23
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export { AmplifyServerContextError } from './AmplifyServerContextError';
@@ -0,0 +1,11 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export {
5
+ createAmplifyServerContext,
6
+ getAmplifyServerContext,
7
+ destroyAmplifyServerContext,
8
+ AmplifyServer,
9
+ CookieStorage,
10
+ } from './serverContext';
11
+ export { AmplifyServerContextError } from './error';
@@ -0,0 +1,10 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export {
5
+ createAmplifyServerContext,
6
+ destroyAmplifyServerContext,
7
+ getAmplifyServerContext,
8
+ } from './serverContext';
9
+
10
+ export { AmplifyServer, CookieStorage } from './types';
@@ -0,0 +1,54 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AmplifyServer } from './types';
5
+ import { serverContextRegistry } from './serverContextRegistry';
6
+ import { AmplifyClass } from '../../singleton';
7
+ import { LibraryOptions, ResourcesConfig } from '../../singleton/types';
8
+
9
+ /**
10
+ * Creates an Amplify server context.
11
+ * @param amplifyConfig The Amplify resource config.
12
+ * @param libraryOptions The Amplify library options.
13
+ * @returns The Amplify server context spec.
14
+ */
15
+ export const createAmplifyServerContext = (
16
+ amplifyConfig: ResourcesConfig,
17
+ libraryOptions: LibraryOptions
18
+ ): AmplifyServer.ContextSpec => {
19
+ const amplify = new AmplifyClass();
20
+ amplify.configure(amplifyConfig, libraryOptions);
21
+
22
+ return serverContextRegistry.register({
23
+ amplify,
24
+ });
25
+ };
26
+
27
+ /**
28
+ * Returns an Amplify server context.
29
+ * @param contextSpec The context spec used to get the Amplify server context.
30
+ * @returns The Amplify server context.
31
+ */
32
+ export const getAmplifyServerContext = (
33
+ contextSpec: AmplifyServer.ContextSpec
34
+ ): AmplifyServer.Context => {
35
+ const context = serverContextRegistry.get(contextSpec);
36
+
37
+ if (context) {
38
+ return context;
39
+ }
40
+
41
+ throw new Error(
42
+ 'Attempted to get the Amplify Server Context that may have been destroyed.'
43
+ );
44
+ };
45
+
46
+ /**
47
+ * Destroys an Amplify server context.
48
+ * @param contextSpec The context spec used to destroy the Amplify server context.
49
+ */
50
+ export const destroyAmplifyServerContext = (
51
+ contextSpec: AmplifyServer.ContextSpec
52
+ ): void => {
53
+ serverContextRegistry.deregister(contextSpec);
54
+ };
@@ -0,0 +1,31 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AmplifyServer } from './types';
5
+
6
+ const storage = new WeakMap<
7
+ AmplifyServer.ContextToken,
8
+ AmplifyServer.Context
9
+ >();
10
+
11
+ function createToken(): AmplifyServer.ContextToken {
12
+ return {
13
+ value: Symbol('AmplifyServerContextToken'),
14
+ };
15
+ }
16
+
17
+ export const serverContextRegistry = {
18
+ register(context: AmplifyServer.Context): AmplifyServer.ContextSpec {
19
+ const token = createToken();
20
+ storage.set(token, context);
21
+ return { token };
22
+ },
23
+ deregister(contextSpec: AmplifyServer.ContextSpec): boolean {
24
+ return storage.delete(contextSpec.token);
25
+ },
26
+ get(
27
+ contextSpec: AmplifyServer.ContextSpec
28
+ ): AmplifyServer.Context | undefined {
29
+ return storage.get(contextSpec.token);
30
+ },
31
+ };
@@ -0,0 +1,29 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AmplifyClass } from '../../../singleton';
5
+ import { LibraryOptions, ResourcesConfig } from '../../../singleton/types';
6
+
7
+ export namespace AmplifyServer {
8
+ export type ContextToken = {
9
+ readonly value: Symbol;
10
+ };
11
+
12
+ export type ContextSpec = {
13
+ readonly token: ContextToken;
14
+ };
15
+
16
+ export type Context = {
17
+ amplify: AmplifyClass;
18
+ };
19
+
20
+ export interface RunOperationWithContext {
21
+ <Result>(
22
+ amplifyConfig: ResourcesConfig,
23
+ libraryOptions: LibraryOptions,
24
+ operation: (
25
+ contextSpec: AmplifyServer.ContextSpec
26
+ ) => Result | Promise<Result>
27
+ ): Promise<Result>;
28
+ }
29
+ }
@@ -0,0 +1,43 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { CookieSerializeOptions } from 'cookie';
5
+
6
+ export namespace CookieStorage {
7
+ export type SetCookieOptions = Pick<
8
+ CookieSerializeOptions,
9
+ 'domain' | 'expires' | 'httpOnly' | 'maxAge' | 'sameSite' | 'secure'
10
+ >;
11
+
12
+ export type Cookie = {
13
+ name: string;
14
+ value?: string;
15
+ } & SetCookieOptions;
16
+
17
+ export interface Adapter {
18
+ /**
19
+ * Get all cookies from the storage.
20
+ */
21
+ getAll(): Cookie[];
22
+
23
+ /**
24
+ * Get a cookie from the storage.
25
+ * @param name The name of the cookie.
26
+ */
27
+ get(name: string): Cookie | undefined;
28
+
29
+ /**
30
+ * Set a cookie in the storage.
31
+ * @param name The name of the cookie.
32
+ * @param value The value of the cookie.
33
+ * @param [options] The cookie's options.
34
+ */
35
+ set(name: string, value: string, options?: SetCookieOptions): void;
36
+
37
+ /**
38
+ * Delete a cookie from the storage.
39
+ * @param name The name of the cookie.
40
+ */
41
+ delete(name: string): void;
42
+ }
43
+ }
@@ -0,0 +1,9 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AmplifyServer } from './amplifyServer';
5
+
6
+ type AmplifyServerContextSpec = AmplifyServer.ContextSpec;
7
+
8
+ export { AmplifyServerContextSpec, AmplifyServer };
9
+ export { CookieStorage } from './cookieStorage';
@@ -9,6 +9,7 @@ import { withMemoization } from '../utils/memoization';
9
9
  const shouldSendBody = (method: string) =>
10
10
  !['HEAD', 'GET', 'DELETE'].includes(method.toUpperCase());
11
11
 
12
+ // TODO[AllanZhengYP]: we need to provide isCanceledError utility
12
13
  export const fetchTransferHandler: TransferHandler<
13
14
  HttpRequest,
14
15
  HttpResponse,
@@ -9,7 +9,7 @@ export const composeServiceApi = <
9
9
  TransferHandlerOptions,
10
10
  Input,
11
11
  Output,
12
- DefaultConfig extends Partial<TransferHandlerOptions & ServiceClientOptions>
12
+ DefaultConfig
13
13
  >(
14
14
  transferHandler: TransferHandler<
15
15
  HttpRequest,
@@ -21,11 +21,14 @@ export const composeServiceApi = <
21
21
  endpoint: Endpoint
22
22
  ) => Promise<HttpRequest> | HttpRequest,
23
23
  deserializer: (output: HttpResponse) => Promise<Output>,
24
- defaultConfig: DefaultConfig
24
+ defaultConfig: Partial<DefaultConfig>
25
25
  ) => {
26
26
  return async (
27
27
  config: OptionalizeKey<
28
- TransferHandlerOptions & ServiceClientOptions & DefaultConfig,
28
+ TransferHandlerOptions &
29
+ ServiceClientOptions &
30
+ Partial<DefaultConfig> &
31
+ InferEndpointResolverOptionType<DefaultConfig>,
29
32
  keyof DefaultConfig
30
33
  >,
31
34
  input: Input
@@ -51,6 +54,12 @@ export const composeServiceApi = <
51
54
  };
52
55
  };
53
56
 
54
- type OptionalizeKey<T, K> = Omit<T, K & keyof T> & {
57
+ type OptionalizeKey<T, K extends keyof T> = Omit<T, K> & {
55
58
  [P in K & keyof T]?: T[P];
56
59
  };
60
+
61
+ type InferEndpointResolverOptionType<T> = T extends {
62
+ endpointResolver: (options: infer EndpointOptions) => any;
63
+ }
64
+ ? EndpointOptions
65
+ : never;
package/src/index.ts CHANGED
@@ -1,127 +1,20 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Amplify } from './Amplify';
5
- import { Platform } from './Platform';
6
-
7
- export { Amplify };
8
- export { AmplifyClass } from './Amplify';
4
+ /*
5
+ This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
6
+ */
7
+ // TODO Remove these
9
8
  export { ClientDevice } from './ClientDevice';
10
9
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
11
- export {
12
- invalidParameter,
13
- missingConfig,
14
- AmplifyError,
15
- AmplifyErrorString,
16
- } from './Errors';
17
- export { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';
18
- export { I18n } from './I18n';
19
- export {
20
- browserOrNode,
21
- filenameToContentType,
22
- generateRandomString,
23
- isEmpty,
24
- isStrictObject,
25
- isTextFile,
26
- isWebWorker,
27
- makeQuerablePromise,
28
- objectLessAttributes,
29
- sortByField,
30
- transferKeyToLowerCase,
31
- transferKeyToUpperCase,
32
- } from './JS';
33
- export { Signer } from './Signer';
34
- export { parseAWSExports } from './parseAWSExports';
35
- export { AWSCloudWatchProvider } from './Providers';
10
+ export { Hub } from './Hub';
11
+ export { HubCapsule, HubCallback, HubPayload } from './Hub/types';
36
12
  export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
37
13
  export { AppState, AsyncStorage, Linking } from './RNComponents';
38
14
  export { Credentials, CredentialsClass } from './Credentials';
39
- export { ServiceWorker } from './ServiceWorker';
40
- export {
41
- ICredentials,
42
- ErrorParams,
43
- AmplifyErrorMap,
44
- ServiceError,
45
- KeyValueStorageInterface,
46
- } from './types';
47
- export {
48
- StorageHelper,
49
- MemoryStorage,
50
- LocalStorage,
51
- CookieStorage,
52
- SessionStorage,
53
- MemoryKeyValueStorage,
54
- } from './StorageHelper';
55
- export { UniversalStorage } from './UniversalStorage';
56
- export {
57
- Platform,
58
- getAmplifyUserAgentObject,
59
- getAmplifyUserAgent,
60
- } from './Platform';
61
- export {
62
- ApiAction,
63
- AuthAction,
64
- AnalyticsAction,
65
- Category,
66
- CustomUserAgentDetails,
67
- DataStoreAction,
68
- Framework,
69
- GeoAction,
70
- InteractionsAction,
71
- InAppMessagingAction,
72
- PredictionsAction,
73
- PubSubAction,
74
- PushNotificationAction,
75
- StorageAction,
76
- } from './Platform/types';
77
- export {
78
- INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER,
79
- USER_AGENT_HEADER,
80
- } from './constants';
81
-
82
- export const Constants = {
83
- userAgent: Platform.userAgent,
84
- };
85
-
86
- export {
87
- AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
88
- AWS_CLOUDWATCH_CATEGORY,
89
- AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
90
- AWS_CLOUDWATCH_MAX_EVENT_SIZE,
91
- AWS_CLOUDWATCH_PROVIDER_NAME,
92
- BackgroundManagerNotOpenError,
93
- BackgroundProcessManager,
94
- BackgroundProcessManagerState,
95
- DateUtils,
96
- Mutex,
97
- NO_CREDS_ERROR_STRING,
98
- NonRetryableError,
99
- RETRY_ERROR_CODES,
100
- Reachability,
101
- isNonRetryableError,
102
- jitteredBackoff,
103
- jitteredExponentialRetry,
104
- retry,
105
- urlSafeDecode,
106
- urlSafeEncode,
107
- } from './Util';
108
-
109
- // Cache exports
110
- import { BrowserStorageCache } from './Cache/BrowserStorageCache';
111
- export { asserts } from './Util/errors/AssertError';
112
- export { isTokenExpired } from './singleton/Auth';
113
- export { InMemoryCache } from './Cache/InMemoryCache';
114
- export { CacheConfig } from './Cache/types';
115
- export { ICache } from './Cache/types';
116
- export { BrowserStorageCache };
117
- export { BrowserStorageCache as Cache }; // Maintain interoperability with React Native
15
+ export { ICredentials } from './types';
118
16
 
119
17
  // Singleton exports
120
- export {
121
- decodeJWT,
122
- assertTokenProviderConfig,
123
- assertIdentityPooIdConfig,
124
- } from './singleton/Auth/utils';
125
18
  export {
126
19
  TokenProvider,
127
20
  AuthTokens,
@@ -129,6 +22,7 @@ export {
129
22
  AWSCredentialsAndIdentityIdProvider,
130
23
  AWSCredentialsAndIdentityId,
131
24
  Identity,
25
+ OAuthConfig,
132
26
  } from './singleton/Auth/types';
133
27
  export {
134
28
  AuthConfig,
@@ -137,7 +31,14 @@ export {
137
31
  StorageAccessLevel,
138
32
  StorageConfig,
139
33
  GetCredentialsOptions,
34
+ ResourcesConfig,
35
+ LibraryOptions,
140
36
  } from './singleton/types';
37
+ export {
38
+ Amplify,
39
+ fetchAuthSession,
40
+ AmplifyClass as AmplifyClassV6,
41
+ } from './singleton';
141
42
 
142
43
  // AWSClients exports
143
44
  export {
@@ -147,10 +48,29 @@ export {
147
48
  GetCredentialsForIdentityOutput,
148
49
  } from './AwsClients/CognitoIdentity';
149
50
 
150
- export { AmplifyV6, fetchAuthSession } from './singleton';
151
- export { LibraryOptions, ResourcesConfig } from './singleton/types';
51
+ // Amplify-wide constructs
52
+ export { UserProfile } from './types';
152
53
 
153
- /**
154
- * @deprecated use named import
155
- */
156
- export default Amplify;
54
+ // Storage helpers
55
+ export {
56
+ StorageHelper,
57
+ MemoryStorage,
58
+ LocalStorage,
59
+ CookieStorage,
60
+ SessionStorage,
61
+ MemoryKeyValueStorage,
62
+ } from './StorageHelper';
63
+ export { KeyValueStorageInterface } from './types';
64
+ export { UniversalStorage } from './UniversalStorage';
65
+
66
+ // Cache exports
67
+ import { BrowserStorageCache } from './Cache/BrowserStorageCache';
68
+ export { InMemoryCache } from './Cache/InMemoryCache';
69
+ export { CacheConfig } from './Cache/types';
70
+ export { BrowserStorageCache };
71
+ export { BrowserStorageCache as Cache }; // Maintain interoperability with React Native
72
+
73
+ // Internationalization utilities
74
+ export { I18n } from './I18n';
75
+
76
+ export { parseAWSExports } from './parseAWSExports';