@aws-amplify/core 5.3.2-unstable.ffe65ea.1 → 5.4.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 (507) hide show
  1. package/internals/aws-client-utils/package.json +8 -0
  2. package/internals/aws-clients/pinpoint/package.json +8 -0
  3. package/lib/Amplify.js +18 -3
  4. package/lib/AwsClients/CognitoIdentity/base.d.ts +28 -0
  5. package/lib/AwsClients/CognitoIdentity/base.js +109 -0
  6. package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +12 -0
  7. package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +82 -0
  8. package/lib/AwsClients/CognitoIdentity/getId.d.ts +12 -0
  9. package/lib/AwsClients/CognitoIdentity/getId.js +72 -0
  10. package/lib/AwsClients/CognitoIdentity/index.d.ts +2 -0
  11. package/lib/AwsClients/CognitoIdentity/index.js +9 -0
  12. package/lib/AwsClients/CognitoIdentity/types.d.ts +153 -0
  13. package/lib/AwsClients/CognitoIdentity/types.js +4 -0
  14. package/lib/AwsClients/Pinpoint/base.d.ts +17 -0
  15. package/lib/AwsClients/Pinpoint/base.js +39 -0
  16. package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +13 -0
  17. package/lib/AwsClients/Pinpoint/getInAppMessages.js +77 -0
  18. package/lib/AwsClients/Pinpoint/index.d.ts +4 -0
  19. package/lib/AwsClients/Pinpoint/index.js +11 -0
  20. package/lib/AwsClients/Pinpoint/putEvents.d.ts +13 -0
  21. package/lib/AwsClients/Pinpoint/putEvents.js +78 -0
  22. package/lib/AwsClients/Pinpoint/types.d.ts +836 -0
  23. package/lib/AwsClients/Pinpoint/types.js +5 -0
  24. package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +13 -0
  25. package/lib/AwsClients/Pinpoint/updateEndpoint.js +81 -0
  26. package/lib/ClientDevice/android.js +3 -2
  27. package/lib/ClientDevice/browser.js +1 -1
  28. package/lib/ClientDevice/index.js +3 -3
  29. package/lib/ClientDevice/ios.js +3 -2
  30. package/lib/ClientDevice/reactnative.js +3 -3
  31. package/lib/Credentials.js +176 -113
  32. package/lib/Errors.js +1 -1
  33. package/lib/Hub.d.ts +4 -4
  34. package/lib/Hub.js +47 -12
  35. package/lib/I18n/I18n.js +13 -3
  36. package/lib/I18n/index.js +1 -1
  37. package/lib/I18n/types.js +1 -1
  38. package/lib/JS.js +29 -17
  39. package/lib/Logger/ConsoleLogger.js +51 -17
  40. package/lib/Logger/index.js +3 -3
  41. package/lib/Logger/logger-interface.js +0 -1
  42. package/lib/OAuthHelper/FacebookOAuth.js +41 -6
  43. package/lib/OAuthHelper/GoogleOAuth.js +41 -6
  44. package/lib/OAuthHelper/index.js +1 -1
  45. package/lib/Platform/index.js +8 -7
  46. package/lib/Platform/version.d.ts +1 -1
  47. package/lib/Platform/version.js +2 -2
  48. package/lib/Providers/AWSCloudWatchProvider.js +104 -44
  49. package/lib/Providers/index.js +2 -2
  50. package/lib/RNComponents/index.js +2 -2
  51. package/lib/RNComponents/reactnative.js +7 -5
  52. package/lib/ServiceWorker/ServiceWorker.js +11 -11
  53. package/lib/ServiceWorker/index.js +2 -2
  54. package/lib/Signer.js +17 -7
  55. package/lib/StorageHelper/index.js +1 -1
  56. package/lib/StorageHelper/reactnative.js +5 -3
  57. package/lib/UniversalStorage/index.d.ts +2 -2
  58. package/lib/UniversalStorage/index.js +24 -6
  59. package/lib/Util/BackgroundProcessManager.js +84 -23
  60. package/lib/Util/Constants.js +1 -1
  61. package/lib/Util/DateUtils.js +18 -3
  62. package/lib/Util/Mutex.js +0 -1
  63. package/lib/Util/Reachability.d.ts +1 -1
  64. package/lib/Util/Reachability.js +18 -6
  65. package/lib/Util/Reachability.native.d.ts +1 -1
  66. package/lib/Util/Reachability.native.js +4 -3
  67. package/lib/Util/Retry.js +103 -26
  68. package/lib/Util/StringUtils.js +1 -1
  69. package/lib/Util/index.js +24 -21
  70. package/lib/clients/endpoints/getDnsSuffix.d.ts +11 -0
  71. package/lib/clients/endpoints/getDnsSuffix.js +49 -0
  72. package/lib/clients/endpoints/index.d.ts +1 -0
  73. package/lib/clients/endpoints/index.js +7 -0
  74. package/lib/clients/endpoints/partitions.d.ts +33 -0
  75. package/lib/clients/endpoints/partitions.js +41 -0
  76. package/lib/clients/handlers/authenticated.d.ts +5 -0
  77. package/lib/clients/handlers/authenticated.js +15 -0
  78. package/lib/clients/handlers/fetch.d.ts +4 -0
  79. package/lib/clients/handlers/fetch.js +123 -0
  80. package/lib/clients/handlers/unauthenticated.d.ts +4 -0
  81. package/lib/clients/handlers/unauthenticated.js +10 -0
  82. package/lib/clients/index.d.ts +8 -0
  83. package/lib/clients/index.js +37 -0
  84. package/lib/clients/internal/composeServiceApi.d.ts +8 -0
  85. package/lib/clients/internal/composeServiceApi.js +75 -0
  86. package/lib/clients/internal/composeTransferHandler.d.ts +29 -0
  87. package/lib/clients/internal/composeTransferHandler.js +26 -0
  88. package/lib/clients/middleware/retry/defaultRetryDecider.d.ts +6 -0
  89. package/lib/clients/middleware/retry/defaultRetryDecider.js +101 -0
  90. package/lib/clients/middleware/retry/index.d.ts +3 -0
  91. package/lib/clients/middleware/retry/index.js +11 -0
  92. package/lib/clients/middleware/retry/jitteredBackoff.d.ts +2 -0
  93. package/lib/clients/middleware/retry/jitteredBackoff.js +16 -0
  94. package/lib/clients/middleware/retry/middleware.d.ts +40 -0
  95. package/lib/clients/middleware/retry/middleware.js +143 -0
  96. package/lib/clients/middleware/signing/index.d.ts +1 -0
  97. package/lib/clients/middleware/signing/index.js +7 -0
  98. package/lib/clients/middleware/signing/middleware.d.ts +13 -0
  99. package/lib/clients/middleware/signing/middleware.js +101 -0
  100. package/lib/clients/middleware/signing/signer/signatureV4/constants.js +1 -1
  101. package/lib/clients/middleware/signing/signer/signatureV4/index.js +4 -4
  102. package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +4 -4
  103. package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +46 -8
  104. package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js +22 -11
  105. package/lib/clients/middleware/signing/signer/signatureV4/types/index.js +0 -1
  106. package/lib/clients/middleware/signing/signer/signatureV4/types/signer.js +0 -1
  107. package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.d.ts +3 -2
  108. package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +7 -5
  109. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +2 -1
  110. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +23 -7
  111. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +24 -8
  112. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +8 -7
  113. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +3 -2
  114. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +3 -2
  115. package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -2
  116. package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +2 -1
  117. package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +4 -3
  118. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +7 -6
  119. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +2 -1
  120. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +3 -2
  121. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +8 -7
  122. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +5 -4
  123. package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +3 -2
  124. package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.d.ts +10 -0
  125. package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.js +23 -0
  126. package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.d.ts +10 -0
  127. package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.js +18 -0
  128. package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.d.ts +9 -0
  129. package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +21 -0
  130. package/lib/clients/middleware/signing/utils/isClockSkewed.d.ts +11 -0
  131. package/lib/clients/middleware/signing/utils/isClockSkewed.js +23 -0
  132. package/lib/clients/middleware/userAgent/index.d.ts +1 -0
  133. package/lib/clients/middleware/userAgent/index.js +7 -0
  134. package/lib/clients/middleware/userAgent/middleware.d.ts +13 -0
  135. package/lib/clients/middleware/userAgent/middleware.js +77 -0
  136. package/lib/clients/serde/index.d.ts +2 -0
  137. package/lib/clients/serde/index.js +10 -0
  138. package/lib/clients/serde/json.d.ts +12 -0
  139. package/lib/clients/serde/json.js +115 -0
  140. package/lib/clients/serde/responseInfo.d.ts +3 -0
  141. package/lib/clients/serde/responseInfo.js +23 -0
  142. package/lib/clients/types/aws.d.ts +18 -1
  143. package/lib/clients/types/aws.js +0 -1
  144. package/lib/clients/types/core.d.ts +22 -0
  145. package/lib/clients/types/core.js +0 -1
  146. package/lib/clients/types/http.d.ts +8 -4
  147. package/lib/clients/types/http.js +0 -1
  148. package/lib/clients/types/index.d.ts +3 -2
  149. package/lib/clients/types/index.js +0 -1
  150. package/lib/clients/utils/isClockSkewError.d.ts +9 -0
  151. package/lib/clients/utils/isClockSkewError.js +27 -0
  152. package/lib/constants.js +1 -1
  153. package/lib/index.js +61 -60
  154. package/lib/parseAWSExports.js +15 -4
  155. package/lib/tsconfig.tsbuildinfo +1 -0
  156. package/lib/types/index.js +15 -1
  157. package/lib/types/types.d.ts +1 -1
  158. package/lib/types/types.js +0 -1
  159. package/lib-esm/Amplify.js +16 -2
  160. package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +28 -0
  161. package/lib-esm/AwsClients/CognitoIdentity/base.js +104 -0
  162. package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +12 -0
  163. package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +79 -0
  164. package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +12 -0
  165. package/lib-esm/AwsClients/CognitoIdentity/getId.js +69 -0
  166. package/lib-esm/AwsClients/CognitoIdentity/index.d.ts +2 -0
  167. package/lib-esm/AwsClients/CognitoIdentity/index.js +4 -0
  168. package/lib-esm/AwsClients/CognitoIdentity/types.d.ts +153 -0
  169. package/lib-esm/AwsClients/CognitoIdentity/types.js +3 -0
  170. package/lib-esm/AwsClients/Pinpoint/base.d.ts +17 -0
  171. package/lib-esm/AwsClients/Pinpoint/base.js +35 -0
  172. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +13 -0
  173. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +74 -0
  174. package/lib-esm/AwsClients/Pinpoint/index.d.ts +4 -0
  175. package/lib-esm/AwsClients/Pinpoint/index.js +5 -0
  176. package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +13 -0
  177. package/lib-esm/AwsClients/Pinpoint/putEvents.js +75 -0
  178. package/lib-esm/AwsClients/Pinpoint/types.d.ts +836 -0
  179. package/lib-esm/AwsClients/Pinpoint/types.js +4 -0
  180. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +13 -0
  181. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +78 -0
  182. package/lib-esm/ClientDevice/android.js +0 -1
  183. package/lib-esm/ClientDevice/browser.js +0 -1
  184. package/lib-esm/ClientDevice/index.js +0 -1
  185. package/lib-esm/ClientDevice/ios.js +0 -1
  186. package/lib-esm/ClientDevice/reactnative.js +0 -1
  187. package/lib-esm/Credentials.js +149 -87
  188. package/lib-esm/Errors.js +0 -1
  189. package/lib-esm/Hub.d.ts +4 -4
  190. package/lib-esm/Hub.js +43 -9
  191. package/lib-esm/I18n/I18n.js +11 -2
  192. package/lib-esm/I18n/index.js +0 -1
  193. package/lib-esm/I18n/types.js +0 -1
  194. package/lib-esm/JS.js +0 -1
  195. package/lib-esm/Logger/ConsoleLogger.js +49 -16
  196. package/lib-esm/Logger/index.js +0 -1
  197. package/lib-esm/Logger/logger-interface.js +1 -1
  198. package/lib-esm/OAuthHelper/FacebookOAuth.js +36 -2
  199. package/lib-esm/OAuthHelper/GoogleOAuth.js +36 -2
  200. package/lib-esm/OAuthHelper/index.js +0 -1
  201. package/lib-esm/Platform/index.js +5 -6
  202. package/lib-esm/Platform/version.d.ts +1 -1
  203. package/lib-esm/Platform/version.js +1 -2
  204. package/lib-esm/Providers/AWSCloudWatchProvider.js +75 -16
  205. package/lib-esm/Providers/index.js +0 -1
  206. package/lib-esm/RNComponents/index.js +0 -1
  207. package/lib-esm/RNComponents/reactnative.js +0 -1
  208. package/lib-esm/ServiceWorker/ServiceWorker.js +9 -10
  209. package/lib-esm/ServiceWorker/index.js +0 -1
  210. package/lib-esm/Signer.js +11 -2
  211. package/lib-esm/StorageHelper/index.js +0 -1
  212. package/lib-esm/StorageHelper/reactnative.js +0 -1
  213. package/lib-esm/UniversalStorage/index.d.ts +2 -2
  214. package/lib-esm/UniversalStorage/index.js +17 -3
  215. package/lib-esm/Util/BackgroundProcessManager.js +74 -14
  216. package/lib-esm/Util/Constants.js +0 -1
  217. package/lib-esm/Util/DateUtils.js +16 -2
  218. package/lib-esm/Util/Mutex.js +0 -1
  219. package/lib-esm/Util/Reachability.d.ts +1 -1
  220. package/lib-esm/Util/Reachability.js +11 -2
  221. package/lib-esm/Util/Reachability.native.d.ts +1 -1
  222. package/lib-esm/Util/Reachability.native.js +0 -1
  223. package/lib-esm/Util/Retry.js +92 -18
  224. package/lib-esm/Util/StringUtils.js +0 -1
  225. package/lib-esm/Util/index.js +0 -1
  226. package/lib-esm/clients/endpoints/getDnsSuffix.d.ts +11 -0
  227. package/lib-esm/clients/endpoints/getDnsSuffix.js +45 -0
  228. package/lib-esm/clients/endpoints/index.d.ts +1 -0
  229. package/lib-esm/clients/endpoints/index.js +3 -0
  230. package/lib-esm/clients/endpoints/partitions.d.ts +33 -0
  231. package/lib-esm/clients/endpoints/partitions.js +38 -0
  232. package/lib-esm/clients/handlers/authenticated.d.ts +5 -0
  233. package/lib-esm/clients/handlers/authenticated.js +12 -0
  234. package/lib-esm/clients/handlers/fetch.d.ts +4 -0
  235. package/lib-esm/clients/handlers/fetch.js +119 -0
  236. package/lib-esm/clients/handlers/unauthenticated.d.ts +4 -0
  237. package/lib-esm/clients/handlers/unauthenticated.js +7 -0
  238. package/lib-esm/clients/index.d.ts +8 -0
  239. package/lib-esm/clients/index.js +10 -0
  240. package/lib-esm/clients/internal/composeServiceApi.d.ts +8 -0
  241. package/lib-esm/clients/internal/composeServiceApi.js +71 -0
  242. package/lib-esm/clients/internal/composeTransferHandler.d.ts +29 -0
  243. package/lib-esm/clients/internal/composeTransferHandler.js +22 -0
  244. package/lib-esm/clients/middleware/retry/defaultRetryDecider.d.ts +6 -0
  245. package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +97 -0
  246. package/lib-esm/clients/middleware/retry/index.d.ts +3 -0
  247. package/lib-esm/clients/middleware/retry/index.js +5 -0
  248. package/lib-esm/clients/middleware/retry/jitteredBackoff.d.ts +2 -0
  249. package/lib-esm/clients/middleware/retry/jitteredBackoff.js +12 -0
  250. package/lib-esm/clients/middleware/retry/middleware.d.ts +40 -0
  251. package/lib-esm/clients/middleware/retry/middleware.js +138 -0
  252. package/lib-esm/clients/middleware/signing/index.d.ts +1 -0
  253. package/lib-esm/clients/middleware/signing/index.js +3 -0
  254. package/lib-esm/clients/middleware/signing/middleware.d.ts +13 -0
  255. package/lib-esm/clients/middleware/signing/middleware.js +97 -0
  256. package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js +0 -1
  257. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +0 -1
  258. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +0 -1
  259. package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +39 -3
  260. package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js +15 -6
  261. package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.js +1 -1
  262. package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.js +1 -1
  263. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.d.ts +3 -2
  264. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +0 -1
  265. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +2 -1
  266. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +20 -6
  267. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +18 -4
  268. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +0 -1
  269. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +0 -1
  270. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +1 -2
  271. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +0 -1
  272. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +2 -1
  273. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +0 -1
  274. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +0 -1
  275. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +2 -1
  276. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +0 -1
  277. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +1 -2
  278. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +0 -1
  279. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +0 -1
  280. package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.d.ts +10 -0
  281. package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.js +19 -0
  282. package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.d.ts +10 -0
  283. package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.js +14 -0
  284. package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.d.ts +9 -0
  285. package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +17 -0
  286. package/lib-esm/clients/middleware/signing/utils/isClockSkewed.d.ts +11 -0
  287. package/lib-esm/clients/middleware/signing/utils/isClockSkewed.js +19 -0
  288. package/lib-esm/clients/middleware/userAgent/index.d.ts +1 -0
  289. package/lib-esm/clients/middleware/userAgent/index.js +3 -0
  290. package/lib-esm/clients/middleware/userAgent/middleware.d.ts +13 -0
  291. package/lib-esm/clients/middleware/userAgent/middleware.js +73 -0
  292. package/lib-esm/clients/serde/index.d.ts +2 -0
  293. package/lib-esm/clients/serde/index.js +4 -0
  294. package/lib-esm/clients/serde/json.d.ts +12 -0
  295. package/lib-esm/clients/serde/json.js +110 -0
  296. package/lib-esm/clients/serde/responseInfo.d.ts +3 -0
  297. package/lib-esm/clients/serde/responseInfo.js +19 -0
  298. package/lib-esm/clients/types/aws.d.ts +18 -1
  299. package/lib-esm/clients/types/aws.js +1 -1
  300. package/lib-esm/clients/types/core.d.ts +22 -0
  301. package/lib-esm/clients/types/core.js +1 -1
  302. package/lib-esm/clients/types/http.d.ts +8 -4
  303. package/lib-esm/clients/types/http.js +1 -1
  304. package/lib-esm/clients/types/index.d.ts +3 -2
  305. package/lib-esm/clients/types/index.js +1 -1
  306. package/lib-esm/clients/utils/isClockSkewError.d.ts +9 -0
  307. package/lib-esm/clients/utils/isClockSkewError.js +23 -0
  308. package/lib-esm/constants.js +0 -1
  309. package/lib-esm/index.js +0 -1
  310. package/lib-esm/parseAWSExports.js +11 -2
  311. package/lib-esm/tsconfig.tsbuildinfo +1 -0
  312. package/lib-esm/types/index.js +1 -1
  313. package/lib-esm/types/types.d.ts +1 -1
  314. package/lib-esm/types/types.js +1 -1
  315. package/package.json +56 -22
  316. package/src/AwsClients/CognitoIdentity/base.ts +88 -0
  317. package/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +67 -0
  318. package/src/AwsClients/CognitoIdentity/getId.ts +58 -0
  319. package/src/AwsClients/CognitoIdentity/index.ts +9 -0
  320. package/src/AwsClients/CognitoIdentity/types.ts +159 -0
  321. package/src/AwsClients/Pinpoint/base.ts +41 -0
  322. package/src/AwsClients/Pinpoint/getInAppMessages.ts +56 -0
  323. package/src/AwsClients/Pinpoint/index.ts +15 -0
  324. package/src/AwsClients/Pinpoint/putEvents.ts +55 -0
  325. package/src/AwsClients/Pinpoint/types.ts +844 -0
  326. package/src/AwsClients/Pinpoint/updateEndpoint.ts +60 -0
  327. package/src/Credentials.ts +75 -100
  328. package/src/OAuthHelper/FacebookOAuth.ts +1 -1
  329. package/src/OAuthHelper/GoogleOAuth.ts +1 -1
  330. package/src/Platform/version.ts +1 -1
  331. package/src/StorageHelper/reactnative.ts +1 -1
  332. package/src/clients/endpoints/getDnsSuffix.ts +25 -0
  333. package/src/clients/endpoints/index.ts +4 -0
  334. package/src/clients/endpoints/partitions.ts +40 -0
  335. package/src/clients/handlers/authenticated.ts +19 -0
  336. package/src/clients/handlers/fetch.ts +75 -0
  337. package/src/clients/handlers/unauthenticated.ts +14 -0
  338. package/src/clients/index.ts +15 -0
  339. package/src/clients/internal/composeServiceApi.ts +50 -0
  340. package/src/clients/internal/composeTransferHandler.ts +89 -0
  341. package/src/clients/middleware/retry/defaultRetryDecider.ts +54 -0
  342. package/src/clients/middleware/retry/index.ts +6 -0
  343. package/src/clients/middleware/retry/jitteredBackoff.ts +16 -0
  344. package/src/clients/middleware/retry/middleware.ts +133 -0
  345. package/src/clients/middleware/signing/index.ts +4 -0
  346. package/src/clients/middleware/signing/middleware.ts +65 -0
  347. package/src/clients/middleware/signing/utils/extendedEncodeURIComponent.ts +21 -0
  348. package/src/clients/middleware/signing/utils/getSkewCorrectedDate.ts +14 -0
  349. package/src/clients/middleware/signing/utils/getUpdatedSystemClockOffset.ts +22 -0
  350. package/src/clients/middleware/signing/utils/isClockSkewed.ts +26 -0
  351. package/src/clients/middleware/userAgent/index.ts +4 -0
  352. package/src/clients/middleware/userAgent/middleware.ts +41 -0
  353. package/src/clients/serde/index.ts +5 -0
  354. package/src/clients/serde/json.ts +51 -0
  355. package/src/clients/serde/responseInfo.ts +20 -0
  356. package/src/clients/types/aws.ts +21 -0
  357. package/src/clients/types/core.ts +40 -0
  358. package/src/clients/types/http.ts +12 -2
  359. package/src/clients/types/index.ts +22 -2
  360. package/src/clients/utils/isClockSkewError.ts +24 -0
  361. package/lib/.tsbuildinfo +0 -3
  362. package/lib/Amplify.js.map +0 -1
  363. package/lib/ClientDevice/android.js.map +0 -1
  364. package/lib/ClientDevice/browser.js.map +0 -1
  365. package/lib/ClientDevice/index.js.map +0 -1
  366. package/lib/ClientDevice/ios.js.map +0 -1
  367. package/lib/ClientDevice/reactnative.js.map +0 -1
  368. package/lib/Credentials.js.map +0 -1
  369. package/lib/Errors.js.map +0 -1
  370. package/lib/Hub.js.map +0 -1
  371. package/lib/I18n/I18n.js.map +0 -1
  372. package/lib/I18n/index.js.map +0 -1
  373. package/lib/I18n/types.js.map +0 -1
  374. package/lib/JS.js.map +0 -1
  375. package/lib/Logger/ConsoleLogger.js.map +0 -1
  376. package/lib/Logger/index.js.map +0 -1
  377. package/lib/Logger/logger-interface.js.map +0 -1
  378. package/lib/OAuthHelper/FacebookOAuth.js.map +0 -1
  379. package/lib/OAuthHelper/GoogleOAuth.js.map +0 -1
  380. package/lib/OAuthHelper/index.js.map +0 -1
  381. package/lib/Platform/index.js.map +0 -1
  382. package/lib/Platform/version.js.map +0 -1
  383. package/lib/Providers/AWSCloudWatchProvider.js.map +0 -1
  384. package/lib/Providers/index.js.map +0 -1
  385. package/lib/RNComponents/index.js.map +0 -1
  386. package/lib/RNComponents/reactnative.js.map +0 -1
  387. package/lib/ServiceWorker/ServiceWorker.js.map +0 -1
  388. package/lib/ServiceWorker/index.js.map +0 -1
  389. package/lib/Signer.js.map +0 -1
  390. package/lib/StorageHelper/index.js.map +0 -1
  391. package/lib/StorageHelper/reactnative.js.map +0 -1
  392. package/lib/UniversalStorage/index.js.map +0 -1
  393. package/lib/Util/BackgroundProcessManager.js.map +0 -1
  394. package/lib/Util/CognitoIdentityClient.d.ts +0 -14
  395. package/lib/Util/CognitoIdentityClient.js +0 -31
  396. package/lib/Util/CognitoIdentityClient.js.map +0 -1
  397. package/lib/Util/Constants.js.map +0 -1
  398. package/lib/Util/DateUtils.js.map +0 -1
  399. package/lib/Util/Mutex.js.map +0 -1
  400. package/lib/Util/Reachability.js.map +0 -1
  401. package/lib/Util/Reachability.native.js.map +0 -1
  402. package/lib/Util/Retry.js.map +0 -1
  403. package/lib/Util/StringUtils.js.map +0 -1
  404. package/lib/Util/index.js.map +0 -1
  405. package/lib/clients/middleware/signing/signer/signatureV4/constants.js.map +0 -1
  406. package/lib/clients/middleware/signing/signer/signatureV4/index.js.map +0 -1
  407. package/lib/clients/middleware/signing/signer/signatureV4/index.native.js.map +0 -1
  408. package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +0 -1
  409. package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js.map +0 -1
  410. package/lib/clients/middleware/signing/signer/signatureV4/types/index.js.map +0 -1
  411. package/lib/clients/middleware/signing/signer/signatureV4/types/signer.js.map +0 -1
  412. package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js.map +0 -1
  413. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map +0 -1
  414. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +0 -1
  415. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map +0 -1
  416. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js.map +0 -1
  417. package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js.map +0 -1
  418. package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +0 -1
  419. package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +0 -1
  420. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js.map +0 -1
  421. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js.map +0 -1
  422. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js.map +0 -1
  423. package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js.map +0 -1
  424. package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js.map +0 -1
  425. package/lib/clients/types/aws.js.map +0 -1
  426. package/lib/clients/types/core.js.map +0 -1
  427. package/lib/clients/types/http.js.map +0 -1
  428. package/lib/clients/types/index.js.map +0 -1
  429. package/lib/constants.js.map +0 -1
  430. package/lib/index.js.map +0 -1
  431. package/lib/parseAWSExports.js.map +0 -1
  432. package/lib/types/index.js.map +0 -1
  433. package/lib/types/types.js.map +0 -1
  434. package/lib-esm/.tsbuildinfo +0 -3
  435. package/lib-esm/Amplify.js.map +0 -1
  436. package/lib-esm/ClientDevice/android.js.map +0 -1
  437. package/lib-esm/ClientDevice/browser.js.map +0 -1
  438. package/lib-esm/ClientDevice/index.js.map +0 -1
  439. package/lib-esm/ClientDevice/ios.js.map +0 -1
  440. package/lib-esm/ClientDevice/reactnative.js.map +0 -1
  441. package/lib-esm/Credentials.js.map +0 -1
  442. package/lib-esm/Errors.js.map +0 -1
  443. package/lib-esm/Hub.js.map +0 -1
  444. package/lib-esm/I18n/I18n.js.map +0 -1
  445. package/lib-esm/I18n/index.js.map +0 -1
  446. package/lib-esm/I18n/types.js.map +0 -1
  447. package/lib-esm/JS.js.map +0 -1
  448. package/lib-esm/Logger/ConsoleLogger.js.map +0 -1
  449. package/lib-esm/Logger/index.js.map +0 -1
  450. package/lib-esm/Logger/logger-interface.js.map +0 -1
  451. package/lib-esm/OAuthHelper/FacebookOAuth.js.map +0 -1
  452. package/lib-esm/OAuthHelper/GoogleOAuth.js.map +0 -1
  453. package/lib-esm/OAuthHelper/index.js.map +0 -1
  454. package/lib-esm/Platform/index.js.map +0 -1
  455. package/lib-esm/Platform/version.js.map +0 -1
  456. package/lib-esm/Providers/AWSCloudWatchProvider.js.map +0 -1
  457. package/lib-esm/Providers/index.js.map +0 -1
  458. package/lib-esm/RNComponents/index.js.map +0 -1
  459. package/lib-esm/RNComponents/reactnative.js.map +0 -1
  460. package/lib-esm/ServiceWorker/ServiceWorker.js.map +0 -1
  461. package/lib-esm/ServiceWorker/index.js.map +0 -1
  462. package/lib-esm/Signer.js.map +0 -1
  463. package/lib-esm/StorageHelper/index.js.map +0 -1
  464. package/lib-esm/StorageHelper/reactnative.js.map +0 -1
  465. package/lib-esm/UniversalStorage/index.js.map +0 -1
  466. package/lib-esm/Util/BackgroundProcessManager.js.map +0 -1
  467. package/lib-esm/Util/CognitoIdentityClient.d.ts +0 -14
  468. package/lib-esm/Util/CognitoIdentityClient.js +0 -27
  469. package/lib-esm/Util/CognitoIdentityClient.js.map +0 -1
  470. package/lib-esm/Util/Constants.js.map +0 -1
  471. package/lib-esm/Util/DateUtils.js.map +0 -1
  472. package/lib-esm/Util/Mutex.js.map +0 -1
  473. package/lib-esm/Util/Reachability.js.map +0 -1
  474. package/lib-esm/Util/Reachability.native.js.map +0 -1
  475. package/lib-esm/Util/Retry.js.map +0 -1
  476. package/lib-esm/Util/StringUtils.js.map +0 -1
  477. package/lib-esm/Util/index.js.map +0 -1
  478. package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js.map +0 -1
  479. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js.map +0 -1
  480. package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js.map +0 -1
  481. package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +0 -1
  482. package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js.map +0 -1
  483. package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.js.map +0 -1
  484. package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.js.map +0 -1
  485. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js.map +0 -1
  486. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map +0 -1
  487. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +0 -1
  488. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map +0 -1
  489. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js.map +0 -1
  490. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js.map +0 -1
  491. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +0 -1
  492. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +0 -1
  493. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js.map +0 -1
  494. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js.map +0 -1
  495. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js.map +0 -1
  496. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js.map +0 -1
  497. package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js.map +0 -1
  498. package/lib-esm/clients/types/aws.js.map +0 -1
  499. package/lib-esm/clients/types/core.js.map +0 -1
  500. package/lib-esm/clients/types/http.js.map +0 -1
  501. package/lib-esm/clients/types/index.js.map +0 -1
  502. package/lib-esm/constants.js.map +0 -1
  503. package/lib-esm/index.js.map +0 -1
  504. package/lib-esm/parseAWSExports.js.map +0 -1
  505. package/lib-esm/types/index.js.map +0 -1
  506. package/lib-esm/types/types.js.map +0 -1
  507. package/src/Util/CognitoIdentityClient.ts +0 -48
