@aws-amplify/core 6.0.16 → 6.0.17-unstable.0d2aa5d.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 (463) hide show
  1. package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js +11 -16
  2. package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js.map +1 -1
  3. package/dist/cjs/Cache/StorageCacheCommon.js +5 -5
  4. package/dist/cjs/Cache/StorageCacheCommon.js.map +1 -1
  5. package/dist/cjs/Cache/utils/CacheList.js +2 -2
  6. package/dist/cjs/Cache/utils/CacheList.js.map +1 -1
  7. package/dist/cjs/Hub/index.js +2 -2
  8. package/dist/cjs/Hub/index.js.map +1 -1
  9. package/dist/cjs/I18n/I18n.js +8 -13
  10. package/dist/cjs/I18n/I18n.js.map +1 -1
  11. package/dist/cjs/I18n/index.js +4 -4
  12. package/dist/cjs/I18n/index.js.map +1 -1
  13. package/dist/cjs/Logger/ConsoleLogger.js +8 -7
  14. package/dist/cjs/Logger/ConsoleLogger.js.map +1 -1
  15. package/dist/cjs/Logger/types.js +1 -0
  16. package/dist/cjs/Logger/types.js.map +1 -1
  17. package/dist/cjs/Mutex/Mutex.js +4 -1
  18. package/dist/cjs/Mutex/Mutex.js.map +1 -1
  19. package/dist/cjs/Platform/detectFramework.js +3 -1
  20. package/dist/cjs/Platform/detectFramework.js.map +1 -1
  21. package/dist/cjs/Platform/detection/Angular.js +2 -4
  22. package/dist/cjs/Platform/detection/Angular.js.map +1 -1
  23. package/dist/cjs/Platform/detection/Expo.js +1 -2
  24. package/dist/cjs/Platform/detection/Expo.js.map +1 -1
  25. package/dist/cjs/Platform/detection/Next.js +3 -2
  26. package/dist/cjs/Platform/detection/Next.js.map +1 -1
  27. package/dist/cjs/Platform/detection/Nuxt.js +3 -4
  28. package/dist/cjs/Platform/detection/Nuxt.js.map +1 -1
  29. package/dist/cjs/Platform/index.js +1 -1
  30. package/dist/cjs/Platform/index.js.map +1 -1
  31. package/dist/cjs/Platform/version.js +1 -1
  32. package/dist/cjs/Platform/version.js.map +1 -1
  33. package/dist/cjs/Reachability/Reachability.js +6 -2
  34. package/dist/cjs/Reachability/Reachability.js.map +1 -1
  35. package/dist/cjs/ServiceWorker/ServiceWorker.js +11 -11
  36. package/dist/cjs/ServiceWorker/ServiceWorker.js.map +1 -1
  37. package/dist/cjs/Signer/DateUtils.js +1 -1
  38. package/dist/cjs/Signer/DateUtils.js.map +1 -1
  39. package/dist/cjs/Signer/Signer.js +3 -3
  40. package/dist/cjs/Signer/Signer.js.map +1 -1
  41. package/dist/cjs/adapterCore/serverContext/serverContext.js +1 -1
  42. package/dist/cjs/adapterCore/serverContext/serverContext.js.map +1 -1
  43. package/dist/cjs/awsClients/cognitoIdentity/base.js +2 -2
  44. package/dist/cjs/awsClients/cognitoIdentity/base.js.map +1 -1
  45. package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js +1 -1
  46. package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js.map +1 -1
  47. package/dist/cjs/awsClients/cognitoIdentity/getId.js +1 -1
  48. package/dist/cjs/awsClients/cognitoIdentity/getId.js.map +1 -1
  49. package/dist/cjs/awsClients/pinpoint/getInAppMessages.js +1 -1
  50. package/dist/cjs/awsClients/pinpoint/getInAppMessages.js.map +1 -1
  51. package/dist/cjs/awsClients/pinpoint/putEvents.js +1 -1
  52. package/dist/cjs/awsClients/pinpoint/putEvents.js.map +1 -1
  53. package/dist/cjs/awsClients/pinpoint/types.js +0 -1
  54. package/dist/cjs/awsClients/pinpoint/types.js.map +1 -1
  55. package/dist/cjs/awsClients/pinpoint/updateEndpoint.js +1 -1
  56. package/dist/cjs/awsClients/pinpoint/updateEndpoint.js.map +1 -1
  57. package/dist/cjs/clients/handlers/authenticated.js +3 -3
  58. package/dist/cjs/clients/handlers/authenticated.js.map +1 -1
  59. package/dist/cjs/clients/handlers/unauthenticated.js +1 -1
  60. package/dist/cjs/clients/handlers/unauthenticated.js.map +1 -1
  61. package/dist/cjs/clients/index.js +4 -4
  62. package/dist/cjs/clients/index.js.map +1 -1
  63. package/dist/cjs/clients/internal/composeServiceApi.js +1 -1
  64. package/dist/cjs/clients/internal/composeServiceApi.js.map +1 -1
  65. package/dist/cjs/clients/internal/composeTransferHandler.js +1 -1
  66. package/dist/cjs/clients/internal/composeTransferHandler.js.map +1 -1
  67. package/dist/cjs/clients/middleware/retry/defaultRetryDecider.js +2 -2
  68. package/dist/cjs/clients/middleware/retry/defaultRetryDecider.js.map +1 -1
  69. package/dist/cjs/clients/middleware/retry/index.js +2 -2
  70. package/dist/cjs/clients/middleware/retry/index.js.map +1 -1
  71. package/dist/cjs/clients/middleware/retry/jitteredBackoff.js +1 -1
  72. package/dist/cjs/clients/middleware/retry/jitteredBackoff.js.map +1 -1
  73. package/dist/cjs/clients/middleware/retry/middleware.js +6 -6
  74. package/dist/cjs/clients/middleware/retry/middleware.js.map +1 -1
  75. package/dist/cjs/clients/middleware/signing/index.js +2 -2
  76. package/dist/cjs/clients/middleware/signing/index.js.map +1 -1
  77. package/dist/cjs/clients/middleware/signing/middleware.js +3 -3
  78. package/dist/cjs/clients/middleware/signing/middleware.js.map +1 -1
  79. package/dist/cjs/clients/middleware/signing/signer/signatureV4/presignUrl.js +1 -2
  80. package/dist/cjs/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +1 -1
  81. package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +1 -1
  82. package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +1 -1
  83. package/dist/cjs/clients/middleware/userAgent/index.js +2 -2
  84. package/dist/cjs/clients/middleware/userAgent/index.js.map +1 -1
  85. package/dist/cjs/clients/middleware/userAgent/middleware.js +3 -3
  86. package/dist/cjs/clients/middleware/userAgent/middleware.js.map +1 -1
  87. package/dist/cjs/clients/serde/json.js +1 -1
  88. package/dist/cjs/clients/serde/json.js.map +1 -1
  89. package/dist/cjs/errors/errorHelpers.js +1 -1
  90. package/dist/cjs/errors/errorHelpers.js.map +1 -1
  91. package/dist/cjs/parseAWSExports.js +1 -1
  92. package/dist/cjs/parseAWSExports.js.map +1 -1
  93. package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js +1 -1
  94. package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js.map +1 -1
  95. package/dist/cjs/providers/pinpoint/utils/PinpointEventBuffer.js +2 -3
  96. package/dist/cjs/providers/pinpoint/utils/PinpointEventBuffer.js.map +1 -1
  97. package/dist/cjs/providers/pinpoint/utils/isAppInForeground.native.js +0 -1
  98. package/dist/cjs/providers/pinpoint/utils/isAppInForeground.native.js.map +1 -1
  99. package/dist/cjs/singleton/Amplify.js +1 -1
  100. package/dist/cjs/singleton/Amplify.js.map +1 -1
  101. package/dist/cjs/singleton/Auth/index.js +2 -6
  102. package/dist/cjs/singleton/Auth/index.js.map +1 -1
  103. package/dist/cjs/singleton/Auth/utils/index.js +4 -4
  104. package/dist/cjs/singleton/Auth/utils/index.js.map +1 -1
  105. package/dist/cjs/singleton/apis/fetchAuthSession.js +1 -1
  106. package/dist/cjs/singleton/apis/fetchAuthSession.js.map +1 -1
  107. package/dist/cjs/storage/CookieStorage.js +8 -4
  108. package/dist/cjs/storage/CookieStorage.js.map +1 -1
  109. package/dist/cjs/storage/CookieStorage.native.js +0 -3
  110. package/dist/cjs/storage/CookieStorage.native.js.map +1 -1
  111. package/dist/cjs/utils/WordArray.js +2 -2
  112. package/dist/cjs/utils/WordArray.js.map +1 -1
  113. package/dist/cjs/utils/deDupeAsyncFunction.js +8 -8
  114. package/dist/cjs/utils/deDupeAsyncFunction.js.map +1 -1
  115. package/dist/cjs/utils/getClientInfo/getClientInfo.android.js +2 -3
  116. package/dist/cjs/utils/getClientInfo/getClientInfo.android.js.map +1 -1
  117. package/dist/cjs/utils/getClientInfo/getClientInfo.ios.js +2 -3
  118. package/dist/cjs/utils/getClientInfo/getClientInfo.ios.js.map +1 -1
  119. package/dist/cjs/utils/queuedStorage/createQueuedStorage.native.js +2 -2
  120. package/dist/cjs/utils/queuedStorage/createQueuedStorage.native.js.map +1 -1
  121. package/dist/cjs/utils/retry/NonRetryableError.js +2 -2
  122. package/dist/cjs/utils/retry/NonRetryableError.js.map +1 -1
  123. package/dist/cjs/utils/retry/retry.js +15 -6
  124. package/dist/cjs/utils/retry/retry.js.map +1 -1
  125. package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.d.ts +2 -8
  126. package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs +11 -16
  127. package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs.map +1 -1
  128. package/dist/esm/BackgroundProcessManager/types.d.ts +3 -3
  129. package/dist/esm/Cache/StorageCacheCommon.mjs +5 -5
  130. package/dist/esm/Cache/StorageCacheCommon.mjs.map +1 -1
  131. package/dist/esm/Cache/types/cache.d.ts +1 -1
  132. package/dist/esm/Cache/utils/CacheList.mjs +2 -2
  133. package/dist/esm/Cache/utils/CacheList.mjs.map +1 -1
  134. package/dist/esm/Hub/index.d.ts +4 -4
  135. package/dist/esm/Hub/index.mjs +2 -2
  136. package/dist/esm/Hub/index.mjs.map +1 -1
  137. package/dist/esm/Hub/types/AuthTypes.d.ts +11 -11
  138. package/dist/esm/Hub/types/HubTypes.d.ts +8 -8
  139. package/dist/esm/I18n/I18n.d.ts +0 -6
  140. package/dist/esm/I18n/I18n.mjs +8 -13
  141. package/dist/esm/I18n/I18n.mjs.map +1 -1
  142. package/dist/esm/I18n/index.mjs +4 -4
  143. package/dist/esm/I18n/index.mjs.map +1 -1
  144. package/dist/esm/Logger/ConsoleLogger.d.ts +1 -1
  145. package/dist/esm/Logger/ConsoleLogger.mjs +8 -7
  146. package/dist/esm/Logger/ConsoleLogger.mjs.map +1 -1
  147. package/dist/esm/Logger/types.d.ts +2 -1
  148. package/dist/esm/Logger/types.mjs +1 -0
  149. package/dist/esm/Logger/types.mjs.map +1 -1
  150. package/dist/esm/Mutex/Mutex.mjs +4 -1
  151. package/dist/esm/Mutex/Mutex.mjs.map +1 -1
  152. package/dist/esm/Mutex/types.d.ts +2 -6
  153. package/dist/esm/Platform/detectFramework.mjs +3 -1
  154. package/dist/esm/Platform/detectFramework.mjs.map +1 -1
  155. package/dist/esm/Platform/detection/Angular.mjs +2 -4
  156. package/dist/esm/Platform/detection/Angular.mjs.map +1 -1
  157. package/dist/esm/Platform/detection/Expo.mjs +1 -2
  158. package/dist/esm/Platform/detection/Expo.mjs.map +1 -1
  159. package/dist/esm/Platform/detection/Next.mjs +3 -2
  160. package/dist/esm/Platform/detection/Next.mjs.map +1 -1
  161. package/dist/esm/Platform/detection/Nuxt.mjs +3 -4
  162. package/dist/esm/Platform/detection/Nuxt.mjs.map +1 -1
  163. package/dist/esm/Platform/detection/index.mjs.map +1 -1
  164. package/dist/esm/Platform/index.d.ts +2 -2
  165. package/dist/esm/Platform/index.mjs +1 -1
  166. package/dist/esm/Platform/index.mjs.map +1 -1
  167. package/dist/esm/Platform/types.d.ts +12 -12
  168. package/dist/esm/Platform/version.d.ts +1 -1
  169. package/dist/esm/Platform/version.mjs +1 -1
  170. package/dist/esm/Platform/version.mjs.map +1 -1
  171. package/dist/esm/Reachability/Reachability.mjs +6 -2
  172. package/dist/esm/Reachability/Reachability.mjs.map +1 -1
  173. package/dist/esm/Reachability/types.d.ts +2 -2
  174. package/dist/esm/ServiceWorker/ServiceWorker.d.ts +0 -1
  175. package/dist/esm/ServiceWorker/ServiceWorker.mjs +11 -11
  176. package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
  177. package/dist/esm/Signer/DateUtils.d.ts +9 -9
  178. package/dist/esm/Signer/DateUtils.mjs +1 -1
  179. package/dist/esm/Signer/DateUtils.mjs.map +1 -1
  180. package/dist/esm/Signer/Signer.mjs +3 -3
  181. package/dist/esm/Signer/Signer.mjs.map +1 -1
  182. package/dist/esm/adapterCore/serverContext/serverContext.d.ts +1 -1
  183. package/dist/esm/adapterCore/serverContext/serverContext.mjs +1 -1
  184. package/dist/esm/adapterCore/serverContext/serverContext.mjs.map +1 -1
  185. package/dist/esm/adapterCore/serverContext/types/amplifyServer.d.ts +7 -9
  186. package/dist/esm/awsClients/cognitoIdentity/base.d.ts +1 -1
  187. package/dist/esm/awsClients/cognitoIdentity/base.mjs +2 -2
  188. package/dist/esm/awsClients/cognitoIdentity/base.mjs.map +1 -1
  189. package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +2 -6
  190. package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs +1 -1
  191. package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs.map +1 -1
  192. package/dist/esm/awsClients/cognitoIdentity/getId.d.ts +2 -6
  193. package/dist/esm/awsClients/cognitoIdentity/getId.mjs +1 -1
  194. package/dist/esm/awsClients/cognitoIdentity/getId.mjs.map +1 -1
  195. package/dist/esm/awsClients/cognitoIdentity/types.d.ts +2 -4
  196. package/dist/esm/awsClients/pinpoint/base.mjs.map +1 -1
  197. package/dist/esm/awsClients/pinpoint/getInAppMessages.d.ts +1 -1
  198. package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs +1 -1
  199. package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs.map +1 -1
  200. package/dist/esm/awsClients/pinpoint/putEvents.d.ts +1 -1
  201. package/dist/esm/awsClients/pinpoint/putEvents.mjs +1 -1
  202. package/dist/esm/awsClients/pinpoint/putEvents.mjs.map +1 -1
  203. package/dist/esm/awsClients/pinpoint/types.d.ts +3 -6
  204. package/dist/esm/awsClients/pinpoint/updateEndpoint.d.ts +1 -1
  205. package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs +1 -1
  206. package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs.map +1 -1
  207. package/dist/esm/clients/handlers/authenticated.mjs +6 -6
  208. package/dist/esm/clients/handlers/authenticated.mjs.map +1 -1
  209. package/dist/esm/clients/handlers/unauthenticated.mjs +3 -3
  210. package/dist/esm/clients/handlers/unauthenticated.mjs.map +1 -1
  211. package/dist/esm/clients/index.d.ts +3 -3
  212. package/dist/esm/clients/index.mjs +3 -3
  213. package/dist/esm/clients/internal/composeServiceApi.d.ts +2 -2
  214. package/dist/esm/clients/internal/composeServiceApi.mjs +1 -1
  215. package/dist/esm/clients/internal/composeServiceApi.mjs.map +1 -1
  216. package/dist/esm/clients/internal/composeTransferHandler.d.ts +2 -2
  217. package/dist/esm/clients/internal/composeTransferHandler.mjs +1 -1
  218. package/dist/esm/clients/internal/composeTransferHandler.mjs.map +1 -1
  219. package/dist/esm/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
  220. package/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs +2 -2
  221. package/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs.map +1 -1
  222. package/dist/esm/clients/middleware/retry/index.d.ts +1 -1
  223. package/dist/esm/clients/middleware/retry/index.mjs +1 -1
  224. package/dist/esm/clients/middleware/retry/jitteredBackoff.mjs.map +1 -1
  225. package/dist/esm/clients/middleware/retry/middleware.d.ts +3 -3
  226. package/dist/esm/clients/middleware/retry/middleware.mjs +5 -5
  227. package/dist/esm/clients/middleware/retry/middleware.mjs.map +1 -1
  228. package/dist/esm/clients/middleware/signing/index.d.ts +1 -1
  229. package/dist/esm/clients/middleware/signing/index.mjs +1 -1
  230. package/dist/esm/clients/middleware/signing/middleware.d.ts +1 -1
  231. package/dist/esm/clients/middleware/signing/middleware.mjs +2 -2
  232. package/dist/esm/clients/middleware/signing/middleware.mjs.map +1 -1
  233. package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.d.ts +1 -1
  234. package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs +1 -2
  235. package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs.map +1 -1
  236. package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.mjs +1 -1
  237. package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.mjs.map +1 -1
  238. package/dist/esm/clients/middleware/userAgent/index.d.ts +1 -1
  239. package/dist/esm/clients/middleware/userAgent/index.mjs +1 -1
  240. package/dist/esm/clients/middleware/userAgent/middleware.d.ts +1 -1
  241. package/dist/esm/clients/middleware/userAgent/middleware.mjs +2 -2
  242. package/dist/esm/clients/middleware/userAgent/middleware.mjs.map +1 -1
  243. package/dist/esm/clients/serde/json.mjs +1 -1
  244. package/dist/esm/clients/serde/json.mjs.map +1 -1
  245. package/dist/esm/clients/types/aws.d.ts +3 -3
  246. package/dist/esm/clients/types/core.d.ts +3 -5
  247. package/dist/esm/errors/APIError.d.ts +1 -1
  248. package/dist/esm/errors/errorHelpers.mjs +1 -1
  249. package/dist/esm/errors/errorHelpers.mjs.map +1 -1
  250. package/dist/esm/index.d.ts +1 -1
  251. package/dist/esm/libraryUtils.d.ts +1 -1
  252. package/dist/esm/parseAWSExports.mjs +1 -1
  253. package/dist/esm/parseAWSExports.mjs.map +1 -1
  254. package/dist/esm/providers/kinesis/types/kinesis.d.ts +2 -2
  255. package/dist/esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +2 -2
  256. package/dist/esm/providers/personalize/types/personalize.d.ts +2 -2
  257. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs +1 -1
  258. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs.map +1 -1
  259. package/dist/esm/providers/pinpoint/types/buffer.d.ts +6 -8
  260. package/dist/esm/providers/pinpoint/types/pinpoint.d.ts +10 -10
  261. package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -1
  262. package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs +2 -3
  263. package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs.map +1 -1
  264. package/dist/esm/providers/pinpoint/utils/getEventBuffer.d.ts +1 -1
  265. package/dist/esm/providers/pinpoint/utils/isAppInForeground.native.mjs +0 -1
  266. package/dist/esm/providers/pinpoint/utils/isAppInForeground.native.mjs.map +1 -1
  267. package/dist/esm/singleton/API/types.d.ts +35 -37
  268. package/dist/esm/singleton/Amplify.d.ts +1 -1
  269. package/dist/esm/singleton/Amplify.mjs +1 -1
  270. package/dist/esm/singleton/Amplify.mjs.map +1 -1
  271. package/dist/esm/singleton/Auth/index.d.ts +0 -1
  272. package/dist/esm/singleton/Auth/index.mjs +2 -6
  273. package/dist/esm/singleton/Auth/index.mjs.map +1 -1
  274. package/dist/esm/singleton/Auth/types.d.ts +53 -52
  275. package/dist/esm/singleton/Auth/utils/index.d.ts +1 -1
  276. package/dist/esm/singleton/Auth/utils/index.mjs +4 -4
  277. package/dist/esm/singleton/Auth/utils/index.mjs.map +1 -1
  278. package/dist/esm/singleton/Geo/types.d.ts +3 -3
  279. package/dist/esm/singleton/Interactions/types.d.ts +4 -4
  280. package/dist/esm/singleton/Notifications/types.d.ts +5 -5
  281. package/dist/esm/singleton/Predictions/types.d.ts +28 -28
  282. package/dist/esm/singleton/Storage/types.d.ts +2 -2
  283. package/dist/esm/singleton/apis/fetchAuthSession.mjs +1 -1
  284. package/dist/esm/singleton/apis/fetchAuthSession.mjs.map +1 -1
  285. package/dist/esm/singleton/types.d.ts +8 -8
  286. package/dist/esm/storage/CookieStorage.mjs +8 -4
  287. package/dist/esm/storage/CookieStorage.mjs.map +1 -1
  288. package/dist/esm/storage/CookieStorage.native.d.ts +0 -1
  289. package/dist/esm/storage/CookieStorage.native.mjs +0 -3
  290. package/dist/esm/storage/CookieStorage.native.mjs.map +1 -1
  291. package/dist/esm/types/core.d.ts +2 -2
  292. package/dist/esm/types/errors.d.ts +4 -4
  293. package/dist/esm/types/storage.d.ts +2 -2
  294. package/dist/esm/utils/WordArray.mjs +2 -2
  295. package/dist/esm/utils/WordArray.mjs.map +1 -1
  296. package/dist/esm/utils/deDupeAsyncFunction.d.ts +1 -5
  297. package/dist/esm/utils/deDupeAsyncFunction.mjs +8 -8
  298. package/dist/esm/utils/deDupeAsyncFunction.mjs.map +1 -1
  299. package/dist/esm/utils/getClientInfo/getClientInfo.android.mjs +0 -1
  300. package/dist/esm/utils/getClientInfo/getClientInfo.android.mjs.map +1 -1
  301. package/dist/esm/utils/getClientInfo/getClientInfo.ios.mjs +0 -1
  302. package/dist/esm/utils/getClientInfo/getClientInfo.ios.mjs.map +1 -1
  303. package/dist/esm/utils/globalHelpers/index.native.mjs.map +1 -1
  304. package/dist/esm/utils/queuedStorage/createQueuedStorage.native.mjs +2 -2
  305. package/dist/esm/utils/queuedStorage/createQueuedStorage.native.mjs.map +1 -1
  306. package/dist/esm/utils/retry/NonRetryableError.d.ts +0 -1
  307. package/dist/esm/utils/retry/NonRetryableError.mjs +2 -2
  308. package/dist/esm/utils/retry/NonRetryableError.mjs.map +1 -1
  309. package/dist/esm/utils/retry/retry.mjs +15 -6
  310. package/dist/esm/utils/retry/retry.mjs.map +1 -1
  311. package/dist/esm/utils/sessionListener/SessionListener.d.ts +1 -1
  312. package/dist/esm/utils/sessionListener/SessionListener.native.d.ts +1 -1
  313. package/dist/esm/utils/sessionListener/types.d.ts +2 -2
  314. package/package.json +5 -4
  315. package/src/BackgroundProcessManager/BackgroundProcessManager.ts +29 -34
  316. package/src/BackgroundProcessManager/types.ts +3 -3
  317. package/src/Cache/StorageCache.native.ts +5 -0
  318. package/src/Cache/StorageCache.ts +2 -0
  319. package/src/Cache/StorageCacheCommon.ts +49 -29
  320. package/src/Cache/types/cache.ts +2 -1
  321. package/src/Cache/utils/CacheList.ts +6 -3
  322. package/src/Cache/utils/cacheHelpers.ts +2 -1
  323. package/src/Hub/index.ts +15 -15
  324. package/src/Hub/types/AuthTypes.ts +11 -11
  325. package/src/Hub/types/HubTypes.ts +11 -8
  326. package/src/I18n/I18n.ts +10 -16
  327. package/src/I18n/index.ts +7 -7
  328. package/src/Logger/ConsoleLogger.ts +12 -9
  329. package/src/Logger/types.ts +1 -0
  330. package/src/Mutex/Mutex.ts +8 -4
  331. package/src/Mutex/types.ts +3 -7
  332. package/src/Platform/customUserAgent.ts +3 -3
  333. package/src/Platform/detectFramework.ts +4 -1
  334. package/src/Platform/detection/Angular.ts +4 -4
  335. package/src/Platform/detection/Expo.ts +1 -2
  336. package/src/Platform/detection/Next.ts +5 -2
  337. package/src/Platform/detection/Nuxt.ts +5 -4
  338. package/src/Platform/detection/index.ts +9 -9
  339. package/src/Platform/index.ts +4 -4
  340. package/src/Platform/types.ts +12 -12
  341. package/src/Platform/version.ts +1 -1
  342. package/src/Reachability/Reachability.native.ts +6 -3
  343. package/src/Reachability/Reachability.ts +12 -6
  344. package/src/Reachability/types.ts +2 -2
  345. package/src/ServiceWorker/ServiceWorker.ts +28 -23
  346. package/src/Signer/DateUtils.ts +16 -16
  347. package/src/Signer/Signer.ts +19 -13
  348. package/src/adapterCore/serverContext/serverContext.ts +6 -5
  349. package/src/adapterCore/serverContext/serverContextRegistry.ts +2 -1
  350. package/src/adapterCore/serverContext/types/amplifyServer.ts +15 -17
  351. package/src/adapterCore/serverContext/types/cookieStorage.ts +1 -1
  352. package/src/awsClients/cognitoIdentity/base.ts +16 -12
  353. package/src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts +13 -10
  354. package/src/awsClients/cognitoIdentity/getId.ts +12 -9
  355. package/src/awsClients/cognitoIdentity/types.ts +3 -3
  356. package/src/awsClients/pinpoint/base.ts +1 -1
  357. package/src/awsClients/pinpoint/getInAppMessages.ts +8 -5
  358. package/src/awsClients/pinpoint/putEvents.ts +8 -5
  359. package/src/awsClients/pinpoint/types.ts +3 -4
  360. package/src/awsClients/pinpoint/updateEndpoint.ts +8 -5
  361. package/src/clients/endpoints/getDnsSuffix.ts +1 -0
  362. package/src/clients/handlers/authenticated.ts +14 -7
  363. package/src/clients/handlers/fetch.ts +1 -1
  364. package/src/clients/handlers/unauthenticated.ts +8 -4
  365. package/src/clients/index.ts +6 -3
  366. package/src/clients/internal/composeServiceApi.ts +8 -7
  367. package/src/clients/internal/composeTransferHandler.ts +16 -15
  368. package/src/clients/middleware/retry/defaultRetryDecider.ts +5 -3
  369. package/src/clients/middleware/retry/index.ts +1 -1
  370. package/src/clients/middleware/retry/jitteredBackoff.ts +3 -1
  371. package/src/clients/middleware/retry/middleware.ts +12 -9
  372. package/src/clients/middleware/signing/index.ts +1 -1
  373. package/src/clients/middleware/signing/middleware.ts +5 -2
  374. package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +4 -4
  375. package/src/clients/middleware/signing/signer/signatureV4/signRequest.ts +2 -1
  376. package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +4 -2
  377. package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.ts +2 -1
  378. package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.ts +2 -1
  379. package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.ts +1 -1
  380. package/src/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.ts +1 -1
  381. package/src/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.ts +2 -1
  382. package/src/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.ts +3 -0
  383. package/src/clients/middleware/signing/signer/signatureV4/utils/getSignature.ts +4 -3
  384. package/src/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.ts +3 -1
  385. package/src/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.ts +3 -1
  386. package/src/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.ts +2 -2
  387. package/src/clients/middleware/signing/utils/getUpdatedSystemClockOffset.ts +2 -1
  388. package/src/clients/middleware/signing/utils/isClockSkewed.ts +2 -2
  389. package/src/clients/middleware/userAgent/index.ts +1 -1
  390. package/src/clients/middleware/userAgent/middleware.ts +3 -1
  391. package/src/clients/serde/json.ts +6 -2
  392. package/src/clients/serde/responseInfo.ts +6 -2
  393. package/src/clients/types/aws.ts +6 -3
  394. package/src/clients/types/core.ts +6 -8
  395. package/src/clients/types/http.ts +2 -1
  396. package/src/clients/utils/memoization.ts +2 -0
  397. package/src/errors/APIError.ts +3 -2
  398. package/src/errors/PlatformNotSupportedError.ts +1 -0
  399. package/src/errors/createAssertionFunction.ts +2 -1
  400. package/src/errors/errorHelpers.ts +2 -1
  401. package/src/index.ts +0 -1
  402. package/src/libraryUtils.ts +1 -0
  403. package/src/parseAWSExports.ts +16 -15
  404. package/src/providers/kinesis/types/kinesis.ts +2 -2
  405. package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +2 -2
  406. package/src/providers/personalize/types/personalize.ts +2 -2
  407. package/src/providers/pinpoint/apis/updateEndpoint.ts +2 -2
  408. package/src/providers/pinpoint/types/buffer.ts +7 -8
  409. package/src/providers/pinpoint/types/pinpoint.ts +11 -10
  410. package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +11 -21
  411. package/src/providers/pinpoint/utils/cacheEndpointId.ts +3 -1
  412. package/src/providers/pinpoint/utils/getCacheKey.ts +1 -1
  413. package/src/providers/pinpoint/utils/getEndpointId.ts +3 -1
  414. package/src/providers/pinpoint/utils/getEventBuffer.ts +2 -1
  415. package/src/providers/pinpoint/utils/isAppInForeground.native.ts +0 -1
  416. package/src/providers/pinpoint/utils/resolveEndpointId.ts +1 -0
  417. package/src/singleton/API/types.ts +35 -33
  418. package/src/singleton/Amplify.ts +8 -6
  419. package/src/singleton/Auth/index.ts +9 -13
  420. package/src/singleton/Auth/types.ts +59 -51
  421. package/src/singleton/Auth/utils/index.ts +16 -28
  422. package/src/singleton/Geo/types.ts +3 -3
  423. package/src/singleton/Interactions/types.ts +4 -4
  424. package/src/singleton/Notifications/types.ts +6 -5
  425. package/src/singleton/Predictions/types.ts +28 -28
  426. package/src/singleton/Storage/types.ts +2 -2
  427. package/src/singleton/apis/fetchAuthSession.ts +2 -1
  428. package/src/singleton/apis/internal/fetchAuthSession.ts +1 -1
  429. package/src/singleton/apis/server/fetchAuthSession.ts +2 -2
  430. package/src/singleton/types.ts +10 -10
  431. package/src/storage/CookieStorage.native.ts +1 -5
  432. package/src/storage/CookieStorage.ts +12 -6
  433. package/src/storage/DefaultStorage.native.ts +3 -1
  434. package/src/storage/InMemoryStorage.ts +1 -0
  435. package/src/storage/KeyValueStorage.ts +1 -0
  436. package/src/types/core.ts +3 -3
  437. package/src/types/errors.ts +5 -5
  438. package/src/types/storage.ts +2 -2
  439. package/src/utils/WordArray.ts +2 -2
  440. package/src/utils/convert/base64/base64Encoder.ts +1 -0
  441. package/src/utils/convert/types.ts +1 -1
  442. package/src/utils/cryptoSecureRandomInt.ts +1 -0
  443. package/src/utils/deDupeAsyncFunction.ts +15 -20
  444. package/src/utils/generateRandomString.ts +1 -1
  445. package/src/utils/getClientInfo/getClientInfo.android.ts +3 -2
  446. package/src/utils/getClientInfo/getClientInfo.ios.ts +4 -2
  447. package/src/utils/getClientInfo/getClientInfo.ts +3 -3
  448. package/src/utils/globalHelpers/index.native.ts +2 -1
  449. package/src/utils/haveCredentialsChanged.ts +5 -2
  450. package/src/utils/isWebWorker.ts +1 -0
  451. package/src/utils/queuedStorage/createQueuedStorage.native.ts +9 -6
  452. package/src/utils/queuedStorage/createQueuedStorage.ts +7 -3
  453. package/src/utils/queuedStorage/types.ts +1 -1
  454. package/src/utils/retry/NonRetryableError.ts +0 -3
  455. package/src/utils/retry/isNonRetryableError.ts +1 -0
  456. package/src/utils/retry/jitteredBackoff.ts +3 -1
  457. package/src/utils/retry/jitteredExponentialRetry.ts +1 -1
  458. package/src/utils/retry/retry.ts +22 -8
  459. package/src/utils/sessionListener/SessionListener.native.ts +4 -3
  460. package/src/utils/sessionListener/SessionListener.ts +4 -3
  461. package/src/utils/sessionListener/index.ts +1 -0
  462. package/src/utils/sessionListener/types.ts +2 -2
  463. package/src/utils/urlSafeDecode.ts +1 -0
