@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
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { AppState } from '.';
4
+ export var isAppInForeground = function () {
5
+ return AppState.currentState === 'active';
6
+ };
@@ -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.
@@ -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 { PlatformNotSupportedError } from '../Errors';
39
+ import { PlatformNotSupportedError } from '../Util/Errors';
40
40
  var LocalStorageClass = /** @class */ (function () {
41
41
  function LocalStorageClass() {
42
42
  if (typeof window !== undefined) {
@@ -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 { PlatformNotSupportedError } from '../Errors';
39
+ import { PlatformNotSupportedError } from '../Util/Errors';
40
40
  var SessionStorageClass = /** @class */ (function () {
41
41
  function SessionStorageClass() {
42
42
  if (typeof window !== undefined) {
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
13
  // SPDX-License-Identifier: Apache-2.0
14
14
  import Cookies from 'universal-cookie';
15
- import { browserOrNode } from '../JS';
15
+ import { browserOrNode } from '../Util/JS';
16
16
  var isBrowser = browserOrNode().isBrowser;
17
17
  var ONE_YEAR_IN_MS = 365 * 24 * 60 * 60 * 1000;
18
18
  var UniversalStorage = /** @class */ (function () {
@@ -1,8 +1,12 @@
1
- declare const AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
2
- declare const AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;
3
- declare const AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;
4
- declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
5
- declare const AWS_CLOUDWATCH_PROVIDER_NAME = "AWSCloudWatch";
6
- declare const NO_CREDS_ERROR_STRING = "No credentials";
7
- declare const RETRY_ERROR_CODES: string[];
8
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, };
1
+ export declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
2
+ export declare const NO_CREDS_ERROR_STRING = "No credentials";
3
+ export declare const RETRY_ERROR_CODES: string[];
4
+ export declare const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;
5
+ export declare const USER_AGENT_HEADER = "x-amz-user-agent";
6
+ export declare const AUTH_CONFING_EXCEPTION = "AuthConfigException";
7
+ export declare const CACHE_LIST_EXCEPTION = "CacheListException";
8
+ export declare const I18N_EXCEPTION = "I18NException";
9
+ export declare const SERVICE_WORKER_EXCEPTION = "ServiceWorkerException";
10
+ export declare const STORAGE_CACHE_EXCEPTION = "StorageCacheException";
11
+ export declare const APPLICATION_ID_EXCEPTION = "ApplicationIdException";
12
+ export declare const NO_HUBCALLBACK_PROVIDED_EXCEPTION = "NoHubcallbackProvidedException";
@@ -1,14 +1,26 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // Logging constants
4
- var AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
5
- var AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;
6
- var AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;
7
- var AWS_CLOUDWATCH_CATEGORY = 'Logging';
8
- var AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';
9
- var NO_CREDS_ERROR_STRING = 'No credentials';
10
- var RETRY_ERROR_CODES = [
4
+ export var AWS_CLOUDWATCH_CATEGORY = 'Logging';
5
+ export var NO_CREDS_ERROR_STRING = 'No credentials';
6
+ export var RETRY_ERROR_CODES = [
11
7
  'ResourceNotFoundException',
12
8
  'InvalidSequenceTokenException',
13
9
  ];
14
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, };
10
+ /**
11
+ * This Symbol is used to reference an internal-only PubSub provider that
12
+ * is used for AppSync/GraphQL subscriptions in the API category.
13
+ */
14
+ var hasSymbol = typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';
15
+ export var INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol
16
+ ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')
17
+ : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';
18
+ export var USER_AGENT_HEADER = 'x-amz-user-agent';
19
+ // Error exception code constants
20
+ export var AUTH_CONFING_EXCEPTION = 'AuthConfigException';
21
+ export var CACHE_LIST_EXCEPTION = 'CacheListException';
22
+ export var I18N_EXCEPTION = 'I18NException';
23
+ export var SERVICE_WORKER_EXCEPTION = 'ServiceWorkerException';
24
+ export var STORAGE_CACHE_EXCEPTION = 'StorageCacheException';
25
+ export var APPLICATION_ID_EXCEPTION = 'ApplicationIdException';
26
+ export var NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';
@@ -1,4 +1,4 @@
1
- import { ErrorParams } from './types/types';
1
+ import { ErrorParams } from '../types/errors';
2
2
  export declare function missingConfig(name: string): Error;
3
3
  export declare function invalidParameter(name: string): Error;
4
4
  export declare enum AmplifyErrorString {
@@ -12,7 +12,7 @@ var __values = (this && this.__values) || function(o) {
12
12
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
13
  // SPDX-License-Identifier: Apache-2.0
14
14
  import Observable from 'zen-observable-ts';
15
- import { browserOrNode, isWebWorker } from '../JS';
15
+ import { browserOrNode, isWebWorker } from './JS';
16
16
  var ReachabilityNavigator = /** @class */ (function () {
17
17
  function ReachabilityNavigator() {
18
18
  }
@@ -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
  export function asserts(assertion, errorParams) {
5
5
  if (!assertion)
6
6
  throw new AmplifyError(errorParams);
@@ -3,5 +3,5 @@ export { default as Mutex } from './Mutex';
3
3
  export { default as Reachability } from './Reachability';
4
4
  export { DateUtils } from './DateUtils';
5
5
  export { urlSafeDecode, urlSafeEncode } from './StringUtils';
6
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
6
+ export { AWS_CLOUDWATCH_CATEGORY, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
7
7
  export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
@@ -5,5 +5,5 @@ export { default as Mutex } from './Mutex';
5
5
  export { default as Reachability } from './Reachability';
6
6
  export { DateUtils } from './DateUtils';
7
7
  export { urlSafeDecode, urlSafeEncode } from './StringUtils';
8
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
8
+ export { AWS_CLOUDWATCH_CATEGORY, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
9
9
  export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
@@ -0,0 +1,8 @@
1
+ import { AmplifyError } from '../../libraryUtils';
2
+ export declare class AmplifyServerContextError extends AmplifyError {
3
+ constructor({ message, recoverySuggestion, underlyingError, }: {
4
+ message: string;
5
+ recoverySuggestion?: string;
6
+ underlyingError?: Error;
7
+ });
8
+ }
@@ -0,0 +1,32 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ var __extends = (this && this.__extends) || (function () {
4
+ var extendStatics = function (d, b) {
5
+ extendStatics = Object.setPrototypeOf ||
6
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
8
+ return extendStatics(d, b);
9
+ };
10
+ return function (d, b) {
11
+ if (typeof b !== "function" && b !== null)
12
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
13
+ extendStatics(d, b);
14
+ function __() { this.constructor = d; }
15
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16
+ };
17
+ })();
18
+ import { AmplifyError } from '../../libraryUtils';
19
+ var AmplifyServerContextError = /** @class */ (function (_super) {
20
+ __extends(AmplifyServerContextError, _super);
21
+ function AmplifyServerContextError(_a) {
22
+ var message = _a.message, recoverySuggestion = _a.recoverySuggestion, underlyingError = _a.underlyingError;
23
+ return _super.call(this, {
24
+ name: 'AmplifyServerContextError',
25
+ message: message,
26
+ recoverySuggestion: recoverySuggestion,
27
+ underlyingError: underlyingError,
28
+ }) || this;
29
+ }
30
+ return AmplifyServerContextError;
31
+ }(AmplifyError));
32
+ export { AmplifyServerContextError };
@@ -0,0 +1 @@
1
+ export { AmplifyServerContextError } from './AmplifyServerContextError';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { AmplifyServerContextError } from './AmplifyServerContextError';
@@ -0,0 +1,2 @@
1
+ export { createAmplifyServerContext, getAmplifyServerContext, destroyAmplifyServerContext, AmplifyServer, CookieStorage, } from './serverContext';
2
+ export { AmplifyServerContextError } from './error';
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { createAmplifyServerContext, getAmplifyServerContext, destroyAmplifyServerContext, } from './serverContext';
4
+ export { AmplifyServerContextError } from './error';
@@ -0,0 +1,2 @@
1
+ export { createAmplifyServerContext, destroyAmplifyServerContext, getAmplifyServerContext, } from './serverContext';
2
+ export { AmplifyServer, CookieStorage } from './types';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { createAmplifyServerContext, destroyAmplifyServerContext, getAmplifyServerContext, } from './serverContext';
@@ -0,0 +1,20 @@
1
+ import { AmplifyServer } from './types';
2
+ import { LibraryOptions, ResourcesConfig } from '../../singleton/types';
3
+ /**
4
+ * Creates an Amplify server context.
5
+ * @param amplifyConfig The Amplify resource config.
6
+ * @param libraryOptions The Amplify library options.
7
+ * @returns The Amplify server context spec.
8
+ */
9
+ export declare const createAmplifyServerContext: (amplifyConfig: ResourcesConfig, libraryOptions: LibraryOptions) => AmplifyServer.ContextSpec;
10
+ /**
11
+ * Returns an Amplify server context.
12
+ * @param contextSpec The context spec used to get the Amplify server context.
13
+ * @returns The Amplify server context.
14
+ */
15
+ export declare const getAmplifyServerContext: (contextSpec: AmplifyServer.ContextSpec) => AmplifyServer.Context;
16
+ /**
17
+ * Destroys an Amplify server context.
18
+ * @param contextSpec The context spec used to destroy the Amplify server context.
19
+ */
20
+ export declare const destroyAmplifyServerContext: (contextSpec: AmplifyServer.ContextSpec) => void;
@@ -0,0 +1,36 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { serverContextRegistry } from './serverContextRegistry';
4
+ import { AmplifyClass } from '../../singleton';
5
+ /**
6
+ * Creates an Amplify server context.
7
+ * @param amplifyConfig The Amplify resource config.
8
+ * @param libraryOptions The Amplify library options.
9
+ * @returns The Amplify server context spec.
10
+ */
11
+ export var createAmplifyServerContext = function (amplifyConfig, libraryOptions) {
12
+ var amplify = new AmplifyClass();
13
+ amplify.configure(amplifyConfig, libraryOptions);
14
+ return serverContextRegistry.register({
15
+ amplify: amplify,
16
+ });
17
+ };
18
+ /**
19
+ * Returns an Amplify server context.
20
+ * @param contextSpec The context spec used to get the Amplify server context.
21
+ * @returns The Amplify server context.
22
+ */
23
+ export var getAmplifyServerContext = function (contextSpec) {
24
+ var context = serverContextRegistry.get(contextSpec);
25
+ if (context) {
26
+ return context;
27
+ }
28
+ throw new Error('Attempted to get the Amplify Server Context that may have been destroyed.');
29
+ };
30
+ /**
31
+ * Destroys an Amplify server context.
32
+ * @param contextSpec The context spec used to destroy the Amplify server context.
33
+ */
34
+ export var destroyAmplifyServerContext = function (contextSpec) {
35
+ serverContextRegistry.deregister(contextSpec);
36
+ };
@@ -0,0 +1,6 @@
1
+ import { AmplifyServer } from './types';
2
+ export declare const serverContextRegistry: {
3
+ register(context: AmplifyServer.Context): AmplifyServer.ContextSpec;
4
+ deregister(contextSpec: AmplifyServer.ContextSpec): boolean;
5
+ get(contextSpec: AmplifyServer.ContextSpec): AmplifyServer.Context | undefined;
6
+ };
@@ -0,0 +1,21 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ var storage = new WeakMap();
4
+ function createToken() {
5
+ return {
6
+ value: Symbol('AmplifyServerContextToken'),
7
+ };
8
+ }
9
+ export var serverContextRegistry = {
10
+ register: function (context) {
11
+ var token = createToken();
12
+ storage.set(token, context);
13
+ return { token: token };
14
+ },
15
+ deregister: function (contextSpec) {
16
+ return storage.delete(contextSpec.token);
17
+ },
18
+ get: function (contextSpec) {
19
+ return storage.get(contextSpec.token);
20
+ },
21
+ };
@@ -0,0 +1,16 @@
1
+ import { AmplifyClass } from '../../../singleton';
2
+ import { LibraryOptions, ResourcesConfig } from '../../../singleton/types';
3
+ export declare namespace AmplifyServer {
4
+ type ContextToken = {
5
+ readonly value: Symbol;
6
+ };
7
+ type ContextSpec = {
8
+ readonly token: ContextToken;
9
+ };
10
+ type Context = {
11
+ amplify: AmplifyClass;
12
+ };
13
+ interface RunOperationWithContext {
14
+ <Result>(amplifyConfig: ResourcesConfig, libraryOptions: LibraryOptions, operation: (contextSpec: AmplifyServer.ContextSpec) => Result | Promise<Result>): Promise<Result>;
15
+ }
16
+ }
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,31 @@
1
+ import { CookieSerializeOptions } from 'cookie';
2
+ export declare namespace CookieStorage {
3
+ type SetCookieOptions = Pick<CookieSerializeOptions, 'domain' | 'expires' | 'httpOnly' | 'maxAge' | 'sameSite' | 'secure'>;
4
+ type Cookie = {
5
+ name: string;
6
+ value?: string;
7
+ } & SetCookieOptions;
8
+ interface Adapter {
9
+ /**
10
+ * Get all cookies from the storage.
11
+ */
12
+ getAll(): Cookie[];
13
+ /**
14
+ * Get a cookie from the storage.
15
+ * @param name The name of the cookie.
16
+ */
17
+ get(name: string): Cookie | undefined;
18
+ /**
19
+ * Set a cookie in the storage.
20
+ * @param name The name of the cookie.
21
+ * @param value The value of the cookie.
22
+ * @param [options] The cookie's options.
23
+ */
24
+ set(name: string, value: string, options?: SetCookieOptions): void;
25
+ /**
26
+ * Delete a cookie from the storage.
27
+ * @param name The name of the cookie.
28
+ */
29
+ delete(name: string): void;
30
+ }
31
+ }
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,4 @@
1
+ import { AmplifyServer } from './amplifyServer';
2
+ type AmplifyServerContextSpec = AmplifyServer.ContextSpec;
3
+ export { AmplifyServerContextSpec, AmplifyServer };
4
+ export { CookieStorage } from './cookieStorage';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -52,6 +52,7 @@ import { withMemoization } from '../utils/memoization';
52
52
  var shouldSendBody = function (method) {
53
53
  return !['HEAD', 'GET', 'DELETE'].includes(method.toUpperCase());
54
54
  };
55
+ // TODO[AllanZhengYP]: we need to provide isCanceledError utility
55
56
  export var fetchTransferHandler = function (_a, _b) {
56
57
  var url = _a.url, method = _a.method, headers = _a.headers, body = _a.body;
57
58
  var abortSignal = _b.abortSignal;
@@ -1,8 +1,11 @@
1
1
  import { ServiceClientOptions } from '../types/aws';
2
2
  import { TransferHandler, Endpoint } from '../types/core';
3
3
  import { HttpRequest, HttpResponse } from '../types/http';
4
- export declare const composeServiceApi: <TransferHandlerOptions, Input, Output, DefaultConfig extends Partial<TransferHandlerOptions & ServiceClientOptions>>(transferHandler: TransferHandler<HttpRequest, HttpResponse, TransferHandlerOptions>, serializer: (input: Input, endpoint: Endpoint) => Promise<HttpRequest> | HttpRequest, deserializer: (output: HttpResponse) => Promise<Output>, defaultConfig: DefaultConfig) => (config: OptionalizeKey<TransferHandlerOptions & ServiceClientOptions & DefaultConfig, keyof DefaultConfig>, input: Input) => Promise<Output>;
5
- type OptionalizeKey<T, K> = Omit<T, K & keyof T> & {
4
+ export declare const composeServiceApi: <TransferHandlerOptions, Input, Output, DefaultConfig>(transferHandler: TransferHandler<HttpRequest, HttpResponse, TransferHandlerOptions>, serializer: (input: Input, endpoint: Endpoint) => Promise<HttpRequest> | HttpRequest, deserializer: (output: HttpResponse) => Promise<Output>, defaultConfig: Partial<DefaultConfig>) => (config: OptionalizeKey<TransferHandlerOptions & ServiceClientOptions & Partial<DefaultConfig> & InferEndpointResolverOptionType<DefaultConfig>, keyof DefaultConfig>, input: Input) => Promise<Output>;
5
+ type OptionalizeKey<T, K extends keyof T> = Omit<T, K> & {
6
6
  [P in K & keyof T]?: T[P];
7
7
  };
8
+ type InferEndpointResolverOptionType<T> = T extends {
9
+ endpointResolver: (options: infer EndpointOptions) => any;
10
+ } ? EndpointOptions : never;
8
11
  export {};
@@ -1,44 +1,23 @@
1
- import { Amplify } from './Amplify';
2
- export { Amplify };
3
- export { AmplifyClass } from './Amplify';
4
1
  export { ClientDevice } from './ClientDevice';
5
2
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
6
- export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Errors';
7
- export { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';
8
- export { I18n } from './I18n';
9
- export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './JS';
10
- export { Signer } from './Signer';
11
- export { parseAWSExports } from './parseAWSExports';
12
- export { AWSCloudWatchProvider } from './Providers';
3
+ export { Hub } from './Hub';
4
+ export { HubCapsule, HubCallback, HubPayload } from './Hub/types';
13
5
  export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
14
6
  export { AppState, AsyncStorage, Linking } from './RNComponents';
15
7
  export { Credentials, CredentialsClass } from './Credentials';
16
- export { ServiceWorker } from './ServiceWorker';
17
- export { ICredentials, ErrorParams, AmplifyErrorMap, ServiceError, KeyValueStorageInterface, } from './types';
8
+ export { ICredentials } from './types';
9
+ export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, OAuthConfig, } from './singleton/Auth/types';
10
+ export { AuthConfig, UserPoolConfig, UserPoolConfigAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, } from './singleton/types';
11
+ export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, } from './singleton';
12
+ export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './AwsClients/CognitoIdentity';
13
+ export { UserProfile } from './types';
18
14
  export { StorageHelper, MemoryStorage, LocalStorage, CookieStorage, SessionStorage, MemoryKeyValueStorage, } from './StorageHelper';
15
+ export { KeyValueStorageInterface } from './types';
19
16
  export { UniversalStorage } from './UniversalStorage';
20
- export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
21
- export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
22
- export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
23
- export declare const Constants: {
24
- userAgent: string;
25
- };
26
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
27
17
  import { BrowserStorageCache } from './Cache/BrowserStorageCache';
28
- export { asserts } from './Util/errors/AssertError';
29
- export { isTokenExpired } from './singleton/Auth';
30
18
  export { InMemoryCache } from './Cache/InMemoryCache';
31
19
  export { CacheConfig } from './Cache/types';
32
- export { ICache } from './Cache/types';
33
20
  export { BrowserStorageCache };
34
21
  export { BrowserStorageCache as Cache };
35
- export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, } from './singleton/Auth/utils';
36
- export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, } from './singleton/Auth/types';
37
- export { AuthConfig, UserPoolConfig, UserPoolConfigAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, } from './singleton/types';
38
- export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './AwsClients/CognitoIdentity';
39
- export { AmplifyV6, fetchAuthSession } from './singleton';
40
- export { LibraryOptions, ResourcesConfig } from './singleton/types';
41
- /**
42
- * @deprecated use named import
43
- */
44
- export default Amplify;
22
+ export { I18n } from './I18n';
23
+ export { parseAWSExports } from './parseAWSExports';
package/lib-esm/index.js CHANGED
@@ -1,44 +1,26 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { Amplify } from './Amplify';
4
- import { Platform } from './Platform';
5
- export { Amplify };
6
- export { AmplifyClass } from './Amplify';
3
+ /*
4
+ This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
5
+ */
6
+ // TODO Remove these
7
7
  export { ClientDevice } from './ClientDevice';
8
8
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
9
- export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Errors';
10
9
  export { Hub } from './Hub';
11
- export { I18n } from './I18n';
12
- export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './JS';
13
- export { Signer } from './Signer';
14
- export { parseAWSExports } from './parseAWSExports';
15
- export { AWSCloudWatchProvider } from './Providers';
16
10
  export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
17
11
  export { AppState, AsyncStorage, Linking } from './RNComponents';
18
12
  export { Credentials, CredentialsClass } from './Credentials';
19
- export { ServiceWorker } from './ServiceWorker';
13
+ export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, } from './singleton';
14
+ // AWSClients exports
15
+ export { getCredentialsForIdentity, getId, } from './AwsClients/CognitoIdentity';
16
+ // Storage helpers
20
17
  export { StorageHelper, MemoryStorage, LocalStorage, CookieStorage, SessionStorage, MemoryKeyValueStorage, } from './StorageHelper';
21
18
  export { UniversalStorage } from './UniversalStorage';
22
- export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
23
- export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
24
- export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
25
- export var Constants = {
26
- userAgent: Platform.userAgent,
27
- };
28
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
29
19
  // Cache exports
30
20
  import { BrowserStorageCache } from './Cache/BrowserStorageCache';
31
- export { asserts } from './Util/errors/AssertError';
32
- export { isTokenExpired } from './singleton/Auth';
33
21
  export { InMemoryCache } from './Cache/InMemoryCache';
34
22
  export { BrowserStorageCache };
35
23
  export { BrowserStorageCache as Cache }; // Maintain interoperability with React Native
36
- // Singleton exports
37
- export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, } from './singleton/Auth/utils';
38
- // AWSClients exports
39
- export { getCredentialsForIdentity, getId, } from './AwsClients/CognitoIdentity';
40
- export { AmplifyV6, fetchAuthSession } from './singleton';
41
- /**
42
- * @deprecated use named import
43
- */
44
- export default Amplify;
24
+ // Internationalization utilities
25
+ export { I18n } from './I18n';
26
+ export { parseAWSExports } from './parseAWSExports';
@@ -0,0 +1,21 @@
1
+ export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
2
+ export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
3
+ export { isTokenExpired } from './singleton/Auth';
4
+ export { Signer } from './Signer';
5
+ export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
6
+ export { ClientDevice } from './ClientDevice';
7
+ export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
8
+ export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
9
+ export declare const Constants: {
10
+ userAgent: string;
11
+ };
12
+ export { ServiceWorker } from './ServiceWorker';
13
+ export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
14
+ export { asserts } from './Util/errors/AssertError';
15
+ export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Util/Errors';
16
+ export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
17
+ export { AppState, AsyncStorage, Linking } from './RNComponents';
18
+ export { ErrorParams, AmplifyErrorMap, ServiceError } from './types';
19
+ export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
20
+ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
21
+ export { AMPLIFY_SYMBOL } from './Hub';
@@ -0,0 +1,33 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /*
4
+ This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
5
+ utils for use throughout the library.
6
+ */
7
+ // JS utilities
8
+ export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
9
+ // Auth utilities
10
+ export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
11
+ export { isTokenExpired } from './singleton/Auth';
12
+ export { Signer } from './Signer';
13
+ // Logging utilities
14
+ export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
15
+ // Platform & device utils
16
+ import { Platform } from './Platform';
17
+ export { ClientDevice } from './ClientDevice';
18
+ export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
19
+ export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
20
+ export var Constants = {
21
+ userAgent: Platform.userAgent,
22
+ };
23
+ // Service worker
24
+ export { ServiceWorker } from './ServiceWorker';
25
+ // Other utilities & constants
26
+ export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
27
+ export { asserts } from './Util/errors/AssertError';
28
+ export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Util/Errors';
29
+ export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
30
+ export { AppState, AsyncStorage, Linking } from './RNComponents';
31
+ export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
32
+ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
33
+ export { AMPLIFY_SYMBOL } from './Hub';
@@ -0,0 +1,2 @@
1
+ export { updateEndpoint } from './updateEndpoint';
2
+ export { record } from './record';
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { updateEndpoint } from './updateEndpoint';
4
+ export { record } from './record';
@@ -0,0 +1,5 @@
1
+ import { PinpointRecordParameters } from '../types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const record: ({ appId, category, credentials, event, identityId, region, userAgentValue, }: PinpointRecordParameters) => Promise<void>;