@aws-amplify/core 6.4.7-local-stack.0aa9031.0 → 6.4.7-unstable.847fb51.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/Platform/version.js +1 -1
- package/dist/cjs/Platform/version.js.map +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/base.js +69 -0
- package/dist/cjs/awsClients/cognitoIdentity/base.js.map +1 -0
- package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js +41 -0
- package/dist/cjs/awsClients/cognitoIdentity/getCredentialsForIdentity.js.map +1 -0
- package/dist/cjs/awsClients/cognitoIdentity/getId.js +32 -0
- package/dist/cjs/awsClients/cognitoIdentity/getId.js.map +1 -0
- package/dist/cjs/awsClients/cognitoIdentity/index.js +11 -0
- package/dist/cjs/awsClients/cognitoIdentity/index.js.map +1 -0
- package/dist/cjs/{foundation/factories/serviceClients/cognitoIdentity/types/sdk.js → awsClients/cognitoIdentity/types.js} +1 -1
- package/dist/cjs/awsClients/cognitoIdentity/types.js.map +1 -0
- package/dist/cjs/index.js +5 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parseAmplifyOutputs.js +21 -0
- package/dist/cjs/parseAmplifyOutputs.js.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/cognitoIdentity/base.d.ts +29 -0
- package/dist/esm/awsClients/cognitoIdentity/base.mjs +73 -0
- package/dist/esm/awsClients/cognitoIdentity/base.mjs.map +1 -0
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.d.ts +18 -0
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs +47 -0
- package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs.map +1 -0
- package/dist/esm/awsClients/cognitoIdentity/getId.d.ts +18 -0
- package/dist/esm/awsClients/cognitoIdentity/getId.mjs +38 -0
- package/dist/esm/awsClients/cognitoIdentity/getId.mjs.map +1 -0
- package/dist/esm/awsClients/cognitoIdentity/index.d.ts +2 -0
- package/dist/esm/awsClients/cognitoIdentity/index.mjs +3 -0
- package/dist/esm/{foundation/factories/middleware → awsClients/cognitoIdentity}/index.mjs.map +1 -1
- package/dist/esm/awsClients/cognitoIdentity/types.mjs +2 -0
- package/dist/esm/awsClients/cognitoIdentity/types.mjs.map +1 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.mjs +2 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/parseAmplifyOutputs.mjs +21 -0
- package/dist/esm/parseAmplifyOutputs.mjs.map +1 -1
- package/dist/esm/singleton/API/types.d.ts +34 -1
- package/dist/esm/singleton/AmplifyOutputs/types.d.ts +10 -0
- package/dist/esm/singleton/Auth/types.d.ts +0 -2
- package/package.json +3 -3
- package/src/Platform/version.ts +1 -1
- package/src/awsClients/cognitoIdentity/base.ts +101 -0
- package/src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts +77 -0
- package/src/awsClients/cognitoIdentity/getId.ts +61 -0
- package/src/awsClients/cognitoIdentity/index.ts +9 -0
- package/src/{foundation/factories/serviceClients/cognitoIdentity/types/sdk.ts → awsClients/cognitoIdentity/types.ts} +2 -0
- package/src/index.ts +6 -5
- package/src/parseAmplifyOutputs.ts +32 -1
- package/src/singleton/API/types.ts +38 -1
- package/src/singleton/AmplifyOutputs/types.ts +12 -0
- package/src/singleton/Auth/types.ts +0 -2
- package/dist/cjs/foundation/factories/middleware/createDisableCacheMiddleware.js +0 -15
- package/dist/cjs/foundation/factories/middleware/createDisableCacheMiddleware.js.map +0 -1
- package/dist/cjs/foundation/factories/middleware/index.js +0 -9
- package/dist/cjs/foundation/factories/middleware/index.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.js +0 -14
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/constants.js +0 -18
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/constants.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.js +0 -37
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.js +0 -32
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.js +0 -17
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/index.js +0 -9
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/handler/index.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/index.js +0 -13
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/index.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.js +0 -24
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/index.js +0 -9
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/serde/index.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/index.js +0 -9
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/index.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/sdk.js.map +0 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.js +0 -6
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.js.map +0 -1
- package/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.d.ts +0 -5
- package/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.mjs +0 -12
- package/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.mjs.map +0 -1
- package/dist/esm/foundation/factories/middleware/index.d.ts +0 -1
- package/dist/esm/foundation/factories/middleware/index.mjs +0 -2
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.d.ts +0 -4
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.mjs +0 -27
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.d.ts +0 -10
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.mjs +0 -23
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.d.ts +0 -14
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs +0 -42
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.d.ts +0 -14
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs +0 -37
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.d.ts +0 -8
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.mjs +0 -22
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/index.d.ts +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/index.mjs +0 -2
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/index.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/index.d.ts +0 -3
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/index.mjs +0 -4
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/index.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.d.ts +0 -3
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.mjs +0 -20
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/index.d.ts +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/index.mjs +0 -2
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/index.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/index.d.ts +0 -3
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/index.mjs +0 -2
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/index.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/sdk.mjs +0 -2
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/sdk.mjs.map +0 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.d.ts +0 -6
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.mjs +0 -2
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.mjs.map +0 -1
- package/src/foundation/factories/middleware/createDisableCacheMiddleware.ts +0 -18
- package/src/foundation/factories/middleware/index.ts +0 -4
- package/src/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.ts +0 -15
- package/src/foundation/factories/serviceClients/cognitoIdentity/constants.ts +0 -20
- package/src/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.ts +0 -62
- package/src/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.ts +0 -48
- package/src/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.ts +0 -23
- package/src/foundation/factories/serviceClients/cognitoIdentity/handler/index.ts +0 -4
- package/src/foundation/factories/serviceClients/cognitoIdentity/index.ts +0 -6
- package/src/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.ts +0 -29
- package/src/foundation/factories/serviceClients/cognitoIdentity/serde/index.ts +0 -4
- package/src/foundation/factories/serviceClients/cognitoIdentity/types/index.ts +0 -9
- package/src/foundation/factories/serviceClients/cognitoIdentity/types/serviceClient.ts +0 -8
- /package/dist/esm/{foundation/factories/serviceClients/cognitoIdentity/types/sdk.d.ts → awsClients/cognitoIdentity/types.d.ts} +0 -0
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.version = void 0;
|
|
5
5
|
// generated by genversion
|
|
6
|
-
exports.version = '6.6.7-
|
|
6
|
+
exports.version = '6.6.7-unstable.847fb51.0+847fb51';
|
|
7
7
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.6.7-
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.6.7-unstable.847fb51.0+847fb51';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,kCAAkC;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildHttpRpcRequest = exports.getSharedHeaders = exports.defaultConfig = exports.cognitoIdentityTransferHandler = void 0;
|
|
7
|
+
const clients_1 = require("../../clients");
|
|
8
|
+
const composeTransferHandler_1 = require("../../clients/internal/composeTransferHandler");
|
|
9
|
+
const retry_1 = require("../../clients/middleware/retry");
|
|
10
|
+
const Platform_1 = require("../../Platform");
|
|
11
|
+
const detectFramework_1 = require("../../Platform/detectFramework");
|
|
12
|
+
const amplifyUrl_1 = require("../../utils/amplifyUrl");
|
|
13
|
+
/**
|
|
14
|
+
* The service name used to sign requests if the API requires authentication.
|
|
15
|
+
*/
|
|
16
|
+
const SERVICE_NAME = 'cognito-identity';
|
|
17
|
+
/**
|
|
18
|
+
* The endpoint resolver function that returns the endpoint URL for a given region.
|
|
19
|
+
*/
|
|
20
|
+
const endpointResolver = ({ region }) => ({
|
|
21
|
+
url: new amplifyUrl_1.AmplifyUrl(`https://cognito-identity.${region}.${(0, clients_1.getDnsSuffix)(region)}`),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* A Cognito Identity-specific middleware that disables caching for all requests.
|
|
25
|
+
*/
|
|
26
|
+
const disableCacheMiddlewareFactory = () => next => async function disableCacheMiddleware(request) {
|
|
27
|
+
request.headers['cache-control'] = 'no-store';
|
|
28
|
+
return next(request);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
32
|
+
* disables caching.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
exports.cognitoIdentityTransferHandler = (0, composeTransferHandler_1.composeTransferHandler)(clients_1.unauthenticatedHandler, [disableCacheMiddlewareFactory]);
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
exports.defaultConfig = {
|
|
41
|
+
service: SERVICE_NAME,
|
|
42
|
+
endpointResolver,
|
|
43
|
+
retryDecider: (0, retry_1.getRetryDecider)(clients_1.parseJsonError),
|
|
44
|
+
computeDelay: retry_1.jitteredBackoff,
|
|
45
|
+
userAgentValue: (0, Platform_1.getAmplifyUserAgent)(),
|
|
46
|
+
cache: 'no-store',
|
|
47
|
+
};
|
|
48
|
+
(0, detectFramework_1.observeFrameworkChanges)(() => {
|
|
49
|
+
exports.defaultConfig.userAgentValue = (0, Platform_1.getAmplifyUserAgent)();
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
const getSharedHeaders = (operation) => ({
|
|
55
|
+
'content-type': 'application/x-amz-json-1.1',
|
|
56
|
+
'x-amz-target': `AWSCognitoIdentityService.${operation}`,
|
|
57
|
+
});
|
|
58
|
+
exports.getSharedHeaders = getSharedHeaders;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
const buildHttpRpcRequest = ({ url }, headers, body) => ({
|
|
63
|
+
headers,
|
|
64
|
+
url,
|
|
65
|
+
body,
|
|
66
|
+
method: 'POST',
|
|
67
|
+
});
|
|
68
|
+
exports.buildHttpRpcRequest = buildHttpRpcRequest;
|
|
69
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/awsClients/cognitoIdentity/base.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.buildHttpRpcRequest = exports.getSharedHeaders = exports.defaultConfig = exports.cognitoIdentityTransferHandler = void 0;\nconst clients_1 = require(\"../../clients\");\nconst composeTransferHandler_1 = require(\"../../clients/internal/composeTransferHandler\");\nconst retry_1 = require(\"../../clients/middleware/retry\");\nconst Platform_1 = require(\"../../Platform\");\nconst detectFramework_1 = require(\"../../Platform/detectFramework\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst SERVICE_NAME = 'cognito-identity';\n/**\n * The endpoint resolver function that returns the endpoint URL for a given region.\n */\nconst endpointResolver = ({ region }) => ({\n url: new amplifyUrl_1.AmplifyUrl(`https://cognito-identity.${region}.${(0, clients_1.getDnsSuffix)(region)}`),\n});\n/**\n * A Cognito Identity-specific middleware that disables caching for all requests.\n */\nconst disableCacheMiddlewareFactory = () => next => async function disableCacheMiddleware(request) {\n request.headers['cache-control'] = 'no-store';\n return next(request);\n};\n/**\n * A Cognito Identity-specific transfer handler that does NOT sign requests, and\n * disables caching.\n *\n * @internal\n */\nexports.cognitoIdentityTransferHandler = (0, composeTransferHandler_1.composeTransferHandler)(clients_1.unauthenticatedHandler, [disableCacheMiddlewareFactory]);\n/**\n * @internal\n */\nexports.defaultConfig = {\n service: SERVICE_NAME,\n endpointResolver,\n retryDecider: (0, retry_1.getRetryDecider)(clients_1.parseJsonError),\n computeDelay: retry_1.jitteredBackoff,\n userAgentValue: (0, Platform_1.getAmplifyUserAgent)(),\n cache: 'no-store',\n};\n(0, detectFramework_1.observeFrameworkChanges)(() => {\n exports.defaultConfig.userAgentValue = (0, Platform_1.getAmplifyUserAgent)();\n});\n/**\n * @internal\n */\nconst getSharedHeaders = (operation) => ({\n 'content-type': 'application/x-amz-json-1.1',\n 'x-amz-target': `AWSCognitoIdentityService.${operation}`,\n});\nexports.getSharedHeaders = getSharedHeaders;\n/**\n * @internal\n */\nconst buildHttpRpcRequest = ({ url }, headers, body) => ({\n headers,\n url,\n body,\n method: 'POST',\n});\nexports.buildHttpRpcRequest = buildHttpRpcRequest;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,8BAA8B,GAAG,KAAK,CAAC,CAAC;AACjI,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC3C,MAAM,wBAAwB,GAAG,OAAO,CAAC,+CAA+C,CAAC,CAAC;AAC1F,MAAM,OAAO,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC7C,MAAM,iBAAiB,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;AACpE,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACvD;AACA;AACA;AACA,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM;AAC1C,IAAI,GAAG,EAAE,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AACjH,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA,MAAM,6BAA6B,GAAG,MAAM,IAAI,IAAI,eAAe,sBAAsB,CAAC,OAAO,EAAE;AACnG,IAAI,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;AAClD,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC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
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCredentialsForIdentity = void 0;
|
|
7
|
+
const clients_1 = require("../../clients");
|
|
8
|
+
const internal_1 = require("../../clients/internal");
|
|
9
|
+
const base_1 = require("./base");
|
|
10
|
+
const getCredentialsForIdentitySerializer = (input, endpoint) => {
|
|
11
|
+
const headers = (0, base_1.getSharedHeaders)('GetCredentialsForIdentity');
|
|
12
|
+
const body = JSON.stringify(input);
|
|
13
|
+
return (0, base_1.buildHttpRpcRequest)(endpoint, headers, body);
|
|
14
|
+
};
|
|
15
|
+
const getCredentialsForIdentityDeserializer = async (response) => {
|
|
16
|
+
if (response.statusCode >= 300) {
|
|
17
|
+
const error = await (0, clients_1.parseJsonError)(response);
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const body = await (0, clients_1.parseJsonBody)(response);
|
|
22
|
+
return {
|
|
23
|
+
IdentityId: body.IdentityId,
|
|
24
|
+
Credentials: deserializeCredentials(body.Credentials),
|
|
25
|
+
$metadata: (0, clients_1.parseMetadata)(response),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const deserializeCredentials = ({ AccessKeyId, SecretKey, SessionToken, Expiration, } = {}) => {
|
|
30
|
+
return {
|
|
31
|
+
AccessKeyId,
|
|
32
|
+
SecretKey,
|
|
33
|
+
SessionToken,
|
|
34
|
+
Expiration: Expiration && new Date(Expiration * 1000),
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
exports.getCredentialsForIdentity = (0, internal_1.composeServiceApi)(base_1.cognitoIdentityTransferHandler, getCredentialsForIdentitySerializer, getCredentialsForIdentityDeserializer, base_1.defaultConfig);
|
|
41
|
+
//# sourceMappingURL=getCredentialsForIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCredentialsForIdentity.js","sources":["../../../../src/awsClients/cognitoIdentity/getCredentialsForIdentity.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.getCredentialsForIdentity = void 0;\nconst clients_1 = require(\"../../clients\");\nconst internal_1 = require(\"../../clients/internal\");\nconst base_1 = require(\"./base\");\nconst getCredentialsForIdentitySerializer = (input, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)('GetCredentialsForIdentity');\n const body = JSON.stringify(input);\n return (0, base_1.buildHttpRpcRequest)(endpoint, headers, body);\n};\nconst getCredentialsForIdentityDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, clients_1.parseJsonError)(response);\n throw error;\n }\n else {\n const body = await (0, clients_1.parseJsonBody)(response);\n return {\n IdentityId: body.IdentityId,\n Credentials: deserializeCredentials(body.Credentials),\n $metadata: (0, clients_1.parseMetadata)(response),\n };\n }\n};\nconst deserializeCredentials = ({ AccessKeyId, SecretKey, SessionToken, Expiration, } = {}) => {\n return {\n AccessKeyId,\n SecretKey,\n SessionToken,\n Expiration: Expiration && new Date(Expiration * 1000),\n };\n};\n/**\n * @internal\n */\nexports.getCredentialsForIdentity = (0, internal_1.composeServiceApi)(base_1.cognitoIdentityTransferHandler, getCredentialsForIdentitySerializer, getCredentialsForIdentityDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,yBAAyB,GAAG,KAAK,CAAC,CAAC;AAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACrD,MAAM,MAAM,GA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;AACA,OAAO,CAAC,yBAAyB,GAAG,IAAI,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,8BAA8B,EAAE,mCAAmC,EAAE,qCAAqC,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getId = void 0;
|
|
7
|
+
const clients_1 = require("../../clients");
|
|
8
|
+
const internal_1 = require("../../clients/internal");
|
|
9
|
+
const base_1 = require("./base");
|
|
10
|
+
const getIdSerializer = (input, endpoint) => {
|
|
11
|
+
const headers = (0, base_1.getSharedHeaders)('GetId');
|
|
12
|
+
const body = JSON.stringify(input);
|
|
13
|
+
return (0, base_1.buildHttpRpcRequest)(endpoint, headers, body);
|
|
14
|
+
};
|
|
15
|
+
const getIdDeserializer = async (response) => {
|
|
16
|
+
if (response.statusCode >= 300) {
|
|
17
|
+
const error = await (0, clients_1.parseJsonError)(response);
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const body = await (0, clients_1.parseJsonBody)(response);
|
|
22
|
+
return {
|
|
23
|
+
IdentityId: body.IdentityId,
|
|
24
|
+
$metadata: (0, clients_1.parseMetadata)(response),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
exports.getId = (0, internal_1.composeServiceApi)(base_1.cognitoIdentityTransferHandler, getIdSerializer, getIdDeserializer, base_1.defaultConfig);
|
|
32
|
+
//# sourceMappingURL=getId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getId.js","sources":["../../../../src/awsClients/cognitoIdentity/getId.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.getId = void 0;\nconst clients_1 = require(\"../../clients\");\nconst internal_1 = require(\"../../clients/internal\");\nconst base_1 = require(\"./base\");\nconst getIdSerializer = (input, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)('GetId');\n const body = JSON.stringify(input);\n return (0, base_1.buildHttpRpcRequest)(endpoint, headers, body);\n};\nconst getIdDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, clients_1.parseJsonError)(response);\n throw error;\n }\n else {\n const body = await (0, clients_1.parseJsonBody)(response);\n return {\n IdentityId: body.IdentityId,\n $metadata: (0, clients_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.getId = (0, internal_1.composeServiceApi)(base_1.cognitoIdentityTransferHandler, getIdSerializer, getIdDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AACvB,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACrD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC7C,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC1D,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACvC,IAAI,OAAO,IAAI,MAAM,CAAC,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACpE,CAAC,CAAC;AACF,MAAM,iBAAiB,GAAG,OAAO,QAAQ,KAAK;AAC9C,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AACpE,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,IAAI,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAClE,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,IAAI,CAAC,UAAU;AACvC,YAAY,SAAS,EAAE,IAAI,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC7D,SAAS,CAAC;AACV,KAAK;AACL,CAAC,CAAC;AACF;AACA;AACA;AACA,OAAO,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,8BAA8B,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCredentialsForIdentity = exports.getId = void 0;
|
|
7
|
+
var getId_1 = require("./getId");
|
|
8
|
+
Object.defineProperty(exports, "getId", { enumerable: true, get: function () { return getId_1.getId; } });
|
|
9
|
+
var getCredentialsForIdentity_1 = require("./getCredentialsForIdentity");
|
|
10
|
+
Object.defineProperty(exports, "getCredentialsForIdentity", { enumerable: true, get: function () { return getCredentialsForIdentity_1.getCredentialsForIdentity; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/awsClients/cognitoIdentity/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.getCredentialsForIdentity = exports.getId = void 0;\nvar getId_1 = require(\"./getId\");\nObject.defineProperty(exports, \"getId\", { enumerable: true, get: function () { return getId_1.getId; } });\nvar getCredentialsForIdentity_1 = require(\"./getCredentialsForIdentity\");\nObject.defineProperty(exports, \"getCredentialsForIdentity\", { enumerable: true, get: function () { return getCredentialsForIdentity_1.getCredentialsForIdentity; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AAC3D,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACjC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1G,IAAI,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AACzE,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,2BAA2B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,2BAA2B,CAAC,yBAAyB,CAAC,EAAE,EAAE,CAAC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/awsClients/cognitoIdentity/types.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 });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
|
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.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.
|
|
6
|
+
exports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = 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,11 +17,10 @@ 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, "
|
|
24
|
-
Object.defineProperty(exports, "cognitoIdentityPoolEndpointResolver", { enumerable: true, get: function () { return cognitoIdentity_1.cognitoIdentityPoolEndpointResolver; } });
|
|
20
|
+
// AWSClients exports
|
|
21
|
+
var cognitoIdentity_1 = require("./awsClients/cognitoIdentity");
|
|
22
|
+
Object.defineProperty(exports, "getCredentialsForIdentity", { enumerable: true, get: function () { return cognitoIdentity_1.getCredentialsForIdentity; } });
|
|
23
|
+
Object.defineProperty(exports, "getId", { enumerable: true, get: function () { return cognitoIdentity_1.getId; } });
|
|
25
24
|
// Storage helpers
|
|
26
25
|
var storage_1 = require("./storage");
|
|
27
26
|
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.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.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = 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// AWSClients exports\nvar cognitoIdentity_1 = require(\"./awsClients/cognitoIdentity\");\nObject.defineProperty(exports, \"getCredentialsForIdentity\", { enumerable: true, get: function () { return cognitoIdentity_1.getCredentialsForIdentity; } });\nObject.defineProperty(exports, \"getId\", { enumerable: true, get: function () { return cognitoIdentity_1.getId; } });\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, \"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 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,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
|
|
@@ -131,6 +131,21 @@ function parseData(amplifyOutputsDataProperties) {
|
|
|
131
131
|
GraphQL,
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
+
function parseCustom(amplifyOutputsCustomProperties) {
|
|
135
|
+
if (!amplifyOutputsCustomProperties?.events) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;
|
|
139
|
+
const Events = {
|
|
140
|
+
endpoint: url,
|
|
141
|
+
defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
|
|
142
|
+
region: aws_region,
|
|
143
|
+
apiKey: api_key,
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
Events,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
134
149
|
function parseNotifications(amplifyOutputsNotificationsProperties) {
|
|
135
150
|
if (!amplifyOutputsNotificationsProperties) {
|
|
136
151
|
return undefined;
|
|
@@ -178,6 +193,12 @@ function parseAmplifyOutputs(amplifyOutputs) {
|
|
|
178
193
|
if (amplifyOutputs.data) {
|
|
179
194
|
resourcesConfig.API = parseData(amplifyOutputs.data);
|
|
180
195
|
}
|
|
196
|
+
if (amplifyOutputs.custom) {
|
|
197
|
+
const customConfig = parseCustom(amplifyOutputs.custom);
|
|
198
|
+
if (customConfig && 'Events' in customConfig) {
|
|
199
|
+
resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };
|
|
200
|
+
}
|
|
201
|
+
}
|
|
181
202
|
if (amplifyOutputs.notifications) {
|
|
182
203
|
resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);
|
|
183
204
|
}
|
|
@@ -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, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\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 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.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 }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n mappedBuckets[name] = {\n bucketName,\n region,\n };\n });\n return mappedBuckets;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AACzF,SAAS,gBAAgB,CAAC,MAAM,EAAE;AAClC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAC/B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AAC5C,SAAS,YAAY,CAAC,+BAA+B,EAAE;AACvD,IAAI,IAAI,CAAC,+BAA+B,EAAE;AAC1C,QAAQ,OAAO,SAAS,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,+BAA+B,CAAC;AACjF,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE;AACZ,YAAY,MAAM,EAAE,WAAW;AAC/B,YAAY,MAAM,EAAE,UAAU;AAC9B,YAAY,OAAO,EAAE,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC;AAC5D,SAAS;AACT,K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}
|
|
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, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\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 }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n mappedBuckets[name] = {\n bucketName,\n region,\n };\n });\n return mappedBuckets;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AACzF,SAAS,gBAAgB,CAAC,MAAM,EAAE;AAClC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAC/B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,OAAO,C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AC;AACP,IAAI,OAAO,aAAa,CAAC;AACzB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.6.7-
|
|
1
|
+
export declare const version = "6.6.7-unstable.847fb51.0+847fb51";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.6.7-
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.6.7-unstable.847fb51.0+847fb51';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Endpoint, EndpointResolverOptions, Headers, HttpRequest, HttpResponse } from '../../clients';
|
|
2
|
+
/**
|
|
3
|
+
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
4
|
+
* disables caching.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const cognitoIdentityTransferHandler: (request: HttpRequest, options: Record<string, unknown> & import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").HttpTransferOptions) => Promise<HttpResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultConfig: {
|
|
13
|
+
service: string;
|
|
14
|
+
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
15
|
+
url: URL;
|
|
16
|
+
};
|
|
17
|
+
retryDecider: (response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>;
|
|
18
|
+
computeDelay: (attempt: number) => number;
|
|
19
|
+
userAgentValue: string;
|
|
20
|
+
cache: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const getSharedHeaders: (operation: string) => Headers;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const buildHttpRpcRequest: ({ url }: Endpoint, headers: Headers, body: any) => HttpRequest;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { getDnsSuffix } from '../../clients/endpoints/getDnsSuffix.mjs';
|
|
2
|
+
import '../../types/errors.mjs';
|
|
3
|
+
import '../../errors/errorHelpers.mjs';
|
|
4
|
+
import { unauthenticatedHandler } from '../../clients/handlers/unauthenticated.mjs';
|
|
5
|
+
import { jitteredBackoff } from '../../clients/middleware/retry/jitteredBackoff.mjs';
|
|
6
|
+
import { getRetryDecider } from '../../clients/middleware/retry/defaultRetryDecider.mjs';
|
|
7
|
+
import '@aws-crypto/sha256-js';
|
|
8
|
+
import '@smithy/util-hex-encoding';
|
|
9
|
+
import { AmplifyUrl } from '../../utils/amplifyUrl/index.mjs';
|
|
10
|
+
import { composeTransferHandler } from '../../clients/internal/composeTransferHandler.mjs';
|
|
11
|
+
import { parseJsonError } from '../../clients/serde/json.mjs';
|
|
12
|
+
import { getAmplifyUserAgent } from '../../Platform/index.mjs';
|
|
13
|
+
import { observeFrameworkChanges } from '../../Platform/detectFramework.mjs';
|
|
14
|
+
|
|
15
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
/**
|
|
18
|
+
* The service name used to sign requests if the API requires authentication.
|
|
19
|
+
*/
|
|
20
|
+
const SERVICE_NAME = 'cognito-identity';
|
|
21
|
+
/**
|
|
22
|
+
* The endpoint resolver function that returns the endpoint URL for a given region.
|
|
23
|
+
*/
|
|
24
|
+
const endpointResolver = ({ region }) => ({
|
|
25
|
+
url: new AmplifyUrl(`https://cognito-identity.${region}.${getDnsSuffix(region)}`),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* A Cognito Identity-specific middleware that disables caching for all requests.
|
|
29
|
+
*/
|
|
30
|
+
const disableCacheMiddlewareFactory = () => next => async function disableCacheMiddleware(request) {
|
|
31
|
+
request.headers['cache-control'] = 'no-store';
|
|
32
|
+
return next(request);
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
36
|
+
* disables caching.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
const cognitoIdentityTransferHandler = composeTransferHandler(unauthenticatedHandler, [disableCacheMiddlewareFactory]);
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
const defaultConfig = {
|
|
45
|
+
service: SERVICE_NAME,
|
|
46
|
+
endpointResolver,
|
|
47
|
+
retryDecider: getRetryDecider(parseJsonError),
|
|
48
|
+
computeDelay: jitteredBackoff,
|
|
49
|
+
userAgentValue: getAmplifyUserAgent(),
|
|
50
|
+
cache: 'no-store',
|
|
51
|
+
};
|
|
52
|
+
observeFrameworkChanges(() => {
|
|
53
|
+
defaultConfig.userAgentValue = getAmplifyUserAgent();
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
const getSharedHeaders = (operation) => ({
|
|
59
|
+
'content-type': 'application/x-amz-json-1.1',
|
|
60
|
+
'x-amz-target': `AWSCognitoIdentityService.${operation}`,
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
const buildHttpRpcRequest = ({ url }, headers, body) => ({
|
|
66
|
+
headers,
|
|
67
|
+
url,
|
|
68
|
+
body,
|
|
69
|
+
method: 'POST',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export { buildHttpRpcRequest, cognitoIdentityTransferHandler, defaultConfig, getSharedHeaders };
|
|
73
|
+
//# sourceMappingURL=base.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.mjs","sources":["../../../../src/awsClients/cognitoIdentity/base.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getDnsSuffix, parseJsonError, unauthenticatedHandler, } from '../../clients';\nimport { composeTransferHandler } from '../../clients/internal/composeTransferHandler';\nimport { getRetryDecider, jitteredBackoff, } from '../../clients/middleware/retry';\nimport { getAmplifyUserAgent } from '../../Platform';\nimport { observeFrameworkChanges } from '../../Platform/detectFramework';\nimport { AmplifyUrl } from '../../utils/amplifyUrl';\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst SERVICE_NAME = 'cognito-identity';\n/**\n * The endpoint resolver function that returns the endpoint URL for a given region.\n */\nconst endpointResolver = ({ region }) => ({\n url: new AmplifyUrl(`https://cognito-identity.${region}.${getDnsSuffix(region)}`),\n});\n/**\n * A Cognito Identity-specific middleware that disables caching for all requests.\n */\nconst disableCacheMiddlewareFactory = () => next => async function disableCacheMiddleware(request) {\n request.headers['cache-control'] = 'no-store';\n return next(request);\n};\n/**\n * A Cognito Identity-specific transfer handler that does NOT sign requests, and\n * disables caching.\n *\n * @internal\n */\nexport const cognitoIdentityTransferHandler = composeTransferHandler(unauthenticatedHandler, [disableCacheMiddlewareFactory]);\n/**\n * @internal\n */\nexport const defaultConfig = {\n service: SERVICE_NAME,\n endpointResolver,\n retryDecider: getRetryDecider(parseJsonError),\n computeDelay: jitteredBackoff,\n userAgentValue: getAmplifyUserAgent(),\n cache: 'no-store',\n};\nobserveFrameworkChanges(() => {\n defaultConfig.userAgentValue = getAmplifyUserAgent();\n});\n/**\n * @internal\n */\nexport const getSharedHeaders = (operation) => ({\n 'content-type': 'application/x-amz-json-1.1',\n 'x-amz-target': `AWSCognitoIdentityService.${operation}`,\n});\n/**\n * @internal\n */\nexport const buildHttpRpcRequest = ({ url }, headers, body) => ({\n headers,\n url,\n body,\n method: 'POST',\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACA,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC;A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AI,MAAM,EAAE,MAAM;AAClB,CAAC;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients';
|
|
2
|
+
import type { GetCredentialsForIdentityCommandInput as GetCredentialsForIdentityInput, GetCredentialsForIdentityCommandOutput as GetCredentialsForIdentityOutput } from './types';
|
|
3
|
+
export type { GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput };
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const getCredentialsForIdentity: (config: {
|
|
8
|
+
service?: string | undefined;
|
|
9
|
+
endpointResolver?: (((options: import("../../clients").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
10
|
+
url: URL;
|
|
11
|
+
})) | undefined;
|
|
12
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
|
|
13
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
|
+
userAgentValue?: string | undefined;
|
|
15
|
+
cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
}, input: import("./types").GetCredentialsForIdentityInput) => Promise<GetCredentialsForIdentityOutput>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import '../../types/errors.mjs';
|
|
2
|
+
import '../../errors/errorHelpers.mjs';
|
|
3
|
+
import '../../utils/getClientInfo/getClientInfo.mjs';
|
|
4
|
+
import '../../utils/retry/retry.mjs';
|
|
5
|
+
import '@aws-crypto/sha256-js';
|
|
6
|
+
import '@smithy/util-hex-encoding';
|
|
7
|
+
import { parseMetadata } from '../../clients/serde/responseInfo.mjs';
|
|
8
|
+
import { parseJsonError, parseJsonBody } from '../../clients/serde/json.mjs';
|
|
9
|
+
import { composeServiceApi } from '../../clients/internal/composeServiceApi.mjs';
|
|
10
|
+
import { defaultConfig, cognitoIdentityTransferHandler, buildHttpRpcRequest, getSharedHeaders } from './base.mjs';
|
|
11
|
+
|
|
12
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
13
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
const getCredentialsForIdentitySerializer = (input, endpoint) => {
|
|
15
|
+
const headers = getSharedHeaders('GetCredentialsForIdentity');
|
|
16
|
+
const body = JSON.stringify(input);
|
|
17
|
+
return buildHttpRpcRequest(endpoint, headers, body);
|
|
18
|
+
};
|
|
19
|
+
const getCredentialsForIdentityDeserializer = async (response) => {
|
|
20
|
+
if (response.statusCode >= 300) {
|
|
21
|
+
const error = await parseJsonError(response);
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const body = await parseJsonBody(response);
|
|
26
|
+
return {
|
|
27
|
+
IdentityId: body.IdentityId,
|
|
28
|
+
Credentials: deserializeCredentials(body.Credentials),
|
|
29
|
+
$metadata: parseMetadata(response),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const deserializeCredentials = ({ AccessKeyId, SecretKey, SessionToken, Expiration, } = {}) => {
|
|
34
|
+
return {
|
|
35
|
+
AccessKeyId,
|
|
36
|
+
SecretKey,
|
|
37
|
+
SessionToken,
|
|
38
|
+
Expiration: Expiration && new Date(Expiration * 1000),
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
const getCredentialsForIdentity = composeServiceApi(cognitoIdentityTransferHandler, getCredentialsForIdentitySerializer, getCredentialsForIdentityDeserializer, defaultConfig);
|
|
45
|
+
|
|
46
|
+
export { getCredentialsForIdentity };
|
|
47
|
+
//# sourceMappingURL=getCredentialsForIdentity.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCredentialsForIdentity.mjs","sources":["../../../../src/awsClients/cognitoIdentity/getCredentialsForIdentity.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { parseJsonBody, parseJsonError, parseMetadata, } from '../../clients';\nimport { composeServiceApi } from '../../clients/internal';\nimport { buildHttpRpcRequest, cognitoIdentityTransferHandler, defaultConfig, getSharedHeaders, } from './base';\nconst getCredentialsForIdentitySerializer = (input, endpoint) => {\n const headers = getSharedHeaders('GetCredentialsForIdentity');\n const body = JSON.stringify(input);\n return buildHttpRpcRequest(endpoint, headers, body);\n};\nconst getCredentialsForIdentityDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await parseJsonError(response);\n throw error;\n }\n else {\n const body = await parseJsonBody(response);\n return {\n IdentityId: body.IdentityId,\n Credentials: deserializeCredentials(body.Credentials),\n $metadata: parseMetadata(response),\n };\n }\n};\nconst deserializeCredentials = ({ AccessKeyId, SecretKey, SessionToken, Expiration, } = {}) => {\n return {\n AccessKeyId,\n SecretKey,\n SessionToken,\n Expiration: Expiration && new Date(Expiration * 1000),\n };\n};\n/**\n * @internal\n */\nexport const getCredentialsForIdentity = composeServiceApi(cognitoIdentityTransferHandler, getCredentialsForIdentitySerializer, getCredentialsForIdentityDeserializer, defaultConfig);\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;AAIA,MAAM,mCAAmC,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AACjE,IAAI,MAAM,OAAO,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAClE,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACvC,IAAI,OAAO,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC,CAAC;AACF,MAAM,qCAAqC,GAAG,OAAO,QAAQ,KAAK;AAClE,IAAI,IAAI,QAAQ,CAAC,UAAU,IA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