@aws-amplify/core 6.12.4-unstable.e5a8569.0 → 6.13.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 (240) hide show
  1. package/dist/cjs/BackgroundProcessManager/BackgroundManagerNotOpenError.js.map +1 -1
  2. package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js.map +1 -1
  3. package/dist/cjs/BackgroundProcessManager/index.js.map +1 -1
  4. package/dist/cjs/Cache/StorageCache.js.map +1 -1
  5. package/dist/cjs/Cache/StorageCache.native.js.map +1 -1
  6. package/dist/cjs/Cache/StorageCacheCommon.js.map +1 -1
  7. package/dist/cjs/Cache/utils/CacheList.js.map +1 -1
  8. package/dist/cjs/Cache/utils/cacheHelpers.js.map +1 -1
  9. package/dist/cjs/Cache/utils/index.js.map +1 -1
  10. package/dist/cjs/Hub/index.js.map +1 -1
  11. package/dist/cjs/I18n/I18n.js.map +1 -1
  12. package/dist/cjs/I18n/index.js.map +1 -1
  13. package/dist/cjs/I18n/types.js.map +1 -1
  14. package/dist/cjs/Logger/ConsoleLogger.js.map +1 -1
  15. package/dist/cjs/Logger/index.js.map +1 -1
  16. package/dist/cjs/Mutex/Mutex.js.map +1 -1
  17. package/dist/cjs/Mutex/index.js.map +1 -1
  18. package/dist/cjs/Platform/customUserAgent.js.map +1 -1
  19. package/dist/cjs/Platform/detectFramework.js.map +1 -1
  20. package/dist/cjs/Platform/detection/React.js.map +1 -1
  21. package/dist/cjs/Platform/index.js.map +1 -1
  22. package/dist/cjs/Platform/version.js +1 -1
  23. package/dist/cjs/Platform/version.js.map +1 -1
  24. package/dist/cjs/Reachability/Reachability.js.map +1 -1
  25. package/dist/cjs/Reachability/Reachability.native.js.map +1 -1
  26. package/dist/cjs/Reachability/index.js.map +1 -1
  27. package/dist/cjs/ServiceWorker/ServiceWorker.js.map +1 -1
  28. package/dist/cjs/ServiceWorker/index.js.map +1 -1
  29. package/dist/cjs/Signer/DateUtils.js.map +1 -1
  30. package/dist/cjs/Signer/Signer.js.map +1 -1
  31. package/dist/cjs/Signer/index.js.map +1 -1
  32. package/dist/cjs/adapterCore/error/AmplifyServerContextError.js.map +1 -1
  33. package/dist/cjs/adapterCore/error/index.js.map +1 -1
  34. package/dist/cjs/adapterCore/index.js.map +1 -1
  35. package/dist/cjs/adapterCore/serverContext/index.js.map +1 -1
  36. package/dist/cjs/adapterCore/serverContext/serverContext.js.map +1 -1
  37. package/dist/cjs/adapterCore/serverContext/serverContextRegistry.js.map +1 -1
  38. package/dist/cjs/awsClients/pinpoint/base.js.map +1 -1
  39. package/dist/cjs/awsClients/pinpoint/getInAppMessages.js.map +1 -1
  40. package/dist/cjs/awsClients/pinpoint/index.js.map +1 -1
  41. package/dist/cjs/awsClients/pinpoint/putEvents.js.map +1 -1
  42. package/dist/cjs/awsClients/pinpoint/updateEndpoint.js.map +1 -1
  43. package/dist/cjs/clients/endpoints/getDnsSuffix.js.map +1 -1
  44. package/dist/cjs/clients/endpoints/index.js.map +1 -1
  45. package/dist/cjs/clients/handlers/fetch.js +1 -1
  46. package/dist/cjs/clients/handlers/fetch.js.map +1 -1
  47. package/dist/cjs/clients/index.js.map +1 -1
  48. package/dist/cjs/clients/internal/composeServiceApi.js.map +1 -1
  49. package/dist/cjs/clients/internal/composeTransferHandler.js.map +1 -1
  50. package/dist/cjs/clients/internal/index.js.map +1 -1
  51. package/dist/cjs/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.js.map +1 -1
  52. package/dist/cjs/clients/middleware/retry/amzSdkRequestHeaderMiddleware.js.map +1 -1
  53. package/dist/cjs/clients/middleware/retry/index.js.map +1 -1
  54. package/dist/cjs/clients/middleware/retry/retryMiddleware.js.map +1 -1
  55. package/dist/cjs/clients/middleware/signing/index.js.map +1 -1
  56. package/dist/cjs/clients/middleware/signing/middleware.js.map +1 -1
  57. package/dist/cjs/clients/middleware/signing/signer/signatureV4/index.js.map +1 -1
  58. package/dist/cjs/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +1 -1
  59. package/dist/cjs/clients/middleware/signing/signer/signatureV4/signRequest.js.map +1 -1
  60. package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +1 -1
  61. package/dist/cjs/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +1 -1
  62. package/dist/cjs/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js.map +1 -1
  63. package/dist/cjs/clients/middleware/userAgent/index.js.map +1 -1
  64. package/dist/cjs/clients/middleware/userAgent/middleware.js.map +1 -1
  65. package/dist/cjs/clients/serde/index.js.map +1 -1
  66. package/dist/cjs/clients/serde/json.js.map +1 -1
  67. package/dist/cjs/clients/utils/memoization.js.map +1 -1
  68. package/dist/cjs/errors/APIError.js.map +1 -1
  69. package/dist/cjs/errors/AmplifyError.js.map +1 -1
  70. package/dist/cjs/errors/PlatformNotSupportedError.js.map +1 -1
  71. package/dist/cjs/errors/createAssertionFunction.js.map +1 -1
  72. package/dist/cjs/errors/index.js.map +1 -1
  73. package/dist/cjs/foundation/factories/middleware/index.js.map +1 -1
  74. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.js.map +1 -1
  75. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.js.map +1 -1
  76. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/index.js.map +1 -1
  77. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/index.js.map +1 -1
  78. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/index.js.map +1 -1
  79. package/dist/cjs/index.js.map +1 -1
  80. package/dist/cjs/libraryUtils.js.map +1 -1
  81. package/dist/cjs/parseAWSExports.js.map +1 -1
  82. package/dist/cjs/parseAmplifyOutputs.js.map +1 -1
  83. package/dist/cjs/providers/pinpoint/apis/index.js.map +1 -1
  84. package/dist/cjs/providers/pinpoint/apis/record.js.map +1 -1
  85. package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js.map +1 -1
  86. package/dist/cjs/providers/pinpoint/index.js.map +1 -1
  87. package/dist/cjs/providers/pinpoint/types/index.js.map +1 -1
  88. package/dist/cjs/providers/pinpoint/utils/PinpointEventBuffer.js.map +1 -1
  89. package/dist/cjs/providers/pinpoint/utils/createEndpointId.js.map +1 -1
  90. package/dist/cjs/providers/pinpoint/utils/getEventBuffer.js.map +1 -1
  91. package/dist/cjs/providers/pinpoint/utils/index.js.map +1 -1
  92. package/dist/cjs/providers/pinpoint/utils/resolveEndpointId.js.map +1 -1
  93. package/dist/cjs/server.js.map +1 -1
  94. package/dist/cjs/singleton/Amplify.js.map +1 -1
  95. package/dist/cjs/singleton/Auth/index.js +2 -2
  96. package/dist/cjs/singleton/Auth/index.js.map +1 -1
  97. package/dist/cjs/singleton/Auth/utils/index.js.map +1 -1
  98. package/dist/cjs/singleton/apis/fetchAuthSession.js +2 -2
  99. package/dist/cjs/singleton/apis/fetchAuthSession.js.map +1 -1
  100. package/dist/cjs/singleton/index.js.map +1 -1
  101. package/dist/cjs/storage/CookieStorage.js.map +1 -1
  102. package/dist/cjs/storage/DefaultStorage.js.map +1 -1
  103. package/dist/cjs/storage/DefaultStorage.native.js.map +1 -1
  104. package/dist/cjs/storage/InMemoryStorage.js.map +1 -1
  105. package/dist/cjs/storage/KeyValueStorage.js.map +1 -1
  106. package/dist/cjs/storage/SessionStorage.js.map +1 -1
  107. package/dist/cjs/storage/SyncKeyValueStorage.js.map +1 -1
  108. package/dist/cjs/storage/SyncSessionStorage.js.map +1 -1
  109. package/dist/cjs/storage/index.js.map +1 -1
  110. package/dist/cjs/storage/utils.js.map +1 -1
  111. package/dist/cjs/utils/WordArray.js.map +1 -1
  112. package/dist/cjs/utils/convert/base64/base64Decoder.js.map +1 -1
  113. package/dist/cjs/utils/convert/base64/base64Encoder.js.map +1 -1
  114. package/dist/cjs/utils/convert/index.js.map +1 -1
  115. package/dist/cjs/utils/deDupeAsyncFunction.js.map +1 -1
  116. package/dist/cjs/utils/deepFreeze.js.map +1 -1
  117. package/dist/cjs/utils/deviceName/index.js.map +1 -1
  118. package/dist/cjs/utils/generateRandomString.js.map +1 -1
  119. package/dist/cjs/utils/getClientInfo/getClientInfo.ios.js.map +1 -1
  120. package/dist/cjs/utils/getClientInfo/getClientInfo.js.map +1 -1
  121. package/dist/cjs/utils/getClientInfo/index.js.map +1 -1
  122. package/dist/cjs/utils/globalHelpers/index.js.map +1 -1
  123. package/dist/cjs/utils/globalHelpers/index.native.js.map +1 -1
  124. package/dist/cjs/utils/index.js.map +1 -1
  125. package/dist/cjs/utils/isWebWorker.js.map +1 -1
  126. package/dist/cjs/utils/parseAmplifyConfig.js.map +1 -1
  127. package/dist/cjs/utils/queuedStorage/createQueuedStorage.js.map +1 -1
  128. package/dist/cjs/utils/queuedStorage/createQueuedStorage.native.js.map +1 -1
  129. package/dist/cjs/utils/queuedStorage/index.js.map +1 -1
  130. package/dist/cjs/utils/retry/NonRetryableError.js.map +1 -1
  131. package/dist/cjs/utils/retry/index.js.map +1 -1
  132. package/dist/cjs/utils/retry/jitteredBackoff.js.map +1 -1
  133. package/dist/cjs/utils/retry/retry.js.map +1 -1
  134. package/dist/cjs/utils/sessionListener/SessionListener.js.map +1 -1
  135. package/dist/cjs/utils/sessionListener/SessionListener.native.js.map +1 -1
  136. package/dist/cjs/utils/sessionListener/index.js.map +1 -1
  137. package/dist/esm/BackgroundProcessManager/BackgroundManagerNotOpenError.mjs.map +1 -1
  138. package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs.map +1 -1
  139. package/dist/esm/Cache/StorageCache.mjs.map +1 -1
  140. package/dist/esm/Cache/StorageCache.native.mjs.map +1 -1
  141. package/dist/esm/Cache/StorageCacheCommon.mjs.map +1 -1
  142. package/dist/esm/Cache/utils/CacheList.mjs.map +1 -1
  143. package/dist/esm/Cache/utils/cacheHelpers.mjs.map +1 -1
  144. package/dist/esm/Hub/index.mjs.map +1 -1
  145. package/dist/esm/I18n/I18n.mjs.map +1 -1
  146. package/dist/esm/I18n/index.mjs.map +1 -1
  147. package/dist/esm/I18n/types.mjs.map +1 -1
  148. package/dist/esm/Logger/ConsoleLogger.mjs.map +1 -1
  149. package/dist/esm/Mutex/Mutex.mjs.map +1 -1
  150. package/dist/esm/Platform/customUserAgent.mjs.map +1 -1
  151. package/dist/esm/Platform/detectFramework.mjs.map +1 -1
  152. package/dist/esm/Platform/detection/React.mjs.map +1 -1
  153. package/dist/esm/Platform/index.mjs.map +1 -1
  154. package/dist/esm/Platform/version.d.ts +1 -1
  155. package/dist/esm/Platform/version.mjs +1 -1
  156. package/dist/esm/Platform/version.mjs.map +1 -1
  157. package/dist/esm/Reachability/Reachability.mjs.map +1 -1
  158. package/dist/esm/Reachability/Reachability.native.mjs.map +1 -1
  159. package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
  160. package/dist/esm/Signer/DateUtils.mjs.map +1 -1
  161. package/dist/esm/Signer/Signer.mjs.map +1 -1
  162. package/dist/esm/adapterCore/error/AmplifyServerContextError.mjs.map +1 -1
  163. package/dist/esm/adapterCore/serverContext/serverContext.mjs.map +1 -1
  164. package/dist/esm/adapterCore/serverContext/serverContextRegistry.mjs.map +1 -1
  165. package/dist/esm/awsClients/pinpoint/base.mjs.map +1 -1
  166. package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs.map +1 -1
  167. package/dist/esm/awsClients/pinpoint/putEvents.mjs.map +1 -1
  168. package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs.map +1 -1
  169. package/dist/esm/clients/endpoints/getDnsSuffix.mjs.map +1 -1
  170. package/dist/esm/clients/handlers/fetch.mjs +1 -1
  171. package/dist/esm/clients/handlers/fetch.mjs.map +1 -1
  172. package/dist/esm/clients/internal/composeServiceApi.mjs.map +1 -1
  173. package/dist/esm/clients/internal/composeTransferHandler.mjs.map +1 -1
  174. package/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs.map +1 -1
  175. package/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs.map +1 -1
  176. package/dist/esm/clients/middleware/retry/retryMiddleware.mjs.map +1 -1
  177. package/dist/esm/clients/middleware/signing/middleware.mjs.map +1 -1
  178. package/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs.map +1 -1
  179. package/dist/esm/clients/middleware/signing/signer/signatureV4/signRequest.mjs.map +1 -1
  180. package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.mjs.map +1 -1
  181. package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.mjs.map +1 -1
  182. package/dist/esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.mjs.map +1 -1
  183. package/dist/esm/clients/middleware/userAgent/middleware.mjs.map +1 -1
  184. package/dist/esm/clients/serde/json.mjs.map +1 -1
  185. package/dist/esm/clients/utils/memoization.mjs.map +1 -1
  186. package/dist/esm/errors/APIError.mjs.map +1 -1
  187. package/dist/esm/errors/AmplifyError.mjs.map +1 -1
  188. package/dist/esm/errors/PlatformNotSupportedError.mjs.map +1 -1
  189. package/dist/esm/errors/createAssertionFunction.mjs.map +1 -1
  190. package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs.map +1 -1
  191. package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs.map +1 -1
  192. package/dist/esm/parseAWSExports.mjs.map +1 -1
  193. package/dist/esm/parseAmplifyOutputs.mjs.map +1 -1
  194. package/dist/esm/providers/pinpoint/apis/record.mjs.map +1 -1
  195. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs.map +1 -1
  196. package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs.map +1 -1
  197. package/dist/esm/providers/pinpoint/utils/createEndpointId.mjs.map +1 -1
  198. package/dist/esm/providers/pinpoint/utils/getEventBuffer.mjs.map +1 -1
  199. package/dist/esm/providers/pinpoint/utils/resolveEndpointId.mjs.map +1 -1
  200. package/dist/esm/singleton/Amplify.mjs.map +1 -1
  201. package/dist/esm/singleton/Auth/index.d.ts +2 -2
  202. package/dist/esm/singleton/Auth/index.mjs +2 -2
  203. package/dist/esm/singleton/Auth/index.mjs.map +1 -1
  204. package/dist/esm/singleton/Auth/utils/index.mjs.map +1 -1
  205. package/dist/esm/singleton/apis/fetchAuthSession.d.ts +2 -2
  206. package/dist/esm/singleton/apis/fetchAuthSession.mjs +2 -2
  207. package/dist/esm/singleton/apis/fetchAuthSession.mjs.map +1 -1
  208. package/dist/esm/storage/CookieStorage.mjs.map +1 -1
  209. package/dist/esm/storage/DefaultStorage.mjs.map +1 -1
  210. package/dist/esm/storage/DefaultStorage.native.mjs.map +1 -1
  211. package/dist/esm/storage/InMemoryStorage.mjs.map +1 -1
  212. package/dist/esm/storage/KeyValueStorage.mjs.map +1 -1
  213. package/dist/esm/storage/SessionStorage.mjs.map +1 -1
  214. package/dist/esm/storage/SyncKeyValueStorage.mjs.map +1 -1
  215. package/dist/esm/storage/SyncSessionStorage.mjs.map +1 -1
  216. package/dist/esm/storage/utils.mjs.map +1 -1
  217. package/dist/esm/utils/WordArray.mjs.map +1 -1
  218. package/dist/esm/utils/convert/base64/base64Decoder.mjs.map +1 -1
  219. package/dist/esm/utils/convert/base64/base64Encoder.mjs.map +1 -1
  220. package/dist/esm/utils/deDupeAsyncFunction.mjs.map +1 -1
  221. package/dist/esm/utils/deepFreeze.mjs.map +1 -1
  222. package/dist/esm/utils/generateRandomString.mjs.map +1 -1
  223. package/dist/esm/utils/getClientInfo/getClientInfo.ios.mjs.map +1 -1
  224. package/dist/esm/utils/getClientInfo/getClientInfo.mjs.map +1 -1
  225. package/dist/esm/utils/globalHelpers/index.mjs.map +1 -1
  226. package/dist/esm/utils/globalHelpers/index.native.mjs.map +1 -1
  227. package/dist/esm/utils/isWebWorker.mjs.map +1 -1
  228. package/dist/esm/utils/parseAmplifyConfig.mjs.map +1 -1
  229. package/dist/esm/utils/queuedStorage/createQueuedStorage.mjs.map +1 -1
  230. package/dist/esm/utils/queuedStorage/createQueuedStorage.native.mjs.map +1 -1
  231. package/dist/esm/utils/retry/NonRetryableError.mjs.map +1 -1
  232. package/dist/esm/utils/retry/jitteredBackoff.mjs.map +1 -1
  233. package/dist/esm/utils/retry/retry.mjs.map +1 -1
  234. package/dist/esm/utils/sessionListener/SessionListener.mjs.map +1 -1
  235. package/dist/esm/utils/sessionListener/SessionListener.native.mjs.map +1 -1
  236. package/package.json +3 -3
  237. package/src/Platform/version.ts +1 -1
  238. package/src/clients/handlers/fetch.ts +1 -1
  239. package/src/singleton/Auth/index.ts +2 -2
  240. package/src/singleton/apis/fetchAuthSession.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/singleton/Auth/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthClass = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Logger_1 = require(\"../../Logger\");\nconst logger = new Logger_1.ConsoleLogger('Auth');\nclass 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 if (authResourcesConfig && authResourcesConfig.Cognito?.userPoolEndpoint) {\n logger.warn(getCustomEndpointWarningMessage('Amazon Cognito User Pool'));\n }\n if (authResourcesConfig &&\n authResourcesConfig.Cognito?.identityPoolEndpoint) {\n logger.warn(getCustomEndpointWarningMessage('Amazon Cognito Identity Pool'));\n }\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}\nexports.AuthClass = AuthClass;\nconst getCustomEndpointWarningMessage = (target) => `You are using a custom Amazon ${target} endpoint, ensure the endpoint is correct.`;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B;AACA;AACA,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;AACjD,MAAM,SAAS,CAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB,EAAE,WAAW,EAAE;AAChD,QAAQ,IAAI,CAAC,UAAU,GAAG,mBAAmB;AAC7C,QAAQ,IAAI,CAAC,W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,WAAW,EAAE,wBAAwB,EAAE,WAAW;AAC9D,YAAY,UAAU,EAAE,wBAAwB,EAAE,UAAU;AAC5D,YAAY,OAAO;AACnB,SAAS;AACT;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,6BAA6B,EAAE;AACpF;AACA,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,SAAS;AACxF;AACA;AACA,OAAO,CAAC,SAAS,GAAG,SAAS;AAC7B,MAAM,+BAA+B,GAAG,CAAC,MAAM,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,0CAA0C,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/singleton/Auth/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthClass = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Logger_1 = require(\"../../Logger\");\nconst logger = new Logger_1.ConsoleLogger('Auth');\nclass 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 if (authResourcesConfig && authResourcesConfig.Cognito?.userPoolEndpoint) {\n logger.warn(getCustomEndpointWarningMessage('Amazon Cognito User Pool'));\n }\n if (authResourcesConfig &&\n authResourcesConfig.Cognito?.identityPoolEndpoint) {\n logger.warn(getCustomEndpointWarningMessage('Amazon Cognito Identity Pool'));\n }\n }\n /**\n * Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it\n * will automatically refresh expired auth tokens if a valid refresh token is present. You can force a refresh\n * of non-expired tokens 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}\nexports.AuthClass = AuthClass;\nconst getCustomEndpointWarningMessage = (target) => `You are using a custom Amazon ${target} endpoint, ensure the endpoint is correct.`;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B;AACA;AACA,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;AACjD,MAAM,SAAS,CAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB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AAK;AACxC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC;AAClB,QAAQ;AACR,QAAQ,OAAO;AACf,YAAY,MAAM;AAClB,YAAY,WAAW,EAAE,wBAAwB,EAAE,WAAW;AAC9D,YAAY,UAAU,EAAE,wBAAwB,EAAE,UAAU;AAC5D,YAAY,OAAO;AACnB,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,6BAA6B,EAAE;AACpF,IAAI;AACJ,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,SAAS;AACxF,IAAI;AACJ;AACA,OAAO,CAAC,SAAS,GAAG,SAAS;AAC7B,MAAM,+BAA+B,GAAG,CAAC,MAAM,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,0CAA0C,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/singleton/Auth/utils/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertTokenProviderConfig = assertTokenProviderConfig;\nexports.assertOAuthConfig = assertOAuthConfig;\nexports.assertIdentityPoolIdConfig = assertIdentityPoolIdConfig;\nexports.decodeJWT = decodeJWT;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst convert_1 = require(\"../../../utils/convert\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nfunction 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 (0, errorHelpers_1.assert)(assertionValid, errorHelpers_1.AuthConfigurationErrorCode.AuthUserPoolException);\n}\nfunction 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 (0, errorHelpers_1.assert)(validOAuthConfig, errorHelpers_1.AuthConfigurationErrorCode.OAuthNotConfigureException);\n}\nfunction assertIdentityPoolIdConfig(cognitoConfig) {\n const validConfig = !!cognitoConfig?.identityPoolId;\n (0, errorHelpers_1.assert)(validConfig, errorHelpers_1.AuthConfigurationErrorCode.InvalidIdentityPoolIdException);\n}\n/**\n * Decodes payload of JWT token\n *\n * @param {String} token A string representing a token to be decoded\n * @throws {@link Error} - Throws error when token is invalid or payload malformed.\n */\nfunction 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(convert_1.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":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,yBAAyB;AAC7D,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;AAC7C,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D,OAAO,CAAC,SAAS,GAAG,SAAS;AAC7B;AACA;AACA,MAAM,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACnD,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E;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC;AACxC;AACA,IAAI,IAAI;AACR,QAAQ,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC;AAC/C,QAAQ,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC9E,QAAQ,MAAM,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC;AACrD,aAAa,OAAO,CAAC,MAAM;AAC3B,aAAa,KAAK,CAAC,EAAE;AACrB,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;AAC/E,aAAa,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,QAAQ,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAC3C,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,MAAM,KAAK;AACjC,YAAY,OAAO;AACnB,SAAS;AACT;AACA,IAAI,OAAO,GAAG,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;AAChD;AACA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/singleton/Auth/utils/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertTokenProviderConfig = assertTokenProviderConfig;\nexports.assertOAuthConfig = assertOAuthConfig;\nexports.assertIdentityPoolIdConfig = assertIdentityPoolIdConfig;\nexports.decodeJWT = decodeJWT;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst convert_1 = require(\"../../../utils/convert\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nfunction 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 (0, errorHelpers_1.assert)(assertionValid, errorHelpers_1.AuthConfigurationErrorCode.AuthUserPoolException);\n}\nfunction 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 (0, errorHelpers_1.assert)(validOAuthConfig, errorHelpers_1.AuthConfigurationErrorCode.OAuthNotConfigureException);\n}\nfunction assertIdentityPoolIdConfig(cognitoConfig) {\n const validConfig = !!cognitoConfig?.identityPoolId;\n (0, errorHelpers_1.assert)(validConfig, errorHelpers_1.AuthConfigurationErrorCode.InvalidIdentityPoolIdException);\n}\n/**\n * Decodes payload of JWT token\n *\n * @param {String} token A string representing a token to be decoded\n * @throws {@link Error} - Throws error when token is invalid or payload malformed.\n */\nfunction 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(convert_1.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":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yBAAyB,GAAG,yB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CAAC,8BAA8B,CAAC;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACvC,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC;AACxC,IAAI;AACJ,IAAI,IAAI;AACR,QAAQ,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC;AAC/C,QAAQ,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC9E,QAAQ,MAAM,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC;AACrD,aAAa,OAAO,CAAC,MAAM;AAC3B,aAAa,KAAK,CAAC,EAAE;AACrB,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;AAC/E,aAAa,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,QAAQ,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAC3C,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,MAAM,KAAK;AACjC,YAAY,OAAO;AACnB,SAAS;AACT,IAAI;AACJ,IAAI,OAAO,GAAG,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;AAChD,IAAI;AACJ;;"}
@@ -8,8 +8,8 @@ const Amplify_1 = require("../Amplify");
8
8
  const fetchAuthSession_1 = require("./internal/fetchAuthSession");
9
9
  /**
10
10
  * Fetch the auth session including the tokens and credentials if they are available. By default it
11
- * does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh
12
- * with `{ forceRefresh: true }` input.
11
+ * will automatically refresh expired auth tokens if a valid refresh token is present. You can force a refresh
12
+ * of non-expired tokens with `{ forceRefresh: true }` input.
13
13
  *
14
14
  * @param options - Options configuring the fetch behavior.
15
15
  * @throws {@link AuthError} - Throws error when session information cannot be refreshed.
@@ -1 +1 @@
1
- {"version":3,"file":"fetchAuthSession.js","sources":["../../../../src/singleton/apis/fetchAuthSession.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAuthSession = void 0;\nconst Amplify_1 = require(\"../Amplify\");\nconst fetchAuthSession_1 = require(\"./internal/fetchAuthSession\");\n/**\n * Fetch the auth session including the tokens and credentials if they are available. 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 * @throws {@link AuthError} - Throws error when session information cannot be refreshed.\n * @returns Promise<AuthSession>\n */\nconst fetchAuthSession = (options) => {\n return (0, fetchAuthSession_1.fetchAuthSession)(Amplify_1.Amplify, options);\n};\nexports.fetchAuthSession = fetchAuthSession;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;AACvC,MAAM,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAK;AACtC,IAAI,OAAO,IAAI,kBAAkB,CAAC,gBAAgB,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;AAC/E,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
1
+ {"version":3,"file":"fetchAuthSession.js","sources":["../../../../src/singleton/apis/fetchAuthSession.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAuthSession = void 0;\nconst Amplify_1 = require(\"../Amplify\");\nconst fetchAuthSession_1 = require(\"./internal/fetchAuthSession\");\n/**\n * Fetch the auth session including the tokens and credentials if they are available. By default it\n * will automatically refresh expired auth tokens if a valid refresh token is present. You can force a refresh\n * of non-expired tokens with `{ forceRefresh: true }` input.\n *\n * @param options - Options configuring the fetch behavior.\n * @throws {@link AuthError} - Throws error when session information cannot be refreshed.\n * @returns Promise<AuthSession>\n */\nconst fetchAuthSession = (options) => {\n return (0, fetchAuthSession_1.fetchAuthSession)(Amplify_1.Amplify, options);\n};\nexports.fetchAuthSession = fetchAuthSession;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;AACvC,MAAM,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAK;AACtC,IAAI,OAAO,IAAI,kBAAkB,CAAC,gBAAgB,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;AAC/E,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/singleton/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clearCredentials = exports.fetchAuthSession = exports.Amplify = exports.AmplifyClass = void 0;\nvar Amplify_1 = require(\"./Amplify\");\nObject.defineProperty(exports, \"AmplifyClass\", { enumerable: true, get: function () { return Amplify_1.AmplifyClass; } });\nObject.defineProperty(exports, \"Amplify\", { enumerable: true, get: function () { return Amplify_1.Amplify; } });\nvar fetchAuthSession_1 = require(\"./apis/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\nvar clearCredentials_1 = require(\"./apis/clearCredentials\");\nObject.defineProperty(exports, \"clearCredentials\", { enumerable: true, get: function () { return clearCredentials_1.clearCredentials; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM;AACrG,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;AACzH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;AAC/G,IAAI,kBAAkB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;AAC1I,IAAI,kBAAkB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/singleton/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clearCredentials = exports.fetchAuthSession = exports.Amplify = exports.AmplifyClass = void 0;\nvar Amplify_1 = require(\"./Amplify\");\nObject.defineProperty(exports, \"AmplifyClass\", { enumerable: true, get: function () { return Amplify_1.AmplifyClass; } });\nObject.defineProperty(exports, \"Amplify\", { enumerable: true, get: function () { return Amplify_1.Amplify; } });\nvar fetchAuthSession_1 = require(\"./apis/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\nvar clearCredentials_1 = require(\"./apis/clearCredentials\");\nObject.defineProperty(exports, \"clearCredentials\", { enumerable: true, get: function () { return clearCredentials_1.clearCredentials; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM;AACrG,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;AACzH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/G,IAAI,kBAAkB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1I,IAAI,kBAAkB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CookieStorage.js","sources":["../../../src/storage/CookieStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CookieStorage = void 0;\nconst tslib_1 = require(\"tslib\");\nconst js_cookie_1 = tslib_1.__importDefault(require(\"js-cookie\"));\nclass CookieStorage {\n constructor(data = {}) {\n const { path, domain, expires, sameSite, secure } = data;\n this.domain = domain;\n this.path = path || '/';\n this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')\n ? expires\n : 365;\n this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')\n ? secure\n : true;\n if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {\n if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {\n throw new Error('The sameSite value of cookieStorage must be \"lax\", \"strict\" or \"none\".');\n }\n if (sameSite === 'none' && !this.secure) {\n throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');\n }\n this.sameSite = sameSite;\n }\n }\n async setItem(key, value) {\n js_cookie_1.default.set(key, value, this.getData());\n }\n async getItem(key) {\n const item = js_cookie_1.default.get(key);\n return item ?? null;\n }\n async removeItem(key) {\n js_cookie_1.default.remove(key, this.getData());\n }\n async clear() {\n const cookie = js_cookie_1.default.get();\n const promises = Object.keys(cookie).map(key => this.removeItem(key));\n await Promise.all(promises);\n }\n getData() {\n return {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure,\n ...(this.sameSite && { sameSite: this.sameSite }),\n };\n }\n}\nexports.CookieStorage = CookieStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACjE,MAAM,aAAa,CAAC;AACpB,IAAI,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE;AAC3B,QAAQ,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;AAChE,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM;AAC5B,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,GAAG;AAC/B,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS;AAC3E,cAAc;AACd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CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC7E,QAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACnC;AACA,IAAI,OAAO,GAAG;AACd,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,IAAI,CAAC,IAAI;AAC3B,YAAY,OAAO,EAAE,IAAI,CAAC,OAAO;AACjC,YAAY,MAAM,EAAE,IAAI,CAAC,MAAM;AAC/B,YAAY,MAAM,EAAE,IAAI,CAAC,MAAM;AAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC7D,SAAS;AACT;AACA;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
1
+ {"version":3,"file":"CookieStorage.js","sources":["../../../src/storage/CookieStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CookieStorage = void 0;\nconst tslib_1 = require(\"tslib\");\nconst js_cookie_1 = tslib_1.__importDefault(require(\"js-cookie\"));\nclass CookieStorage {\n constructor(data = {}) {\n const { path, domain, expires, sameSite, secure } = data;\n this.domain = domain;\n this.path = path || '/';\n this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')\n ? expires\n : 365;\n this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')\n ? secure\n : true;\n if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {\n if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {\n throw new Error('The sameSite value of cookieStorage must be \"lax\", \"strict\" or \"none\".');\n }\n if (sameSite === 'none' && !this.secure) {\n throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');\n }\n this.sameSite = sameSite;\n }\n }\n async setItem(key, value) {\n js_cookie_1.default.set(key, value, this.getData());\n }\n async getItem(key) {\n const item = js_cookie_1.default.get(key);\n return item ?? null;\n }\n async removeItem(key) {\n js_cookie_1.default.remove(key, this.getData());\n }\n async clear() {\n const cookie = js_cookie_1.default.get();\n const promises = Object.keys(cookie).map(key => this.removeItem(key));\n await Promise.all(promises);\n }\n getData() {\n return {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure,\n ...(this.sameSite && { sameSite: this.sameSite }),\n };\n }\n}\nexports.CookieStorage = CookieStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACjE,MAAM,aAAa,CAAC;AACpB,IAAI,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE;AAC3B,QAAQ,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;AAChE,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM;AAC5B,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,GAAG;AAC/B,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS;AAC3E,cAAc;AACd,cAAc,GAAG;AACjB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ;AACzE,cAAc;AACd,cAAc,IAAI;AAClB,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE;A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,OAAO;AACf,YAAY,IAAI,EAAE,IAAI,CAAC,IAAI;AAC3B,YAAY,OAAO,EAAE,IAAI,CAAC,OAAO;AACjC,YAAY,MAAM,EAAE,IAAI,CAAC,MAAM;AAC/B,YAAY,MAAM,EAAE,IAAI,CAAC,MAAM;AAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC7D,SAAS;AACT,IAAI;AACJ;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultStorage.js","sources":["../../../src/storage/DefaultStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultStorage = void 0;\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass DefaultStorage extends KeyValueStorage_1.KeyValueStorage {\n constructor() {\n super((0, utils_1.getLocalStorageWithFallback)());\n }\n}\nexports.DefaultStorage = DefaultStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA,MAAM,cAAc,SAAS,iBAAiB,CAAC,eAAe,CAAC;AAC/D,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,2BAA2B,GAAG,CAAC;AACzD;AACA;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
1
+ {"version":3,"file":"DefaultStorage.js","sources":["../../../src/storage/DefaultStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultStorage = void 0;\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass DefaultStorage extends KeyValueStorage_1.KeyValueStorage {\n constructor() {\n super((0, utils_1.getLocalStorageWithFallback)());\n }\n}\nexports.DefaultStorage = DefaultStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA,MAAM,cAAc,SAAS,iBAAiB,CAAC,eAAe,CAAC;AAC/D,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,2BAA2B,GAAG,CAAC;AACzD,IAAI;AACJ;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultStorage.native.js","sources":["../../../src/storage/DefaultStorage.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultStorage = void 0;\nconst react_native_1 = require(\"@aws-amplify/react-native\");\nconst MEMORY_KEY_PREFIX = '@MemoryStorage:';\n/**\n * @internal\n */\nclass DefaultStorage {\n constructor() {\n this.asyncStorage = (0, react_native_1.loadAsyncStorage)();\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n return this.asyncStorage.setItem(`${MEMORY_KEY_PREFIX}${key}`, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return this.asyncStorage.getItem(`${MEMORY_KEY_PREFIX}${key}`);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n return this.asyncStorage.removeItem(`${MEMORY_KEY_PREFIX}${key}`);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n async clear() {\n const allKeys = await this.asyncStorage.getAllKeys();\n return this.asyncStorage.multiRemove(allKeys.filter(key => key.startsWith(MEMORY_KEY_PREFIX)));\n }\n}\nexports.DefaultStorage = DefaultStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,iBAAiB,GAAG,iBAAiB;AAC3C;AACA;AACA;AACA,MAAM,cAAc,CAAC;AACrB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,cAAc,CAAC,gBAAgB,GAAG;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACzE;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;AAC5D,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACtG;AACA;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
1
+ {"version":3,"file":"DefaultStorage.native.js","sources":["../../../src/storage/DefaultStorage.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultStorage = void 0;\nconst react_native_1 = require(\"@aws-amplify/react-native\");\nconst MEMORY_KEY_PREFIX = '@MemoryStorage:';\n/**\n * @internal\n */\nclass DefaultStorage {\n constructor() {\n this.asyncStorage = (0, react_native_1.loadAsyncStorage)();\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n return this.asyncStorage.setItem(`${MEMORY_KEY_PREFIX}${key}`, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return this.asyncStorage.getItem(`${MEMORY_KEY_PREFIX}${key}`);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n return this.asyncStorage.removeItem(`${MEMORY_KEY_PREFIX}${key}`);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n async clear() {\n const allKeys = await this.asyncStorage.getAllKeys();\n return this.asyncStorage.multiRemove(allKeys.filter(key => key.startsWith(MEMORY_KEY_PREFIX)));\n }\n}\nexports.DefaultStorage = DefaultStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,iBAAiB,GAAG,iBAAiB;AAC3C;AACA;AACA;AACA,MAAM,cAAc,CAAC;AACrB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,cAAc,CAAC,gBAAgB,GAAG;AAClE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;AAC7E,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACtE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACzE,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;AAC5D,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACtG,IAAI;AACJ;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InMemoryStorage.js","sources":["../../../src/storage/InMemoryStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InMemoryStorage = void 0;\n/**\n * @internal\n */\nclass InMemoryStorage {\n constructor() {\n this.storage = new Map();\n }\n get length() {\n return this.storage.size;\n }\n key(index) {\n if (index > this.length - 1) {\n return null;\n }\n return Array.from(this.storage.keys())[index];\n }\n setItem(key, value) {\n this.storage.set(key, value);\n }\n getItem(key) {\n return this.storage.get(key) ?? null;\n }\n removeItem(key) {\n this.storage.delete(key);\n }\n clear() {\n this.storage.clear();\n }\n}\nexports.InMemoryStorage = InMemoryStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC;AACA;AACA;AACA,MAAM,eAAe,CAAC;AACtB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE;AAChC;AACA,IAAI,IAAI,MAAM,GAAG;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI;AAChC;AACA,IAAI,GAAG,CAAC,KAAK,EAAE;AACf,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;AACrC,YAAY,OAAO,IAAI;AACvB;AACA,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;AACrD;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AACpC;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI;AAC5C;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;AAChC;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAC5B;AACA;AACA,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
1
+ {"version":3,"file":"InMemoryStorage.js","sources":["../../../src/storage/InMemoryStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InMemoryStorage = void 0;\n/**\n * @internal\n */\nclass InMemoryStorage {\n constructor() {\n this.storage = new Map();\n }\n get length() {\n return this.storage.size;\n }\n key(index) {\n if (index > this.length - 1) {\n return null;\n }\n return Array.from(this.storage.keys())[index];\n }\n setItem(key, value) {\n this.storage.set(key, value);\n }\n getItem(key) {\n return this.storage.get(key) ?? null;\n }\n removeItem(key) {\n this.storage.delete(key);\n }\n clear() {\n this.storage.clear();\n }\n}\nexports.InMemoryStorage = InMemoryStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC;AACA;AACA;AACA,MAAM,eAAe,CAAC;AACtB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE;AAChC,IAAI;AACJ,IAAI,IAAI,MAAM,GAAG;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI;AAChC,IAAI;AACJ,IAAI,GAAG,CAAC,KAAK,EAAE;AACf,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;AACrC,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;AACrD,IAAI;AACJ,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AACpC,IAAI;AACJ,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI;AAC5C,IAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;AAChC,IAAI;AACJ,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAC5B,IAAI;AACJ;AACA,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"KeyValueStorage.js","sources":["../../../src/storage/KeyValueStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KeyValueStorage = void 0;\nconst errors_1 = require(\"../errors\");\n/**\n * @internal\n */\nclass KeyValueStorage {\n constructor(storage) {\n this.storage = storage;\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n async setItem(key, value) {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n this.storage.setItem(key, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n async getItem(key) {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n return this.storage.getItem(key);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n async removeItem(key) {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n this.storage.removeItem(key);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n async clear() {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n this.storage.clear();\n }\n}\nexports.KeyValueStorage = KeyValueStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC;AACA;AACA;AACA,MAAM,eAAe,CAAC;AACtB,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AAC9B,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,UAAU,CAAC,GAAG,EAAE;AAC1B,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAC5B;AACA;AACA,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
1
+ {"version":3,"file":"KeyValueStorage.js","sources":["../../../src/storage/KeyValueStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KeyValueStorage = void 0;\nconst errors_1 = require(\"../errors\");\n/**\n * @internal\n */\nclass KeyValueStorage {\n constructor(storage) {\n this.storage = storage;\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n async setItem(key, value) {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n this.storage.setItem(key, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n async getItem(key) {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n return this.storage.getItem(key);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n async removeItem(key) {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n this.storage.removeItem(key);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n async clear() {\n if (!this.storage)\n throw new errors_1.PlatformNotSupportedError();\n this.storage.clear();\n }\n}\nexports.KeyValueStorage = KeyValueStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC;AACA;AACA;AACA,MAAM,eAAe,CAAC;AACtB,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO;AAC9B,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AAC9B,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;AACxC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACxC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,UAAU,CAAC,GAAG,EAAE;AAC1B,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;AACzB,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAC5B,IAAI;AACJ;AACA,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SessionStorage.js","sources":["../../../src/storage/SessionStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SessionStorage = void 0;\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass SessionStorage extends KeyValueStorage_1.KeyValueStorage {\n constructor() {\n super((0, utils_1.getSessionStorageWithFallback)());\n }\n}\nexports.SessionStorage = SessionStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA,MAAM,cAAc,SAAS,iBAAiB,CAAC,eAAe,CAAC;AAC/D,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,6BAA6B,GAAG,CAAC;AAC3D;AACA;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
1
+ {"version":3,"file":"SessionStorage.js","sources":["../../../src/storage/SessionStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SessionStorage = void 0;\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass SessionStorage extends KeyValueStorage_1.KeyValueStorage {\n constructor() {\n super((0, utils_1.getSessionStorageWithFallback)());\n }\n}\nexports.SessionStorage = SessionStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA,MAAM,cAAc,SAAS,iBAAiB,CAAC,eAAe,CAAC;AAC/D,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,6BAA6B,GAAG,CAAC;AAC3D,IAAI;AACJ;AACA,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SyncKeyValueStorage.js","sources":["../../../src/storage/SyncKeyValueStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncKeyValueStorage = void 0;\nconst errors_1 = require(\"../errors\");\n/**\n * @internal\n */\nclass SyncKeyValueStorage {\n constructor(storage) {\n this._storage = storage;\n }\n get storage() {\n if (!this._storage)\n throw new errors_1.PlatformNotSupportedError();\n return this._storage;\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n this.storage.setItem(key, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return this.storage.getItem(key);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n this.storage.removeItem(key);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n this.storage.clear();\n }\n}\nexports.SyncKeyValueStorage = SyncKeyValueStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC;AACA;AACA;AACA,MAAM,mBAAmB,CAAC;AAC1B,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO;AAC/B;AACA,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ;AAC1B,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,OAAO,IAAI,CAAC,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAC5B;AACA;AACA,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
1
+ {"version":3,"file":"SyncKeyValueStorage.js","sources":["../../../src/storage/SyncKeyValueStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncKeyValueStorage = void 0;\nconst errors_1 = require(\"../errors\");\n/**\n * @internal\n */\nclass SyncKeyValueStorage {\n constructor(storage) {\n this._storage = storage;\n }\n get storage() {\n if (!this._storage)\n throw new errors_1.PlatformNotSupportedError();\n return this._storage;\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n this.storage.setItem(key, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return this.storage.getItem(key);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n this.storage.removeItem(key);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n this.storage.clear();\n }\n}\nexports.SyncKeyValueStorage = SyncKeyValueStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC;AACA;AACA;AACA,MAAM,mBAAmB,CAAC;AAC1B,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO;AAC/B,IAAI;AACJ,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ;AAC1B,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE;AAC1D,QAAQ,OAAO,IAAI,CAAC,QAAQ;AAC5B,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;AACxC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACxC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAC5B,IAAI;AACJ;AACA,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SyncSessionStorage.js","sources":["../../../src/storage/SyncSessionStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncSessionStorage = void 0;\nconst SyncKeyValueStorage_1 = require(\"./SyncKeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass SyncSessionStorage extends SyncKeyValueStorage_1.SyncKeyValueStorage {\n constructor() {\n super((0, utils_1.getSessionStorageWithFallback)());\n }\n}\nexports.SyncSessionStorage = SyncSessionStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA,MAAM,kBAAkB,SAAS,qBAAqB,CAAC,mBAAmB,CAAC;AAC3E,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,6BAA6B,GAAG,CAAC;AAC3D;AACA;AACA,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
1
+ {"version":3,"file":"SyncSessionStorage.js","sources":["../../../src/storage/SyncSessionStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncSessionStorage = void 0;\nconst SyncKeyValueStorage_1 = require(\"./SyncKeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass SyncSessionStorage extends SyncKeyValueStorage_1.SyncKeyValueStorage {\n constructor() {\n super((0, utils_1.getSessionStorageWithFallback)());\n }\n}\nexports.SyncSessionStorage = SyncSessionStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA,MAAM,kBAAkB,SAAS,qBAAqB,CAAC,mBAAmB,CAAC;AAC3E,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,6BAA6B,GAAG,CAAC;AAC3D,IAAI;AACJ;AACA,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/storage/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = void 0;\nconst DefaultStorage_1 = require(\"./DefaultStorage\");\nconst InMemoryStorage_1 = require(\"./InMemoryStorage\");\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst SessionStorage_1 = require(\"./SessionStorage\");\nconst SyncSessionStorage_1 = require(\"./SyncSessionStorage\");\nvar CookieStorage_1 = require(\"./CookieStorage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return CookieStorage_1.CookieStorage; } });\nexports.defaultStorage = new DefaultStorage_1.DefaultStorage();\nexports.sessionStorage = new SessionStorage_1.SessionStorage();\nexports.syncSessionStorage = new SyncSessionStorage_1.SyncSessionStorage();\nexports.sharedInMemoryStorage = new KeyValueStorage_1.KeyValueStorage(new InMemoryStorage_1.InMemoryStorage());\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AAC7I,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACpD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACpD,MAAM,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;AAC5D,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACjI,OAAO,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE;AAC9D,OAAO,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE;AAC9D,OAAO,CAAC,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,kBAAkB,EAAE;AAC1E,OAAO,CAAC,qBAAqB,GAAG,IAAI,iBAAiB,CAAC,eAAe,CAAC,IAAI,iBAAiB,CAAC,eAAe,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/storage/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = void 0;\nconst DefaultStorage_1 = require(\"./DefaultStorage\");\nconst InMemoryStorage_1 = require(\"./InMemoryStorage\");\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst SessionStorage_1 = require(\"./SessionStorage\");\nconst SyncSessionStorage_1 = require(\"./SyncSessionStorage\");\nvar CookieStorage_1 = require(\"./CookieStorage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return CookieStorage_1.CookieStorage; } });\nexports.defaultStorage = new DefaultStorage_1.DefaultStorage();\nexports.sessionStorage = new SessionStorage_1.SessionStorage();\nexports.syncSessionStorage = new SyncSessionStorage_1.SyncSessionStorage();\nexports.sharedInMemoryStorage = new KeyValueStorage_1.KeyValueStorage(new InMemoryStorage_1.InMemoryStorage());\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AAC7I,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACpD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACpD,MAAM,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;AAC5D,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,OAAO,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE;AAC9D,OAAO,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE;AAC9D,OAAO,CAAC,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,kBAAkB,EAAE;AAC1E,OAAO,CAAC,qBAAqB,GAAG,IAAI,iBAAiB,CAAC,eAAe,CAAC,IAAI,iBAAiB,CAAC,eAAe,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/storage/utils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSessionStorageWithFallback = exports.getLocalStorageWithFallback = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst InMemoryStorage_1 = require(\"./InMemoryStorage\");\n/**\n * @internal\n * @returns Either a reference to window.localStorage or an in-memory storage as fallback\n */\nconst logger = new Logger_1.ConsoleLogger('CoreStorageUtils');\nconst getLocalStorageWithFallback = () => {\n try {\n // Attempt to use localStorage directly\n if (typeof window !== 'undefined' && window.localStorage) {\n return window.localStorage;\n }\n }\n catch (e) {\n // Handle any errors related to localStorage access\n logger.info('localStorage not found. InMemoryStorage is used as a fallback.');\n }\n // Return in-memory storage as a fallback if localStorage is not accessible\n return new InMemoryStorage_1.InMemoryStorage();\n};\nexports.getLocalStorageWithFallback = getLocalStorageWithFallback;\n/**\n * @internal\n * @returns Either a reference to window.sessionStorage or an in-memory storage as fallback\n */\nconst getSessionStorageWithFallback = () => {\n try {\n // Attempt to use sessionStorage directly\n if (typeof window !== 'undefined' && window.sessionStorage) {\n // Verify we can actually use it by testing access\n window.sessionStorage.getItem('test');\n return window.sessionStorage;\n }\n throw new Error('sessionStorage is not defined');\n }\n catch (e) {\n // Handle any errors related to sessionStorage access\n logger.info('sessionStorage not found. InMemoryStorage is used as a fallback.');\n return new InMemoryStorage_1.InMemoryStorage();\n }\n};\nexports.getSessionStorageWithFallback = getSessionStorageWithFallback;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAA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n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSessionStorageWithFallback = exports.getLocalStorageWithFallback = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst InMemoryStorage_1 = require(\"./InMemoryStorage\");\n/**\n * @internal\n * @returns Either a reference to window.localStorage or an in-memory storage as fallback\n */\nconst logger = new Logger_1.ConsoleLogger('CoreStorageUtils');\nconst getLocalStorageWithFallback = () => {\n try {\n // Attempt to use localStorage directly\n if (typeof window !== 'undefined' && window.localStorage) {\n return window.localStorage;\n }\n }\n catch (e) {\n // Handle any errors related to localStorage access\n logger.info('localStorage not found. InMemoryStorage is used as a fallback.');\n }\n // Return in-memory storage as a fallback if localStorage is not accessible\n return new InMemoryStorage_1.InMemoryStorage();\n};\nexports.getLocalStorageWithFallback = getLocalStorageWithFallback;\n/**\n * @internal\n * @returns Either a reference to window.sessionStorage or an in-memory storage as fallback\n */\nconst getSessionStorageWithFallback = () => {\n try {\n // Attempt to use sessionStorage directly\n if (typeof window !== 'undefined' && window.sessionStorage) {\n // Verify we can actually use it by testing access\n window.sessionStorage.getItem('test');\n return window.sessionStorage;\n }\n throw new Error('sessionStorage is not defined');\n }\n catch (e) {\n // Handle any errors related to sessionStorage access\n logger.info('sessionStorage not found. InMemoryStorage is used as a fallback.');\n return new InMemoryStorage_1.InMemoryStorage();\n }\n};\nexports.getSessionStorageWithFallback = getSessionStorageWithFallback;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,6BAA6B,GAAG,OAAO,CAAC,2BAA2B,GAAG,MAAM;AACpF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;AACrC,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACtD;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC;AAC7D,MAAM,2BAA2B,GAAG,MAAM;AAC1C,IAAI,IAAI;AACR;AACA,QAAQ,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,YAAY,EAAE;AAClE,YAAY,OAAO,MAAM,CAAC,YAAY;AACtC,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA,QAAQ,MAAM,CAAC,IAAI,CAAC,gEAAgE,CAAC;AACrF,IAAI;AACJ;AACA,IAAI,OAAO,IAAI,iBAAiB,CAAC,eAAe,EAAE;AAClD,CAAC;AACD,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;AACjE;AACA;AACA;AACA;AACA,MAAM,6BAA6B,GAAG,MAAM;AAC5C,IAAI,IAAI;AACR;AACA,QAAQ,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,cAAc,EAAE;AACpE;AACA,YAAY,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC;AACjD,YAAY,OAAO,MAAM,CAAC,cAAc;AACxC,QAAQ;AACR,QAAQ,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;AACxD,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA,QAAQ,MAAM,CAAC,IAAI,CAAC,kEAAkE,CAAC;AACvF,QAAQ,OAAO,IAAI,iBAAiB,CAAC,eAAe,EAAE;AACtD,IAAI;AACJ,CAAC;AACD,OAAO,CAAC,6BAA6B,GAAG,6BAA6B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WordArray.js","sources":["../../../src/utils/WordArray.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WordArray = void 0;\nconst cryptoSecureRandomInt_1 = require(\"./cryptoSecureRandomInt\");\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\nfunction hexStringify(wordArray) {\n // Shortcuts\n const { words } = wordArray;\n const { sigBytes } = wordArray;\n // Convert\n const hexChars = [];\n for (let i = 0; i < sigBytes; i++) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n return hexChars.join('');\n}\nclass WordArray {\n constructor(words, sigBytes) {\n this.words = [];\n let Words = words;\n Words = this.words = Words || [];\n if (sigBytes !== undefined) {\n this.sigBytes = sigBytes;\n }\n else {\n this.sigBytes = Words.length * 4;\n }\n }\n random(nBytes) {\n const words = [];\n for (let i = 0; i < nBytes; i += 4) {\n words.push((0, cryptoSecureRandomInt_1.cryptoSecureRandomInt)());\n }\n return new WordArray(words, nBytes);\n }\n toString() {\n return hexStringify(this);\n }\n}\nexports.WordArray = WordArray;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,SAAS,EAAE;AACjC;AACA,IAAI,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS;AAC/B,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS;AAClC;AACA,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;AACvC,QAAQ,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,MAA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ourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WordArray = void 0;\nconst cryptoSecureRandomInt_1 = require(\"./cryptoSecureRandomInt\");\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\nfunction hexStringify(wordArray) {\n // Shortcuts\n const { words } = wordArray;\n const { sigBytes } = wordArray;\n // Convert\n const hexChars = [];\n for (let i = 0; i < sigBytes; i++) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n return hexChars.join('');\n}\nclass WordArray {\n constructor(words, sigBytes) {\n this.words = [];\n let Words = words;\n Words = this.words = Words || [];\n if (sigBytes !== undefined) {\n this.sigBytes = sigBytes;\n }\n else {\n this.sigBytes = Words.length * 4;\n }\n }\n random(nBytes) {\n const words = [];\n for (let i = 0; i < nBytes; i += 4) {\n words.push((0, cryptoSecureRandomInt_1.cryptoSecureRandomInt)());\n }\n return new WordArray(words, nBytes);\n }\n toString() {\n return hexStringify(this);\n }\n}\nexports.WordArray = WordArray;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,SAAS,EAAE;AACjC;AACA,IAAI,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS;AAC/B,IAAI,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS;AAClC;AACA,IAAI,MAAM,QAAQ,GAAG,EAAE;A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C,KAAK,EAAE,MAAM,CAAC;AAC3C,IAAI;AACJ,IAAI,QAAQ,GAAG;AACf,QAAQ,OAAO,YAAY,CAAC,IAAI,CAAC;AACjC,IAAI;AACJ;AACA,OAAO,CAAC,SAAS,GAAG,SAAS;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base64Decoder.js","sources":["../../../../../src/utils/convert/base64/base64Decoder.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Decoder = void 0;\nconst globalHelpers_1 = require(\"../../globalHelpers\");\nexports.base64Decoder = {\n convert(input, options) {\n let inputStr = input;\n // urlSafe character replacement options conform to the base64 url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#page-7\n if (options?.urlSafe) {\n inputStr = inputStr.replace(/-/g, '+').replace(/_/g, '/');\n }\n return (0, globalHelpers_1.getAtob)()(inputStr);\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACtD,OAAO,CAAC,aAAa,GAAG;AACxB,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;AAC5B,QAAQ,IAAI,QAAQ,GAAG,KAAK;AAC5B;AACA;AACA,QAAQ,IAAI,OAAO,EAAE,OAAO,EAAE;AAC9B,YAAY,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACrE;AACA,QAAQ,OAAO,IAAI,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC;AACvD,KAAK;AACL,CAAC;;"}
1
+ {"version":3,"file":"base64Decoder.js","sources":["../../../../../src/utils/convert/base64/base64Decoder.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Decoder = void 0;\nconst globalHelpers_1 = require(\"../../globalHelpers\");\nexports.base64Decoder = {\n convert(input, options) {\n let inputStr = input;\n // urlSafe character replacement options conform to the base64 url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#page-7\n if (options?.urlSafe) {\n inputStr = inputStr.replace(/-/g, '+').replace(/_/g, '/');\n }\n return (0, globalHelpers_1.getAtob)()(inputStr);\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACtD,OAAO,CAAC,aAAa,GAAG;AACxB,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;AAC5B,QAAQ,IAAI,QAAQ,GAAG,KAAK;AAC5B;AACA;AACA,QAAQ,IAAI,OAAO,EAAE,OAAO,EAAE;AAC9B,YAAY,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACrE,QAAQ;AACR,QAAQ,OAAO,IAAI,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC;AACvD,IAAI,CAAC;AACL,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base64Encoder.js","sources":["../../../../../src/utils/convert/base64/base64Encoder.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = void 0;\nconst globalHelpers_1 = require(\"../../globalHelpers\");\nconst bytesToString_1 = require(\"./bytesToString\");\nexports.base64Encoder = {\n /**\n * Convert input to base64-encoded string\n * @param input - string to convert to base64\n * @param options - encoding options that can optionally produce a base64url string\n * @returns base64-encoded string\n */\n convert(input, options = {\n urlSafe: false,\n skipPadding: false,\n }) {\n const inputStr = typeof input === 'string' ? input : (0, bytesToString_1.bytesToString)(input);\n let encodedStr = (0, globalHelpers_1.getBtoa)()(inputStr);\n // urlSafe char replacement and skipPadding options conform to the base64url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#section-5\n if (options.urlSafe) {\n encodedStr = encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n if (options.skipPadding) {\n encodedStr = encodedStr.replace(/=/g, '');\n }\n return encodedStr;\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACtD,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,OAAO,CAAC,aAAa,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG;AAC7B,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,WAAW,EAAE,KAAK;AAC1B,KAAK,EAAE;AACP,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,CAAC;AACtG,QAAQ,IAAI,UAAU,GAAG,IAAI,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC;AACjE;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE;AAC7B,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AAC3E;AACA,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE;AACjC,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACrD;AACA,QAAQ,OAAO,UAAU;AACzB,KAAK;AACL,CAAC;;"}
1
+ {"version":3,"file":"base64Encoder.js","sources":["../../../../../src/utils/convert/base64/base64Encoder.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = void 0;\nconst globalHelpers_1 = require(\"../../globalHelpers\");\nconst bytesToString_1 = require(\"./bytesToString\");\nexports.base64Encoder = {\n /**\n * Convert input to base64-encoded string\n * @param input - string to convert to base64\n * @param options - encoding options that can optionally produce a base64url string\n * @returns base64-encoded string\n */\n convert(input, options = {\n urlSafe: false,\n skipPadding: false,\n }) {\n const inputStr = typeof input === 'string' ? input : (0, bytesToString_1.bytesToString)(input);\n let encodedStr = (0, globalHelpers_1.getBtoa)()(inputStr);\n // urlSafe char replacement and skipPadding options conform to the base64url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#section-5\n if (options.urlSafe) {\n encodedStr = encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n if (options.skipPadding) {\n encodedStr = encodedStr.replace(/=/g, '');\n }\n return encodedStr;\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACtD,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,OAAO,CAAC,aAAa,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG;AAC7B,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,WAAW,EAAE,KAAK;AAC1B,KAAK,EAAE;AACP,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,CAAC;AACtG,QAAQ,IAAI,UAAU,GAAG,IAAI,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC;AACjE;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE;AAC7B,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AAC3E,QAAQ;AACR,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE;AACjC,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACrD,QAAQ;AACR,QAAQ,OAAO,UAAU;AACzB,IAAI,CAAC;AACL,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/convert/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = exports.base64Decoder = void 0;\nvar base64Decoder_1 = require(\"./base64/base64Decoder\");\nObject.defineProperty(exports, \"base64Decoder\", { enumerable: true, get: function () { return base64Decoder_1.base64Decoder; } });\nvar base64Encoder_1 = require(\"./base64/base64Encoder\");\nObject.defineProperty(exports, \"base64Encoder\", { enumerable: true, get: function () { return base64Encoder_1.base64Encoder; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AACtD,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACjI,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/convert/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = exports.base64Decoder = void 0;\nvar base64Decoder_1 = require(\"./base64/base64Decoder\");\nObject.defineProperty(exports, \"base64Decoder\", { enumerable: true, get: function () { return base64Decoder_1.base64Decoder; } });\nvar base64Encoder_1 = require(\"./base64/base64Encoder\");\nObject.defineProperty(exports, \"base64Encoder\", { enumerable: true, get: function () { return base64Encoder_1.base64Encoder; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM;AACtD,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deDupeAsyncFunction.js","sources":["../../../src/utils/deDupeAsyncFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deDupeAsyncFunction = void 0;\n/**\n * returns in-flight promise if there is one\n *\n * @param asyncFunction - asyncFunction to be deduped.\n * @returns - the return type of the callback\n */\nconst deDupeAsyncFunction = (asyncFunction) => {\n let inflightPromise;\n return async (...args) => {\n if (inflightPromise)\n return inflightPromise;\n inflightPromise = new Promise((resolve, reject) => {\n asyncFunction(...args)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n reject(error);\n })\n .finally(() => {\n inflightPromise = undefined;\n });\n });\n return inflightPromise;\n };\n};\nexports.deDupeAsyncFunction = deDupeAsyncFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,CAAC,aAAa,KAAK;AAC/C,IAAI,IAAI,eAAe;AACvB,IAAI,OAAO,OAAO,GAAG,IAAI,KAAK;AAC9B,QAAQ,IAAI,eAAe;AAC3B,YAAY,OAAO,eAAe;AAClC,QAAQ,eAAe,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC3D,YAAY,aAAa,CAAC,GAAG,IAAI;AACjC,iBAAiB,IAAI,CAAC,MAAM,IAAI;AAChC,gBAAgB,OAAO,CAAC,MAAM,CAAC;AAC/B,aAAa;AACb,iBAAiB,KAAK,CAAC,KAAK,IAAI;AAChC,gBAAgB,MAAM,CAAC,KAAK,CAAC;AAC7B,aAAa;AACb,iBAAiB,OAAO,CAAC,MAAM;AAC/B,gBAAgB,eAAe,GAAG,SAAS;AAC3C,aAAa,CAAC;AACd,SAAS,CAAC;AACV,QAAQ,OAAO,eAAe;AAC9B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
1
+ {"version":3,"file":"deDupeAsyncFunction.js","sources":["../../../src/utils/deDupeAsyncFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deDupeAsyncFunction = void 0;\n/**\n * returns in-flight promise if there is one\n *\n * @param asyncFunction - asyncFunction to be deduped.\n * @returns - the return type of the callback\n */\nconst deDupeAsyncFunction = (asyncFunction) => {\n let inflightPromise;\n return async (...args) => {\n if (inflightPromise)\n return inflightPromise;\n inflightPromise = new Promise((resolve, reject) => {\n asyncFunction(...args)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n reject(error);\n })\n .finally(() => {\n inflightPromise = undefined;\n });\n });\n return inflightPromise;\n };\n};\nexports.deDupeAsyncFunction = deDupeAsyncFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,CAAC,aAAa,KAAK;AAC/C,IAAI,IAAI,eAAe;AACvB,IAAI,OAAO,OAAO,GAAG,IAAI,KAAK;AAC9B,QAAQ,IAAI,eAAe;AAC3B,YAAY,OAAO,eAAe;AAClC,QAAQ,eAAe,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC3D,YAAY,aAAa,CAAC,GAAG,IAAI;AACjC,iBAAiB,IAAI,CAAC,MAAM,IAAI;AAChC,gBAAgB,OAAO,CAAC,MAAM,CAAC;AAC/B,YAAY,CAAC;AACb,iBAAiB,KAAK,CAAC,KAAK,IAAI;AAChC,gBAAgB,MAAM,CAAC,KAAK,CAAC;AAC7B,YAAY,CAAC;AACb,iBAAiB,OAAO,CAAC,MAAM;AAC/B,gBAAgB,eAAe,GAAG,SAAS;AAC3C,YAAY,CAAC,CAAC;AACd,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,eAAe;AAC9B,IAAI,CAAC;AACL,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deepFreeze.js","sources":["../../../src/utils/deepFreeze.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deepFreeze = void 0;\nconst deepFreeze = (object) => {\n const propNames = Reflect.ownKeys(object);\n for (const name of propNames) {\n const value = object[name];\n if ((value && typeof value === 'object') || typeof value === 'function') {\n (0, exports.deepFreeze)(value);\n }\n }\n return Object.freeze(object);\n};\nexports.deepFreeze = deepFreeze;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B,MAAM,UAAU,GAAG,CAAC,MAAM,KAAK;AAC/B,IAAI,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;AAC7C,IAAI,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;AAClC,QAAQ,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;AAClC,QAAQ,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,KAAK,OAAO,KAAK,KAAK,UAAU,EAAE;AACjF,YAAY,IAAI,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;AAC1C;AACA;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAChC,CAAC;AACD,OAAO,CAAC,UAAU,GAAG,UAAU;;"}
1
+ {"version":3,"file":"deepFreeze.js","sources":["../../../src/utils/deepFreeze.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deepFreeze = void 0;\nconst deepFreeze = (object) => {\n const propNames = Reflect.ownKeys(object);\n for (const name of propNames) {\n const value = object[name];\n if ((value && typeof value === 'object') || typeof value === 'function') {\n (0, exports.deepFreeze)(value);\n }\n }\n return Object.freeze(object);\n};\nexports.deepFreeze = deepFreeze;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B,MAAM,UAAU,GAAG,CAAC,MAAM,KAAK;AAC/B,IAAI,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;AAC7C,IAAI,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;AAClC,QAAQ,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;AAClC,QAAQ,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,KAAK,OAAO,KAAK,KAAK,UAAU,EAAE;AACjF,YAAY,IAAI,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;AAC1C,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAChC,CAAC;AACD,OAAO,CAAC,UAAU,GAAG,UAAU;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/deviceName/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDeviceName = void 0;\nvar getDeviceName_1 = require(\"./getDeviceName\");\nObject.defineProperty(exports, \"getDeviceName\", { enumerable: true, get: function () { return getDeviceName_1.getDeviceName; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/deviceName/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDeviceName = void 0;\nvar getDeviceName_1 = require(\"./getDeviceName\");\nObject.defineProperty(exports, \"getDeviceName\", { enumerable: true, get: function () { return getDeviceName_1.getDeviceName; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateRandomString.js","sources":["../../../src/utils/generateRandomString.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateRandomString = void 0;\nconst globalHelpers_1 = require(\"./globalHelpers\");\nconst generateRandomString = (length) => {\n const STATE_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const result = [];\n const randomNums = new Uint8Array(length);\n (0, globalHelpers_1.getCrypto)().getRandomValues(randomNums);\n for (const num of randomNums) {\n result.push(STATE_CHARSET[num % STATE_CHARSET.length]);\n }\n return result.join('');\n};\nexports.generateRandomString = generateRandomString;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,MAAM;AACrC,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,MAAM,oBAAoB,GAAG,CAAC,MAAM,KAAK;AACzC,IAAI,MAAM,aAAa,GAAG,gEAAgE;AAC1F,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;AAC7C,IAAI,IAAI,eAAe,CAAC,SAAS,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC;AAChE,IAAI,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;AAClC,QAAQ,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9D;AACA,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1B,CAAC;AACD,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;;"}
1
+ {"version":3,"file":"generateRandomString.js","sources":["../../../src/utils/generateRandomString.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateRandomString = void 0;\nconst globalHelpers_1 = require(\"./globalHelpers\");\nconst generateRandomString = (length) => {\n const STATE_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const result = [];\n const randomNums = new Uint8Array(length);\n (0, globalHelpers_1.getCrypto)().getRandomValues(randomNums);\n for (const num of randomNums) {\n result.push(STATE_CHARSET[num % STATE_CHARSET.length]);\n }\n return result.join('');\n};\nexports.generateRandomString = generateRandomString;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,MAAM;AACrC,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,MAAM,oBAAoB,GAAG,CAAC,MAAM,KAAK;AACzC,IAAI,MAAM,aAAa,GAAG,gEAAgE;AAC1F,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;AAC7C,IAAI,IAAI,eAAe,CAAC,SAAS,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC;AAChE,IAAI,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;AAClC,QAAQ,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9D,IAAI;AACJ,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1B,CAAC;AACD,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getClientInfo.ios.js","sources":["../../../../src/utils/getClientInfo/getClientInfo.ios.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClientInfo = void 0;\nconst react_native_1 = require(\"react-native\");\nconst Logger_1 = require(\"../../Logger\");\nconst logger = new Logger_1.ConsoleLogger('getClientInfo');\nconst getClientInfo = () => {\n const dim = react_native_1.Dimensions.get('screen');\n logger.debug(react_native_1.Platform, dim);\n const OS = 'ios';\n const { Version } = react_native_1.Platform;\n const { make, model } = dimToMake(dim);\n return {\n platform: OS,\n version: String(Version),\n appVersion: [OS, String(Version)].join('/'),\n make,\n model,\n };\n};\nexports.getClientInfo = getClientInfo;\nfunction dimToMake(dim) {\n let { height, width } = dim;\n if (height < width) {\n const tmp = height;\n height = width;\n width = tmp;\n }\n if (width === 320 && height === 568) {\n return { make: 'iPhone', model: 'iPhone 5' };\n }\n if (width === 375 && height === 667) {\n return { make: 'iPhone', model: 'iPhone 6/7/8' };\n }\n if (width === 414 && height === 736) {\n return { make: 'iPhone', model: 'iPhone 6/7/8 plus' };\n }\n if (width === 375 && height === 812) {\n return { make: 'iPhone', model: 'iPhone X' };\n }\n if (width === 414 && height === 896) {\n return { make: 'iPhone', model: 'iPhone XR' };\n }\n if (width === 768 && height === 1024) {\n return { make: 'iPad', model: 'iPad Mini/Air' };\n }\n if (width === 834 && height === 1112) {\n return { make: 'iPad', model: 'iPad Pro' };\n }\n if (width === 1024 && height === 1366) {\n return { make: 'iPad', model: 'iPad Pro' };\n }\n if (width === 272 && height === 340) {\n return { make: 'Watch', model: 'Watch 38mm' };\n }\n if (width === 312 && height === 390) {\n return { make: 'Watch', model: 'Watch 42mm' };\n }\n return { make: null, model: null };\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;AAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC;AAC1D,MAAM,aAAa,GAAG,MAAM;AAC5B,IAAI,MAAM,GAAG,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvD,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC;AAC9C,IAAI,MAAM,EAAE,GAAG,KAAK;AACpB,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,QAAQ;AAC/C,IAAI,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC;AAC1C,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,EAAE;AACpB,QAAQ,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;AAChC,QAAQ,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACnD,QAAQ,IAAI;AACZ,QAAQ,KAAK;AACb,KAAK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa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M,EAAE,KAAK,EAAE,UAAU,EAAE;AAClD;AACA,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3C,QAAQ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;AAClD;AACA,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE;AACzC,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE;AACrD;AACA,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE;AACzC,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE;AACrD;AACA,IAAI,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;AACtC;;"}
1
+ {"version":3,"file":"getClientInfo.ios.js","sources":["../../../../src/utils/getClientInfo/getClientInfo.ios.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClientInfo = void 0;\nconst react_native_1 = require(\"react-native\");\nconst Logger_1 = require(\"../../Logger\");\nconst logger = new Logger_1.ConsoleLogger('getClientInfo');\nconst getClientInfo = () => {\n const dim = react_native_1.Dimensions.get('screen');\n logger.debug(react_native_1.Platform, dim);\n const OS = 'ios';\n const { Version } = react_native_1.Platform;\n const { make, model } = dimToMake(dim);\n return {\n platform: OS,\n version: String(Version),\n appVersion: [OS, String(Version)].join('/'),\n make,\n model,\n };\n};\nexports.getClientInfo = getClientInfo;\nfunction dimToMake(dim) {\n let { height, width } = dim;\n if (height < width) {\n const tmp = height;\n height = width;\n width = tmp;\n }\n if (width === 320 && height === 568) {\n return { make: 'iPhone', model: 'iPhone 5' };\n }\n if (width === 375 && height === 667) {\n return { make: 'iPhone', model: 'iPhone 6/7/8' };\n }\n if (width === 414 && height === 736) {\n return { make: 'iPhone', model: 'iPhone 6/7/8 plus' };\n }\n if (width === 375 && height === 812) {\n return { make: 'iPhone', model: 'iPhone X' };\n }\n if (width === 414 && height === 896) {\n return { make: 'iPhone', model: 'iPhone XR' };\n }\n if (width === 768 && height === 1024) {\n return { make: 'iPad', model: 'iPad Mini/Air' };\n }\n if (width === 834 && height === 1112) {\n return { make: 'iPad', model: 'iPad Pro' };\n }\n if (width === 1024 && height === 1366) {\n return { make: 'iPad', model: 'iPad Pro' };\n }\n if (width === 272 && height === 340) {\n return { make: 'Watch', model: 'Watch 38mm' };\n }\n if (width === 312 && height === 390) {\n return { make: 'Watch', model: 'Watch 42mm' };\n }\n return { make: null, model: null };\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;AAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC;AAC1D,MAAM,aAAa,GAAG,MAAM;AAC5B,IAAI,MAAM,GAAG,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvD,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC;AAC9C,IAAI,MAAM,EAAE,GAAG,KAAK;AACpB,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,QAAQ;AAC/C,IAAI,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC;AAC1C,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,EAAE;AACpB,QAAQ,OAAO,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AAE;AACrD,IAAI;AACJ,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,MAAM,KAAK,IAAI,EAAE;AAC1C,QAAQ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;AACvD,IAAI;AACJ,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,MAAM,KAAK,IAAI,EAAE;AAC1C,QAAQ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;AAClD,IAAI;AACJ,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3C,QAAQ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;AAClD,IAAI;AACJ,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE;AACzC,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE;AACrD,IAAI;AACJ,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE;AACzC,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE;AACrD,IAAI;AACJ,IAAI,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;AACtC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getClientInfo.js","sources":["../../../../src/utils/getClientInfo/getClientInfo.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClientInfo = getClientInfo;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Logger_1 = require(\"../../Logger\");\nconst logger = new Logger_1.ConsoleLogger('getClientInfo');\nfunction getClientInfo() {\n if (typeof window === 'undefined') {\n return {};\n }\n return browserClientInfo();\n}\nfunction browserClientInfo() {\n if (typeof window === 'undefined') {\n logger.warn('No window object available to get browser client info');\n return {};\n }\n const nav = window.navigator;\n if (!nav) {\n logger.warn('No navigator object available to get browser client info');\n return {};\n }\n const { platform, product, vendor, userAgent, language } = nav;\n const type = getBrowserType(userAgent);\n const timezone = browserTimezone();\n return {\n platform,\n make: product || vendor,\n model: type.type,\n version: type.version,\n appVersion: [type.type, type.version].join('/'),\n language,\n timezone,\n };\n}\nfunction browserTimezone() {\n const tzMatch = /\\(([A-Za-z\\s].*)\\)/.exec(new Date().toString());\n return tzMatch ? tzMatch[1] || '' : '';\n}\nfunction getBrowserType(userAgent) {\n // The latest user agents for Opera: https://www.whatismybrowser.com/guides/the-latest-user-agent/opera\n const operaMatch = /.+(Opera[\\s[A-Z]*|OPR[\\sA-Z]*)\\/([0-9.]+).*/i.exec(userAgent);\n if (operaMatch) {\n return { type: operaMatch[1], version: operaMatch[2] };\n }\n // The latest user agents for Edge: https://www.whatismybrowser.com/guides/the-latest-user-agent/edge\n const ieMatch = /.+(Trident|Edge|Edg|EdgA|EdgiOS)\\/([0-9.]+).*/i.exec(userAgent);\n if (ieMatch) {\n return { type: ieMatch[1], version: ieMatch[2] };\n }\n // The latest user agents for web browsers on Firefox and Chrome\n // https://www.whatismybrowser.com/guides/the-latest-user-agent/firefox\n // https://www.whatismybrowser.com/guides/the-latest-user-agent/chrome\n const cfMatch = /.+(Chrome|CriOS|Firefox|FxiOS)\\/([0-9.]+).*/i.exec(userAgent);\n if (cfMatch) {\n return { type: cfMatch[1], version: cfMatch[2] };\n }\n // The latest user agents for Safari: https://www.whatismybrowser.com/guides/the-latest-user-agent/safari\n const sMatch = /.+(Safari)\\/([0-9.]+).*/i.exec(userAgent);\n if (sMatch) {\n return { type: sMatch[1], version: sMatch[2] };\n }\n const awkMatch = /.+(AppleWebKit)\\/([0-9.]+).*/i.exec(userAgent);\n if (awkMatch) {\n return { type: awkMatch[1], version: awkMatch[2] };\n }\n const anyMatch = /.*([A-Z]+)\\/([0-9.]+).*/i.exec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AAE;AACtD;AACA,IAAI,MAAM,QAAQ,GAAG,+BAA+B,CAAC,IAAI,CAAC,SAAS,CAAC;AACpE,IAAI,IAAI,QAAQ,EAAE;AAClB,QAAQ,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;AAC1D;AACA,IAAI,MAAM,QAAQ,GAAG,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC;AAC/D,IAAI,IAAI,QAAQ,EAAE;AAClB,QAAQ,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;AAC1D;AACA,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;AACpC;;"}
1
+ {"version":3,"file":"getClientInfo.js","sources":["../../../../src/utils/getClientInfo/getClientInfo.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClientInfo = getClientInfo;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst Logger_1 = require(\"../../Logger\");\nconst logger = new Logger_1.ConsoleLogger('getClientInfo');\nfunction getClientInfo() {\n if (typeof window === 'undefined') {\n return {};\n }\n return browserClientInfo();\n}\nfunction browserClientInfo() {\n if (typeof window === 'undefined') {\n logger.warn('No window object available to get browser client info');\n return {};\n }\n const nav = window.navigator;\n if (!nav) {\n logger.warn('No navigator object available to get browser client info');\n return {};\n }\n const { platform, product, vendor, userAgent, language } = nav;\n const type = getBrowserType(userAgent);\n const timezone = browserTimezone();\n return {\n platform,\n make: product || vendor,\n model: type.type,\n version: type.version,\n appVersion: [type.type, type.version].join('/'),\n language,\n timezone,\n };\n}\nfunction browserTimezone() {\n const tzMatch = /\\(([A-Za-z\\s].*)\\)/.exec(new Date().toString());\n return tzMatch ? tzMatch[1] || '' : '';\n}\nfunction getBrowserType(userAgent) {\n // The latest user agents for Opera: https://www.whatismybrowser.com/guides/the-latest-user-agent/opera\n const operaMatch = /.+(Opera[\\s[A-Z]*|OPR[\\sA-Z]*)\\/([0-9.]+).*/i.exec(userAgent);\n if (operaMatch) {\n return { type: operaMatch[1], version: operaMatch[2] };\n }\n // The latest user agents for Edge: https://www.whatismybrowser.com/guides/the-latest-user-agent/edge\n const ieMatch = /.+(Trident|Edge|Edg|EdgA|EdgiOS)\\/([0-9.]+).*/i.exec(userAgent);\n if (ieMatch) {\n return { type: ieMatch[1], version: ieMatch[2] };\n }\n // The latest user agents for web browsers on Firefox and Chrome\n // https://www.whatismybrowser.com/guides/the-latest-user-agent/firefox\n // https://www.whatismybrowser.com/guides/the-latest-user-agent/chrome\n const cfMatch = /.+(Chrome|CriOS|Firefox|FxiOS)\\/([0-9.]+).*/i.exec(userAgent);\n if (cfMatch) {\n return { type: cfMatch[1], version: cfMatch[2] };\n }\n // The latest user agents for Safari: https://www.whatismybrowser.com/guides/the-latest-user-agent/safari\n const sMatch = /.+(Safari)\\/([0-9.]+).*/i.exec(userAgent);\n if (sMatch) {\n return { type: sMatch[1], version: sMatch[2] };\n }\n const awkMatch = /.+(AppleWebKit)\\/([0-9.]+).*/i.exec(userAgent);\n if (awkMatch) {\n return { type: awkMatch[1], version: awkMatch[2] };\n }\n const anyMatch = /.*([A-Z]+)\\/([0-9.]+).*/i.exec(userAgent);\n if (anyMatch) {\n return { type: anyMatch[1], version: anyMatch[2] };\n }\n return { type: '', version: '' };\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC;AACA;AACA,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,eAAe,CAA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,SAAS,CAAC;AAC/D,IAAI,IAAI,QAAQ,EAAE;AAClB,QAAQ,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;AAC1D,IAAI;AACJ,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;AACpC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/getClientInfo/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClientInfo = void 0;\nvar getClientInfo_1 = require(\"./getClientInfo\");\nObject.defineProperty(exports, \"getClientInfo\", { enumerable: true, get: function () { return getClientInfo_1.getClientInfo; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/getClientInfo/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClientInfo = void 0;\nvar getClientInfo_1 = require(\"./getClientInfo\");\nObject.defineProperty(exports, \"getClientInfo\", { enumerable: true, get: function () { return getClientInfo_1.getClientInfo; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/globalHelpers/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAtob = exports.getBtoa = exports.getCrypto = void 0;\nconst errors_1 = require(\"../../errors\");\nconst getCrypto = () => {\n if (typeof window === 'object' && typeof window.crypto === 'object') {\n return window.crypto;\n }\n // Next.js global polyfill\n if (typeof crypto === 'object') {\n return crypto;\n }\n throw new errors_1.AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexports.getCrypto = getCrypto;\nconst getBtoa = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa;\n }\n // Next.js global polyfill\n if (typeof btoa === 'function') {\n return btoa;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `btoa` function from the environment.',\n });\n};\nexports.getBtoa = getBtoa;\nconst getAtob = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return window.atob;\n }\n // Next.js global polyfill\n if (typeof atob === 'function') {\n return atob;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `atob` function from the environment.',\n });\n};\nexports.getAtob =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AI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI;AAC1B;AACA;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI;AACnB;AACA,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/globalHelpers/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAtob = exports.getBtoa = exports.getCrypto = void 0;\nconst errors_1 = require(\"../../errors\");\nconst getCrypto = () => {\n if (typeof window === 'object' && typeof window.crypto === 'object') {\n return window.crypto;\n }\n // Next.js global polyfill\n if (typeof crypto === 'object') {\n return crypto;\n }\n throw new errors_1.AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexports.getCrypto = getCrypto;\nconst getBtoa = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa;\n }\n // Next.js global polyfill\n if (typeof btoa === 'function') {\n return btoa;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `btoa` function from the environment.',\n });\n};\nexports.getBtoa = getBtoa;\nconst getAtob = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return window.atob;\n }\n // Next.js global polyfill\n if (typeof atob === 'function') {\n return atob;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `atob` function from the environment.',\n });\n};\nexports.getAtob = getAtob;\n"],"names":[],"mappings":";;AACA;AACA;AAC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,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI;AAC1B,IAAI;AACJ;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sources":["../../../../src/utils/globalHelpers/index.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAtob = exports.getBtoa = exports.getCrypto = void 0;\nconst react_native_1 = require(\"@aws-amplify/react-native\");\nconst errors_1 = require(\"../../errors\");\n(0, react_native_1.loadGetRandomValues)();\nconst { encode, decode } = (0, react_native_1.loadBase64)();\nconst getCrypto = () => {\n if (typeof crypto !== 'undefined' &&\n typeof crypto.getRandomValues === 'function') {\n return crypto;\n }\n throw new errors_1.AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexports.getCrypto = getCrypto;\nconst getBtoa = () => {\n return encode;\n};\nexports.getBtoa = getBtoa;\nconst getAtob = () => {\n return decode;\n};\nexports.getAtob = getAtob;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,MAAM;AAC9D,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,IAAI,cAAc,CAAC,mBAAmB,GAAG;AACzC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,UAAU,GAAG;AAC3D,MAAM,SAAS,GAAG,MAAM;AACxB,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW;AACrC,QAAQ,OAAO,MAAM,CAAC,eAAe,KAAK,UAAU,EAAE;AACtD,QAAQ,OAAO,MAAM;AACrB;AACA,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,SAAS,GAAG,SAAS;AAC7B,MAAM,OAAO,GAAG,MAAM;AACtB,IAAI,OAAO,MAAM;AACjB,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;AACzB,MAAM,OAAO,GAAG,MAAM;AACtB,IAAI,OAAO,MAAM;AACjB,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
1
+ {"version":3,"file":"index.native.js","sources":["../../../../src/utils/globalHelpers/index.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAtob = exports.getBtoa = exports.getCrypto = void 0;\nconst react_native_1 = require(\"@aws-amplify/react-native\");\nconst errors_1 = require(\"../../errors\");\n(0, react_native_1.loadGetRandomValues)();\nconst { encode, decode } = (0, react_native_1.loadBase64)();\nconst getCrypto = () => {\n if (typeof crypto !== 'undefined' &&\n typeof crypto.getRandomValues === 'function') {\n return crypto;\n }\n throw new errors_1.AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexports.getCrypto = getCrypto;\nconst getBtoa = () => {\n return encode;\n};\nexports.getBtoa = getBtoa;\nconst getAtob = () => {\n return decode;\n};\nexports.getAtob = getAtob;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,MAAM;AAC9D,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;AAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;AACxC,IAAI,cAAc,CAAC,mBAAmB,GAAG;AACzC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,UAAU,GAAG;AAC3D,MAAM,SAAS,GAAG,MAAM;AACxB,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW;AACrC,QAAQ,OAAO,MAAM,CAAC,eAAe,KAAK,UAAU,EAAE;AACtD,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,SAAS,GAAG,SAAS;AAC7B,MAAM,OAAO,GAAG,MAAM;AACtB,IAAI,OAAO,MAAM;AACjB,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;AACzB,MAAM,OAAO,GAAG,MAAM;AACtB,IAAI,OAAO,MAAM;AACjB,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTokenExpired = exports.deDupeAsyncFunction = exports.deepFreeze = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = exports.NonRetryableError = exports.isWebWorker = exports.isBrowser = exports.getClientInfo = exports.generateRandomString = void 0;\nvar generateRandomString_1 = require(\"./generateRandomString\");\nObject.defineProperty(exports, \"generateRandomString\", { enumerable: true, get: function () { return generateRandomString_1.generateRandomString; } });\nvar getClientInfo_1 = require(\"./getClientInfo\");\nObject.defineProperty(exports, \"getClientInfo\", { enumerable: true, get: function () { return getClientInfo_1.getClientInfo; } });\nvar isBrowser_1 = require(\"./isBrowser\");\nObject.defineProperty(exports, \"isBrowser\", { enumerable: true, get: function () { return isBrowser_1.isBrowser; } });\nvar isWebWorker_1 = require(\"./isWebWorker\");\nObject.defineProperty(exports, \"isWebWorker\", { enumerable: true, get: function () { return isWebWorker_1.isWebWorker; } });\nvar retry_1 = require(\"./retry\");\nObject.defineProperty(exports, \"NonRetryableError\", { enumerable: true, get: function () { return retry_1.NonRetryableError; } });\nObject.defineProperty(exports, \"isNonRetryableError\", { enumerable: true, get: function () { return retry_1.isNonRetryableError; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return retry_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"jitteredExponentialRetry\", { enumerable: true, get: function () { return retry_1.jitteredExponentialRetry; } });\nObject.defineProperty(exports, \"retry\", { enumerable: true, get: function () { return retry_1.retry; } });\nvar urlSafeDecode_1 = require(\"./urlSafeDecode\");\nObject.defineProperty(exports, \"urlSafeDecode\", { enumerable: true, get: function () { return urlSafeDecode_1.urlSafeDecode; } });\nvar urlSafeEncode_1 = require(\"./urlSafeEncode\");\nObject.defineProperty(exports, \"urlSafeEncode\", { enumerable: true, get: function () { return urlSafeEncode_1.urlSafeEncode; } });\nvar deepFreeze_1 = require(\"./deepFreeze\");\nObject.defineProperty(exports, \"deepFreeze\", { enumerable: true, get: function () { return deepFreeze_1.deepFreeze; } });\nvar deDupeAsyncFunction_1 = require(\"./deDupeAsyncFunction\");\nObject.defineProperty(exports, \"deDupeAsyncFunction\", { enumerable: true, get: function () { return deDupeAsyncFunction_1.deDupeAsyncFunction; } });\nvar isTokenExpired_1 = require(\"./isTokenExpired\");\nObject.defineProperty(exports, \"isTokenExpired\", { enumerable: true, get: function () { return isTokenExpired_1.isTokenExpired; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,oBAAoB,GAAG,MAAM;AAC1W,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC9D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC;AACtJ,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACjI,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AACxC,MAAM,CAAC,cAAc,CAAC,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;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACjI,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACjI,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AACxH,IAAI,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,qBAAqB,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC;AACnJ,IAAI,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTokenExpired = exports.deDupeAsyncFunction = exports.deepFreeze = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = exports.NonRetryableError = exports.isWebWorker = exports.isBrowser = exports.getClientInfo = exports.generateRandomString = void 0;\nvar generateRandomString_1 = require(\"./generateRandomString\");\nObject.defineProperty(exports, \"generateRandomString\", { enumerable: true, get: function () { return generateRandomString_1.generateRandomString; } });\nvar getClientInfo_1 = require(\"./getClientInfo\");\nObject.defineProperty(exports, \"getClientInfo\", { enumerable: true, get: function () { return getClientInfo_1.getClientInfo; } });\nvar isBrowser_1 = require(\"./isBrowser\");\nObject.defineProperty(exports, \"isBrowser\", { enumerable: true, get: function () { return isBrowser_1.isBrowser; } });\nvar isWebWorker_1 = require(\"./isWebWorker\");\nObject.defineProperty(exports, \"isWebWorker\", { enumerable: true, get: function () { return isWebWorker_1.isWebWorker; } });\nvar retry_1 = require(\"./retry\");\nObject.defineProperty(exports, \"NonRetryableError\", { enumerable: true, get: function () { return retry_1.NonRetryableError; } });\nObject.defineProperty(exports, \"isNonRetryableError\", { enumerable: true, get: function () { return retry_1.isNonRetryableError; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return retry_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"jitteredExponentialRetry\", { enumerable: true, get: function () { return retry_1.jitteredExponentialRetry; } });\nObject.defineProperty(exports, \"retry\", { enumerable: true, get: function () { return retry_1.retry; } });\nvar urlSafeDecode_1 = require(\"./urlSafeDecode\");\nObject.defineProperty(exports, \"urlSafeDecode\", { enumerable: true, get: function () { return urlSafeDecode_1.urlSafeDecode; } });\nvar urlSafeEncode_1 = require(\"./urlSafeEncode\");\nObject.defineProperty(exports, \"urlSafeEncode\", { enumerable: true, get: function () { return urlSafeEncode_1.urlSafeEncode; } });\nvar deepFreeze_1 = require(\"./deepFreeze\");\nObject.defineProperty(exports, \"deepFreeze\", { enumerable: true, get: function () { return deepFreeze_1.deepFreeze; } });\nvar deDupeAsyncFunction_1 = require(\"./deDupeAsyncFunction\");\nObject.defineProperty(exports, \"deDupeAsyncFunction\", { enumerable: true, get: function () { return deDupeAsyncFunction_1.deDupeAsyncFunction; } });\nvar isTokenExpired_1 = require(\"./isTokenExpired\");\nObject.defineProperty(exports, \"isTokenExpired\", { enumerable: true, get: function () { return isTokenExpired_1.isTokenExpired; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,oBAAoB,GAAG,MAAM;AAC1W,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC9D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;AACtJ,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,U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AAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAChD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AACjI,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;AACxH,IAAI,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,qBAAqB,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;AACnJ,IAAI,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"isWebWorker.js","sources":["../../../src/utils/isWebWorker.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isWebWorker = void 0;\nconst isWebWorker = () => {\n if (typeof self === 'undefined') {\n return false;\n }\n const selfContext = self;\n return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&\n self instanceof selfContext.WorkerGlobalScope);\n};\nexports.isWebWorker = isWebWorker;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,MAAM;AAC5B,MAAM,WAAW,GAAG,MAAM;AAC1B,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACrC,QAAQ,OAAO,KAAK;AACpB;AACA,IAAI,MAAM,WAAW,GAAG,IAAI;AAC5B,IAAI,QAAQ,OAAO,WAAW,CAAC,iBAAiB,KAAK,WAAW;AAChE,QAAQ,IAAI,YAAY,WAAW,CAAC,iBAAiB;AACrD,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,WAAW;;"}
1
+ {"version":3,"file":"isWebWorker.js","sources":["../../../src/utils/isWebWorker.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isWebWorker = void 0;\nconst isWebWorker = () => {\n if (typeof self === 'undefined') {\n return false;\n }\n const selfContext = self;\n return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&\n self instanceof selfContext.WorkerGlobalScope);\n};\nexports.isWebWorker = isWebWorker;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,MAAM;AAC5B,MAAM,WAAW,GAAG,MAAM;AAC1B,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACrC,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG,IAAI;AAC5B,IAAI,QAAQ,OAAO,WAAW,CAAC,iBAAiB,KAAK,WAAW;AAChE,QAAQ,IAAI,YAAY,WAAW,CAAC,iBAAiB;AACrD,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,WAAW;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseAmplifyConfig.js","sources":["../../../src/utils/parseAmplifyConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseAmplifyConfig = void 0;\nconst parseAWSExports_1 = require(\"../parseAWSExports\");\nconst parseAmplifyOutputs_1 = require(\"../parseAmplifyOutputs\");\n/**\n * Parses the variety of configuration shapes that Amplify can accept into a ResourcesConfig.\n *\n * @param amplifyConfig An Amplify configuration object conforming to one of the supported schemas.\n * @return A ResourcesConfig for the provided configuration object.\n */\nconst parseAmplifyConfig = (amplifyConfig) => {\n if (Object.keys(amplifyConfig).some(key => key.startsWith('aws_'))) {\n return (0, parseAWSExports_1.parseAWSExports)(amplifyConfig);\n }\n else if ((0, parseAmplifyOutputs_1.isAmplifyOutputs)(amplifyConfig)) {\n return (0, parseAmplifyOutputs_1.parseAmplifyOutputs)(amplifyConfig);\n }\n else {\n return amplifyConfig;\n }\n};\nexports.parseAmplifyConfig = parseAmplifyConfig;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACvD,MAAM,qBAAqB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,aAAa,KAAK;AAC9C,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;AACxE,QAAQ,OAAO,IAAI,iBAAiB,CAAC,eAAe,EAAE,aAAa,CAAC;AACpE;AACA,SAAS,IAAI,IAAI,qBAAqB,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAE;AACzE,QAAQ,OAAO,IAAI,qBAAqB,CAAC,mBAAmB,EAAE,aAAa,CAAC;AAC5E;AACA,SAAS;AACT,QAAQ,OAAO,aAAa;AAC5B;AACA,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
1
+ {"version":3,"file":"parseAmplifyConfig.js","sources":["../../../src/utils/parseAmplifyConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseAmplifyConfig = void 0;\nconst parseAWSExports_1 = require(\"../parseAWSExports\");\nconst parseAmplifyOutputs_1 = require(\"../parseAmplifyOutputs\");\n/**\n * Parses the variety of configuration shapes that Amplify can accept into a ResourcesConfig.\n *\n * @param amplifyConfig An Amplify configuration object conforming to one of the supported schemas.\n * @return A ResourcesConfig for the provided configuration object.\n */\nconst parseAmplifyConfig = (amplifyConfig) => {\n if (Object.keys(amplifyConfig).some(key => key.startsWith('aws_'))) {\n return (0, parseAWSExports_1.parseAWSExports)(amplifyConfig);\n }\n else if ((0, parseAmplifyOutputs_1.isAmplifyOutputs)(amplifyConfig)) {\n return (0, parseAmplifyOutputs_1.parseAmplifyOutputs)(amplifyConfig);\n }\n else {\n return amplifyConfig;\n }\n};\nexports.parseAmplifyConfig = parseAmplifyConfig;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;AACvD,MAAM,qBAAqB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,aAAa,KAAK;AAC9C,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;AACxE,QAAQ,OAAO,IAAI,iBAAiB,CAAC,eAAe,EAAE,aAAa,CAAC;AACpE,IAAI;AACJ,SAAS,IAAI,IAAI,qBAAqB,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAE;AACzE,QAAQ,OAAO,IAAI,qBAAqB,CAAC,mBAAmB,EAAE,aAAa,CAAC;AAC5E,IAAI;AACJ,SAAS;AACT,QAAQ,OAAO,aAAa;AAC5B,IAAI;AACJ,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createQueuedStorage.js","sources":["../../../../src/utils/queuedStorage/createQueuedStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createQueuedStorage = void 0;\nconst constants_1 = require(\"./constants\");\nconst getAddItemBytesSize_1 = require(\"./getAddItemBytesSize\");\nconst createQueuedStorage = () => {\n let currentBytesSize = 0;\n let error;\n const openDBPromise = new Promise((resolve, reject) => {\n const { indexedDB } = window;\n const openRequest = indexedDB.open(constants_1.DATABASE_NAME, 1);\n openRequest.onupgradeneeded = () => {\n const db = openRequest.result;\n if (!db.objectStoreNames.contains(constants_1.STORE_NAME)) {\n db.createObjectStore(constants_1.STORE_NAME, {\n keyPath: 'id',\n autoIncrement: true,\n });\n }\n };\n openRequest.onsuccess = async () => {\n const db = openRequest.result;\n const transaction = db.transaction(constants_1.STORE_NAME, 'readonly');\n const request = transaction.objectStore(constants_1.STORE_NAME).getAll();\n await promisifyIDBRequest(request);\n for (const item of request.result) {\n currentBytesSize += item.bytesSize;\n }\n resolve(openRequest.result);\n };\n openRequest.onerror = () => {\n reject(openRequest.error);\n };\n }).catch(err => {\n error = err;\n return undefined;\n });\n const getDB = async () => {\n const db = await openDBPromise;\n if (!db) {\n throw error;\n }\n return db;\n };\n const getStore = async () => {\n const db = await getDB();\n const transaction = db.transaction(constants_1.STORE_NAME, 'readwrite');\n return transaction.objectStore(constants_1.STORE_NAME);\n };\n const _peek = async (n) => {\n const store = await getStore();\n const request = store.getAll(undefined, n);\n await promisifyIDBRequest(request);\n return request.result.map(item => item);\n };\n return {\n async add(item, { dequeueBeforeEnqueue } = { dequeueBeforeEnqueue: false }) {\n if (dequeueBeforeEnqueue) {\n const itemsToDelete = await this.peek(1);\n await this.delete(itemsToDelete);\n }\n const store = await getStore();\n const itemBytesSize = (0, getAddItemBytesSize_1.getAddItemBytesSize)(item);\n const queuedItem = {\n ...item,\n bytesSize: itemBytesSize,\n };\n const request = store.add(queuedItem);\n await promisifyIDBRequest(request);\n currentBytesSize += itemBytesSize;\n },\n async peek(n) {\n return _peek(n);\n },\n async peekAll() {\n return _peek();\n },\n async delete(items) {\n if (!items.length) {\n return;\n }\n const store = await getStore();\n // delete by range to improve performance\n const keyRangesToDelete = findRanges(items\n .map(item => item.id)\n .filter((id) => id !== undefined)).map(([lower, upper]) => IDBKeyRange.bound(lower, upper));\n await Promise.all(keyRangesToDelete.map(range => promisifyIDBRequest(store.delete(range))));\n for (const item of items) {\n currentBytesSize -= item.bytesSize;\n }\n },\n async clear() {\n const store = await getStore();\n await store.clear();\n currentBytesSize = 0;\n },\n isFull(maxBytesSizeInMiB) {\n return currentBytesSize >= maxBytesSizeInMiB * 1024 * 1024;\n },\n };\n};\nexports.createQueuedStorage = createQueuedStorage;\nconst promisifyIDBRequest = (request) => new Promise((resolve, reject) => {\n request.onsuccess = () => {\n resolve();\n };\n request.onerror = () => {\n reject(request.error);\n };\n});\nconst findRanges = (input) => {\n const nums = input.concat().sort((a, b) => a - b);\n const result = [];\n let rangeLength = 1;\n for (let i = 1; i <= nums.length; i++) {\n if (i === nums.length || nums[i] - nums[i - 1] !== 1) {\n if (rangeLength === 1) {\n result.push([nums[i - rangeLength], nums[i - rangeLength]]);\n }\n else {\n result.push([nums[i - rangeLength], nums[i - 1]]);\n }\n rangeLength = 1;\n }\n else {\n rangeLength += 1;\n }\n }\n return result;\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC9D,MAAM,mBAAmB,GAAG,MAAM;AAClC,IAAI,IAAI,gBAAgB,GAAG,CAAC;AAC5B,IAAI,IAAI,KAAK;AACb,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC3D,QAAQ,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM;AACpC,QAAQ,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC;AACxE,QAAQ,WAAW,CAAC,eAAe,GAAG,MAAM;AAC5C,YAAY,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM;AACzC,YAAY,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;AACvE,gBAAgB,EAAE,CAAC,iBAAiB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,KAAK;AACL,IAAI,OAAO,CAAC,OAAO,GAAG,MAAM;AAC5B,QAAQ,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B,KAAK;AACL,CAAC,CAAC;AACF,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACrD,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,IAAI,WAAW,GAAG,CAAC;AACvB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;AAC9D,YAAY,IAAI,WAAW,KAAK,CAAC,EAAE;AACnC,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;AAC3E;AACA,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjE;AACA,YAAY,WAAW,GAAG,CAAC;AAC3B;AACA,aAAa;AACb,YAAY,WAAW,IAAI,CAAC;AAC5B;AACA;AACA,IAAI,OAAO,MAAM;AACjB,CAAC;;"}
1
+ {"version":3,"file":"createQueuedStorage.js","sources":["../../../../src/utils/queuedStorage/createQueuedStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createQueuedStorage = void 0;\nconst constants_1 = require(\"./constants\");\nconst getAddItemBytesSize_1 = require(\"./getAddItemBytesSize\");\nconst createQueuedStorage = () => {\n let currentBytesSize = 0;\n let error;\n const openDBPromise = new Promise((resolve, reject) => {\n const { indexedDB } = window;\n const openRequest = indexedDB.open(constants_1.DATABASE_NAME, 1);\n openRequest.onupgradeneeded = () => {\n const db = openRequest.result;\n if (!db.objectStoreNames.contains(constants_1.STORE_NAME)) {\n db.createObjectStore(constants_1.STORE_NAME, {\n keyPath: 'id',\n autoIncrement: true,\n });\n }\n };\n openRequest.onsuccess = async () => {\n const db = openRequest.result;\n const transaction = db.transaction(constants_1.STORE_NAME, 'readonly');\n const request = transaction.objectStore(constants_1.STORE_NAME).getAll();\n await promisifyIDBRequest(request);\n for (const item of request.result) {\n currentBytesSize += item.bytesSize;\n }\n resolve(openRequest.result);\n };\n openRequest.onerror = () => {\n reject(openRequest.error);\n };\n }).catch(err => {\n error = err;\n return undefined;\n });\n const getDB = async () => {\n const db = await openDBPromise;\n if (!db) {\n throw error;\n }\n return db;\n };\n const getStore = async () => {\n const db = await getDB();\n const transaction = db.transaction(constants_1.STORE_NAME, 'readwrite');\n return transaction.objectStore(constants_1.STORE_NAME);\n };\n const _peek = async (n) => {\n const store = await getStore();\n const request = store.getAll(undefined, n);\n await promisifyIDBRequest(request);\n return request.result.map(item => item);\n };\n return {\n async add(item, { dequeueBeforeEnqueue } = { dequeueBeforeEnqueue: false }) {\n if (dequeueBeforeEnqueue) {\n const itemsToDelete = await this.peek(1);\n await this.delete(itemsToDelete);\n }\n const store = await getStore();\n const itemBytesSize = (0, getAddItemBytesSize_1.getAddItemBytesSize)(item);\n const queuedItem = {\n ...item,\n bytesSize: itemBytesSize,\n };\n const request = store.add(queuedItem);\n await promisifyIDBRequest(request);\n currentBytesSize += itemBytesSize;\n },\n async peek(n) {\n return _peek(n);\n },\n async peekAll() {\n return _peek();\n },\n async delete(items) {\n if (!items.length) {\n return;\n }\n const store = await getStore();\n // delete by range to improve performance\n const keyRangesToDelete = findRanges(items\n .map(item => item.id)\n .filter((id) => id !== undefined)).map(([lower, upper]) => IDBKeyRange.bound(lower, upper));\n await Promise.all(keyRangesToDelete.map(range => promisifyIDBRequest(store.delete(range))));\n for (const item of items) {\n currentBytesSize -= item.bytesSize;\n }\n },\n async clear() {\n const store = await getStore();\n await store.clear();\n currentBytesSize = 0;\n },\n isFull(maxBytesSizeInMiB) {\n return currentBytesSize >= maxBytesSizeInMiB * 1024 * 1024;\n },\n };\n};\nexports.createQueuedStorage = createQueuedStorage;\nconst promisifyIDBRequest = (request) => new Promise((resolve, reject) => {\n request.onsuccess = () => {\n resolve();\n };\n request.onerror = () => {\n reject(request.error);\n };\n});\nconst findRanges = (input) => {\n const nums = input.concat().sort((a, b) => a - b);\n const result = [];\n let rangeLength = 1;\n for (let i = 1; i <= nums.length; i++) {\n if (i === nums.length || nums[i] - nums[i - 1] !== 1) {\n if (rangeLength === 1) {\n result.push([nums[i - rangeLength], nums[i - rangeLength]]);\n }\n else {\n result.push([nums[i - rangeLength], nums[i - 1]]);\n }\n rangeLength = 1;\n }\n else {\n rangeLength += 1;\n }\n }\n return result;\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,MAAM;AACpC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC9D,MAAM,mBAAmB,GAAG,MAAM;AAClC,IAAI,IAAI,gBAAgB,GAAG,CAAC;AAC5B,IAAI,IAAI,KAAK;AACb,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC3D,QAAQ,MAAM,EAAE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