@@ -1,4 +1,14 @@
1
- import { __assign } from "tslib";
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
2
12
  import Cookies from 'universal-cookie';
3
13
  import { browserOrNode } from '../JS';
4
14
  var isBrowser = browserOrNode().isBrowser;
@@ -17,7 +27,7 @@ var UniversalStorage = /** @class */ (function () {
17
27
  get: function () {
18
28
  return Object.entries(this.store).length;
19
29
  },
20
- enumerable: true,
30
+ enumerable: false,
21
31
  configurable: true
22
32
  });
23
33
  UniversalStorage.prototype.clear = function () {
@@ -66,6 +76,11 @@ var UniversalStorage = /** @class */ (function () {
66
76
  'refreshToken',
67
77
  // Required for CognitoUserSession
68
78
  'idToken',
79
+ // userData is used when `Auth.currentAuthenticatedUser({ bypassCache: false })`.
80
+ // Can be persisted to speed up calls to `Auth.currentAuthenticatedUser()`
81
+ // 'userData',
82
+ // Ignoring clockDrift on the server for now, but needs testing
83
+ // 'clockDrift',
69
84
  ];
70
85
  if (sessionTokenTypes.includes(tokenType !== null && tokenType !== void 0 ? tokenType : '')) {
71
86
  this.setUniversalItem(key, value, {
@@ -87,4 +102,3 @@ var UniversalStorage = /** @class */ (function () {
87
102
  return UniversalStorage;
88
103
  }());
89
104
  export { UniversalStorage };
90
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,65 @@
1
- import { __awaiter, __extends, __generator, __values } from "tslib";
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __values = (this && this.__values) || function(o) {
53
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
54
+ if (m) return m.call(o);
55
+ if (o && typeof o.length === "number") return {
56
+ next: function () {
57
+ if (o && i >= o.length) o = void 0;
58
+ return { value: o && o[i++], done: !o };
59
+ }
60
+ };
61
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
62
+ };
2
63
  /**
3
64
  * @private For internal Amplify use.
4
65
  *
@@ -188,7 +249,7 @@ var BackgroundProcessManager = /** @class */ (function () {
188
249
  get: function () {
189
250
  return this.jobs.size;
190
251
  },
191
- enumerable: true,
252
+ enumerable: false,
192
253
  configurable: true
193
254
  });
194
255
  Object.defineProperty(BackgroundProcessManager.prototype, "state", {
@@ -202,7 +263,7 @@ var BackgroundProcessManager = /** @class */ (function () {
202
263
  get: function () {
203
264
  return this._state;
204
265
  },
205
- enumerable: true,
266
+ enumerable: false,
206
267
  configurable: true
207
268
  });
208
269
  Object.defineProperty(BackgroundProcessManager.prototype, "pending", {
@@ -214,7 +275,7 @@ var BackgroundProcessManager = /** @class */ (function () {
214
275
  get: function () {
215
276
  return Array.from(this.jobs).map(function (job) { return job.description; });
216
277
  },
217
- enumerable: true,
278
+ enumerable: false,
218
279
  configurable: true
219
280
  });
220
281
  Object.defineProperty(BackgroundProcessManager.prototype, "isOpen", {
@@ -224,7 +285,7 @@ var BackgroundProcessManager = /** @class */ (function () {
224
285
  get: function () {
225
286
  return this._state === BackgroundProcessManagerState.Open;
226
287
  },
227
- enumerable: true,
288
+ enumerable: false,
228
289
  configurable: true
229
290
  });
230
291
  Object.defineProperty(BackgroundProcessManager.prototype, "isClosing", {
@@ -235,7 +296,7 @@ var BackgroundProcessManager = /** @class */ (function () {
235
296
  get: function () {
236
297
  return this._state === BackgroundProcessManagerState.Closing;
237
298
  },
238
- enumerable: true,
299
+ enumerable: false,
239
300
  configurable: true
240
301
  });
241
302
  Object.defineProperty(BackgroundProcessManager.prototype, "isClosed", {
@@ -246,17 +307,17 @@ var BackgroundProcessManager = /** @class */ (function () {
246
307
  get: function () {
247
308
  return this._state === BackgroundProcessManagerState.Closed;
248
309
  },
249
- enumerable: true,
310
+ enumerable: false,
250
311
  configurable: true
251
312
  });
252
313
  BackgroundProcessManager.prototype.closedFailure = function (description) {
253
314
  if (!this.isOpen) {
254
315
  return Promise.reject(new BackgroundManagerNotOpenError([
255
- "The manager is " + this.state + ".",
256
- "You tried to add \"" + description + "\".",
257
- "Pending jobs: [\n" + this.pending
316
+ "The manager is ".concat(this.state, "."),
317
+ "You tried to add \"".concat(description, "\"."),
318
+ "Pending jobs: [\n".concat(this.pending
258
319
  .map(function (t) { return ' ' + t; })
259
- .join(',\n') + "\n]",
320
+ .join(',\n'), "\n]"),
260
321
  ].join('\n')));
261
322
  }
262
323
  };
@@ -296,7 +357,7 @@ var BackgroundProcessManager = /** @class */ (function () {
296
357
  // Due to potential races with a job's natural completion, it's
297
358
  // reasonable to expect the termination call to fail. Hence,
298
359
  // not logging as an error.
299
- console.warn("Failed to send termination signal to job. Error: " + error.message, job);
360
+ console.warn("Failed to send termination signal to job. Error: ".concat(error.message), job);
300
361
  }
301
362
  }
302
363
  }
@@ -357,7 +418,7 @@ export { BackgroundProcessManager };
357
418
  var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
358
419
  __extends(BackgroundManagerNotOpenError, _super);
359
420
  function BackgroundManagerNotOpenError(message) {
360
- return _super.call(this, "BackgroundManagerNotOpenError: " + message) || this;
421
+ return _super.call(this, "BackgroundManagerNotOpenError: ".concat(message)) || this;
361
422
  }
362
423
  return BackgroundManagerNotOpenError;
363
424
  }(Error));
@@ -380,4 +441,3 @@ export var BackgroundProcessManagerState;
380
441
  */
381
442
  BackgroundProcessManagerState["Closed"] = "Closed";
382
443
  })(BackgroundProcessManagerState || (BackgroundProcessManagerState = {}));
383
- //# sourceMappingURL=BackgroundProcessManager.js.map
@@ -12,4 +12,3 @@ var RETRY_ERROR_CODES = [
12
12
  'InvalidSequenceTokenException',
13
13
  ];
14
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, };
15
- //# sourceMappingURL=Constants.js.map
@@ -4,7 +4,22 @@
4
4
  *
5
5
  * @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262
6
6
  */
7
- import { __read } from "tslib";
7
+ var __read = (this && this.__read) || function (o, n) {
8
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
9
+ if (!m) return o;
10
+ var i = m.call(o), r, ar = [], e;
11
+ try {
12
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
+ }
14
+ catch (error) { e = { error: error }; }
15
+ finally {
16
+ try {
17
+ if (r && !r.done && (m = i["return"])) m.call(i);
18
+ }
19
+ finally { if (e) throw e.error; }
20
+ }
21
+ return ar;
22
+ };
8
23
  // Comment - TODO: remove
9
24
  var FIVE_MINUTES_IN_MS = 1000 * 60 * 5;
10
25
  export var DateUtils = {
@@ -53,4 +68,3 @@ export var DateUtils = {
53
68
  DateUtils.clockOffset = offset;
54
69
  },
55
70
  };
56
- //# sourceMappingURL=DateUtils.js.map
@@ -67,4 +67,3 @@ var Mutex = /** @class */ (function () {
67
67
  return Mutex;
68
68
  }());
69
69
  export default Mutex;
70
- //# sourceMappingURL=Mutex.js.map
@@ -1,5 +1,5 @@
1
1
  import Observable from 'zen-observable-ts';
2
- declare type NetworkStatus = {
2
+ type NetworkStatus = {
3
3
  online: boolean;
4
4
  };
5
5
  export default class ReachabilityNavigator implements Reachability {
@@ -1,4 +1,14 @@
1
- import { __values } from "tslib";
1
+ var __values = (this && this.__values) || function(o) {
2
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
+ if (m) return m.call(o);
4
+ if (o && typeof o.length === "number") return {
5
+ next: function () {
6
+ if (o && i >= o.length) o = void 0;
7
+ return { value: o && o[i++], done: !o };
8
+ }
9
+ };
10
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
+ };
2
12
  import { browserOrNode, isWebWorker } from '@aws-amplify/core';
3
13
  import Observable from 'zen-observable-ts';
4
14
  var ReachabilityNavigator = /** @class */ (function () {
@@ -51,4 +61,3 @@ var ReachabilityNavigator = /** @class */ (function () {
51
61
  return ReachabilityNavigator;
52
62
  }());
53
63
  export default ReachabilityNavigator;
54
- //# sourceMappingURL=Reachability.js.map
@@ -1,5 +1,5 @@
1
1
  import Observable from 'zen-observable-ts';
2
- declare type NetworkStatus = {
2
+ type NetworkStatus = {
3
3
  online: boolean;
4
4
  };
5
5
  export default class ReachabilityNavigator implements Reachability {
@@ -35,4 +35,3 @@ var ReachabilityNavigator = /** @class */ (function () {
35
35
  return ReachabilityNavigator;
36
36
  }());
37
37
  export default ReachabilityNavigator;
38
- //# sourceMappingURL=Reachability.native.js.map
@@ -1,4 +1,79 @@
1
- import { __awaiter, __extends, __generator, __read, __spread } from "tslib";
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __read = (this && this.__read) || function (o, n) {
53
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
54
+ if (!m) return o;
55
+ var i = m.call(o), r, ar = [], e;
56
+ try {
57
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
58
+ }
59
+ catch (error) { e = { error: error }; }
60
+ finally {
61
+ try {
62
+ if (r && !r.done && (m = i["return"])) m.call(i);
63
+ }
64
+ finally { if (e) throw e.error; }
65
+ }
66
+ return ar;
67
+ };
68
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
69
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
70
+ if (ar || !(i in from)) {
71
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
72
+ ar[i] = from[i];
73
+ }
74
+ }
75
+ return to.concat(ar || Array.prototype.slice.call(from));
76
+ };
2
77
  import { ConsoleLogger as Logger } from '../Logger/ConsoleLogger';
3
78
  var logger = new Logger('Util');
4
79
  var NonRetryableError = /** @class */ (function (_super) {
@@ -43,29 +118,29 @@ export function retry(functionToRetry, args, delayFn, onTerminate) {
43
118
  wakeUp();
44
119
  });
45
120
  _loop_1 = function () {
46
- var _a, _b, err_1, retryIn_1;
47
- return __generator(this, function (_c) {
48
- switch (_c.label) {
121
+ var _b, _c, err_1, retryIn_1;
122
+ return __generator(this, function (_d) {
123
+ switch (_d.label) {
49
124
  case 0:
50
125
  attempt++;
51
- logger.debug(functionToRetry.name + " attempt #" + attempt + " with this vars: " + JSON.stringify(args));
52
- _c.label = 1;
126
+ logger.debug("".concat(functionToRetry.name, " attempt #").concat(attempt, " with this vars: ").concat(JSON.stringify(args)));
127
+ _d.label = 1;
53
128
  case 1:
54
- _c.trys.push([1, 3, , 7]);
55
- _a = {};
56
- _b = resolve;
57
- return [4 /*yield*/, functionToRetry.apply(void 0, __spread(args))];
58
- case 2: return [2 /*return*/, (_a.value = _b.apply(void 0, [_c.sent()]), _a)];
129
+ _d.trys.push([1, 3, , 7]);
130
+ _b = {};
131
+ _c = resolve;
132
+ return [4 /*yield*/, functionToRetry.apply(void 0, __spreadArray([], __read(args), false))];
133
+ case 2: return [2 /*return*/, (_b.value = _c.apply(void 0, [_d.sent()]), _b)];
59
134
  case 3:
60
- err_1 = _c.sent();
135
+ err_1 = _d.sent();
61
136
  lastError = err_1;
62
- logger.debug("error on " + functionToRetry.name, err_1);
137
+ logger.debug("error on ".concat(functionToRetry.name), err_1);
63
138
  if (isNonRetryableError(err_1)) {
64
- logger.debug(functionToRetry.name + " non retryable error", err_1);
139
+ logger.debug("".concat(functionToRetry.name, " non retryable error"), err_1);
65
140
  return [2 /*return*/, { value: reject(err_1) }];
66
141
  }
67
142
  retryIn_1 = delayFn(attempt, args, err_1);
68
- logger.debug(functionToRetry.name + " retrying in " + retryIn_1 + " ms");
143
+ logger.debug("".concat(functionToRetry.name, " retrying in ").concat(retryIn_1, " ms"));
69
144
  if (!(retryIn_1 === false || terminated)) return [3 /*break*/, 4];
70
145
  return [2 /*return*/, { value: reject(err_1) }];
71
146
  case 4: return [4 /*yield*/, new Promise(function (r) {
@@ -73,8 +148,8 @@ export function retry(functionToRetry, args, delayFn, onTerminate) {
73
148
  timeout = setTimeout(wakeUp, retryIn_1);
74
149
  })];
75
150
  case 5:
76
- _c.sent();
77
- _c.label = 6;
151
+ _d.sent();
152
+ _d.label = 6;
78
153
  case 6: return [3 /*break*/, 7];
79
154
  case 7: return [2 /*return*/];
80
155
  }
@@ -121,4 +196,3 @@ export var jitteredExponentialRetry = function (functionToRetry, args, maxDelayM
121
196
  if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }
122
197
  return retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);
123
198
  };
124
- //# sourceMappingURL=Retry.js.map
@@ -15,4 +15,3 @@ export function urlSafeDecode(hex) {
15
15
  .map(function (char) { return String.fromCharCode(parseInt(char, 16)); })
16
16
  .join('');
17
17
  }
18
- //# sourceMappingURL=StringUtils.js.map
@@ -5,4 +5,3 @@ export { DateUtils } from './DateUtils';
5
5
  export { urlSafeDecode, urlSafeEncode } from './StringUtils';
6
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';
7
7
  export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
8
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Get the AWS Services endpoint URL's DNS suffix for a given region. A typical AWS regional service endpoint URL will
3
+ * follow this pattern: {endpointPrefix}.{region}.{dnsSuffix}. For example, the endpoint URL for Cognito Identity in
4
+ * us-east-1 will be cognito-identity.us-east-1.amazonaws.com. Here the DnsSuffix is `amazonaws.com`.
5
+ *
6
+ * @param region
7
+ * @returns The DNS suffix
8
+ *
9
+ * @internal
10
+ */
11
+ export declare const getDnsSuffix: (region: string) => string;
@@ -0,0 +1,45 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ var __values = (this && this.__values) || function(o) {
4
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
5
+ if (m) return m.call(o);
6
+ if (o && typeof o.length === "number") return {
7
+ next: function () {
8
+ if (o && i >= o.length) o = void 0;
9
+ return { value: o && o[i++], done: !o };
10
+ }
11
+ };
12
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
13
+ };
14
+ import { defaultPartition, partitionsInfo } from './partitions';
15
+ /**
16
+ * Get the AWS Services endpoint URL's DNS suffix for a given region. A typical AWS regional service endpoint URL will
17
+ * follow this pattern: {endpointPrefix}.{region}.{dnsSuffix}. For example, the endpoint URL for Cognito Identity in
18
+ * us-east-1 will be cognito-identity.us-east-1.amazonaws.com. Here the DnsSuffix is `amazonaws.com`.
19
+ *
20
+ * @param region
21
+ * @returns The DNS suffix
22
+ *
23
+ * @internal
24
+ */
25
+ export var getDnsSuffix = function (region) {
26
+ var e_1, _a;
27
+ var partitions = partitionsInfo.partitions;
28
+ try {
29
+ for (var partitions_1 = __values(partitions), partitions_1_1 = partitions_1.next(); !partitions_1_1.done; partitions_1_1 = partitions_1.next()) {
30
+ var _b = partitions_1_1.value, regions = _b.regions, outputs = _b.outputs, regionRegex = _b.regionRegex;
31
+ var regex = new RegExp(regionRegex);
32
+ if (regions.includes(region) || regex.test(region)) {
33
+ return outputs.dnsSuffix;
34
+ }
35
+ }
36
+ }
37
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
38
+ finally {
39
+ try {
40
+ if (partitions_1_1 && !partitions_1_1.done && (_a = partitions_1.return)) _a.call(partitions_1);
41
+ }
42
+ finally { if (e_1) throw e_1.error; }
43
+ }
44
+ return defaultPartition.outputs.dnsSuffix;
45
+ };
@@ -0,0 +1 @@
1
+ export { getDnsSuffix } from './getDnsSuffix';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { getDnsSuffix } from './getDnsSuffix';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Default partition for AWS services. This is used when the region is not provided or the region is not recognized.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const defaultPartition: {
7
+ id: string;
8
+ outputs: {
9
+ dnsSuffix: string;
10
+ };
11
+ regionRegex: string;
12
+ regions: string[];
13
+ };
14
+ /**
15
+ * This data is adapted from the partition file from AWS SDK shared utilities but remove some contents for bundle size
16
+ * concern. Information removed are `dualStackDnsSuffix`, `supportDualStack`, `supportFIPS`, restricted partitions, and
17
+ * list of regions for each partition other than global regions.
18
+ *
19
+ * * Ref: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints
20
+ * * Ref: https://github.com/aws/aws-sdk-js-v3/blob/0201baef03c2379f1f6f7150b9d401d4b230d488/packages/util-endpoints/src/lib/aws/partitions.json#L1
21
+ *
22
+ * @internal
23
+ */
24
+ export declare const partitionsInfo: {
25
+ partitions: {
26
+ id: string;
27
+ outputs: {
28
+ dnsSuffix: string;
29
+ };
30
+ regionRegex: string;
31
+ regions: string[];
32
+ }[];
33
+ };
@@ -0,0 +1,38 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * Default partition for AWS services. This is used when the region is not provided or the region is not recognized.
5
+ *
6
+ * @internal
7
+ */
8
+ export var defaultPartition = {
9
+ id: 'aws',
10
+ outputs: {
11
+ dnsSuffix: 'amazonaws.com',
12
+ },
13
+ regionRegex: '^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$',
14
+ regions: ['aws-global'],
15
+ };
16
+ /**
17
+ * This data is adapted from the partition file from AWS SDK shared utilities but remove some contents for bundle size
18
+ * concern. Information removed are `dualStackDnsSuffix`, `supportDualStack`, `supportFIPS`, restricted partitions, and
19
+ * list of regions for each partition other than global regions.
20
+ *
21
+ * * Ref: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints
22
+ * * Ref: https://github.com/aws/aws-sdk-js-v3/blob/0201baef03c2379f1f6f7150b9d401d4b230d488/packages/util-endpoints/src/lib/aws/partitions.json#L1
23
+ *
24
+ * @internal
25
+ */
26
+ export var partitionsInfo = {
27
+ partitions: [
28
+ defaultPartition,
29
+ {
30
+ id: 'aws-cn',
31
+ outputs: {
32
+ dnsSuffix: 'amazonaws.com.cn',
33
+ },
34
+ regionRegex: '^cn\\-\\w+\\-\\d+$',
35
+ regions: ['aws-cn-global'],
36
+ },
37
+ ],
38
+ };
@@ -0,0 +1,5 @@
1
+ import { RetryOptions } from '../middleware/retry';
2
+ import { SigningOptions } from '../middleware/signing';
3
+ import { UserAgentOptions } from '../middleware/userAgent';
4
+ import { HttpRequest, HttpResponse } from '../types';
5
+ export declare const authenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & SigningOptions) => Promise<HttpResponse>;
@@ -0,0 +1,12 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { retryMiddleware } from '../middleware/retry';
4
+ import { signingMiddleware } from '../middleware/signing';
5
+ import { userAgentMiddleware } from '../middleware/userAgent';
6
+ import { composeTransferHandler } from '../internal/composeTransferHandler';
7
+ import { fetchTransferHandler } from './fetch';
8
+ export var authenticatedHandler = composeTransferHandler(fetchTransferHandler, [
9
+ userAgentMiddleware,
10
+ retryMiddleware,
11
+ signingMiddleware,
12
+ ]);
@@ -0,0 +1,4 @@
1
+ import 'isomorphic-unfetch';
2
+ import { HttpRequest, HttpResponse, HttpTransferOptions } from '../types/http';
3
+ import { TransferHandler } from '../types/core';
4
+ export declare const fetchTransferHandler: TransferHandler<HttpRequest, HttpResponse, HttpTransferOptions>;