@@ -1,20 +1,20 @@
1
1
  import { Headers } from '../../clients';
2
2
  import { AtLeastOne } from '../types';
3
- export type LibraryAPIOptions = {
3
+ export interface LibraryAPIOptions {
4
4
  GraphQL?: {
5
- headers?: (options?: {
5
+ headers?(options?: {
6
6
  query?: string;
7
7
  variables?: Record<string, DocumentType>;
8
- }) => Promise<Headers | {}>;
8
+ }): Promise<Headers | Record<string, unknown>>;
9
9
  withCredentials?: boolean;
10
10
  };
11
11
  REST?: {
12
- headers?: (options: {
12
+ headers?(options: {
13
13
  apiName: string;
14
- }) => Promise<Headers>;
14
+ }): Promise<Headers>;
15
15
  };
16
- };
17
- type APIGraphQLConfig = {
16
+ }
17
+ interface APIGraphQLConfig {
18
18
  /**
19
19
  * Required GraphQL endpoint, must be a valid URL string.
20
20
  */
@@ -41,8 +41,8 @@ type APIGraphQLConfig = {
41
41
  */
42
42
  defaultAuthMode: GraphQLAuthMode;
43
43
  modelIntrospection?: ModelIntrospectionSchema;
44
- };
45
- type APIRestConfig = {
44
+ }
45
+ interface APIRestConfig {
46
46
  /**
47
47
  * Required REST endpoint, must be a valid URL string.
48
48
  */
@@ -60,13 +60,13 @@ type APIRestConfig = {
60
60
  * @default 'execute-api'
61
61
  */
62
62
  service?: string;
63
- };
64
- export type RESTProviderConfig = {
63
+ }
64
+ export interface RESTProviderConfig {
65
65
  REST: Record<string, APIRestConfig>;
66
- };
67
- export type GraphQLProviderConfig = {
66
+ }
67
+ export interface GraphQLProviderConfig {
68
68
  GraphQL: APIGraphQLConfig;
69
- };
69
+ }
70
70
  export type APIConfig = AtLeastOne<RESTProviderConfig & GraphQLProviderConfig>;
71
71
  export type GraphQLAuthMode = 'apiKey' | 'oidc' | 'userPool' | 'iam' | 'lambda' | 'none';
72
72
  /**
@@ -80,53 +80,51 @@ export type DocumentType = null | boolean | number | string | DocumentType[] | {
80
80
  *
81
81
  * Borrowed from: https://github.com/aws-amplify/samsara-cli/pull/377/commits/c08ea2c1a43f36aafe63b6d14d03f884e9c0c671#diff-21ae6faa2f22c15bb25ff9b272eaab7846c0650e2d267ab720546c19559583d0R4-R108
82
82
  */
83
- export type ModelIntrospectionSchema = {
83
+ export interface ModelIntrospectionSchema {
84
84
  version: 1;
85
85
  models: SchemaModels;
86
86
  nonModels: SchemaNonModels;
87
87
  enums: SchemaEnums;
88
- };
88
+ }
89
89
  /**
90
90
  * Top-level Entities on a Schema
91
91
  */
92
92
  export type SchemaModels = Record<string, SchemaModel>;
93
93
  export type SchemaNonModels = Record<string, SchemaNonModel>;
94
94
  export type SchemaEnums = Record<string, SchemaEnum>;
95
- export type SchemaModel = {
95
+ export interface SchemaModel {
96
96
  name: string;
97
97
  attributes?: ModelAttribute[];
98
98
  fields: Fields;
99
99
  pluralName: string;
100
100
  syncable?: boolean;
101
101
  primaryKeyInfo: PrimaryKeyInfo;
102
- };
103
- export type SchemaNonModel = {
102
+ }
103
+ export interface SchemaNonModel {
104
104
  name: string;
105
105
  fields: Fields;
106
- };
107
- export type SchemaEnum = {
106
+ }
107
+ export interface SchemaEnum {
108
108
  name: string;
109
109
  values: string[];
110
- };
111
- export type ModelAttribute = {
110
+ }
111
+ export interface ModelAttribute {
112
112
  type: string;
113
- properties?: {
114
- [key: string]: any;
115
- };
116
- };
117
- export type SecondaryIndexAttribute = {
113
+ properties?: Record<string, any>;
114
+ }
115
+ export interface SecondaryIndexAttribute {
118
116
  type: 'key';
119
117
  properties: {
120
118
  name: string;
121
119
  queryField: string;
122
120
  fields: string[];
123
121
  };
124
- };
122
+ }
125
123
  /**
126
124
  * Field Definition
127
125
  */
128
126
  export type Fields = Record<string, Field>;
129
- export type Field = {
127
+ export interface Field {
130
128
  name: string;
131
129
  type: FieldType;
132
130
  isArray: boolean;
@@ -135,10 +133,10 @@ export type Field = {
135
133
  isArrayNullable?: boolean;
136
134
  attributes?: FieldAttribute[];
137
135
  association?: AssociationType;
138
- };
139
- export type ModelFieldType = {
136
+ }
137
+ export interface ModelFieldType {
140
138
  model: string;
141
- };
139
+ }
142
140
  export type FieldType = 'ID' | 'String' | 'Int' | 'Float' | 'AWSDate' | 'AWSTime' | 'AWSDateTime' | 'AWSTimestamp' | 'AWSEmail' | 'AWSURL' | 'AWSIPAddress' | 'Boolean' | 'AWSJSON' | 'AWSPhone' | {
143
141
  enum: string;
144
142
  } | ModelFieldType | {
@@ -153,9 +151,9 @@ export declare enum CodeGenConnectionType {
153
151
  BELONGS_TO = "BELONGS_TO",
154
152
  HAS_MANY = "HAS_MANY"
155
153
  }
156
- export type AssociationBaseType = {
154
+ export interface AssociationBaseType {
157
155
  connectionType: CodeGenConnectionType;
158
- };
156
+ }
159
157
  export type AssociationHasMany = AssociationBaseType & {
160
158
  connectionType: CodeGenConnectionType.HAS_MANY;
161
159
  associatedWith: string[];
@@ -170,9 +168,9 @@ export type AssociationBelongsTo = AssociationBaseType & {
170
168
  targetNames: string[];
171
169
  };
172
170
  export type AssociationType = AssociationHasMany | AssociationHasOne | AssociationBelongsTo;
173
- export type PrimaryKeyInfo = {
171
+ export interface PrimaryKeyInfo {
174
172
  isCustomPrimaryKey: boolean;
175
173
  primaryKeyFieldName: string;
176
174
  sortKeyFieldNames: string[];
177
- };
175
+ }
178
176
  export {};
@@ -1,5 +1,5 @@
1
- import { AuthClass } from './Auth';
2
1
  import { AuthConfig, LegacyConfig, LibraryOptions, ResourcesConfig } from './types';
2
+ import { AuthClass } from './Auth';
3
3
  import { ADD_OAUTH_LISTENER } from './constants';
4
4
  export declare class AmplifyClass {
5
5
  private oAuthListener;
@@ -1,9 +1,9 @@
1
- import { AuthClass } from './Auth/index.mjs';
2
1
  import { Hub, AMPLIFY_SYMBOL } from '../Hub/index.mjs';
3
2
  import { parseAWSExports } from '../parseAWSExports.mjs';
4
3
  import '../utils/getClientInfo/getClientInfo.mjs';
5
4
  import '../utils/retry/retry.mjs';
6
5
  import { deepFreeze } from '../utils/deepFreeze.mjs';
6
+ import { AuthClass } from './Auth/index.mjs';
7
7
  import { ADD_OAUTH_LISTENER } from './constants.mjs';
8
8
 
9
9
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -1 +1 @@
1
- {"version":3,"file":"Amplify.mjs","sources":["../../../src/singleton/Amplify.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AuthClass } from './Auth';\nimport { Hub, AMPLIFY_SYMBOL } from '../Hub';\nimport { parseAWSExports } from '../parseAWSExports';\nimport { deepFreeze } from '../utils';\nimport { ADD_OAUTH_LISTENER } from './constants';\nexport class AmplifyClass {\n constructor() {\n this.oAuthListener = undefined;\n this.resourcesConfig = {};\n this.libraryOptions = {};\n this.Auth = new AuthClass();\n }\n /**\n * Configures Amplify for use with your back-end resources.\n *\n * @remarks\n * This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently\n * provided values will be used after configuration.\n *\n * @remarks\n * `configure` can be used to specify additional library options where available for supported categories.\n *\n * @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.\n * @param libraryOptions - Additional options for customizing the behavior of the library.\n */\n configure(resourcesConfig, libraryOptions) {\n let resolvedResourceConfig;\n if (Object.keys(resourcesConfig).some(key => key.startsWith('aws_'))) {\n resolvedResourceConfig = parseAWSExports(resourcesConfig);\n }\n else {\n resolvedResourceConfig = resourcesConfig;\n }\n this.resourcesConfig = resolvedResourceConfig;\n if (libraryOptions) {\n this.libraryOptions = libraryOptions;\n }\n // Make resource config immutable\n this.resourcesConfig = deepFreeze(this.resourcesConfig);\n this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);\n Hub.dispatch('core', {\n event: 'configure',\n data: this.resourcesConfig,\n }, 'Configure', AMPLIFY_SYMBOL);\n this.notifyOAuthListener();\n }\n /**\n * Provides access to the current back-end resource configuration for the Library.\n *\n * @returns Returns the immutable back-end resource configuration.\n */\n getConfig() {\n return this.resourcesConfig;\n }\n /** @internal */\n [ADD_OAUTH_LISTENER](listener) {\n if (this.resourcesConfig.Auth?.Cognito.loginWith?.oauth) {\n // when Amplify has been configured with a valid OAuth config while adding the listener, run it directly\n listener(this.resourcesConfig.Auth?.Cognito);\n }\n else {\n // otherwise register the listener and run it later when Amplify gets configured with a valid oauth config\n this.oAuthListener = listener;\n }\n }\n notifyOAuthListener() {\n if (!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth ||\n !this.oAuthListener) {\n return;\n }\n this.oAuthListener(this.resourcesConfig.Auth?.Cognito);\n // the listener should only be notified once with a valid oauth config\n this.oAuthListener = undefined;\n }\n}\n/**\n * The `Amplify` utility is used to configure the library.\n *\n * @remarks\n * `Amplify` is responsible for orchestrating cross-category communication within the library.\n */\nexport const Amplify = new AmplifyClass();\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAMO,MAAM,YAAY,CAAC;AAC1B,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;AACvC,QAAQ,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;AAClC,QAAQ,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;AACjC,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,EAAE,cAAc,EAAE;AAC/C,QAAQ,IAAI,sBAAsB,CAAC;AACnC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9E,YAAY,sBAAsB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;AACtE,SAAS;AACT,aAAa;AACb,YAAY,sBAAsB,GAAG,eAAe,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,CAAC,eAAe,GAAG,sBAAsB,CAAC;AACtD,QAAQ,IAAI,cAAc,EAAE;AAC5B,YAAY,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;AACjD,SAAS;AACT;AACA,QAAQ,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAChE,QAAQ,IAAI,CAAC,IAAI,CAAC,SAA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"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AMPLIFY_SYMBOL, Hub } from '../Hub';\nimport { parseAWSExports } from '../parseAWSExports';\nimport { deepFreeze } from '../utils';\nimport { AuthClass } from './Auth';\nimport { ADD_OAUTH_LISTENER } from './constants';\nexport class AmplifyClass {\n constructor() {\n this.oAuthListener = undefined;\n this.resourcesConfig = {};\n this.libraryOptions = {};\n this.Auth = new AuthClass();\n }\n /**\n * Configures Amplify for use with your back-end resources.\n *\n * @remarks\n * This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently\n * provided values will be used after configuration.\n *\n * @remarks\n * `configure` can be used to specify additional library options where available for supported categories.\n *\n * @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.\n * @param libraryOptions - Additional options for customizing the behavior of the library.\n */\n configure(resourcesConfig, libraryOptions) {\n let resolvedResourceConfig;\n if (Object.keys(resourcesConfig).some(key => key.startsWith('aws_'))) {\n resolvedResourceConfig = parseAWSExports(resourcesConfig);\n }\n else {\n resolvedResourceConfig = resourcesConfig;\n }\n this.resourcesConfig = resolvedResourceConfig;\n if (libraryOptions) {\n this.libraryOptions = libraryOptions;\n }\n // Make resource config immutable\n this.resourcesConfig = deepFreeze(this.resourcesConfig);\n this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);\n Hub.dispatch('core', {\n event: 'configure',\n data: this.resourcesConfig,\n }, 'Configure', AMPLIFY_SYMBOL);\n this.notifyOAuthListener();\n }\n /**\n * Provides access to the current back-end resource configuration for the Library.\n *\n * @returns Returns the immutable back-end resource configuration.\n */\n getConfig() {\n return this.resourcesConfig;\n }\n /** @internal */\n [ADD_OAUTH_LISTENER](listener) {\n if (this.resourcesConfig.Auth?.Cognito.loginWith?.oauth) {\n // when Amplify has been configured with a valid OAuth config while adding the listener, run it directly\n listener(this.resourcesConfig.Auth?.Cognito);\n }\n else {\n // otherwise register the listener and run it later when Amplify gets configured with a valid oauth config\n this.oAuthListener = listener;\n }\n }\n notifyOAuthListener() {\n if (!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth ||\n !this.oAuthListener) {\n return;\n }\n this.oAuthListener(this.resourcesConfig.Auth?.Cognito);\n // the listener should only be notified once with a valid oauth config\n this.oAuthListener = undefined;\n }\n}\n/**\n * The `Amplify` utility is used to configure the library.\n *\n * @remarks\n * `Amplify` is responsible for orchestrating cross-category communication within the library.\n */\nexport const Amplify = new AmplifyClass();\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAMO,MAAM,YAAY,CAAC;AAC1B,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;AACvC,QAAQ,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;AAClC,QAAQ,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;AACjC,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,EAAE,cAAc,EAAE;AAC/C,QAAQ,IAAI,sBAAsB,CAAC;AACnC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9E,YAAY,sBAAsB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;AACtE,SAAS;AACT,aAAa;AACb,YAAY,sBAAsB,GAAG,eAAe,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,CAAC,eAAe,GAAG,sBAAsB,CAAC;AACtD,QAAQ,IAAI,cAAc,EAAE;AAC5B,YAAY,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;AACjD,SAAS;AACT;AACA,QAAQ,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,IAAI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,YAAY;;;;"}
@@ -6,7 +6,6 @@ export declare function isTokenExpired({ expiresAt, clockDrift, }: {
6
6
  export declare class AuthClass {
7
7
  private authConfig?;
8
8
  private authOptions?;
9
- constructor();
10
9
  /**
11
10
  * Configure Auth category
12
11
  *
@@ -3,7 +3,6 @@ function isTokenExpired({ expiresAt, clockDrift, }) {
3
3
  return currentTime + clockDrift > expiresAt;
4
4
  }
5
5
  class AuthClass {
6
- constructor() { }
7
6
  /**
8
7
  * Configure Auth category
9
8
  *
@@ -28,11 +27,10 @@ class AuthClass {
28
27
  * @returns Promise of current auth session {@link AuthSession}.
29
28
  */
30
29
  async fetchAuthSession(options = {}) {
31
- let tokens;
32
30
  let credentialsAndIdentityId;
33
31
  let userSub;
34
32
  // Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
35
- tokens = await this.getTokens(options);
33
+ const tokens = await this.getTokens(options);
36
34
  if (tokens) {
37
35
  userSub = tokens.accessToken?.payload?.sub;
38
36
  // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
@@ -61,9 +59,7 @@ class AuthClass {
61
59
  };
62
60
  }
63
61
  async clearCredentials() {
64
- if (this.authOptions?.credentialsProvider) {
65
- return await this.authOptions.credentialsProvider.clearCredentialsAndIdentityId();
66
- }
62
+ await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId();
67
63
  }
68
64
  async getTokens(options) {
69
65
  return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../src/singleton/Auth/index.ts"],"sourcesContent":["export function isTokenExpired({ expiresAt, clockDrift, }) {\n const currentTime = Date.now();\n return currentTime + clockDrift > expiresAt;\n}\nexport class AuthClass {\n constructor() { }\n /**\n * Configure Auth category\n *\n * @internal\n *\n * @param authResourcesConfig - Resources configurations required by Auth providers.\n * @param authOptions - Client options used by library\n *\n * @returns void\n */\n configure(authResourcesConfig, authOptions) {\n this.authConfig = authResourcesConfig;\n this.authOptions = authOptions;\n }\n /**\n * Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it\n * does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh\n * with `{ forceRefresh: true }` input.\n *\n * @param options - Options configuring the fetch behavior.\n *\n * @returns Promise of current auth session {@link AuthSession}.\n */\n async fetchAuthSession(options = {}) {\n let tokens;\n let credentialsAndIdentityId;\n let userSub;\n // Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available\n tokens = await this.getTokens(options);\n if (tokens) {\n userSub = tokens.accessToken?.payload?.sub;\n // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)\n credentialsAndIdentityId =\n await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({\n authConfig: this.authConfig,\n tokens,\n authenticated: true,\n forceRefresh: options.forceRefresh,\n });\n }\n else {\n // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)\n credentialsAndIdentityId =\n await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({\n authConfig: this.authConfig,\n authenticated: false,\n forceRefresh: options.forceRefresh,\n });\n }\n return {\n tokens,\n credentials: credentialsAndIdentityId?.credentials,\n identityId: credentialsAndIdentityId?.identityId,\n userSub,\n };\n }\n async clearCredentials() {\n if (this.authOptions?.credentialsProvider) {\n return await this.authOptions.credentialsProvider.clearCredentialsAndIdentityId();\n }\n }\n async getTokens(options) {\n return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);\n }\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,EAAE;AAC3D,IAAI,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACnC,IAAI,OAAO,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAChD,CAAC;AACM,MAAM,SAAS,CAAC;AACvB,IAAI,WAAW,GAAG,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mB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V,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE;AACnD,YAAY,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,6BAA6B,EAAE,CAAC;AAC9F,SAAS;AACT,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;AAC1F,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../src/singleton/Auth/index.ts"],"sourcesContent":["export function isTokenExpired({ expiresAt, clockDrift, }) {\n const currentTime = Date.now();\n return currentTime + clockDrift > expiresAt;\n}\nexport class AuthClass {\n /**\n * Configure Auth category\n *\n * @internal\n *\n * @param authResourcesConfig - Resources configurations required by Auth providers.\n * @param authOptions - Client options used by library\n *\n * @returns void\n */\n configure(authResourcesConfig, authOptions) {\n this.authConfig = authResourcesConfig;\n this.authOptions = authOptions;\n }\n /**\n * Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it\n * does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh\n * with `{ forceRefresh: true }` input.\n *\n * @param options - Options configuring the fetch behavior.\n *\n * @returns Promise of current auth session {@link AuthSession}.\n */\n async fetchAuthSession(options = {}) {\n let credentialsAndIdentityId;\n let userSub;\n // Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available\n const tokens = await this.getTokens(options);\n if (tokens) {\n userSub = tokens.accessToken?.payload?.sub;\n // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)\n credentialsAndIdentityId =\n await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({\n authConfig: this.authConfig,\n tokens,\n authenticated: true,\n forceRefresh: options.forceRefresh,\n });\n }\n else {\n // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)\n credentialsAndIdentityId =\n await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({\n authConfig: this.authConfig,\n authenticated: false,\n forceRefresh: options.forceRefresh,\n });\n }\n return {\n tokens,\n credentials: credentialsAndIdentityId?.credentials,\n identityId: credentialsAndIdentityId?.identityId,\n userSub,\n };\n }\n async clearCredentials() {\n await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId();\n }\n async getTokens(options) {\n return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);\n }\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,EAAE;AAC3D,IAAI,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACnC,IAAI,OAAO,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAChD,CAAC;AACM,MAAM,SAAS,CAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB,EAAE,WAAW,EAAE;AAChD,QAAQ,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAC9C,QAAQ,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AACvC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,gBAAgB,CAAC,OAAO,GAAG,EAAE,EAAE;AACzC,QAAQ,IAAI,wBAAwB,CAAC;AACrC,QAAQ,IAAI,OAAO,CAAC;AACpB;AACA,QAAQ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACrD,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AACvD;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,MAAM;AAC1B,oBAAoB,aAAa,EAAE,IAAI;AACvC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC,CAAC;AACnB,SAAS;AACT,aAAa;AACb;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,aAAa,EAAE,KAAK;AACxC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC,CAAC;AACnB,SAAS;AACT,QAAQ,OAAO;AACf,YAAY,MAAM;AAClB,YAAY,WAAW,EAAE,wBAAwB,EAAE,WAAW;AAC9D,YAAY,UAAU,EAAE,wBAAwB,EAAE,UAAU;AAC5D,YAAY,OAAO;AACnB,SAAS,CAAC;AACV,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,CAAC;AACrF,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;AAC1F,KAAK;AACL;;;;"}
@@ -9,48 +9,49 @@ interface JwtPayloadStandardFields {
9
9
  jti?: string;
10
10
  sub?: string;
11
11
  }
12
- /** JSON type */
13
- type Json = null | string | number | boolean | Json[] | JsonObject;
12
+ type JsonPrimitive = null | string | number | boolean;
13
+ /** JSON array type */
14
+ type JsonArray = JsonPrimitive[];
14
15
  /** JSON Object type */
15
- type JsonObject = {
16
- [name: string]: Json;
17
- };
16
+ interface JsonObject {
17
+ [x: string]: JsonPrimitive | JsonArray | JsonObject;
18
+ }
18
19
  export type JwtPayload = JwtPayloadStandardFields & JsonObject;
19
- export type JWT = {
20
+ export interface JWT {
20
21
  payload: JwtPayload;
21
- toString: () => string;
22
- };
22
+ toString(): string;
23
+ }
23
24
  export type JWTCreator = (stringJWT: string) => JWT;
24
- export type AuthSession = {
25
+ export interface AuthSession {
25
26
  tokens?: AuthTokens;
26
27
  credentials?: AWSCredentials;
27
28
  identityId?: string;
28
29
  userSub?: string;
29
- };
30
- export type LibraryAuthOptions = {
30
+ }
31
+ export interface LibraryAuthOptions {
31
32
  tokenProvider?: TokenProvider;
32
33
  credentialsProvider?: CredentialsAndIdentityIdProvider;
33
- };
34
- export type Identity = {
34
+ }
35
+ export interface Identity {
35
36
  id: string;
36
37
  type: 'guest' | 'primary';
37
- };
38
+ }
38
39
  export interface CredentialsAndIdentityIdProvider {
39
- getCredentialsAndIdentityId: (getCredentialsOptions: GetCredentialsOptions) => Promise<CredentialsAndIdentityId | undefined>;
40
- clearCredentialsAndIdentityId: () => void;
40
+ getCredentialsAndIdentityId(getCredentialsOptions: GetCredentialsOptions): Promise<CredentialsAndIdentityId | undefined>;
41
+ clearCredentialsAndIdentityId(): void;
41
42
  }
42
- export type TokenProvider = {
43
- getTokens: ({ forceRefresh, }?: {
43
+ export interface TokenProvider {
44
+ getTokens({ forceRefresh, }?: {
44
45
  forceRefresh?: boolean;
45
- }) => Promise<AuthTokens | null>;
46
- };
47
- export type FetchAuthSessionOptions = {
46
+ }): Promise<AuthTokens | null>;
47
+ }
48
+ export interface FetchAuthSessionOptions {
48
49
  forceRefresh?: boolean;
49
- };
50
- export type AuthTokens = {
50
+ }
51
+ export interface AuthTokens {
51
52
  idToken?: JWT;
52
53
  accessToken: JWT;
53
- };
54
+ }
54
55
  export type AuthStandardAttributeKey = 'address' | 'birthdate' | 'email_verified' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number_verified' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo' | AuthVerifiableAttributeKey;
55
56
  export type LegacyUserAttributeKey = Uppercase<AuthStandardAttributeKey>;
56
57
  export type AuthVerifiableAttributeKey = 'email' | 'phone_number';
@@ -62,7 +63,7 @@ export type CognitoProviderConfig = StrictUnion<AuthIdentityPoolConfig | AuthUse
62
63
  type UnionKeys<T> = T extends T ? keyof T : never;
63
64
  type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
64
65
  export type StrictUnion<T> = StrictUnionHelper<T, T>;
65
- export type AuthIdentityPoolConfig = {
66
+ export interface AuthIdentityPoolConfig {
66
67
  Cognito: CognitoIdentityPoolConfig & {
67
68
  userPoolClientId?: never;
68
69
  userPoolId?: never;
@@ -73,18 +74,18 @@ export type AuthIdentityPoolConfig = {
73
74
  mfa?: never;
74
75
  passwordFormat?: never;
75
76
  };
76
- };
77
- export type CognitoIdentityPoolConfig = {
77
+ }
78
+ export interface CognitoIdentityPoolConfig {
78
79
  identityPoolId: string;
79
80
  allowGuestAccess?: boolean;
80
- };
81
- export type AuthUserPoolConfig = {
81
+ }
82
+ export interface AuthUserPoolConfig {
82
83
  Cognito: CognitoUserPoolConfig & {
83
84
  identityPoolId?: never;
84
85
  allowGuestAccess?: never;
85
86
  };
86
- };
87
- export type CognitoUserPoolConfig = {
87
+ }
88
+ export interface CognitoUserPoolConfig {
88
89
  userPoolClientId: string;
89
90
  userPoolId: string;
90
91
  userPoolEndpoint?: string;
@@ -108,51 +109,51 @@ export type CognitoUserPoolConfig = {
108
109
  requireNumbers?: boolean;
109
110
  requireSpecialCharacters?: boolean;
110
111
  };
111
- };
112
- export type OAuthConfig = {
112
+ }
113
+ export interface OAuthConfig {
113
114
  domain: string;
114
- scopes: Array<OAuthScope>;
115
- redirectSignIn: Array<string>;
116
- redirectSignOut: Array<string>;
115
+ scopes: OAuthScope[];
116
+ redirectSignIn: string[];
117
+ redirectSignOut: string[];
117
118
  responseType: 'code' | 'token';
118
- providers?: Array<OAuthProvider | CustomProvider>;
119
- };
119
+ providers?: (OAuthProvider | CustomProvider)[];
120
+ }
120
121
  export type OAuthProvider = 'Google' | 'Facebook' | 'Amazon' | 'Apple';
121
- type CustomProvider = {
122
+ interface CustomProvider {
122
123
  custom: string;
123
- };
124
- type CustomScope = string & {};
125
- type OAuthScope = 'email' | 'openid' | 'phone' | 'email' | 'profile' | 'aws.cognito.signin.user.admin' | CustomScope;
124
+ }
125
+ type CustomScope = string & NonNullable<unknown>;
126
+ export type OAuthScope = 'email' | 'openid' | 'phone' | 'email' | 'profile' | 'aws.cognito.signin.user.admin' | CustomScope;
126
127
  export type CognitoUserPoolWithOAuthConfig = CognitoUserPoolConfig & {
127
128
  loginWith: {
128
129
  oauth: OAuthConfig;
129
130
  };
130
131
  };
131
- export type AuthUserPoolAndIdentityPoolConfig = {
132
+ export interface AuthUserPoolAndIdentityPoolConfig {
132
133
  Cognito: CognitoUserPoolAndIdentityPoolConfig;
133
- };
134
+ }
134
135
  export type CognitoUserPoolAndIdentityPoolConfig = CognitoUserPoolConfig & CognitoIdentityPoolConfig;
135
136
  export type GetCredentialsOptions = GetCredentialsAuthenticatedUser | GetCredentialsUnauthenticatedUser;
136
- type GetCredentialsAuthenticatedUser = {
137
+ interface GetCredentialsAuthenticatedUser {
137
138
  authenticated: true;
138
139
  forceRefresh?: boolean;
139
140
  authConfig: AuthConfig | undefined;
140
141
  tokens: AuthTokens;
141
- };
142
- type GetCredentialsUnauthenticatedUser = {
142
+ }
143
+ interface GetCredentialsUnauthenticatedUser {
143
144
  authenticated: false;
144
145
  forceRefresh?: boolean;
145
146
  authConfig: AuthConfig | undefined;
146
147
  tokens?: never;
147
- };
148
- export type CredentialsAndIdentityId = {
148
+ }
149
+ export interface CredentialsAndIdentityId {
149
150
  credentials: AWSCredentials;
150
151
  identityId?: string;
151
- };
152
- export type AWSCredentials = {
152
+ }
153
+ export interface AWSCredentials {
153
154
  accessKeyId: string;
154
155
  secretAccessKey: string;
155
156
  sessionToken?: string;
156
157
  expiration?: Date;
157
- };
158
+ }
158
159
  export {};
@@ -1,4 +1,4 @@
1
- import { AuthConfig, JWT, CognitoUserPoolConfig, CognitoUserPoolAndIdentityPoolConfig, CognitoIdentityPoolConfig, StrictUnion, OAuthConfig } from '../types';
1
+ import { AuthConfig, CognitoIdentityPoolConfig, CognitoUserPoolAndIdentityPoolConfig, CognitoUserPoolConfig, JWT, OAuthConfig, StrictUnion } from '../types';
2
2
  export declare function assertTokenProviderConfig(cognitoConfig?: StrictUnion<CognitoUserPoolConfig | CognitoUserPoolAndIdentityPoolConfig | CognitoIdentityPoolConfig>): asserts cognitoConfig is CognitoUserPoolAndIdentityPoolConfig | CognitoUserPoolConfig;
3
3
  export declare function assertOAuthConfig(cognitoConfig?: AuthConfig['Cognito']): asserts cognitoConfig is AuthConfig['Cognito'] & {
4
4
  loginWith: {
@@ -1,7 +1,7 @@
1
- import { assert, AuthConfigurationErrorCode } from './errorHelpers.mjs';
2
1
  import { base64Decoder } from '../../../utils/convert/base64/base64Decoder.mjs';
3
2
  import '../../../types/errors.mjs';
4
3
  import '../../../errors/errorHelpers.mjs';
4
+ import { assert, AuthConfigurationErrorCode } from './errorHelpers.mjs';
5
5
 
6
6
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  // SPDX-License-Identifier: Apache-2.0
@@ -14,18 +14,18 @@ function assertTokenProviderConfig(cognitoConfig) {
14
14
  assertionValid =
15
15
  !!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;
16
16
  }
17
- return assert(assertionValid, AuthConfigurationErrorCode.AuthUserPoolException);
17
+ assert(assertionValid, AuthConfigurationErrorCode.AuthUserPoolException);
18
18
  }
19
19
  function assertOAuthConfig(cognitoConfig) {
20
20
  const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&
21
21
  !!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&
22
22
  !!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&
23
23
  !!cognitoConfig?.loginWith?.oauth?.responseType;
24
- return assert(validOAuthConfig, AuthConfigurationErrorCode.OAuthNotConfigureException);
24
+ assert(validOAuthConfig, AuthConfigurationErrorCode.OAuthNotConfigureException);
25
25
  }
26
26
  function assertIdentityPoolIdConfig(cognitoConfig) {
27
27
  const validConfig = !!cognitoConfig?.identityPoolId;
28
- return assert(validConfig, AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
28
+ assert(validConfig, AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
29
29
  }
30
30
  function decodeJWT(token) {
31
31
  const tokenParts = token.split('.');
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../src/singleton/Auth/utils/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AuthConfigurationErrorCode, assert } from './errorHelpers';\nimport { base64Decoder } from '../../../utils/convert';\nexport function assertTokenProviderConfig(cognitoConfig) {\n let assertionValid = true; // assume valid until otherwise proveed\n if (!cognitoConfig) {\n assertionValid = false;\n }\n else {\n assertionValid =\n !!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;\n }\n return assert(assertionValid, AuthConfigurationErrorCode.AuthUserPoolException);\n}\nexport function assertOAuthConfig(cognitoConfig) {\n const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&\n !!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&\n !!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&\n !!cognitoConfig?.loginWith?.oauth?.responseType;\n return assert(validOAuthConfig, AuthConfigurationErrorCode.OAuthNotConfigureException);\n}\nexport function assertIdentityPoolIdConfig(cognitoConfig) {\n const validConfig = !!cognitoConfig?.identityPoolId;\n return assert(validConfig, AuthConfigurationErrorCode.InvalidIdentityPoolIdException);\n}\nfunction assertUserPoolAndIdentityPoolConfig(authConfig) {\n const validConfig = !!authConfig?.Cognito.identityPoolId && !!authConfig?.Cognito.userPoolId;\n return assert(validConfig, AuthConfigurationErrorCode.AuthUserPoolAndIdentityPoolException);\n}\nexport function decodeJWT(token) {\n const tokenParts = token.split('.');\n if (tokenParts.length !== 3) {\n throw new Error('Invalid token');\n }\n try {\n const base64WithUrlSafe = tokenParts[1];\n const base64 = base64WithUrlSafe.replace(/-/g, '+').replace(/_/g, '/');\n const jsonStr = decodeURIComponent(base64Decoder\n .convert(base64)\n .split('')\n .map(char => `%${`00${char.charCodeAt(0).toString(16)}`.slice(-2)}`)\n .join(''));\n const payload = JSON.parse(jsonStr);\n return {\n toString: () => token,\n payload,\n };\n }\n catch (err) {\n throw new Error('Invalid token payload');\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAGO,SAAS,yBAAyB,CAAC,aAAa,EAAE;AACzD,IAAI,IAAI,cAAc,GAAG,IAAI,CAAC;AAC9B,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,QAAQ,cAAc,GAAG,KAAK,CAAC;AAC/B,KAAK;AACL,SAAS;AACT,QAAQ,cAAc;AACtB,YAAY,CAAC,CAAC,aAAa,CAAC,UAAU,IAAI,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAAC;AAC3E,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,cAAc,EAAE,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;AACpF,CAAC;AACM,SAAS,iBAAiB,CAAC,aAAa,EAAE;AACjD,IAAI,MAAM,gBAAgB,GAAG,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM;AACtE,QAAQ,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe;AAC1D,QAAQ,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc;AACzD,QAAQ,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC;AACxD,IAAI,OAAO,MAAM,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,0BAA0B,CAAC,C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EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;AACjD,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../src/singleton/Auth/utils/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { base64Decoder } from '../../../utils/convert';\nimport { AuthConfigurationErrorCode, assert } from './errorHelpers';\nexport function assertTokenProviderConfig(cognitoConfig) {\n let assertionValid = true; // assume valid until otherwise proveed\n if (!cognitoConfig) {\n assertionValid = false;\n }\n else {\n assertionValid =\n !!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;\n }\n assert(assertionValid, AuthConfigurationErrorCode.AuthUserPoolException);\n}\nexport function assertOAuthConfig(cognitoConfig) {\n const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&\n !!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&\n !!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&\n !!cognitoConfig?.loginWith?.oauth?.responseType;\n assert(validOAuthConfig, AuthConfigurationErrorCode.OAuthNotConfigureException);\n}\nexport function assertIdentityPoolIdConfig(cognitoConfig) {\n const validConfig = !!cognitoConfig?.identityPoolId;\n assert(validConfig, AuthConfigurationErrorCode.InvalidIdentityPoolIdException);\n}\nexport function decodeJWT(token) {\n const tokenParts = token.split('.');\n if (tokenParts.length !== 3) {\n throw new Error('Invalid token');\n }\n try {\n const base64WithUrlSafe = tokenParts[1];\n const base64 = base64WithUrlSafe.replace(/-/g, '+').replace(/_/g, '/');\n const jsonStr = decodeURIComponent(base64Decoder\n .convert(base64)\n .split('')\n .map(char => `%${`00${char.charCodeAt(0).toString(16)}`.slice(-2)}`)\n .join(''));\n const payload = JSON.parse(jsonStr);\n return {\n toString: () => token,\n payload,\n };\n }\n catch (err) {\n throw new Error('Invalid token payload');\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAGO,S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AQ,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAChD,QAAQ,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC/E,QAAQ,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa;AACxD,aAAa,OAAO,CAAC,MAAM,CAAC;AAC5B,aAAa,KAAK,CAAC,EAAE,CAAC;AACtB,aAAa,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,aAAa,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,QAAQ,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5C,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,MAAM,KAAK;AACjC,YAAY,OAAO;AACnB,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,GAAG,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;AACjD,KAAK;AACL;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { AtLeastOne } from '../types';
2
- export type LocationServiceConfig = {
2
+ export interface LocationServiceConfig {
3
3
  LocationService: {
4
4
  region: string;
5
5
  maps?: {
6
- items: {};
6
+ items: Record<string, unknown>;
7
7
  default: string;
8
8
  };
9
9
  searchIndices?: {
@@ -15,5 +15,5 @@ export type LocationServiceConfig = {
15
15
  default: string;
16
16
  };
17
17
  };
18
- };
18
+ }
19
19
  export type GeoConfig = AtLeastOne<LocationServiceConfig>;
@@ -9,11 +9,11 @@ interface LexV2BotConfig {
9
9
  localeId: string;
10
10
  region: string;
11
11
  }
12
- type InteractionsLexV1Config = {
12
+ interface InteractionsLexV1Config {
13
13
  LexV1: Record<string, LexV1BotConfig>;
14
- };
15
- type InteractionsLexV2Config = {
14
+ }
15
+ interface InteractionsLexV2Config {
16
16
  LexV2: Record<string, LexV2BotConfig>;
17
- };
17
+ }
18
18
  export type InteractionsConfig = AtLeastOne<InteractionsLexV1Config & InteractionsLexV2Config>;
19
19
  export {};
@@ -1,10 +1,10 @@
1
+ import { AtLeastOne } from '../types';
1
2
  import { InAppMessagingConfig } from './InAppMessaging/types';
2
3
  import { PushNotificationConfig } from './PushNotification/types';
3
- import { AtLeastOne } from '../types';
4
- export type InAppMessagingProviderConfig = {
4
+ export interface InAppMessagingProviderConfig {
5
5
  InAppMessaging: InAppMessagingConfig;
6
- };
7
- export type PushNotificationProviderConfig = {
6
+ }
7
+ export interface PushNotificationProviderConfig {
8
8
  PushNotification: PushNotificationConfig;
9
- };
9
+ }
10
10
  export type NotificationsConfig = AtLeastOne<InAppMessagingProviderConfig & PushNotificationProviderConfig>;