@aws-amplify/core 6.4.6 → 6.4.7-local-stack.0aa9031.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/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/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/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 +23 -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 +42 -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 +37 -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 +22 -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 +3 -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/types.d.ts +2 -0
- package/package.json +3 -3
- 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 +6 -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 -6
- package/src/singleton/Auth/types.ts +2 -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 -73
- 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 -47
- 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 -38
- 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/src/index.ts
CHANGED
|
@@ -43,13 +43,12 @@ export {
|
|
|
43
43
|
clearCredentials,
|
|
44
44
|
} from './singleton';
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// Cognito Identity service client factories
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} from './awsClients/cognitoIdentity';
|
|
48
|
+
createGetCredentialsForIdentityClient,
|
|
49
|
+
createGetIdClient,
|
|
50
|
+
cognitoIdentityPoolEndpointResolver,
|
|
51
|
+
} from './foundation/factories/serviceClients/cognitoIdentity';
|
|
53
52
|
|
|
54
53
|
// Amplify-wide constructs
|
|
55
54
|
export { UserProfile } from './types';
|
|
@@ -135,12 +135,14 @@ export interface AuthIdentityPoolConfig {
|
|
|
135
135
|
|
|
136
136
|
export interface CognitoIdentityPoolConfig {
|
|
137
137
|
identityPoolId: string;
|
|
138
|
+
identityPoolEndpoint?: string;
|
|
138
139
|
allowGuestAccess?: boolean;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
export interface AuthUserPoolConfig {
|
|
142
143
|
Cognito: CognitoUserPoolConfig & {
|
|
143
144
|
identityPoolId?: never;
|
|
145
|
+
identityPoolEndpoint?: never;
|
|
144
146
|
allowGuestAccess?: never;
|
|
145
147
|
};
|
|
146
148
|
}
|
|
@@ -1,69 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AACzB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,8BAA8B,GAAG,IAAI,wBAAwB,CAAC,sBAAsB,EAAE,SAAS,CAAC,sBAAsB,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC;AACjK;AACA;AACA;AACA,OAAO,CAAC,aAAa,GAAG;AACxB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,gBAAgB;AACpB,IAAI,YAAY,EAAE,IAAI,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC,cAAc,CAAC;AACxE,IAAI,YAAY,EAAE,OAAO,CAAC,eAAe;AACzC,IAAI,cAAc,EAAE,IAAI,UAAU,CAAC,mBAAmB,GAAG;AACzD,IAAI,KAAK,EAAE,UAAU;AACrB,CAAC,CAAC;AACF,IAAI,iBAAiB,CAAC,uBAAuB,EAAE,MAAM;AACrD,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,GAAG,IAAI,UAAU,CAAC,mBAAmB,GAAG,CAAC;AACjF,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,SAAS,MAAM;AACzC,IAAI,cAAc,EAAE,4BAA4B;AAChD,IAAI,cAAc,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AAC5C;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,MAAM;AACzD,IAAI,OAAO;AACX,IAAI,GAAG;AACP,IAAI,IAAI;AACR,IAAI,MAAM,EAAE,MAAM;AAClB,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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 = 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
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,mCAAmC,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AACjE,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAC;AAC9E,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,qCAAqC,GAAG,OAAO,QAAQ,KAAK;AAClE,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,WAAW,EAAE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC;AACjE,YAAY,SAAS,EAAE,IAAI,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC7D,SAAS,CAAC;AACV,KAAK;AACL,CAAC,CAAC;AACF,MAAM,sBAAsB,GAAG,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,GAAG,GAAG,EAAE,KAAK;AAC/F,IAAI,OAAO;AACX,QAAQ,WAAW;AACnB,QAAQ,SAAS;AACjB,QAAQ,YAAY;AACpB,QAAQ,UAAU,EAAE,UAAU,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;AAC7D,KAAK,CAAC;AACN,CAAC,CAAC;AACF;AACA;AACA;AACA,OAAO,CAAC,yBAAyB,GAAG,IAAI,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,8BAA8B,EAAE,mCAAmC,EAAE,qCAAqC,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
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;
|
|
@@ -1,73 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM;AAC1C,IAAI,GAAG,EAAE,IAAI,UAAU,CAAC,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrF,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;AACzB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,8BAA8B,GAAG,sBAAsB,CAAC,sBAAsB,EAAE,CAAC,6BAA6B,CAAC,EAAE;AAC9H;AACA;AACA;AACY,MAAC,aAAa,GAAG;AAC7B,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,gBAAgB;AACpB,IAAI,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC;AACjD,IAAI,YAAY,EAAE,eAAe;AACjC,IAAI,cAAc,EAAE,mBAAmB,EAAE;AACzC,IAAI,KAAK,EAAE,UAAU;AACrB,EAAE;AACF,uBAAuB,CAAC,MAAM;AAC9B,IAAI,aAAa,CAAC,cAAc,GAAG,mBAAmB,EAAE,CAAC;AACzD,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,CAAC,SAAS,MAAM;AAChD,IAAI,cAAc,EAAE,4BAA4B;AAChD,IAAI,cAAc,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;AAC5D,CAAC,EAAE;AACH;AACA;AACA;AACY,MAAC,mBAAmB,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,MAAM;AAChE,IAAI,OAAO;AACX,IAAI,GAAG;AACP,IAAI,IAAI;AACR,IAAI,MAAM,EAAE,MAAM;AAClB,CAAC;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
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>;
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;AACrD,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;AACnD,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,IAAI,CAAC,UAAU;AACvC,YAAY,WAAW,EAAE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC;AACjE,YAAY,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC;AAC9C,SAAS,CAAC;AACV,KAAK;AACL,CAAC,CAAC;AACF,MAAM,sBAAsB,GAAG,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,GAAG,GAAG,EAAE,KAAK;AAC/F,IAAI,OAAO;AACX,QAAQ,WAAW;AACnB,QAAQ,SAAS;AACjB,QAAQ,YAAY;AACpB,QAAQ,UAAU,EAAE,UAAU,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;AAC7D,KAAK,CAAC;AACN,CAAC,CAAC;AACF;AACA;AACA;AACY,MAAC,yBAAyB,GAAG,iBAAiB,CAAC,8BAA8B,EAAE,mCAAmC,EAAE,qCAAqC,EAAE,aAAa;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Endpoint, HttpResponse } from '../../clients';
|
|
2
|
-
import { GetIdCommandInput as GetIdInput, GetIdCommandOutput as GetIdOutput } from './types';
|
|
3
|
-
export type { GetIdInput, GetIdOutput };
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare const getId: (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").GetIdInput) => Promise<GetIdOutput>;
|
|
@@ -1,38 +0,0 @@
|
|
|
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 getIdSerializer = (input, endpoint) => {
|
|
15
|
-
const headers = getSharedHeaders('GetId');
|
|
16
|
-
const body = JSON.stringify(input);
|
|
17
|
-
return buildHttpRpcRequest(endpoint, headers, body);
|
|
18
|
-
};
|
|
19
|
-
const getIdDeserializer = 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
|
-
$metadata: parseMetadata(response),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
const getId = composeServiceApi(cognitoIdentityTransferHandler, getIdSerializer, getIdDeserializer, defaultConfig);
|
|
36
|
-
|
|
37
|
-
export { getId };
|
|
38
|
-
//# sourceMappingURL=getId.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getId.mjs","sources":["../../../../src/awsClients/cognitoIdentity/getId.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 getIdSerializer = (input, endpoint) => {\n const headers = getSharedHeaders('GetId');\n const body = JSON.stringify(input);\n return buildHttpRpcRequest(endpoint, headers, body);\n};\nconst getIdDeserializer = 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 $metadata: parseMetadata(response),\n };\n }\n};\n/**\n * @internal\n */\nexport const getId = composeServiceApi(cognitoIdentityTransferHandler, getIdSerializer, getIdDeserializer, defaultConfig);\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;AAIA,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AAC7C,IAAI,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC9C,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,iBAAiB,GAAG,OAAO,QAAQ,KAAK;AAC9C,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;AACrD,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;AACnD,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,IAAI,CAAC,UAAU;AACvC,YAAY,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC;AAC9C,SAAS,CAAC;AACV,KAAK;AACL,CAAC,CAAC;AACF;AACA;AACA;AACY,MAAC,KAAK,GAAG,iBAAiB,CAAC,8BAA8B,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Endpoint,
|
|
6
|
-
EndpointResolverOptions,
|
|
7
|
-
Headers,
|
|
8
|
-
HttpRequest,
|
|
9
|
-
HttpResponse,
|
|
10
|
-
Middleware,
|
|
11
|
-
getDnsSuffix,
|
|
12
|
-
parseJsonError,
|
|
13
|
-
unauthenticatedHandler,
|
|
14
|
-
} from '../../clients';
|
|
15
|
-
import { composeTransferHandler } from '../../clients/internal/composeTransferHandler';
|
|
16
|
-
import {
|
|
17
|
-
getRetryDecider,
|
|
18
|
-
jitteredBackoff,
|
|
19
|
-
} from '../../clients/middleware/retry';
|
|
20
|
-
import { getAmplifyUserAgent } from '../../Platform';
|
|
21
|
-
import { observeFrameworkChanges } from '../../Platform/detectFramework';
|
|
22
|
-
import { AmplifyUrl } from '../../utils/amplifyUrl';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The service name used to sign requests if the API requires authentication.
|
|
26
|
-
*/
|
|
27
|
-
const SERVICE_NAME = 'cognito-identity';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The endpoint resolver function that returns the endpoint URL for a given region.
|
|
31
|
-
*/
|
|
32
|
-
const endpointResolver = ({ region }: EndpointResolverOptions) => ({
|
|
33
|
-
url: new AmplifyUrl(
|
|
34
|
-
`https://cognito-identity.${region}.${getDnsSuffix(region)}`,
|
|
35
|
-
),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* A Cognito Identity-specific middleware that disables caching for all requests.
|
|
40
|
-
*/
|
|
41
|
-
const disableCacheMiddlewareFactory: Middleware<
|
|
42
|
-
HttpRequest,
|
|
43
|
-
HttpResponse,
|
|
44
|
-
Record<string, unknown>
|
|
45
|
-
> = () => next =>
|
|
46
|
-
async function disableCacheMiddleware(request) {
|
|
47
|
-
request.headers['cache-control'] = 'no-store';
|
|
48
|
-
|
|
49
|
-
return next(request);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
54
|
-
* disables caching.
|
|
55
|
-
*
|
|
56
|
-
* @internal
|
|
57
|
-
*/
|
|
58
|
-
export const cognitoIdentityTransferHandler = composeTransferHandler<
|
|
59
|
-
[Parameters<typeof disableCacheMiddlewareFactory>[0]],
|
|
60
|
-
HttpRequest,
|
|
61
|
-
HttpResponse,
|
|
62
|
-
typeof unauthenticatedHandler
|
|
63
|
-
>(unauthenticatedHandler, [disableCacheMiddlewareFactory]);
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
export const defaultConfig = {
|
|
69
|
-
service: SERVICE_NAME,
|
|
70
|
-
endpointResolver,
|
|
71
|
-
retryDecider: getRetryDecider(parseJsonError),
|
|
72
|
-
computeDelay: jitteredBackoff,
|
|
73
|
-
userAgentValue: getAmplifyUserAgent(),
|
|
74
|
-
cache: 'no-store',
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
observeFrameworkChanges(() => {
|
|
78
|
-
defaultConfig.userAgentValue = getAmplifyUserAgent();
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
export const getSharedHeaders = (operation: string): Headers => ({
|
|
85
|
-
'content-type': 'application/x-amz-json-1.1',
|
|
86
|
-
'x-amz-target': `AWSCognitoIdentityService.${operation}`,
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @internal
|
|
91
|
-
*/
|
|
92
|
-
export const buildHttpRpcRequest = (
|
|
93
|
-
{ url }: Endpoint,
|
|
94
|
-
headers: Headers,
|
|
95
|
-
body: any,
|
|
96
|
-
): HttpRequest => ({
|
|
97
|
-
headers,
|
|
98
|
-
url,
|
|
99
|
-
body,
|
|
100
|
-
method: 'POST',
|
|
101
|
-
});
|