create-mastra 0.1.0-alpha.23 → 0.1.0-alpha.25
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/LICENSE +44 -0
- package/dist/AssumeRoleCommand-Cse3dzcY.js +3650 -0
- package/dist/AssumeRoleCommand-Cse3dzcY.js.map +1 -0
- package/dist/create-aggregated-client-BFp7oxSr.js +24 -0
- package/dist/create-aggregated-client-BFp7oxSr.js.map +1 -0
- package/dist/extended-encode-uri-component-Dlbpb2Wd.js +8 -0
- package/dist/extended-encode-uri-component-Dlbpb2Wd.js.map +1 -0
- package/dist/index-B6QXpY-b.js +37 -0
- package/dist/index-B6QXpY-b.js.map +1 -0
- package/dist/index-BRCgFUbU.js +37 -0
- package/dist/index-BRCgFUbU.js.map +1 -0
- package/dist/index-BZHBFaQF.js +37 -0
- package/dist/index-BZHBFaQF.js.map +1 -0
- package/dist/index-B_Yunpbk.js +37 -0
- package/dist/index-B_Yunpbk.js.map +1 -0
- package/dist/index-BpMCSgn8.js +1145 -0
- package/dist/index-BpMCSgn8.js.map +1 -0
- package/dist/index-BxJx8yLU.js +37 -0
- package/dist/index-BxJx8yLU.js.map +1 -0
- package/dist/index-CF0rZfmW.js +37 -0
- package/dist/index-CF0rZfmW.js.map +1 -0
- package/dist/index-DeZeG5u4.js +3726 -0
- package/dist/index-DeZeG5u4.js.map +1 -0
- package/dist/index-_YTyVz_X.js +298 -0
- package/dist/index-_YTyVz_X.js.map +1 -0
- package/dist/index-lqkrgSwk.js +37 -0
- package/dist/index-lqkrgSwk.js.map +1 -0
- package/dist/index.js +152931 -39
- package/dist/index.js.map +1 -0
- package/dist/loadCognitoIdentity-CWxGlq_8.js +828 -0
- package/dist/loadCognitoIdentity-CWxGlq_8.js.map +1 -0
- package/dist/loadSso-MEAVww3h.js +615 -0
- package/dist/loadSso-MEAVww3h.js.map +1 -0
- package/dist/loadSts-DEnlAvEU.js +40 -0
- package/dist/loadSts-DEnlAvEU.js.map +1 -0
- package/dist/parseJsonBody-C_mcRkFo.js +161 -0
- package/dist/parseJsonBody-C_mcRkFo.js.map +1 -0
- package/dist/requestBuilder-CuNXirlx.js +90 -0
- package/dist/requestBuilder-CuNXirlx.js.map +1 -0
- package/package.json +16 -5
- package/starter-files/config.ts +28 -0
- package/starter-files/mastra-pg.docker-compose.yaml +15 -0
- package/starter-files/tools.ts +95 -0
- package/starter-files/workflow.ts +173 -0
- package/dist/index.d.ts +0 -2
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -11
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
import { d as getSmithyContext, n as normalizeProvider, r as resolveAwsSdkSigV4Config, e as resolveEndpoint, E as EndpointCache, f as customEndpointFunctions, h as awsEndpointFunctions, i as fromBase64, A as AwsSdkSigV4Signer, N as NoAuthSigner, j as NoOpLogger, k as emitWarningIfUnsupportedVersion, l as emitWarningIfUnsupportedVersion$1, m as calculateBodyLength, o as createDefaultUserAgentProvider, p as NODE_MAX_ATTEMPT_CONFIG_OPTIONS, q as NODE_REGION_CONFIG_FILE_OPTIONS, s as NODE_REGION_CONFIG_OPTIONS, t as NODE_RETRY_MODE_CONFIG_OPTIONS, D as DEFAULT_RETRY_MODE, H as Hash, u as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, v as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, w as NODE_APP_ID_CONFIG_OPTIONS, x as resolveDefaultsModeConfig, y as loadConfigsForDefaultMode, z as getDefaultExtensionConfiguration, B as getHttpHandlerExtensionConfiguration, F as resolveAwsRegionExtensionConfiguration, G as resolveDefaultRuntimeConfig, I as resolveHttpHandlerRuntimeConfig, J as getAwsRegionExtensionConfiguration, b as Client, K as resolveUserAgentConfig, L as resolveRetryConfig, M as resolveRegionConfig, O as resolveEndpointConfig, P as getUserAgentPlugin, Q as getRetryPlugin, R as getContentLengthPlugin, S as getHostHeaderPlugin, T as getLoggerPlugin, U as getRecursionDetectionPlugin, V as getHttpAuthSchemeEndpointRuleSetPlugin, W as DefaultIdentityProviderConfig, X as getHttpSigningPlugin, Y as resolveHostHeaderConfig, Z as ServiceException, _ as SENSITIVE_STRING, $ as decorateServiceException, a0 as withBaseException, C as Command, g as getSerdePlugin, a as getEndpointPlugin } from './index-DeZeG5u4.js';
|
|
2
|
+
import { z as toBase64, A as parseUrl, B as fromUtf8, C as toUtf8, F as defaultProvider, G as loadConfig, N as NodeHttpHandler, I as streamCollector, H as HttpRequest, J as expectString, K as expectNonNull, L as parseEpochTimestamp, M as expectNumber } from './index.js';
|
|
3
|
+
import 'node:buffer';
|
|
4
|
+
import { _ as _json, p as parseJsonBody, a as parseJsonErrorBody, l as loadRestJsonErrorCode, t as take } from './parseJsonBody-C_mcRkFo.js';
|
|
5
|
+
import 'node:stream';
|
|
6
|
+
import 'node:crypto';
|
|
7
|
+
import 'node:os';
|
|
8
|
+
import 'node:process';
|
|
9
|
+
import 'node:fs';
|
|
10
|
+
import 'commander';
|
|
11
|
+
import 'node:path';
|
|
12
|
+
import 'posthog-node';
|
|
13
|
+
import 'node:url';
|
|
14
|
+
import 'node:readline';
|
|
15
|
+
import 'node:tty';
|
|
16
|
+
import 'node:child_process';
|
|
17
|
+
import 'node:util';
|
|
18
|
+
import 'prettier';
|
|
19
|
+
import 'fs-extra/esm';
|
|
20
|
+
import 'node:fs/promises';
|
|
21
|
+
import 'execa';
|
|
22
|
+
import 'node:events';
|
|
23
|
+
import 'node:assert';
|
|
24
|
+
import 'node:worker_threads';
|
|
25
|
+
import 'node:module';
|
|
26
|
+
import 'node:string_decoder';
|
|
27
|
+
import '@opentelemetry/api';
|
|
28
|
+
import '@opentelemetry/auto-instrumentations-node';
|
|
29
|
+
import '@opentelemetry/exporter-trace-otlp-http';
|
|
30
|
+
import '@opentelemetry/resources';
|
|
31
|
+
import '@opentelemetry/sdk-node';
|
|
32
|
+
import '@opentelemetry/sdk-trace-base';
|
|
33
|
+
import '@opentelemetry/semantic-conventions';
|
|
34
|
+
import 'node:http';
|
|
35
|
+
import 'node:https';
|
|
36
|
+
import 'node:punycode';
|
|
37
|
+
import 'node:zlib';
|
|
38
|
+
import 'fs-extra';
|
|
39
|
+
|
|
40
|
+
const defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
41
|
+
return {
|
|
42
|
+
operation: getSmithyContext(context).operation,
|
|
43
|
+
region: (await normalizeProvider(config.region)()) ||
|
|
44
|
+
(() => {
|
|
45
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
46
|
+
})(),
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
50
|
+
return {
|
|
51
|
+
schemeId: "aws.auth#sigv4",
|
|
52
|
+
signingProperties: {
|
|
53
|
+
name: "cognito-identity",
|
|
54
|
+
region: authParameters.region,
|
|
55
|
+
},
|
|
56
|
+
propertiesExtractor: (config, context) => ({
|
|
57
|
+
signingProperties: {
|
|
58
|
+
config,
|
|
59
|
+
context,
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
65
|
+
return {
|
|
66
|
+
schemeId: "smithy.api#noAuth",
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => {
|
|
70
|
+
const options = [];
|
|
71
|
+
switch (authParameters.operation) {
|
|
72
|
+
case "GetCredentialsForIdentity": {
|
|
73
|
+
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case "GetId": {
|
|
77
|
+
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
case "GetOpenIdToken": {
|
|
81
|
+
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case "UnlinkIdentity": {
|
|
85
|
+
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
default: {
|
|
89
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return options;
|
|
93
|
+
};
|
|
94
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
95
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
96
|
+
return {
|
|
97
|
+
...config_0,
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const resolveClientEndpointParameters = (options) => {
|
|
102
|
+
return {
|
|
103
|
+
...options,
|
|
104
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
105
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
106
|
+
defaultSigningName: "cognito-identity",
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const commonParams = {
|
|
110
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
111
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
112
|
+
Region: { type: "builtInParams", name: "region" },
|
|
113
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var name = "@aws-sdk/client-cognito-identity";
|
|
117
|
+
var description = "AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native";
|
|
118
|
+
var version = "3.716.0";
|
|
119
|
+
var scripts = {
|
|
120
|
+
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
121
|
+
"build:cjs": "node ../../scripts/compilation/inline client-cognito-identity",
|
|
122
|
+
"build:es": "tsc -p tsconfig.es.json",
|
|
123
|
+
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
|
|
124
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
125
|
+
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
126
|
+
clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
|
|
127
|
+
"extract:docs": "api-extractor run --local",
|
|
128
|
+
"generate:client": "node ../../scripts/generate-clients/single-service --solo cognito-identity",
|
|
129
|
+
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
|
|
130
|
+
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
|
|
131
|
+
};
|
|
132
|
+
var main = "./dist-cjs/index.js";
|
|
133
|
+
var types = "./dist-types/index.d.ts";
|
|
134
|
+
var module = "./dist-es/index.js";
|
|
135
|
+
var sideEffects = false;
|
|
136
|
+
var dependencies = {
|
|
137
|
+
"@aws-crypto/sha256-browser": "5.2.0",
|
|
138
|
+
"@aws-crypto/sha256-js": "5.2.0",
|
|
139
|
+
"@aws-sdk/client-sso-oidc": "3.716.0",
|
|
140
|
+
"@aws-sdk/client-sts": "3.716.0",
|
|
141
|
+
"@aws-sdk/core": "3.716.0",
|
|
142
|
+
"@aws-sdk/credential-provider-node": "3.716.0",
|
|
143
|
+
"@aws-sdk/middleware-host-header": "3.714.0",
|
|
144
|
+
"@aws-sdk/middleware-logger": "3.714.0",
|
|
145
|
+
"@aws-sdk/middleware-recursion-detection": "3.714.0",
|
|
146
|
+
"@aws-sdk/middleware-user-agent": "3.716.0",
|
|
147
|
+
"@aws-sdk/region-config-resolver": "3.714.0",
|
|
148
|
+
"@aws-sdk/types": "3.714.0",
|
|
149
|
+
"@aws-sdk/util-endpoints": "3.714.0",
|
|
150
|
+
"@aws-sdk/util-user-agent-browser": "3.714.0",
|
|
151
|
+
"@aws-sdk/util-user-agent-node": "3.716.0",
|
|
152
|
+
"@smithy/config-resolver": "^3.0.13",
|
|
153
|
+
"@smithy/core": "^2.5.5",
|
|
154
|
+
"@smithy/fetch-http-handler": "^4.1.2",
|
|
155
|
+
"@smithy/hash-node": "^3.0.11",
|
|
156
|
+
"@smithy/invalid-dependency": "^3.0.11",
|
|
157
|
+
"@smithy/middleware-content-length": "^3.0.13",
|
|
158
|
+
"@smithy/middleware-endpoint": "^3.2.6",
|
|
159
|
+
"@smithy/middleware-retry": "^3.0.31",
|
|
160
|
+
"@smithy/middleware-serde": "^3.0.11",
|
|
161
|
+
"@smithy/middleware-stack": "^3.0.11",
|
|
162
|
+
"@smithy/node-config-provider": "^3.1.12",
|
|
163
|
+
"@smithy/node-http-handler": "^3.3.2",
|
|
164
|
+
"@smithy/protocol-http": "^4.1.8",
|
|
165
|
+
"@smithy/smithy-client": "^3.5.1",
|
|
166
|
+
"@smithy/types": "^3.7.2",
|
|
167
|
+
"@smithy/url-parser": "^3.0.11",
|
|
168
|
+
"@smithy/util-base64": "^3.0.0",
|
|
169
|
+
"@smithy/util-body-length-browser": "^3.0.0",
|
|
170
|
+
"@smithy/util-body-length-node": "^3.0.0",
|
|
171
|
+
"@smithy/util-defaults-mode-browser": "^3.0.31",
|
|
172
|
+
"@smithy/util-defaults-mode-node": "^3.0.31",
|
|
173
|
+
"@smithy/util-endpoints": "^2.1.7",
|
|
174
|
+
"@smithy/util-middleware": "^3.0.11",
|
|
175
|
+
"@smithy/util-retry": "^3.0.11",
|
|
176
|
+
"@smithy/util-utf8": "^3.0.0",
|
|
177
|
+
tslib: "^2.6.2"
|
|
178
|
+
};
|
|
179
|
+
var devDependencies = {
|
|
180
|
+
"@aws-sdk/client-iam": "3.716.0",
|
|
181
|
+
"@tsconfig/node16": "16.1.3",
|
|
182
|
+
"@types/chai": "^4.2.11",
|
|
183
|
+
"@types/node": "^16.18.96",
|
|
184
|
+
concurrently: "7.0.0",
|
|
185
|
+
"downlevel-dts": "0.10.1",
|
|
186
|
+
rimraf: "3.0.2",
|
|
187
|
+
typescript: "~4.9.5"
|
|
188
|
+
};
|
|
189
|
+
var engines = {
|
|
190
|
+
node: ">=16.0.0"
|
|
191
|
+
};
|
|
192
|
+
var typesVersions = {
|
|
193
|
+
"<4.0": {
|
|
194
|
+
"dist-types/*": [
|
|
195
|
+
"dist-types/ts3.4/*"
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
var files = [
|
|
200
|
+
"dist-*/**"
|
|
201
|
+
];
|
|
202
|
+
var author = {
|
|
203
|
+
name: "AWS SDK for JavaScript Team",
|
|
204
|
+
url: "https://aws.amazon.com/javascript/"
|
|
205
|
+
};
|
|
206
|
+
var license = "Apache-2.0";
|
|
207
|
+
var browser = {
|
|
208
|
+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
|
|
209
|
+
};
|
|
210
|
+
var homepage = "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity";
|
|
211
|
+
var repository = {
|
|
212
|
+
type: "git",
|
|
213
|
+
url: "https://github.com/aws/aws-sdk-js-v3.git",
|
|
214
|
+
directory: "clients/client-cognito-identity"
|
|
215
|
+
};
|
|
216
|
+
var packageInfo = {
|
|
217
|
+
name: name,
|
|
218
|
+
description: description,
|
|
219
|
+
version: version,
|
|
220
|
+
scripts: scripts,
|
|
221
|
+
main: main,
|
|
222
|
+
types: types,
|
|
223
|
+
module: module,
|
|
224
|
+
sideEffects: sideEffects,
|
|
225
|
+
dependencies: dependencies,
|
|
226
|
+
devDependencies: devDependencies,
|
|
227
|
+
engines: engines,
|
|
228
|
+
typesVersions: typesVersions,
|
|
229
|
+
files: files,
|
|
230
|
+
author: author,
|
|
231
|
+
license: license,
|
|
232
|
+
browser: browser,
|
|
233
|
+
"react-native": {
|
|
234
|
+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
|
|
235
|
+
},
|
|
236
|
+
homepage: homepage,
|
|
237
|
+
repository: repository
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const s = "required", t = "fn", u = "argv", v = "ref";
|
|
241
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = { [s]: false, "type": "String" }, i = { [s]: true, "default": false, "type": "Boolean" }, j = { [v]: "Endpoint" }, k = { [t]: c, [u]: [{ [v]: "UseFIPS" }, true] }, l = { [t]: c, [u]: [{ [v]: "UseDualStack" }, true] }, m = {}, n = { [t]: "getAttr", [u]: [{ [v]: g }, "supportsFIPS"] }, o = { [t]: c, [u]: [true, { [t]: "getAttr", [u]: [{ [v]: g }, "supportsDualStack"] }] }, p = [k], q = [l], r = [{ [v]: "Region" }];
|
|
242
|
+
const _data = { version: "1.0", parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h }, rules: [{ conditions: [{ [t]: b, [u]: [j] }], rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }, { conditions: [{ [t]: b, [u]: r }], rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c, [u]: [a, n] }, o], rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c, [u]: [n, a] }], rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o], rules: [{ endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
|
|
243
|
+
const ruleSet = _data;
|
|
244
|
+
|
|
245
|
+
const cache = new EndpointCache({
|
|
246
|
+
size: 50,
|
|
247
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
248
|
+
});
|
|
249
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
250
|
+
return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
|
|
251
|
+
endpointParams: endpointParams,
|
|
252
|
+
logger: context.logger,
|
|
253
|
+
}));
|
|
254
|
+
};
|
|
255
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
256
|
+
|
|
257
|
+
const getRuntimeConfig$1 = (config) => {
|
|
258
|
+
return {
|
|
259
|
+
apiVersion: "2014-06-30",
|
|
260
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
261
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
262
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
263
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
264
|
+
extensions: config?.extensions ?? [],
|
|
265
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultCognitoIdentityHttpAuthSchemeProvider,
|
|
266
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
267
|
+
{
|
|
268
|
+
schemeId: "aws.auth#sigv4",
|
|
269
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
270
|
+
signer: new AwsSdkSigV4Signer(),
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
schemeId: "smithy.api#noAuth",
|
|
274
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
275
|
+
signer: new NoAuthSigner(),
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
279
|
+
serviceId: config?.serviceId ?? "Cognito Identity",
|
|
280
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
281
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
282
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const getRuntimeConfig = (config) => {
|
|
287
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
288
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
289
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
290
|
+
const clientSharedValues = getRuntimeConfig$1(config);
|
|
291
|
+
emitWarningIfUnsupportedVersion$1(process.version);
|
|
292
|
+
const profileConfig = { profile: config?.profile };
|
|
293
|
+
return {
|
|
294
|
+
...clientSharedValues,
|
|
295
|
+
...config,
|
|
296
|
+
runtime: "node",
|
|
297
|
+
defaultsMode,
|
|
298
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
299
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
|
|
300
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
301
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
302
|
+
maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
303
|
+
region: config?.region ??
|
|
304
|
+
loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
|
|
305
|
+
requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
306
|
+
retryMode: config?.retryMode ??
|
|
307
|
+
loadConfig({
|
|
308
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
309
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
310
|
+
}, config),
|
|
311
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
312
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
313
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
|
|
314
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
|
|
315
|
+
userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
320
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
321
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
322
|
+
let _credentials = runtimeConfig.credentials;
|
|
323
|
+
return {
|
|
324
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
325
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
326
|
+
if (index === -1) {
|
|
327
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
httpAuthSchemes() {
|
|
334
|
+
return _httpAuthSchemes;
|
|
335
|
+
},
|
|
336
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
337
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
338
|
+
},
|
|
339
|
+
httpAuthSchemeProvider() {
|
|
340
|
+
return _httpAuthSchemeProvider;
|
|
341
|
+
},
|
|
342
|
+
setCredentials(credentials) {
|
|
343
|
+
_credentials = credentials;
|
|
344
|
+
},
|
|
345
|
+
credentials() {
|
|
346
|
+
return _credentials;
|
|
347
|
+
},
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
351
|
+
return {
|
|
352
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
353
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
354
|
+
credentials: config.credentials(),
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
const asPartial = (t) => t;
|
|
359
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
360
|
+
const extensionConfiguration = {
|
|
361
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
362
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
363
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
364
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
365
|
+
};
|
|
366
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
367
|
+
return {
|
|
368
|
+
...runtimeConfig,
|
|
369
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
370
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
371
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
372
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
class CognitoIdentityClient extends Client {
|
|
377
|
+
constructor(...[configuration]) {
|
|
378
|
+
const _config_0 = getRuntimeConfig(configuration || {});
|
|
379
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
380
|
+
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
381
|
+
const _config_3 = resolveRetryConfig(_config_2);
|
|
382
|
+
const _config_4 = resolveRegionConfig(_config_3);
|
|
383
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
384
|
+
const _config_6 = resolveEndpointConfig(_config_5);
|
|
385
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
386
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
387
|
+
super(_config_8);
|
|
388
|
+
this.config = _config_8;
|
|
389
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
390
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
391
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
392
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
393
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
394
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
395
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
396
|
+
httpAuthSchemeParametersProvider: defaultCognitoIdentityHttpAuthSchemeParametersProvider,
|
|
397
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
398
|
+
"aws.auth#sigv4": config.credentials,
|
|
399
|
+
}),
|
|
400
|
+
}));
|
|
401
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
402
|
+
}
|
|
403
|
+
destroy() {
|
|
404
|
+
super.destroy();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
class CognitoIdentityServiceException extends ServiceException {
|
|
409
|
+
constructor(options) {
|
|
410
|
+
super(options);
|
|
411
|
+
Object.setPrototypeOf(this, CognitoIdentityServiceException.prototype);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
class InternalErrorException extends CognitoIdentityServiceException {
|
|
416
|
+
constructor(opts) {
|
|
417
|
+
super({
|
|
418
|
+
name: "InternalErrorException",
|
|
419
|
+
$fault: "server",
|
|
420
|
+
...opts,
|
|
421
|
+
});
|
|
422
|
+
this.name = "InternalErrorException";
|
|
423
|
+
this.$fault = "server";
|
|
424
|
+
Object.setPrototypeOf(this, InternalErrorException.prototype);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
class InvalidParameterException extends CognitoIdentityServiceException {
|
|
428
|
+
constructor(opts) {
|
|
429
|
+
super({
|
|
430
|
+
name: "InvalidParameterException",
|
|
431
|
+
$fault: "client",
|
|
432
|
+
...opts,
|
|
433
|
+
});
|
|
434
|
+
this.name = "InvalidParameterException";
|
|
435
|
+
this.$fault = "client";
|
|
436
|
+
Object.setPrototypeOf(this, InvalidParameterException.prototype);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
class LimitExceededException extends CognitoIdentityServiceException {
|
|
440
|
+
constructor(opts) {
|
|
441
|
+
super({
|
|
442
|
+
name: "LimitExceededException",
|
|
443
|
+
$fault: "client",
|
|
444
|
+
...opts,
|
|
445
|
+
});
|
|
446
|
+
this.name = "LimitExceededException";
|
|
447
|
+
this.$fault = "client";
|
|
448
|
+
Object.setPrototypeOf(this, LimitExceededException.prototype);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
class NotAuthorizedException extends CognitoIdentityServiceException {
|
|
452
|
+
constructor(opts) {
|
|
453
|
+
super({
|
|
454
|
+
name: "NotAuthorizedException",
|
|
455
|
+
$fault: "client",
|
|
456
|
+
...opts,
|
|
457
|
+
});
|
|
458
|
+
this.name = "NotAuthorizedException";
|
|
459
|
+
this.$fault = "client";
|
|
460
|
+
Object.setPrototypeOf(this, NotAuthorizedException.prototype);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
class ResourceConflictException extends CognitoIdentityServiceException {
|
|
464
|
+
constructor(opts) {
|
|
465
|
+
super({
|
|
466
|
+
name: "ResourceConflictException",
|
|
467
|
+
$fault: "client",
|
|
468
|
+
...opts,
|
|
469
|
+
});
|
|
470
|
+
this.name = "ResourceConflictException";
|
|
471
|
+
this.$fault = "client";
|
|
472
|
+
Object.setPrototypeOf(this, ResourceConflictException.prototype);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
class TooManyRequestsException extends CognitoIdentityServiceException {
|
|
476
|
+
constructor(opts) {
|
|
477
|
+
super({
|
|
478
|
+
name: "TooManyRequestsException",
|
|
479
|
+
$fault: "client",
|
|
480
|
+
...opts,
|
|
481
|
+
});
|
|
482
|
+
this.name = "TooManyRequestsException";
|
|
483
|
+
this.$fault = "client";
|
|
484
|
+
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
class ResourceNotFoundException extends CognitoIdentityServiceException {
|
|
488
|
+
constructor(opts) {
|
|
489
|
+
super({
|
|
490
|
+
name: "ResourceNotFoundException",
|
|
491
|
+
$fault: "client",
|
|
492
|
+
...opts,
|
|
493
|
+
});
|
|
494
|
+
this.name = "ResourceNotFoundException";
|
|
495
|
+
this.$fault = "client";
|
|
496
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
class ExternalServiceException extends CognitoIdentityServiceException {
|
|
500
|
+
constructor(opts) {
|
|
501
|
+
super({
|
|
502
|
+
name: "ExternalServiceException",
|
|
503
|
+
$fault: "client",
|
|
504
|
+
...opts,
|
|
505
|
+
});
|
|
506
|
+
this.name = "ExternalServiceException";
|
|
507
|
+
this.$fault = "client";
|
|
508
|
+
Object.setPrototypeOf(this, ExternalServiceException.prototype);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
class InvalidIdentityPoolConfigurationException extends CognitoIdentityServiceException {
|
|
512
|
+
constructor(opts) {
|
|
513
|
+
super({
|
|
514
|
+
name: "InvalidIdentityPoolConfigurationException",
|
|
515
|
+
$fault: "client",
|
|
516
|
+
...opts,
|
|
517
|
+
});
|
|
518
|
+
this.name = "InvalidIdentityPoolConfigurationException";
|
|
519
|
+
this.$fault = "client";
|
|
520
|
+
Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException.prototype);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
class DeveloperUserAlreadyRegisteredException extends CognitoIdentityServiceException {
|
|
524
|
+
constructor(opts) {
|
|
525
|
+
super({
|
|
526
|
+
name: "DeveloperUserAlreadyRegisteredException",
|
|
527
|
+
$fault: "client",
|
|
528
|
+
...opts,
|
|
529
|
+
});
|
|
530
|
+
this.name = "DeveloperUserAlreadyRegisteredException";
|
|
531
|
+
this.$fault = "client";
|
|
532
|
+
Object.setPrototypeOf(this, DeveloperUserAlreadyRegisteredException.prototype);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
class ConcurrentModificationException extends CognitoIdentityServiceException {
|
|
536
|
+
constructor(opts) {
|
|
537
|
+
super({
|
|
538
|
+
name: "ConcurrentModificationException",
|
|
539
|
+
$fault: "client",
|
|
540
|
+
...opts,
|
|
541
|
+
});
|
|
542
|
+
this.name = "ConcurrentModificationException";
|
|
543
|
+
this.$fault = "client";
|
|
544
|
+
Object.setPrototypeOf(this, ConcurrentModificationException.prototype);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
const GetCredentialsForIdentityInputFilterSensitiveLog = (obj) => ({
|
|
548
|
+
...obj,
|
|
549
|
+
...(obj.Logins && { Logins: SENSITIVE_STRING }),
|
|
550
|
+
});
|
|
551
|
+
const CredentialsFilterSensitiveLog = (obj) => ({
|
|
552
|
+
...obj,
|
|
553
|
+
...(obj.SecretKey && { SecretKey: SENSITIVE_STRING }),
|
|
554
|
+
});
|
|
555
|
+
const GetCredentialsForIdentityResponseFilterSensitiveLog = (obj) => ({
|
|
556
|
+
...obj,
|
|
557
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
|
558
|
+
});
|
|
559
|
+
const GetIdInputFilterSensitiveLog = (obj) => ({
|
|
560
|
+
...obj,
|
|
561
|
+
...(obj.Logins && { Logins: SENSITIVE_STRING }),
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
const se_GetCredentialsForIdentityCommand = async (input, context) => {
|
|
565
|
+
const headers = sharedHeaders("GetCredentialsForIdentity");
|
|
566
|
+
let body;
|
|
567
|
+
body = JSON.stringify(_json(input));
|
|
568
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
569
|
+
};
|
|
570
|
+
const se_GetIdCommand = async (input, context) => {
|
|
571
|
+
const headers = sharedHeaders("GetId");
|
|
572
|
+
let body;
|
|
573
|
+
body = JSON.stringify(_json(input));
|
|
574
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
575
|
+
};
|
|
576
|
+
const de_GetCredentialsForIdentityCommand = async (output, context) => {
|
|
577
|
+
if (output.statusCode >= 300) {
|
|
578
|
+
return de_CommandError(output, context);
|
|
579
|
+
}
|
|
580
|
+
const data = await parseJsonBody(output.body, context);
|
|
581
|
+
let contents = {};
|
|
582
|
+
contents = de_GetCredentialsForIdentityResponse(data);
|
|
583
|
+
const response = {
|
|
584
|
+
$metadata: deserializeMetadata(output),
|
|
585
|
+
...contents,
|
|
586
|
+
};
|
|
587
|
+
return response;
|
|
588
|
+
};
|
|
589
|
+
const de_GetIdCommand = async (output, context) => {
|
|
590
|
+
if (output.statusCode >= 300) {
|
|
591
|
+
return de_CommandError(output, context);
|
|
592
|
+
}
|
|
593
|
+
const data = await parseJsonBody(output.body, context);
|
|
594
|
+
let contents = {};
|
|
595
|
+
contents = _json(data);
|
|
596
|
+
const response = {
|
|
597
|
+
$metadata: deserializeMetadata(output),
|
|
598
|
+
...contents,
|
|
599
|
+
};
|
|
600
|
+
return response;
|
|
601
|
+
};
|
|
602
|
+
const de_CommandError = async (output, context) => {
|
|
603
|
+
const parsedOutput = {
|
|
604
|
+
...output,
|
|
605
|
+
body: await parseJsonErrorBody(output.body, context),
|
|
606
|
+
};
|
|
607
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
608
|
+
switch (errorCode) {
|
|
609
|
+
case "InternalErrorException":
|
|
610
|
+
case "com.amazonaws.cognitoidentity#InternalErrorException":
|
|
611
|
+
throw await de_InternalErrorExceptionRes(parsedOutput);
|
|
612
|
+
case "InvalidParameterException":
|
|
613
|
+
case "com.amazonaws.cognitoidentity#InvalidParameterException":
|
|
614
|
+
throw await de_InvalidParameterExceptionRes(parsedOutput);
|
|
615
|
+
case "LimitExceededException":
|
|
616
|
+
case "com.amazonaws.cognitoidentity#LimitExceededException":
|
|
617
|
+
throw await de_LimitExceededExceptionRes(parsedOutput);
|
|
618
|
+
case "NotAuthorizedException":
|
|
619
|
+
case "com.amazonaws.cognitoidentity#NotAuthorizedException":
|
|
620
|
+
throw await de_NotAuthorizedExceptionRes(parsedOutput);
|
|
621
|
+
case "ResourceConflictException":
|
|
622
|
+
case "com.amazonaws.cognitoidentity#ResourceConflictException":
|
|
623
|
+
throw await de_ResourceConflictExceptionRes(parsedOutput);
|
|
624
|
+
case "TooManyRequestsException":
|
|
625
|
+
case "com.amazonaws.cognitoidentity#TooManyRequestsException":
|
|
626
|
+
throw await de_TooManyRequestsExceptionRes(parsedOutput);
|
|
627
|
+
case "ResourceNotFoundException":
|
|
628
|
+
case "com.amazonaws.cognitoidentity#ResourceNotFoundException":
|
|
629
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput);
|
|
630
|
+
case "ExternalServiceException":
|
|
631
|
+
case "com.amazonaws.cognitoidentity#ExternalServiceException":
|
|
632
|
+
throw await de_ExternalServiceExceptionRes(parsedOutput);
|
|
633
|
+
case "InvalidIdentityPoolConfigurationException":
|
|
634
|
+
case "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":
|
|
635
|
+
throw await de_InvalidIdentityPoolConfigurationExceptionRes(parsedOutput);
|
|
636
|
+
case "DeveloperUserAlreadyRegisteredException":
|
|
637
|
+
case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException":
|
|
638
|
+
throw await de_DeveloperUserAlreadyRegisteredExceptionRes(parsedOutput);
|
|
639
|
+
case "ConcurrentModificationException":
|
|
640
|
+
case "com.amazonaws.cognitoidentity#ConcurrentModificationException":
|
|
641
|
+
throw await de_ConcurrentModificationExceptionRes(parsedOutput);
|
|
642
|
+
default:
|
|
643
|
+
const parsedBody = parsedOutput.body;
|
|
644
|
+
return throwDefaultError({
|
|
645
|
+
output,
|
|
646
|
+
parsedBody,
|
|
647
|
+
errorCode,
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
|
|
652
|
+
const body = parsedOutput.body;
|
|
653
|
+
const deserialized = _json(body);
|
|
654
|
+
const exception = new ConcurrentModificationException({
|
|
655
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
656
|
+
...deserialized,
|
|
657
|
+
});
|
|
658
|
+
return decorateServiceException(exception, body);
|
|
659
|
+
};
|
|
660
|
+
const de_DeveloperUserAlreadyRegisteredExceptionRes = async (parsedOutput, context) => {
|
|
661
|
+
const body = parsedOutput.body;
|
|
662
|
+
const deserialized = _json(body);
|
|
663
|
+
const exception = new DeveloperUserAlreadyRegisteredException({
|
|
664
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
665
|
+
...deserialized,
|
|
666
|
+
});
|
|
667
|
+
return decorateServiceException(exception, body);
|
|
668
|
+
};
|
|
669
|
+
const de_ExternalServiceExceptionRes = async (parsedOutput, context) => {
|
|
670
|
+
const body = parsedOutput.body;
|
|
671
|
+
const deserialized = _json(body);
|
|
672
|
+
const exception = new ExternalServiceException({
|
|
673
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
674
|
+
...deserialized,
|
|
675
|
+
});
|
|
676
|
+
return decorateServiceException(exception, body);
|
|
677
|
+
};
|
|
678
|
+
const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
|
|
679
|
+
const body = parsedOutput.body;
|
|
680
|
+
const deserialized = _json(body);
|
|
681
|
+
const exception = new InternalErrorException({
|
|
682
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
683
|
+
...deserialized,
|
|
684
|
+
});
|
|
685
|
+
return decorateServiceException(exception, body);
|
|
686
|
+
};
|
|
687
|
+
const de_InvalidIdentityPoolConfigurationExceptionRes = async (parsedOutput, context) => {
|
|
688
|
+
const body = parsedOutput.body;
|
|
689
|
+
const deserialized = _json(body);
|
|
690
|
+
const exception = new InvalidIdentityPoolConfigurationException({
|
|
691
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
692
|
+
...deserialized,
|
|
693
|
+
});
|
|
694
|
+
return decorateServiceException(exception, body);
|
|
695
|
+
};
|
|
696
|
+
const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
|
|
697
|
+
const body = parsedOutput.body;
|
|
698
|
+
const deserialized = _json(body);
|
|
699
|
+
const exception = new InvalidParameterException({
|
|
700
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
701
|
+
...deserialized,
|
|
702
|
+
});
|
|
703
|
+
return decorateServiceException(exception, body);
|
|
704
|
+
};
|
|
705
|
+
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
706
|
+
const body = parsedOutput.body;
|
|
707
|
+
const deserialized = _json(body);
|
|
708
|
+
const exception = new LimitExceededException({
|
|
709
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
710
|
+
...deserialized,
|
|
711
|
+
});
|
|
712
|
+
return decorateServiceException(exception, body);
|
|
713
|
+
};
|
|
714
|
+
const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
|
|
715
|
+
const body = parsedOutput.body;
|
|
716
|
+
const deserialized = _json(body);
|
|
717
|
+
const exception = new NotAuthorizedException({
|
|
718
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
719
|
+
...deserialized,
|
|
720
|
+
});
|
|
721
|
+
return decorateServiceException(exception, body);
|
|
722
|
+
};
|
|
723
|
+
const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
|
|
724
|
+
const body = parsedOutput.body;
|
|
725
|
+
const deserialized = _json(body);
|
|
726
|
+
const exception = new ResourceConflictException({
|
|
727
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
728
|
+
...deserialized,
|
|
729
|
+
});
|
|
730
|
+
return decorateServiceException(exception, body);
|
|
731
|
+
};
|
|
732
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
733
|
+
const body = parsedOutput.body;
|
|
734
|
+
const deserialized = _json(body);
|
|
735
|
+
const exception = new ResourceNotFoundException({
|
|
736
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
737
|
+
...deserialized,
|
|
738
|
+
});
|
|
739
|
+
return decorateServiceException(exception, body);
|
|
740
|
+
};
|
|
741
|
+
const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
|
|
742
|
+
const body = parsedOutput.body;
|
|
743
|
+
const deserialized = _json(body);
|
|
744
|
+
const exception = new TooManyRequestsException({
|
|
745
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
746
|
+
...deserialized,
|
|
747
|
+
});
|
|
748
|
+
return decorateServiceException(exception, body);
|
|
749
|
+
};
|
|
750
|
+
const de_Credentials = (output, context) => {
|
|
751
|
+
return take(output, {
|
|
752
|
+
AccessKeyId: expectString,
|
|
753
|
+
Expiration: (_) => expectNonNull(parseEpochTimestamp(expectNumber(_))),
|
|
754
|
+
SecretKey: expectString,
|
|
755
|
+
SessionToken: expectString,
|
|
756
|
+
});
|
|
757
|
+
};
|
|
758
|
+
const de_GetCredentialsForIdentityResponse = (output, context) => {
|
|
759
|
+
return take(output, {
|
|
760
|
+
Credentials: (_) => de_Credentials(_),
|
|
761
|
+
IdentityId: expectString,
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
const deserializeMetadata = (output) => ({
|
|
765
|
+
httpStatusCode: output.statusCode,
|
|
766
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
767
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
768
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
769
|
+
});
|
|
770
|
+
const throwDefaultError = withBaseException(CognitoIdentityServiceException);
|
|
771
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
772
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
773
|
+
const contents = {
|
|
774
|
+
protocol,
|
|
775
|
+
hostname,
|
|
776
|
+
port,
|
|
777
|
+
method: "POST",
|
|
778
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
779
|
+
headers,
|
|
780
|
+
};
|
|
781
|
+
if (body !== undefined) {
|
|
782
|
+
contents.body = body;
|
|
783
|
+
}
|
|
784
|
+
return new HttpRequest(contents);
|
|
785
|
+
};
|
|
786
|
+
function sharedHeaders(operation) {
|
|
787
|
+
return {
|
|
788
|
+
"content-type": "application/x-amz-json-1.1",
|
|
789
|
+
"x-amz-target": `AWSCognitoIdentityService.${operation}`,
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
class GetCredentialsForIdentityCommand extends Command
|
|
794
|
+
.classBuilder()
|
|
795
|
+
.ep(commonParams)
|
|
796
|
+
.m(function (Command, cs, config, o) {
|
|
797
|
+
return [
|
|
798
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
799
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
800
|
+
];
|
|
801
|
+
})
|
|
802
|
+
.s("AWSCognitoIdentityService", "GetCredentialsForIdentity", {})
|
|
803
|
+
.n("CognitoIdentityClient", "GetCredentialsForIdentityCommand")
|
|
804
|
+
.f(GetCredentialsForIdentityInputFilterSensitiveLog, GetCredentialsForIdentityResponseFilterSensitiveLog)
|
|
805
|
+
.ser(se_GetCredentialsForIdentityCommand)
|
|
806
|
+
.de(de_GetCredentialsForIdentityCommand)
|
|
807
|
+
.build() {
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
class GetIdCommand extends Command
|
|
811
|
+
.classBuilder()
|
|
812
|
+
.ep(commonParams)
|
|
813
|
+
.m(function (Command, cs, config, o) {
|
|
814
|
+
return [
|
|
815
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
816
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
817
|
+
];
|
|
818
|
+
})
|
|
819
|
+
.s("AWSCognitoIdentityService", "GetId", {})
|
|
820
|
+
.n("CognitoIdentityClient", "GetIdCommand")
|
|
821
|
+
.f(GetIdInputFilterSensitiveLog, undefined)
|
|
822
|
+
.ser(se_GetIdCommand)
|
|
823
|
+
.de(de_GetIdCommand)
|
|
824
|
+
.build() {
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
export { CognitoIdentityClient, GetCredentialsForIdentityCommand, GetIdCommand };
|
|
828
|
+
//# sourceMappingURL=loadCognitoIdentity-CWxGlq_8.js.map
|