@aws-amplify/core 6.11.4 → 6.11.5-local-stack.00864ae.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.
- package/dist/cjs/BackgroundProcessManager/types.js +5 -1
- package/dist/cjs/BackgroundProcessManager/types.js.map +1 -1
- package/dist/cjs/Cache/constants.js +3 -3
- package/dist/cjs/Cache/constants.js.map +1 -1
- package/dist/cjs/Cache/utils/cacheHelpers.js +4 -4
- package/dist/cjs/Cache/utils/cacheHelpers.js.map +1 -1
- package/dist/cjs/Cache/utils/errorHelpers.js +1 -1
- package/dist/cjs/Cache/utils/errorHelpers.js.map +1 -1
- package/dist/cjs/I18n/errorHelpers.js +1 -1
- package/dist/cjs/I18n/errorHelpers.js.map +1 -1
- package/dist/cjs/Logger/types.js +2 -1
- package/dist/cjs/Logger/types.js.map +1 -1
- package/dist/cjs/Platform/detectFramework.js +2 -2
- package/dist/cjs/Platform/detectFramework.js.map +1 -1
- package/dist/cjs/Platform/detection/Angular.js +2 -3
- package/dist/cjs/Platform/detection/Angular.js.map +1 -1
- package/dist/cjs/Platform/detection/Expo.js +1 -2
- package/dist/cjs/Platform/detection/Expo.js.map +1 -1
- package/dist/cjs/Platform/detection/Next.js +2 -3
- package/dist/cjs/Platform/detection/Next.js.map +1 -1
- package/dist/cjs/Platform/detection/Nuxt.js +2 -3
- package/dist/cjs/Platform/detection/Nuxt.js.map +1 -1
- package/dist/cjs/Platform/detection/React.js +2 -3
- package/dist/cjs/Platform/detection/React.js.map +1 -1
- package/dist/cjs/Platform/detection/ReactNative.js +1 -2
- package/dist/cjs/Platform/detection/ReactNative.js.map +1 -1
- package/dist/cjs/Platform/detection/Svelte.js +2 -3
- package/dist/cjs/Platform/detection/Svelte.js.map +1 -1
- package/dist/cjs/Platform/detection/Vue.js +2 -3
- package/dist/cjs/Platform/detection/Vue.js.map +1 -1
- package/dist/cjs/Platform/detection/Web.js +1 -2
- package/dist/cjs/Platform/detection/Web.js.map +1 -1
- package/dist/cjs/Platform/detection/index.js +1 -2
- package/dist/cjs/Platform/detection/index.js.map +1 -1
- package/dist/cjs/Platform/types.js +28 -14
- package/dist/cjs/Platform/types.js.map +1 -1
- package/dist/cjs/Platform/version.js +1 -1
- package/dist/cjs/Platform/version.js.map +1 -1
- package/dist/cjs/ServiceWorker/errorHelpers.js +1 -1
- package/dist/cjs/ServiceWorker/errorHelpers.js.map +1 -1
- package/dist/cjs/awsClients/pinpoint/errorHelpers.js +1 -1
- package/dist/cjs/awsClients/pinpoint/errorHelpers.js.map +1 -1
- package/dist/cjs/foundation/factories/middleware/createDisableCacheMiddleware.js +15 -0
- package/dist/cjs/foundation/factories/middleware/createDisableCacheMiddleware.js.map +1 -0
- package/dist/cjs/foundation/factories/middleware/index.js +9 -0
- package/dist/cjs/foundation/factories/middleware/index.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.js +14 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/constants.js +18 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/constants.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.js +37 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.js +32 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.js +17 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/index.js +9 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/index.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/index.js +13 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/index.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.js +24 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/index.js +9 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/index.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/index.js +9 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/index.js.map +1 -0
- package/dist/cjs/{awsClients/cognitoIdentity/types.js → foundation/factories/serviceClients/cognitoIdentity/types/sdk.js} +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/sdk.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.js +6 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.js.map +1 -0
- package/dist/cjs/index.js +6 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parseAmplifyOutputs.js +3 -4
- package/dist/cjs/parseAmplifyOutputs.js.map +1 -1
- package/dist/cjs/providers/pinpoint/types/errors.js +2 -1
- package/dist/cjs/providers/pinpoint/types/errors.js.map +1 -1
- package/dist/cjs/singleton/API/types.js +5 -1
- package/dist/cjs/singleton/API/types.js.map +1 -1
- package/dist/cjs/singleton/Auth/index.js +12 -0
- package/dist/cjs/singleton/Auth/index.js.map +1 -1
- package/dist/cjs/singleton/Auth/utils/errorHelpers.js +1 -1
- package/dist/cjs/singleton/Auth/utils/errorHelpers.js.map +1 -1
- package/dist/cjs/singleton/Auth/utils/index.js +4 -5
- package/dist/cjs/singleton/Auth/utils/index.js.map +1 -1
- package/dist/cjs/singleton/apis/clearCredentials.js +1 -2
- package/dist/cjs/singleton/apis/clearCredentials.js.map +1 -1
- package/dist/cjs/types/errors.js +2 -1
- package/dist/cjs/types/errors.js.map +1 -1
- package/dist/cjs/utils/convert/base64/bytesToString.js +1 -2
- package/dist/cjs/utils/convert/base64/bytesToString.js.map +1 -1
- package/dist/cjs/utils/cryptoSecureRandomInt.js +1 -2
- package/dist/cjs/utils/cryptoSecureRandomInt.js.map +1 -1
- package/dist/cjs/utils/getClientInfo/getClientInfo.js +1 -2
- package/dist/cjs/utils/getClientInfo/getClientInfo.js.map +1 -1
- package/dist/cjs/utils/isTokenExpired.js +1 -2
- package/dist/cjs/utils/isTokenExpired.js.map +1 -1
- package/dist/cjs/utils/retry/jitteredBackoff.js +1 -2
- package/dist/cjs/utils/retry/jitteredBackoff.js.map +1 -1
- package/dist/cjs/utils/retry/retry.js +1 -2
- package/dist/cjs/utils/retry/retry.js.map +1 -1
- package/dist/cjs/utils/urlSafeDecode.js +1 -2
- package/dist/cjs/utils/urlSafeDecode.js.map +1 -1
- package/dist/cjs/utils/urlSafeEncode.js +1 -2
- package/dist/cjs/utils/urlSafeEncode.js.map +1 -1
- package/dist/esm/Cache/constants.mjs +3 -3
- package/dist/esm/Cache/constants.mjs.map +1 -1
- package/dist/esm/Platform/version.d.ts +1 -1
- package/dist/esm/Platform/version.mjs +1 -1
- package/dist/esm/Platform/version.mjs.map +1 -1
- package/dist/esm/awsClients/pinpoint/base.d.ts +1 -1
- package/dist/esm/awsClients/pinpoint/getInAppMessages.d.ts +2 -2
- package/dist/esm/awsClients/pinpoint/putEvents.d.ts +2 -2
- package/dist/esm/awsClients/pinpoint/updateEndpoint.d.ts +2 -2
- package/dist/esm/clients/internal/composeServiceApi.d.ts +4 -1
- package/dist/esm/clients/internal/composeTransferHandler.d.ts +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +1 -1
- package/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +1 -1
- package/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.d.ts +5 -0
- package/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.mjs +12 -0
- package/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.mjs.map +1 -0
- package/dist/esm/foundation/factories/middleware/index.d.ts +1 -0
- package/dist/esm/foundation/factories/middleware/index.mjs +2 -0
- package/dist/esm/{awsClients/cognitoIdentity → foundation/factories/middleware}/index.mjs.map +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.d.ts +4 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.mjs +27 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.d.ts +10 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.mjs +34 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.d.ts +14 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs +50 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.d.ts +14 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs +45 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.d.ts +8 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.mjs +31 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/index.d.ts +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/index.mjs +2 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/index.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/index.d.ts +4 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/index.mjs +4 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/index.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.d.ts +3 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.mjs +20 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/index.d.ts +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/index.mjs +2 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/index.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/index.d.ts +3 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/index.mjs +2 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/index.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/sdk.mjs +2 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/sdk.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.d.ts +6 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.mjs +2 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.mjs.map +1 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/singleton/Auth/index.mjs +13 -0
- package/dist/esm/singleton/Auth/index.mjs.map +1 -1
- package/dist/esm/singleton/Auth/types.d.ts +8 -0
- package/dist/esm/utils/amplifyUrl/index.d.ts +4 -3
- package/dist/esm/utils/amplifyUrl/index.native.d.ts +4 -3
- package/dist/esm/utils/queuedStorage/createQueuedStorage.native.d.ts +1 -1
- package/internals/aws-clients/cognitoIdentity/package.json +4 -4
- package/package.json +9 -10
- package/src/Platform/version.ts +1 -1
- package/src/foundation/factories/middleware/createDisableCacheMiddleware.ts +18 -0
- package/src/foundation/factories/middleware/index.ts +4 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.ts +15 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/constants.ts +20 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.ts +62 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.ts +48 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.ts +23 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/handler/index.ts +4 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/index.ts +12 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.ts +29 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/serde/index.ts +4 -0
- package/src/foundation/factories/serviceClients/cognitoIdentity/types/index.ts +9 -0
- package/src/{awsClients/cognitoIdentity/types.ts → foundation/factories/serviceClients/cognitoIdentity/types/sdk.ts} +0 -2
- package/src/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.ts +8 -0
- package/src/index.ts +5 -4
- package/src/singleton/Auth/index.ts +19 -0
- package/src/singleton/Auth/types.ts +8 -0
- package/dist/cjs/awsClients/cognitoIdentity/base.js +0 -69
- package/dist/cjs/awsClients/cognitoIdentity/base.js.map +0 -1
- package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js +0 -41
- package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js.map +0 -1
- package/dist/cjs/awsClients/cognitoIdentity/getId.js +0 -32
- package/dist/cjs/awsClients/cognitoIdentity/getId.js.map +0 -1
- package/dist/cjs/awsClients/cognitoIdentity/index.js +0 -11
- package/dist/cjs/awsClients/cognitoIdentity/index.js.map +0 -1
- package/dist/cjs/awsClients/cognitoIdentity/types.js.map +0 -1
- package/dist/esm/awsClients/cognitoIdentity/base.d.ts +0 -29
- package/dist/esm/awsClients/cognitoIdentity/base.mjs +0 -83
- package/dist/esm/awsClients/cognitoIdentity/base.mjs.map +0 -1
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +0 -18
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs +0 -56
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs.map +0 -1
- package/dist/esm/awsClients/cognitoIdentity/getId.d.ts +0 -18
- package/dist/esm/awsClients/cognitoIdentity/getId.mjs +0 -47
- package/dist/esm/awsClients/cognitoIdentity/getId.mjs.map +0 -1
- package/dist/esm/awsClients/cognitoIdentity/index.d.ts +0 -2
- package/dist/esm/awsClients/cognitoIdentity/index.mjs +0 -3
- package/dist/esm/awsClients/cognitoIdentity/types.mjs +0 -2
- package/dist/esm/awsClients/cognitoIdentity/types.mjs.map +0 -1
- package/src/awsClients/cognitoIdentity/base.ts +0 -101
- package/src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts +0 -77
- package/src/awsClients/cognitoIdentity/getId.ts +0 -61
- package/src/awsClients/cognitoIdentity/index.ts +0 -9
- /package/dist/esm/{awsClients/cognitoIdentity/types.d.ts → foundation/factories/serviceClients/cognitoIdentity/types/sdk.d.ts} +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.
|
|
6
|
+
exports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.cognitoIdentityPoolEndpointResolver = exports.createGetIdClient = exports.createGetCredentialsForIdentityClient = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.decodeJWT = exports.Hub = void 0;
|
|
7
7
|
/*
|
|
8
8
|
This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
|
|
9
9
|
*/
|
|
@@ -17,10 +17,11 @@ Object.defineProperty(exports, "Amplify", { enumerable: true, get: function () {
|
|
|
17
17
|
Object.defineProperty(exports, "fetchAuthSession", { enumerable: true, get: function () { return singleton_1.fetchAuthSession; } });
|
|
18
18
|
Object.defineProperty(exports, "AmplifyClassV6", { enumerable: true, get: function () { return singleton_1.AmplifyClass; } });
|
|
19
19
|
Object.defineProperty(exports, "clearCredentials", { enumerable: true, get: function () { return singleton_1.clearCredentials; } });
|
|
20
|
-
//
|
|
21
|
-
var cognitoIdentity_1 = require("./
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
Object.defineProperty(exports, "
|
|
20
|
+
// Cognito Identity service client factories
|
|
21
|
+
var cognitoIdentity_1 = require("./foundation/factories/serviceClients/cognitoIdentity");
|
|
22
|
+
Object.defineProperty(exports, "createGetCredentialsForIdentityClient", { enumerable: true, get: function () { return cognitoIdentity_1.createGetCredentialsForIdentityClient; } });
|
|
23
|
+
Object.defineProperty(exports, "createGetIdClient", { enumerable: true, get: function () { return cognitoIdentity_1.createGetIdClient; } });
|
|
24
|
+
Object.defineProperty(exports, "cognitoIdentityPoolEndpointResolver", { enumerable: true, get: function () { return cognitoIdentity_1.cognitoIdentityPoolEndpointResolver; } });
|
|
24
25
|
// Storage helpers
|
|
25
26
|
var storage_1 = require("./storage");
|
|
26
27
|
Object.defineProperty(exports, "CookieStorage", { enumerable: true, get: function () { return storage_1.CookieStorage; } });
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/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.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/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.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.cognitoIdentityPoolEndpointResolver = exports.createGetIdClient = exports.createGetCredentialsForIdentityClient = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.decodeJWT = exports.Hub = void 0;\n/*\nThis file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.\n*/\n// Hub exports\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"Hub\", { enumerable: true, get: function () { return Hub_1.Hub; } });\nvar utils_1 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_1.decodeJWT; } });\nvar singleton_1 = require(\"./singleton\");\nObject.defineProperty(exports, \"Amplify\", { enumerable: true, get: function () { return singleton_1.Amplify; } });\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return singleton_1.fetchAuthSession; } });\nObject.defineProperty(exports, \"AmplifyClassV6\", { enumerable: true, get: function () { return singleton_1.AmplifyClass; } });\nObject.defineProperty(exports, \"clearCredentials\", { enumerable: true, get: function () { return singleton_1.clearCredentials; } });\n// Cognito Identity service client factories\nvar cognitoIdentity_1 = require(\"./foundation/factories/serviceClients/cognitoIdentity\");\nObject.defineProperty(exports, \"createGetCredentialsForIdentityClient\", { enumerable: true, get: function () { return cognitoIdentity_1.createGetCredentialsForIdentityClient; } });\nObject.defineProperty(exports, \"createGetIdClient\", { enumerable: true, get: function () { return cognitoIdentity_1.createGetIdClient; } });\nObject.defineProperty(exports, \"cognitoIdentityPoolEndpointResolver\", { enumerable: true, get: function () { return cognitoIdentity_1.cognitoIdentityPoolEndpointResolver; } });\n// Storage helpers\nvar storage_1 = require(\"./storage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return storage_1.CookieStorage; } });\nObject.defineProperty(exports, \"defaultStorage\", { enumerable: true, get: function () { return storage_1.defaultStorage; } });\nObject.defineProperty(exports, \"sessionStorage\", { enumerable: true, get: function () { return storage_1.sessionStorage; } });\nObject.defineProperty(exports, \"syncSessionStorage\", { enumerable: true, get: function () { return storage_1.syncSessionStorage; } });\nObject.defineProperty(exports, \"sharedInMemoryStorage\", { enumerable: true, get: function () { return storage_1.sharedInMemoryStorage; } });\n// Cache exports\nvar Cache_1 = require(\"./Cache\");\nObject.defineProperty(exports, \"Cache\", { enumerable: true, get: function () { return Cache_1.Cache; } });\n// Internationalization utilities\nvar I18n_1 = require(\"./I18n\");\nObject.defineProperty(exports, \"I18n\", { enumerable: true, get: function () { return I18n_1.I18n; } });\n// Logging utilities\nvar Logger_1 = require(\"./Logger\");\nObject.defineProperty(exports, \"ConsoleLogger\", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });\n// Service worker\nvar ServiceWorker_1 = require(\"./ServiceWorker\");\nObject.defineProperty(exports, \"ServiceWorker\", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorker; } });\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,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,mCAAmC,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,qCAAqC,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,GAAG,MAAM;AACzd;AACA;AACA;AACA;AACA,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;AAC5B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACnG,IAAI,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC/C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;AACjH,IAAI,WAAW,GAAG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I,CAAC,EAAE,EAAE,CAAC;AACtG;AACA,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AAC1H;AACA,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;;"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.isAmplifyOutputs = isAmplifyOutputs;
|
|
7
|
+
exports.parseAnalytics = parseAnalytics;
|
|
8
|
+
exports.parseAmplifyOutputs = parseAmplifyOutputs;
|
|
7
9
|
function isAmplifyOutputs(config) {
|
|
8
10
|
// version format initially will be '1' but is expected to be something like x.y where x is major and y minor version
|
|
9
11
|
const { version } = config;
|
|
@@ -12,7 +14,6 @@ function isAmplifyOutputs(config) {
|
|
|
12
14
|
}
|
|
13
15
|
return version.startsWith('1');
|
|
14
16
|
}
|
|
15
|
-
exports.isAmplifyOutputs = isAmplifyOutputs;
|
|
16
17
|
function parseStorage(amplifyOutputsStorageProperties) {
|
|
17
18
|
if (!amplifyOutputsStorageProperties) {
|
|
18
19
|
return undefined;
|
|
@@ -101,7 +102,6 @@ function parseAnalytics(amplifyOutputsAnalyticsProperties) {
|
|
|
101
102
|
},
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
|
-
exports.parseAnalytics = parseAnalytics;
|
|
105
105
|
function parseGeo(amplifyOutputsAnalyticsProperties) {
|
|
106
106
|
if (!amplifyOutputsAnalyticsProperties) {
|
|
107
107
|
return undefined;
|
|
@@ -205,7 +205,6 @@ function parseAmplifyOutputs(amplifyOutputs) {
|
|
|
205
205
|
}
|
|
206
206
|
return resourcesConfig;
|
|
207
207
|
}
|
|
208
|
-
exports.parseAmplifyOutputs = parseAmplifyOutputs;
|
|
209
208
|
const authModeNames = {
|
|
210
209
|
AMAZON_COGNITO_USER_POOLS: 'userPool',
|
|
211
210
|
API_KEY: 'apiKey',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseAmplifyOutputs.js","sources":["../../src/parseAmplifyOutputs.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.parseAmplifyOutputs = exports.parseAnalytics = exports.isAmplifyOutputs = void 0;\nfunction isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nexports.isAmplifyOutputs = isAmplifyOutputs;\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, groups, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n groups,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nfunction parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nexports.parseAnalytics = parseAnalytics;\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseCustom(amplifyOutputsCustomProperties) {\n if (!amplifyOutputsCustomProperties?.events) {\n return undefined;\n }\n const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;\n const Events = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n };\n return {\n Events,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nfunction parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.custom) {\n const customConfig = parseCustom(amplifyOutputs.custom);\n if (customConfig && 'Events' in customConfig) {\n resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };\n }\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nexports.parseAmplifyOutputs = parseAmplifyOutputs;\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region, paths }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n const sanitizedPaths = paths\n ? Object.entries(paths).reduce((acc, [key, value]) => {\n if (value !== undefined) {\n acc[key] = value;\n }\n return acc;\n }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B,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AACpC;AACA,gBAAgB,OAAO,GAAG;AAC1B,aAAa,EAAE,EAAE;AACjB,cAAc,SAAS;AACvB,QAAQ,aAAa,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,KAAK,EAAE,cAAc;AACjC,SAAS;AACT,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB;;"}
|
|
1
|
+
{"version":3,"file":"parseAmplifyOutputs.js","sources":["../../src/parseAmplifyOutputs.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.isAmplifyOutputs = isAmplifyOutputs;\nexports.parseAnalytics = parseAnalytics;\nexports.parseAmplifyOutputs = parseAmplifyOutputs;\nfunction isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, groups, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n groups,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nfunction parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseCustom(amplifyOutputsCustomProperties) {\n if (!amplifyOutputsCustomProperties?.events) {\n return undefined;\n }\n const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;\n const Events = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n };\n return {\n Events,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nfunction parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.custom) {\n const customConfig = parseCustom(amplifyOutputs.custom);\n if (customConfig && 'Events' in customConfig) {\n resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };\n }\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region, paths }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n const sanitizedPaths = paths\n ? Object.entries(paths).reduce((acc, [key, value]) => {\n if (value !== undefined) {\n acc[key] = value;\n }\n return acc;\n }, {})\n : undefined;\n mappedBuckets[name] = {\n bucketName,\n region,\n paths: sanitizedPaths,\n };\n });\n return mappedBuckets;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EA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T,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB;;"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.UpdateEndpointException = void 0;
|
|
7
|
+
var UpdateEndpointException;
|
|
7
8
|
(function (UpdateEndpointException) {
|
|
8
9
|
UpdateEndpointException["BadRequestException"] = "BadRequestException";
|
|
9
10
|
UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
|
|
@@ -12,5 +13,5 @@ exports.UpdateEndpointException = void 0;
|
|
|
12
13
|
UpdateEndpointException["NotFoundException"] = "NotFoundException";
|
|
13
14
|
UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
|
|
14
15
|
UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
|
|
15
|
-
})(
|
|
16
|
+
})(UpdateEndpointException || (exports.UpdateEndpointException = UpdateEndpointException = {}));
|
|
16
17
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../../../../src/providers/pinpoint/types/errors.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.UpdateEndpointException = void 0;\nvar UpdateEndpointException;\n(function (UpdateEndpointException) {\n UpdateEndpointException[\"BadRequestException\"] = \"BadRequestException\";\n UpdateEndpointException[\"ForbiddenException\"] = \"ForbiddenException\";\n UpdateEndpointException[\"InternalServerErrorException\"] = \"InternalServerErrorException\";\n UpdateEndpointException[\"MethodNotAllowedException\"] = \"MethodNotAllowedException\";\n UpdateEndpointException[\"NotFoundException\"] = \"NotFoundException\";\n UpdateEndpointException[\"PayloadTooLargeException\"] = \"PayloadTooLargeException\";\n UpdateEndpointException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n})(UpdateEndpointException
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../../../../src/providers/pinpoint/types/errors.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.UpdateEndpointException = void 0;\nvar UpdateEndpointException;\n(function (UpdateEndpointException) {\n UpdateEndpointException[\"BadRequestException\"] = \"BadRequestException\";\n UpdateEndpointException[\"ForbiddenException\"] = \"ForbiddenException\";\n UpdateEndpointException[\"InternalServerErrorException\"] = \"InternalServerErrorException\";\n UpdateEndpointException[\"MethodNotAllowedException\"] = \"MethodNotAllowedException\";\n UpdateEndpointException[\"NotFoundException\"] = \"NotFoundException\";\n UpdateEndpointException[\"PayloadTooLargeException\"] = \"PayloadTooLargeException\";\n UpdateEndpointException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n})(UpdateEndpointException || (exports.UpdateEndpointException = UpdateEndpointException = {}));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,MAAM;AACxC,IAAI,uBAAuB;AAC3B,CAAC,UAAU,uBAAuB,EAAE;AACpC,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,oBAAoB,CAAC,GAAG,oBAAoB;AACxE,IAAI,uBAAuB,CAAC,8BAA8B,CAAC,GAAG,8BAA8B;AAC5F,IAAI,uBAAuB,CAAC,2BAA2B,CAAC,GAAG,2BAA2B;AACtF,IAAI,uBAAuB,CAAC,mBAAmB,CAAC,GAAG,mBAAmB;AACtE,IAAI,uBAAuB,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACpF,IAAI,uBAAuB,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACpF,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,GAAG,uBAAuB,GAAG,EAAE,CAAC,CAAC;;"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.CodeGenConnectionType = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Field-level Relationship Definitions
|
|
7
|
+
*/
|
|
8
|
+
var CodeGenConnectionType;
|
|
5
9
|
(function (CodeGenConnectionType) {
|
|
6
10
|
CodeGenConnectionType["HAS_ONE"] = "HAS_ONE";
|
|
7
11
|
CodeGenConnectionType["BELONGS_TO"] = "BELONGS_TO";
|
|
8
12
|
CodeGenConnectionType["HAS_MANY"] = "HAS_MANY";
|
|
9
|
-
})(
|
|
13
|
+
})(CodeGenConnectionType || (exports.CodeGenConnectionType = CodeGenConnectionType = {}));
|
|
10
14
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../src/singleton/API/types.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeGenConnectionType = void 0;\n/**\n * Field-level Relationship Definitions\n */\nvar CodeGenConnectionType;\n(function (CodeGenConnectionType) {\n CodeGenConnectionType[\"HAS_ONE\"] = \"HAS_ONE\";\n CodeGenConnectionType[\"BELONGS_TO\"] = \"BELONGS_TO\";\n CodeGenConnectionType[\"HAS_MANY\"] = \"HAS_MANY\";\n})(CodeGenConnectionType
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/singleton/API/types.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeGenConnectionType = void 0;\n/**\n * Field-level Relationship Definitions\n */\nvar CodeGenConnectionType;\n(function (CodeGenConnectionType) {\n CodeGenConnectionType[\"HAS_ONE\"] = \"HAS_ONE\";\n CodeGenConnectionType[\"BELONGS_TO\"] = \"BELONGS_TO\";\n CodeGenConnectionType[\"HAS_MANY\"] = \"HAS_MANY\";\n})(CodeGenConnectionType || (exports.CodeGenConnectionType = CodeGenConnectionType = {}));\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,MAAM;AACtC;AACA;AACA;AACA,IAAI,qBAAqB;AACzB,CAAC,UAAU,qBAAqB,EAAE;AAClC,IAAI,qBAAqB,CAAC,SAAS,CAAC,GAAG,SAAS;AAChD,IAAI,qBAAqB,CAAC,YAAY,CAAC,GAAG,YAAY;AACtD,IAAI,qBAAqB,CAAC,UAAU,CAAC,GAAG,UAAU;AAClD,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,GAAG,EAAE,CAAC,CAAC;;"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.AuthClass = void 0;
|
|
5
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
const Logger_1 = require("../../Logger");
|
|
8
|
+
const logger = new Logger_1.ConsoleLogger('Auth');
|
|
5
9
|
class AuthClass {
|
|
6
10
|
/**
|
|
7
11
|
* Configure Auth category
|
|
@@ -16,6 +20,13 @@ class AuthClass {
|
|
|
16
20
|
configure(authResourcesConfig, authOptions) {
|
|
17
21
|
this.authConfig = authResourcesConfig;
|
|
18
22
|
this.authOptions = authOptions;
|
|
23
|
+
if (authResourcesConfig && authResourcesConfig.Cognito?.userPoolEndpoint) {
|
|
24
|
+
logger.warn(getCustomEndpointWarningMessage('Amazon Cognito User Pool'));
|
|
25
|
+
}
|
|
26
|
+
if (authResourcesConfig &&
|
|
27
|
+
authResourcesConfig.Cognito?.identityPoolEndpoint) {
|
|
28
|
+
logger.warn(getCustomEndpointWarningMessage('Amazon Cognito Identity Pool'));
|
|
29
|
+
}
|
|
19
30
|
}
|
|
20
31
|
/**
|
|
21
32
|
* Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it
|
|
@@ -66,4 +77,5 @@ class AuthClass {
|
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
79
|
exports.AuthClass = AuthClass;
|
|
80
|
+
const getCustomEndpointWarningMessage = (target) => `You are using a custom Amazon ${target} endpoint, ensure the endpoint is correct.`;
|
|
69
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;\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 }\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;\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,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,WAAW,GAAG,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,gBAAgB,CAAC,OAAO,GAAG,EAAE,EAAE;AACzC,QAAQ,IAAI,wBAAwB;AACpC,QAAQ,IAAI,OAAO;AACnB;AACA,QAAQ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;AACpD,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG;AACtD;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,MAAM;AAC1B,oBAAoB,aAAa,EAAE,IAAI;AACvC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC;AAClB;AACA,aAAa;AACb;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,aAAa,EAAE,KAAK;AACxC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC;AAClB;AACA,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;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;;"}
|
|
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,EAA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,IAAI;AACvC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC;AAClB;AACA,aAAa;AACb;AACA,YAAY,wBAAwB;AACpC,gBAAgB,MAAM,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;AACzF,oBAAoB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC/C,oBAAoB,aAAa,EAAE,KAAK;AACxC,oBAAoB,YAAY,EAAE,OAAO,CAAC,YAAY;AACtD,iBAAiB,CAAC;AAClB;AACA,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;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;;"}
|
|
@@ -12,7 +12,7 @@ var AuthConfigurationErrorCode;
|
|
|
12
12
|
AuthConfigurationErrorCode["AuthUserPoolException"] = "AuthUserPoolException";
|
|
13
13
|
AuthConfigurationErrorCode["InvalidIdentityPoolIdException"] = "InvalidIdentityPoolIdException";
|
|
14
14
|
AuthConfigurationErrorCode["OAuthNotConfigureException"] = "OAuthNotConfigureException";
|
|
15
|
-
})(AuthConfigurationErrorCode
|
|
15
|
+
})(AuthConfigurationErrorCode || (exports.AuthConfigurationErrorCode = AuthConfigurationErrorCode = {}));
|
|
16
16
|
const authConfigurationErrorMap = {
|
|
17
17
|
[AuthConfigurationErrorCode.AuthTokenConfigException]: {
|
|
18
18
|
message: 'Auth Token Provider not configured.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHelpers.js","sources":["../../../../../src/singleton/Auth/utils/errorHelpers.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.assert = exports.AuthConfigurationErrorCode = void 0;\nconst errors_1 = require(\"../../../errors\");\nvar AuthConfigurationErrorCode;\n(function (AuthConfigurationErrorCode) {\n AuthConfigurationErrorCode[\"AuthTokenConfigException\"] = \"AuthTokenConfigException\";\n AuthConfigurationErrorCode[\"AuthUserPoolAndIdentityPoolException\"] = \"AuthUserPoolAndIdentityPoolException\";\n AuthConfigurationErrorCode[\"AuthUserPoolException\"] = \"AuthUserPoolException\";\n AuthConfigurationErrorCode[\"InvalidIdentityPoolIdException\"] = \"InvalidIdentityPoolIdException\";\n AuthConfigurationErrorCode[\"OAuthNotConfigureException\"] = \"OAuthNotConfigureException\";\n})(AuthConfigurationErrorCode
|
|
1
|
+
{"version":3,"file":"errorHelpers.js","sources":["../../../../../src/singleton/Auth/utils/errorHelpers.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.assert = exports.AuthConfigurationErrorCode = void 0;\nconst errors_1 = require(\"../../../errors\");\nvar AuthConfigurationErrorCode;\n(function (AuthConfigurationErrorCode) {\n AuthConfigurationErrorCode[\"AuthTokenConfigException\"] = \"AuthTokenConfigException\";\n AuthConfigurationErrorCode[\"AuthUserPoolAndIdentityPoolException\"] = \"AuthUserPoolAndIdentityPoolException\";\n AuthConfigurationErrorCode[\"AuthUserPoolException\"] = \"AuthUserPoolException\";\n AuthConfigurationErrorCode[\"InvalidIdentityPoolIdException\"] = \"InvalidIdentityPoolIdException\";\n AuthConfigurationErrorCode[\"OAuthNotConfigureException\"] = \"OAuthNotConfigureException\";\n})(AuthConfigurationErrorCode || (exports.AuthConfigurationErrorCode = AuthConfigurationErrorCode = {}));\nconst authConfigurationErrorMap = {\n [AuthConfigurationErrorCode.AuthTokenConfigException]: {\n message: 'Auth Token Provider not configured.',\n recoverySuggestion: 'Make sure to call Amplify.configure in your app.',\n },\n [AuthConfigurationErrorCode.AuthUserPoolAndIdentityPoolException]: {\n message: 'Auth UserPool or IdentityPool not configured.',\n recoverySuggestion: 'Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId.',\n },\n [AuthConfigurationErrorCode.AuthUserPoolException]: {\n message: 'Auth UserPool not configured.',\n recoverySuggestion: 'Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId.',\n },\n [AuthConfigurationErrorCode.InvalidIdentityPoolIdException]: {\n message: 'Invalid identity pool id provided.',\n recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',\n },\n [AuthConfigurationErrorCode.OAuthNotConfigureException]: {\n message: 'oauth param not configured.',\n recoverySuggestion: 'Make sure to call Amplify.configure with oauth parameter in your app.',\n },\n};\nexports.assert = (0, errors_1.createAssertionFunction)(authConfigurationErrorMap);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,0BAA0B,GAAG,MAAM;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,IAAI,0BAA0B;AAC9B,CAAC,UAAU,0BAA0B,EAAE;AACvC,IAAI,0BAA0B,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACvF,IAAI,0BAA0B,CAAC,sCAAsC,CAAC,GAAG,sCAAsC;AAC/G,IAAI,0BAA0B,CAAC,uBAAuB,CAAC,GAAG,uBAAuB;AACjF,IAAI,0BAA0B,CAAC,gCAAgC,CAAC,GAAG,gCAAgC;AACnG,IAAI,0BAA0B,CAAC,4BAA4B,CAAC,GAAG,4BAA4B;AAC3F,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC,0BAA0B,GAAG,0BAA0B,GAAG,EAAE,CAAC,CAAC;AACxG,MAAM,yBAAyB,GAAG;AAClC,IAAI,CAAC,0BAA0B,CAAC,wBAAwB,GAAG;AAC3D,QAAQ,OAAO,EAAE,qCAAqC;AACtD,QAAQ,kBAAkB,EAAE,kDAAkD;AAC9E,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,oCAAoC,GAAG;AACvE,QAAQ,OAAO,EAAE,+CAA+C;AAChE,QAAQ,kBAAkB,EAAE,qFAAqF;AACjH,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,qBAAqB,GAAG;AACxD,QAAQ,OAAO,EAAE,+BAA+B;AAChD,QAAQ,kBAAkB,EAAE,uFAAuF;AACnH,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,8BAA8B,GAAG;AACjE,QAAQ,OAAO,EAAE,oCAAoC;AACrD,QAAQ,kBAAkB,EAAE,0DAA0D;AACtF,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,0BAA0B,GAAG;AAC7D,QAAQ,OAAO,EAAE,6BAA6B;AAC9C,QAAQ,kBAAkB,EAAE,uEAAuE;AACnG,KAAK;AACL,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,uBAAuB,EAAE,yBAAyB,CAAC;;"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.assertTokenProviderConfig = assertTokenProviderConfig;
|
|
5
|
+
exports.assertOAuthConfig = assertOAuthConfig;
|
|
6
|
+
exports.assertIdentityPoolIdConfig = assertIdentityPoolIdConfig;
|
|
7
|
+
exports.decodeJWT = decodeJWT;
|
|
5
8
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
10
|
const convert_1 = require("../../../utils/convert");
|
|
@@ -17,7 +20,6 @@ function assertTokenProviderConfig(cognitoConfig) {
|
|
|
17
20
|
}
|
|
18
21
|
(0, errorHelpers_1.assert)(assertionValid, errorHelpers_1.AuthConfigurationErrorCode.AuthUserPoolException);
|
|
19
22
|
}
|
|
20
|
-
exports.assertTokenProviderConfig = assertTokenProviderConfig;
|
|
21
23
|
function assertOAuthConfig(cognitoConfig) {
|
|
22
24
|
const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&
|
|
23
25
|
!!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&
|
|
@@ -25,12 +27,10 @@ function assertOAuthConfig(cognitoConfig) {
|
|
|
25
27
|
!!cognitoConfig?.loginWith?.oauth?.responseType;
|
|
26
28
|
(0, errorHelpers_1.assert)(validOAuthConfig, errorHelpers_1.AuthConfigurationErrorCode.OAuthNotConfigureException);
|
|
27
29
|
}
|
|
28
|
-
exports.assertOAuthConfig = assertOAuthConfig;
|
|
29
30
|
function assertIdentityPoolIdConfig(cognitoConfig) {
|
|
30
31
|
const validConfig = !!cognitoConfig?.identityPoolId;
|
|
31
32
|
(0, errorHelpers_1.assert)(validConfig, errorHelpers_1.AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
|
|
32
33
|
}
|
|
33
|
-
exports.assertIdentityPoolIdConfig = assertIdentityPoolIdConfig;
|
|
34
34
|
/**
|
|
35
35
|
* Decodes payload of JWT token
|
|
36
36
|
*
|
|
@@ -60,5 +60,4 @@ function decodeJWT(token) {
|
|
|
60
60
|
throw new Error('Invalid token payload');
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
exports.decodeJWT = decodeJWT;
|
|
64
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -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.
|
|
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,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,SAAS,yBAAyB,CAAC,aAAa,EAAE;AAClD,IAAI,IAAI,cAAc,GAAG,IAAI,CAAC;AAC9B,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,QAAQ,cAAc,GAAG,KAAK;AAC9B;AACA,SAAS;AACT,QAAQ,cAAc;AACtB,YAAY,CAAC,CAAC,aAAa,CAAC,UAAU,IAAI,CAAC,CAAC,aAAa,CAAC,gBAAgB;AAC1E;AACA,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,cAAc,CAAC,0BAA0B,CAAC,qBAAqB,CAAC;AAC/G;AACA,SAAS,iBAAiB,CAAC,aAAa,EAAE;AAC1C,IAAI,MAAM,gBAAgB,GAAG,CAAC,CAAC,aA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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;;"}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.clearCredentials =
|
|
6
|
+
exports.clearCredentials = clearCredentials;
|
|
7
7
|
const Amplify_1 = require("../Amplify");
|
|
8
8
|
function clearCredentials() {
|
|
9
9
|
return Amplify_1.Amplify.Auth.clearCredentials();
|
|
10
10
|
}
|
|
11
|
-
exports.clearCredentials = clearCredentials;
|
|
12
11
|
//# sourceMappingURL=clearCredentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearCredentials.js","sources":["../../../../src/singleton/apis/clearCredentials.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 =
|
|
1
|
+
{"version":3,"file":"clearCredentials.js","sources":["../../../../src/singleton/apis/clearCredentials.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 = clearCredentials;\nconst Amplify_1 = require(\"../Amplify\");\nfunction clearCredentials() {\n return Amplify_1.Amplify.Auth.clearCredentials();\n}\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,gBAAgB;AAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;AACvC,SAAS,gBAAgB,GAAG;AAC5B,IAAI,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;AACpD;;"}
|
package/dist/cjs/types/errors.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.AmplifyErrorCode = void 0;
|
|
5
|
+
var AmplifyErrorCode;
|
|
5
6
|
(function (AmplifyErrorCode) {
|
|
6
7
|
AmplifyErrorCode["NoEndpointId"] = "NoEndpointId";
|
|
7
8
|
AmplifyErrorCode["PlatformNotSupported"] = "PlatformNotSupported";
|
|
8
9
|
AmplifyErrorCode["Unknown"] = "Unknown";
|
|
9
10
|
AmplifyErrorCode["NetworkError"] = "NetworkError";
|
|
10
|
-
})(
|
|
11
|
+
})(AmplifyErrorCode || (exports.AmplifyErrorCode = AmplifyErrorCode = {}));
|
|
11
12
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../../src/types/errors.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AmplifyErrorCode = void 0;\nvar AmplifyErrorCode;\n(function (AmplifyErrorCode) {\n AmplifyErrorCode[\"NoEndpointId\"] = \"NoEndpointId\";\n AmplifyErrorCode[\"PlatformNotSupported\"] = \"PlatformNotSupported\";\n AmplifyErrorCode[\"Unknown\"] = \"Unknown\";\n AmplifyErrorCode[\"NetworkError\"] = \"NetworkError\";\n})(AmplifyErrorCode
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../../src/types/errors.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AmplifyErrorCode = void 0;\nvar AmplifyErrorCode;\n(function (AmplifyErrorCode) {\n AmplifyErrorCode[\"NoEndpointId\"] = \"NoEndpointId\";\n AmplifyErrorCode[\"PlatformNotSupported\"] = \"PlatformNotSupported\";\n AmplifyErrorCode[\"Unknown\"] = \"Unknown\";\n AmplifyErrorCode[\"NetworkError\"] = \"NetworkError\";\n})(AmplifyErrorCode || (exports.AmplifyErrorCode = AmplifyErrorCode = {}));\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,IAAI,gBAAgB;AACpB,CAAC,UAAU,gBAAgB,EAAE;AAC7B,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,cAAc;AACrD,IAAI,gBAAgB,CAAC,sBAAsB,CAAC,GAAG,sBAAsB;AACrE,IAAI,gBAAgB,CAAC,SAAS,CAAC,GAAG,SAAS;AAC3C,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,cAAc;AACrD,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,GAAG,EAAE,CAAC,CAAC;;"}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bytesToString =
|
|
6
|
+
exports.bytesToString = bytesToString;
|
|
7
7
|
function bytesToString(input) {
|
|
8
8
|
return Array.from(input, byte => String.fromCodePoint(byte)).join('');
|
|
9
9
|
}
|
|
10
|
-
exports.bytesToString = bytesToString;
|
|
11
10
|
//# sourceMappingURL=bytesToString.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytesToString.js","sources":["../../../../../src/utils/convert/base64/bytesToString.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.bytesToString =
|
|
1
|
+
{"version":3,"file":"bytesToString.js","sources":["../../../../../src/utils/convert/base64/bytesToString.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.bytesToString = bytesToString;\nfunction bytesToString(input) {\n return Array.from(input, byte => String.fromCodePoint(byte)).join('');\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,aAAa;AACrC,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACzE;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.cryptoSecureRandomInt =
|
|
6
|
+
exports.cryptoSecureRandomInt = cryptoSecureRandomInt;
|
|
7
7
|
const globalHelpers_1 = require("./globalHelpers");
|
|
8
8
|
/*
|
|
9
9
|
* Cryptographically secure pseudorandom number generator
|
|
@@ -14,5 +14,4 @@ function cryptoSecureRandomInt() {
|
|
|
14
14
|
const randomResult = crypto.getRandomValues(new Uint32Array(1))[0];
|
|
15
15
|
return randomResult;
|
|
16
16
|
}
|
|
17
|
-
exports.cryptoSecureRandomInt = cryptoSecureRandomInt;
|
|
18
17
|
//# sourceMappingURL=cryptoSecureRandomInt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoSecureRandomInt.js","sources":["../../../src/utils/cryptoSecureRandomInt.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.cryptoSecureRandomInt =
|
|
1
|
+
{"version":3,"file":"cryptoSecureRandomInt.js","sources":["../../../src/utils/cryptoSecureRandomInt.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.cryptoSecureRandomInt = cryptoSecureRandomInt;\nconst globalHelpers_1 = require(\"./globalHelpers\");\n/*\n * Cryptographically secure pseudorandom number generator\n * As Math.random() is cryptographically not safe to use\n */\nfunction cryptoSecureRandomInt() {\n const crypto = (0, globalHelpers_1.getCrypto)();\n const randomResult = crypto.getRandomValues(new Uint32Array(1))[0];\n return randomResult;\n}\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,qBAAqB;AACrD,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD;AACA;AACA;AACA;AACA,SAAS,qBAAqB,GAAG;AACjC,IAAI,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,SAAS,GAAG;AACnD,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,IAAI,OAAO,YAAY;AACvB;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getClientInfo =
|
|
4
|
+
exports.getClientInfo = getClientInfo;
|
|
5
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
const Logger_1 = require("../../Logger");
|
|
@@ -12,7 +12,6 @@ function getClientInfo() {
|
|
|
12
12
|
}
|
|
13
13
|
return browserClientInfo();
|
|
14
14
|
}
|
|
15
|
-
exports.getClientInfo = getClientInfo;
|
|
16
15
|
function browserClientInfo() {
|
|
17
16
|
if (typeof window === 'undefined') {
|
|
18
17
|
logger.warn('No window object available to get browser client info');
|
|
@@ -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 =
|
|
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,C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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;;"}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isTokenExpired =
|
|
6
|
+
exports.isTokenExpired = isTokenExpired;
|
|
7
7
|
function isTokenExpired({ expiresAt, clockDrift, tolerance = 5000, }) {
|
|
8
8
|
const currentTime = Date.now();
|
|
9
9
|
return currentTime + clockDrift + tolerance > expiresAt;
|
|
10
10
|
}
|
|
11
|
-
exports.isTokenExpired = isTokenExpired;
|
|
12
11
|
//# sourceMappingURL=isTokenExpired.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTokenExpired.js","sources":["../../../src/utils/isTokenExpired.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 =
|
|
1
|
+
{"version":3,"file":"isTokenExpired.js","sources":["../../../src/utils/isTokenExpired.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 = isTokenExpired;\nfunction isTokenExpired({ expiresAt, clockDrift, tolerance = 5000, }) {\n const currentTime = Date.now();\n return currentTime + clockDrift + tolerance > expiresAt;\n}\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,cAAc;AACvC,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,EAAE;AACtE,IAAI,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE;AAClC,IAAI,OAAO,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS;AAC3D;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.jitteredBackoff =
|
|
6
|
+
exports.jitteredBackoff = jitteredBackoff;
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
8
|
/**
|
|
9
9
|
* @private
|
|
@@ -17,5 +17,4 @@ function jitteredBackoff(maxDelayMs = constants_1.MAX_DELAY_MS) {
|
|
|
17
17
|
return delay > maxDelayMs ? false : delay;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.jitteredBackoff = jitteredBackoff;
|
|
21
20
|
//# sourceMappingURL=jitteredBackoff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jitteredBackoff.js","sources":["../../../../src/utils/retry/jitteredBackoff.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.jitteredBackoff =
|
|
1
|
+
{"version":3,"file":"jitteredBackoff.js","sources":["../../../../src/utils/retry/jitteredBackoff.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.jitteredBackoff = jitteredBackoff;\nconst constants_1 = require(\"./constants\");\n/**\n * @private\n * Internal use of Amplify only\n */\nfunction jitteredBackoff(maxDelayMs = constants_1.MAX_DELAY_MS) {\n const BASE_TIME_MS = 100;\n const JITTER_FACTOR = 100;\n return attempt => {\n const delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();\n return delay > maxDelayMs ? false : delay;\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,eAAe,GAAG,eAAe;AACzC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,UAAU,GAAG,WAAW,CAAC,YAAY,EAAE;AAChE,IAAI,MAAM,YAAY,GAAG,GAAG;AAC5B,IAAI,MAAM,aAAa,GAAG,GAAG;AAC7B,IAAI,OAAO,OAAO,IAAI;AACtB,QAAQ,MAAM,KAAK,GAAG,CAAC,IAAI,OAAO,GAAG,YAAY,GAAG,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE;AACjF,QAAQ,OAAO,KAAK,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK;AACjD,KAAK;AACL;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.retry =
|
|
6
|
+
exports.retry = retry;
|
|
7
7
|
const ConsoleLogger_1 = require("../../Logger/ConsoleLogger");
|
|
8
8
|
const isNonRetryableError_1 = require("./isNonRetryableError");
|
|
9
9
|
const logger = new ConsoleLogger_1.ConsoleLogger('retryUtil');
|
|
@@ -71,5 +71,4 @@ async function retry(functionToRetry, args, delayFn, onTerminate) {
|
|
|
71
71
|
reject(lastError);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
exports.retry = retry;
|
|
75
74
|
//# sourceMappingURL=retry.js.map
|