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.
Files changed (47) hide show
  1. package/LICENSE +44 -0
  2. package/dist/AssumeRoleCommand-Cse3dzcY.js +3650 -0
  3. package/dist/AssumeRoleCommand-Cse3dzcY.js.map +1 -0
  4. package/dist/create-aggregated-client-BFp7oxSr.js +24 -0
  5. package/dist/create-aggregated-client-BFp7oxSr.js.map +1 -0
  6. package/dist/extended-encode-uri-component-Dlbpb2Wd.js +8 -0
  7. package/dist/extended-encode-uri-component-Dlbpb2Wd.js.map +1 -0
  8. package/dist/index-B6QXpY-b.js +37 -0
  9. package/dist/index-B6QXpY-b.js.map +1 -0
  10. package/dist/index-BRCgFUbU.js +37 -0
  11. package/dist/index-BRCgFUbU.js.map +1 -0
  12. package/dist/index-BZHBFaQF.js +37 -0
  13. package/dist/index-BZHBFaQF.js.map +1 -0
  14. package/dist/index-B_Yunpbk.js +37 -0
  15. package/dist/index-B_Yunpbk.js.map +1 -0
  16. package/dist/index-BpMCSgn8.js +1145 -0
  17. package/dist/index-BpMCSgn8.js.map +1 -0
  18. package/dist/index-BxJx8yLU.js +37 -0
  19. package/dist/index-BxJx8yLU.js.map +1 -0
  20. package/dist/index-CF0rZfmW.js +37 -0
  21. package/dist/index-CF0rZfmW.js.map +1 -0
  22. package/dist/index-DeZeG5u4.js +3726 -0
  23. package/dist/index-DeZeG5u4.js.map +1 -0
  24. package/dist/index-_YTyVz_X.js +298 -0
  25. package/dist/index-_YTyVz_X.js.map +1 -0
  26. package/dist/index-lqkrgSwk.js +37 -0
  27. package/dist/index-lqkrgSwk.js.map +1 -0
  28. package/dist/index.js +152931 -39
  29. package/dist/index.js.map +1 -0
  30. package/dist/loadCognitoIdentity-CWxGlq_8.js +828 -0
  31. package/dist/loadCognitoIdentity-CWxGlq_8.js.map +1 -0
  32. package/dist/loadSso-MEAVww3h.js +615 -0
  33. package/dist/loadSso-MEAVww3h.js.map +1 -0
  34. package/dist/loadSts-DEnlAvEU.js +40 -0
  35. package/dist/loadSts-DEnlAvEU.js.map +1 -0
  36. package/dist/parseJsonBody-C_mcRkFo.js +161 -0
  37. package/dist/parseJsonBody-C_mcRkFo.js.map +1 -0
  38. package/dist/requestBuilder-CuNXirlx.js +90 -0
  39. package/dist/requestBuilder-CuNXirlx.js.map +1 -0
  40. package/package.json +16 -5
  41. package/starter-files/config.ts +28 -0
  42. package/starter-files/mastra-pg.docker-compose.yaml +15 -0
  43. package/starter-files/tools.ts +95 -0
  44. package/starter-files/workflow.ts +173 -0
  45. package/dist/index.d.ts +0 -2
  46. package/dist/utils.d.ts +0 -1
  47. package/dist/utils.js +0 -11
@@ -0,0 +1,1145 @@
1
+ import { d as getSmithyContext, n as normalizeProvider, r as resolveAwsSdkSigV4Config, f as customEndpointFunctions, h as awsEndpointFunctions, e as resolveEndpoint, E as EndpointCache, 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, a0 as withBaseException, $ as decorateServiceException, 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, K as expectNonNull, O as expectObject, J as expectString, P as expectInt32, Q as expectLong } from './index.js';
3
+ import 'node:buffer';
4
+ import { c as createAggregatedClient } from './create-aggregated-client-BFp7oxSr.js';
5
+ import { r as requestBuilder } from './requestBuilder-CuNXirlx.js';
6
+ import { t as take, _ as _json, m as map, p as parseJsonBody, a as parseJsonErrorBody, l as loadRestJsonErrorCode } from './parseJsonBody-C_mcRkFo.js';
7
+ import 'node:stream';
8
+ import 'node:crypto';
9
+ import 'node:os';
10
+ import 'node:process';
11
+ import 'node:fs';
12
+ import 'commander';
13
+ import 'node:path';
14
+ import 'posthog-node';
15
+ import 'node:url';
16
+ import 'node:readline';
17
+ import 'node:tty';
18
+ import 'node:child_process';
19
+ import 'node:util';
20
+ import 'prettier';
21
+ import 'fs-extra/esm';
22
+ import 'node:fs/promises';
23
+ import 'execa';
24
+ import 'node:events';
25
+ import 'node:assert';
26
+ import 'node:worker_threads';
27
+ import 'node:module';
28
+ import 'node:string_decoder';
29
+ import '@opentelemetry/api';
30
+ import '@opentelemetry/auto-instrumentations-node';
31
+ import '@opentelemetry/exporter-trace-otlp-http';
32
+ import '@opentelemetry/resources';
33
+ import '@opentelemetry/sdk-node';
34
+ import '@opentelemetry/sdk-trace-base';
35
+ import '@opentelemetry/semantic-conventions';
36
+ import 'node:http';
37
+ import 'node:https';
38
+ import 'node:punycode';
39
+ import 'node:zlib';
40
+ import 'fs-extra';
41
+ import './extended-encode-uri-component-Dlbpb2Wd.js';
42
+
43
+ const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
44
+ return {
45
+ operation: getSmithyContext(context).operation,
46
+ region: (await normalizeProvider(config.region)()) ||
47
+ (() => {
48
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
49
+ })(),
50
+ };
51
+ };
52
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
53
+ return {
54
+ schemeId: "aws.auth#sigv4",
55
+ signingProperties: {
56
+ name: "sso-oauth",
57
+ region: authParameters.region,
58
+ },
59
+ propertiesExtractor: (config, context) => ({
60
+ signingProperties: {
61
+ config,
62
+ context,
63
+ },
64
+ }),
65
+ };
66
+ }
67
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
68
+ return {
69
+ schemeId: "smithy.api#noAuth",
70
+ };
71
+ }
72
+ const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
73
+ const options = [];
74
+ switch (authParameters.operation) {
75
+ case "CreateToken": {
76
+ options.push(createSmithyApiNoAuthHttpAuthOption());
77
+ break;
78
+ }
79
+ case "RegisterClient": {
80
+ options.push(createSmithyApiNoAuthHttpAuthOption());
81
+ break;
82
+ }
83
+ case "StartDeviceAuthorization": {
84
+ options.push(createSmithyApiNoAuthHttpAuthOption());
85
+ break;
86
+ }
87
+ default: {
88
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
89
+ }
90
+ }
91
+ return options;
92
+ };
93
+ const resolveHttpAuthSchemeConfig = (config) => {
94
+ const config_0 = resolveAwsSdkSigV4Config(config);
95
+ return {
96
+ ...config_0,
97
+ };
98
+ };
99
+
100
+ const resolveClientEndpointParameters = (options) => {
101
+ return {
102
+ ...options,
103
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
104
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
105
+ defaultSigningName: "sso-oauth",
106
+ };
107
+ };
108
+ const commonParams = {
109
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
110
+ Endpoint: { type: "builtInParams", name: "endpoint" },
111
+ Region: { type: "builtInParams", name: "region" },
112
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
113
+ };
114
+
115
+ var name = "@aws-sdk/client-sso-oidc";
116
+ var description = "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native";
117
+ var version = "3.716.0";
118
+ var scripts = {
119
+ build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
120
+ "build:cjs": "node ../../scripts/compilation/inline client-sso-oidc",
121
+ "build:es": "tsc -p tsconfig.es.json",
122
+ "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
123
+ "build:types": "tsc -p tsconfig.types.json",
124
+ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
125
+ clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
126
+ "extract:docs": "api-extractor run --local",
127
+ "generate:client": "node ../../scripts/generate-clients/single-service --solo sso-oidc"
128
+ };
129
+ var main = "./dist-cjs/index.js";
130
+ var types = "./dist-types/index.d.ts";
131
+ var module = "./dist-es/index.js";
132
+ var sideEffects = false;
133
+ var dependencies = {
134
+ "@aws-crypto/sha256-browser": "5.2.0",
135
+ "@aws-crypto/sha256-js": "5.2.0",
136
+ "@aws-sdk/core": "3.716.0",
137
+ "@aws-sdk/credential-provider-node": "3.716.0",
138
+ "@aws-sdk/middleware-host-header": "3.714.0",
139
+ "@aws-sdk/middleware-logger": "3.714.0",
140
+ "@aws-sdk/middleware-recursion-detection": "3.714.0",
141
+ "@aws-sdk/middleware-user-agent": "3.716.0",
142
+ "@aws-sdk/region-config-resolver": "3.714.0",
143
+ "@aws-sdk/types": "3.714.0",
144
+ "@aws-sdk/util-endpoints": "3.714.0",
145
+ "@aws-sdk/util-user-agent-browser": "3.714.0",
146
+ "@aws-sdk/util-user-agent-node": "3.716.0",
147
+ "@smithy/config-resolver": "^3.0.13",
148
+ "@smithy/core": "^2.5.5",
149
+ "@smithy/fetch-http-handler": "^4.1.2",
150
+ "@smithy/hash-node": "^3.0.11",
151
+ "@smithy/invalid-dependency": "^3.0.11",
152
+ "@smithy/middleware-content-length": "^3.0.13",
153
+ "@smithy/middleware-endpoint": "^3.2.6",
154
+ "@smithy/middleware-retry": "^3.0.31",
155
+ "@smithy/middleware-serde": "^3.0.11",
156
+ "@smithy/middleware-stack": "^3.0.11",
157
+ "@smithy/node-config-provider": "^3.1.12",
158
+ "@smithy/node-http-handler": "^3.3.2",
159
+ "@smithy/protocol-http": "^4.1.8",
160
+ "@smithy/smithy-client": "^3.5.1",
161
+ "@smithy/types": "^3.7.2",
162
+ "@smithy/url-parser": "^3.0.11",
163
+ "@smithy/util-base64": "^3.0.0",
164
+ "@smithy/util-body-length-browser": "^3.0.0",
165
+ "@smithy/util-body-length-node": "^3.0.0",
166
+ "@smithy/util-defaults-mode-browser": "^3.0.31",
167
+ "@smithy/util-defaults-mode-node": "^3.0.31",
168
+ "@smithy/util-endpoints": "^2.1.7",
169
+ "@smithy/util-middleware": "^3.0.11",
170
+ "@smithy/util-retry": "^3.0.11",
171
+ "@smithy/util-utf8": "^3.0.0",
172
+ tslib: "^2.6.2"
173
+ };
174
+ var devDependencies = {
175
+ "@tsconfig/node16": "16.1.3",
176
+ "@types/node": "^16.18.96",
177
+ concurrently: "7.0.0",
178
+ "downlevel-dts": "0.10.1",
179
+ rimraf: "3.0.2",
180
+ typescript: "~4.9.5"
181
+ };
182
+ var engines = {
183
+ node: ">=16.0.0"
184
+ };
185
+ var typesVersions = {
186
+ "<4.0": {
187
+ "dist-types/*": [
188
+ "dist-types/ts3.4/*"
189
+ ]
190
+ }
191
+ };
192
+ var files = [
193
+ "dist-*/**"
194
+ ];
195
+ var author = {
196
+ name: "AWS SDK for JavaScript Team",
197
+ url: "https://aws.amazon.com/javascript/"
198
+ };
199
+ var license = "Apache-2.0";
200
+ var peerDependencies = {
201
+ "@aws-sdk/client-sts": "^3.716.0"
202
+ };
203
+ var browser = {
204
+ "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
205
+ };
206
+ var homepage = "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc";
207
+ var repository = {
208
+ type: "git",
209
+ url: "https://github.com/aws/aws-sdk-js-v3.git",
210
+ directory: "clients/client-sso-oidc"
211
+ };
212
+ var packageInfo = {
213
+ name: name,
214
+ description: description,
215
+ version: version,
216
+ scripts: scripts,
217
+ main: main,
218
+ types: types,
219
+ module: module,
220
+ sideEffects: sideEffects,
221
+ dependencies: dependencies,
222
+ devDependencies: devDependencies,
223
+ engines: engines,
224
+ typesVersions: typesVersions,
225
+ files: files,
226
+ author: author,
227
+ license: license,
228
+ peerDependencies: peerDependencies,
229
+ browser: browser,
230
+ "react-native": {
231
+ "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
232
+ },
233
+ homepage: homepage,
234
+ repository: repository
235
+ };
236
+
237
+ const u = "required", v = "fn", w = "argv", x = "ref";
238
+ const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "String" }, j = { [u]: true, "default": false, "type": "Boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }];
239
+ const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
240
+ const ruleSet = _data;
241
+
242
+ const cache = new EndpointCache({
243
+ size: 50,
244
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
245
+ });
246
+ const defaultEndpointResolver = (endpointParams, context = {}) => {
247
+ return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
248
+ endpointParams: endpointParams,
249
+ logger: context.logger,
250
+ }));
251
+ };
252
+ customEndpointFunctions.aws = awsEndpointFunctions;
253
+
254
+ const getRuntimeConfig$1 = (config) => {
255
+ return {
256
+ apiVersion: "2019-06-10",
257
+ base64Decoder: config?.base64Decoder ?? fromBase64,
258
+ base64Encoder: config?.base64Encoder ?? toBase64,
259
+ disableHostPrefix: config?.disableHostPrefix ?? false,
260
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
261
+ extensions: config?.extensions ?? [],
262
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider,
263
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
264
+ {
265
+ schemeId: "aws.auth#sigv4",
266
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
267
+ signer: new AwsSdkSigV4Signer(),
268
+ },
269
+ {
270
+ schemeId: "smithy.api#noAuth",
271
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
272
+ signer: new NoAuthSigner(),
273
+ },
274
+ ],
275
+ logger: config?.logger ?? new NoOpLogger(),
276
+ serviceId: config?.serviceId ?? "SSO OIDC",
277
+ urlParser: config?.urlParser ?? parseUrl,
278
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
279
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
280
+ };
281
+ };
282
+
283
+ const getRuntimeConfig = (config) => {
284
+ emitWarningIfUnsupportedVersion(process.version);
285
+ const defaultsMode = resolveDefaultsModeConfig(config);
286
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
287
+ const clientSharedValues = getRuntimeConfig$1(config);
288
+ emitWarningIfUnsupportedVersion$1(process.version);
289
+ const profileConfig = { profile: config?.profile };
290
+ return {
291
+ ...clientSharedValues,
292
+ ...config,
293
+ runtime: "node",
294
+ defaultsMode,
295
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
296
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
297
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
298
+ createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
299
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
300
+ region: config?.region ??
301
+ loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
302
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
303
+ retryMode: config?.retryMode ??
304
+ loadConfig({
305
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
306
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
307
+ }, config),
308
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
309
+ streamCollector: config?.streamCollector ?? streamCollector,
310
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
311
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
312
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
313
+ };
314
+ };
315
+
316
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
317
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
318
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
319
+ let _credentials = runtimeConfig.credentials;
320
+ return {
321
+ setHttpAuthScheme(httpAuthScheme) {
322
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
323
+ if (index === -1) {
324
+ _httpAuthSchemes.push(httpAuthScheme);
325
+ }
326
+ else {
327
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
328
+ }
329
+ },
330
+ httpAuthSchemes() {
331
+ return _httpAuthSchemes;
332
+ },
333
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
334
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
335
+ },
336
+ httpAuthSchemeProvider() {
337
+ return _httpAuthSchemeProvider;
338
+ },
339
+ setCredentials(credentials) {
340
+ _credentials = credentials;
341
+ },
342
+ credentials() {
343
+ return _credentials;
344
+ },
345
+ };
346
+ };
347
+ const resolveHttpAuthRuntimeConfig = (config) => {
348
+ return {
349
+ httpAuthSchemes: config.httpAuthSchemes(),
350
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
351
+ credentials: config.credentials(),
352
+ };
353
+ };
354
+
355
+ const asPartial = (t) => t;
356
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
357
+ const extensionConfiguration = {
358
+ ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
359
+ ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
360
+ ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
361
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
362
+ };
363
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
364
+ return {
365
+ ...runtimeConfig,
366
+ ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
367
+ ...resolveDefaultRuntimeConfig(extensionConfiguration),
368
+ ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
369
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration),
370
+ };
371
+ };
372
+
373
+ class SSOOIDCClient extends Client {
374
+ constructor(...[configuration]) {
375
+ const _config_0 = getRuntimeConfig(configuration || {});
376
+ const _config_1 = resolveClientEndpointParameters(_config_0);
377
+ const _config_2 = resolveUserAgentConfig(_config_1);
378
+ const _config_3 = resolveRetryConfig(_config_2);
379
+ const _config_4 = resolveRegionConfig(_config_3);
380
+ const _config_5 = resolveHostHeaderConfig(_config_4);
381
+ const _config_6 = resolveEndpointConfig(_config_5);
382
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
383
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
384
+ super(_config_8);
385
+ this.config = _config_8;
386
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
387
+ this.middlewareStack.use(getRetryPlugin(this.config));
388
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
389
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
390
+ this.middlewareStack.use(getLoggerPlugin(this.config));
391
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
392
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
393
+ httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider,
394
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
395
+ "aws.auth#sigv4": config.credentials,
396
+ }),
397
+ }));
398
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
399
+ }
400
+ destroy() {
401
+ super.destroy();
402
+ }
403
+ }
404
+
405
+ class SSOOIDCServiceException extends ServiceException {
406
+ constructor(options) {
407
+ super(options);
408
+ Object.setPrototypeOf(this, SSOOIDCServiceException.prototype);
409
+ }
410
+ }
411
+
412
+ class AccessDeniedException extends SSOOIDCServiceException {
413
+ constructor(opts) {
414
+ super({
415
+ name: "AccessDeniedException",
416
+ $fault: "client",
417
+ ...opts,
418
+ });
419
+ this.name = "AccessDeniedException";
420
+ this.$fault = "client";
421
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
422
+ this.error = opts.error;
423
+ this.error_description = opts.error_description;
424
+ }
425
+ }
426
+ class AuthorizationPendingException extends SSOOIDCServiceException {
427
+ constructor(opts) {
428
+ super({
429
+ name: "AuthorizationPendingException",
430
+ $fault: "client",
431
+ ...opts,
432
+ });
433
+ this.name = "AuthorizationPendingException";
434
+ this.$fault = "client";
435
+ Object.setPrototypeOf(this, AuthorizationPendingException.prototype);
436
+ this.error = opts.error;
437
+ this.error_description = opts.error_description;
438
+ }
439
+ }
440
+ class ExpiredTokenException extends SSOOIDCServiceException {
441
+ constructor(opts) {
442
+ super({
443
+ name: "ExpiredTokenException",
444
+ $fault: "client",
445
+ ...opts,
446
+ });
447
+ this.name = "ExpiredTokenException";
448
+ this.$fault = "client";
449
+ Object.setPrototypeOf(this, ExpiredTokenException.prototype);
450
+ this.error = opts.error;
451
+ this.error_description = opts.error_description;
452
+ }
453
+ }
454
+ class InternalServerException extends SSOOIDCServiceException {
455
+ constructor(opts) {
456
+ super({
457
+ name: "InternalServerException",
458
+ $fault: "server",
459
+ ...opts,
460
+ });
461
+ this.name = "InternalServerException";
462
+ this.$fault = "server";
463
+ Object.setPrototypeOf(this, InternalServerException.prototype);
464
+ this.error = opts.error;
465
+ this.error_description = opts.error_description;
466
+ }
467
+ }
468
+ class InvalidClientException extends SSOOIDCServiceException {
469
+ constructor(opts) {
470
+ super({
471
+ name: "InvalidClientException",
472
+ $fault: "client",
473
+ ...opts,
474
+ });
475
+ this.name = "InvalidClientException";
476
+ this.$fault = "client";
477
+ Object.setPrototypeOf(this, InvalidClientException.prototype);
478
+ this.error = opts.error;
479
+ this.error_description = opts.error_description;
480
+ }
481
+ }
482
+ class InvalidGrantException extends SSOOIDCServiceException {
483
+ constructor(opts) {
484
+ super({
485
+ name: "InvalidGrantException",
486
+ $fault: "client",
487
+ ...opts,
488
+ });
489
+ this.name = "InvalidGrantException";
490
+ this.$fault = "client";
491
+ Object.setPrototypeOf(this, InvalidGrantException.prototype);
492
+ this.error = opts.error;
493
+ this.error_description = opts.error_description;
494
+ }
495
+ }
496
+ class InvalidRequestException extends SSOOIDCServiceException {
497
+ constructor(opts) {
498
+ super({
499
+ name: "InvalidRequestException",
500
+ $fault: "client",
501
+ ...opts,
502
+ });
503
+ this.name = "InvalidRequestException";
504
+ this.$fault = "client";
505
+ Object.setPrototypeOf(this, InvalidRequestException.prototype);
506
+ this.error = opts.error;
507
+ this.error_description = opts.error_description;
508
+ }
509
+ }
510
+ class InvalidScopeException extends SSOOIDCServiceException {
511
+ constructor(opts) {
512
+ super({
513
+ name: "InvalidScopeException",
514
+ $fault: "client",
515
+ ...opts,
516
+ });
517
+ this.name = "InvalidScopeException";
518
+ this.$fault = "client";
519
+ Object.setPrototypeOf(this, InvalidScopeException.prototype);
520
+ this.error = opts.error;
521
+ this.error_description = opts.error_description;
522
+ }
523
+ }
524
+ class SlowDownException extends SSOOIDCServiceException {
525
+ constructor(opts) {
526
+ super({
527
+ name: "SlowDownException",
528
+ $fault: "client",
529
+ ...opts,
530
+ });
531
+ this.name = "SlowDownException";
532
+ this.$fault = "client";
533
+ Object.setPrototypeOf(this, SlowDownException.prototype);
534
+ this.error = opts.error;
535
+ this.error_description = opts.error_description;
536
+ }
537
+ }
538
+ class UnauthorizedClientException extends SSOOIDCServiceException {
539
+ constructor(opts) {
540
+ super({
541
+ name: "UnauthorizedClientException",
542
+ $fault: "client",
543
+ ...opts,
544
+ });
545
+ this.name = "UnauthorizedClientException";
546
+ this.$fault = "client";
547
+ Object.setPrototypeOf(this, UnauthorizedClientException.prototype);
548
+ this.error = opts.error;
549
+ this.error_description = opts.error_description;
550
+ }
551
+ }
552
+ class UnsupportedGrantTypeException extends SSOOIDCServiceException {
553
+ constructor(opts) {
554
+ super({
555
+ name: "UnsupportedGrantTypeException",
556
+ $fault: "client",
557
+ ...opts,
558
+ });
559
+ this.name = "UnsupportedGrantTypeException";
560
+ this.$fault = "client";
561
+ Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype);
562
+ this.error = opts.error;
563
+ this.error_description = opts.error_description;
564
+ }
565
+ }
566
+ class InvalidRequestRegionException extends SSOOIDCServiceException {
567
+ constructor(opts) {
568
+ super({
569
+ name: "InvalidRequestRegionException",
570
+ $fault: "client",
571
+ ...opts,
572
+ });
573
+ this.name = "InvalidRequestRegionException";
574
+ this.$fault = "client";
575
+ Object.setPrototypeOf(this, InvalidRequestRegionException.prototype);
576
+ this.error = opts.error;
577
+ this.error_description = opts.error_description;
578
+ this.endpoint = opts.endpoint;
579
+ this.region = opts.region;
580
+ }
581
+ }
582
+ class InvalidClientMetadataException extends SSOOIDCServiceException {
583
+ constructor(opts) {
584
+ super({
585
+ name: "InvalidClientMetadataException",
586
+ $fault: "client",
587
+ ...opts,
588
+ });
589
+ this.name = "InvalidClientMetadataException";
590
+ this.$fault = "client";
591
+ Object.setPrototypeOf(this, InvalidClientMetadataException.prototype);
592
+ this.error = opts.error;
593
+ this.error_description = opts.error_description;
594
+ }
595
+ }
596
+ class InvalidRedirectUriException extends SSOOIDCServiceException {
597
+ constructor(opts) {
598
+ super({
599
+ name: "InvalidRedirectUriException",
600
+ $fault: "client",
601
+ ...opts,
602
+ });
603
+ this.name = "InvalidRedirectUriException";
604
+ this.$fault = "client";
605
+ Object.setPrototypeOf(this, InvalidRedirectUriException.prototype);
606
+ this.error = opts.error;
607
+ this.error_description = opts.error_description;
608
+ }
609
+ }
610
+ const CreateTokenRequestFilterSensitiveLog = (obj) => ({
611
+ ...obj,
612
+ ...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
613
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
614
+ ...(obj.codeVerifier && { codeVerifier: SENSITIVE_STRING }),
615
+ });
616
+ const CreateTokenResponseFilterSensitiveLog = (obj) => ({
617
+ ...obj,
618
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
619
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
620
+ ...(obj.idToken && { idToken: SENSITIVE_STRING }),
621
+ });
622
+ const CreateTokenWithIAMRequestFilterSensitiveLog = (obj) => ({
623
+ ...obj,
624
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
625
+ ...(obj.assertion && { assertion: SENSITIVE_STRING }),
626
+ ...(obj.subjectToken && { subjectToken: SENSITIVE_STRING }),
627
+ ...(obj.codeVerifier && { codeVerifier: SENSITIVE_STRING }),
628
+ });
629
+ const CreateTokenWithIAMResponseFilterSensitiveLog = (obj) => ({
630
+ ...obj,
631
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
632
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
633
+ ...(obj.idToken && { idToken: SENSITIVE_STRING }),
634
+ });
635
+ const RegisterClientResponseFilterSensitiveLog = (obj) => ({
636
+ ...obj,
637
+ ...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
638
+ });
639
+ const StartDeviceAuthorizationRequestFilterSensitiveLog = (obj) => ({
640
+ ...obj,
641
+ ...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
642
+ });
643
+
644
+ const se_CreateTokenCommand = async (input, context) => {
645
+ const b = requestBuilder(input, context);
646
+ const headers = {
647
+ "content-type": "application/json",
648
+ };
649
+ b.bp("/token");
650
+ let body;
651
+ body = JSON.stringify(take(input, {
652
+ clientId: [],
653
+ clientSecret: [],
654
+ code: [],
655
+ codeVerifier: [],
656
+ deviceCode: [],
657
+ grantType: [],
658
+ redirectUri: [],
659
+ refreshToken: [],
660
+ scope: (_) => _json(_),
661
+ }));
662
+ b.m("POST").h(headers).b(body);
663
+ return b.build();
664
+ };
665
+ const se_CreateTokenWithIAMCommand = async (input, context) => {
666
+ const b = requestBuilder(input, context);
667
+ const headers = {
668
+ "content-type": "application/json",
669
+ };
670
+ b.bp("/token");
671
+ const query = map({
672
+ [_ai]: [, "t"],
673
+ });
674
+ let body;
675
+ body = JSON.stringify(take(input, {
676
+ assertion: [],
677
+ clientId: [],
678
+ code: [],
679
+ codeVerifier: [],
680
+ grantType: [],
681
+ redirectUri: [],
682
+ refreshToken: [],
683
+ requestedTokenType: [],
684
+ scope: (_) => _json(_),
685
+ subjectToken: [],
686
+ subjectTokenType: [],
687
+ }));
688
+ b.m("POST").h(headers).q(query).b(body);
689
+ return b.build();
690
+ };
691
+ const se_RegisterClientCommand = async (input, context) => {
692
+ const b = requestBuilder(input, context);
693
+ const headers = {
694
+ "content-type": "application/json",
695
+ };
696
+ b.bp("/client/register");
697
+ let body;
698
+ body = JSON.stringify(take(input, {
699
+ clientName: [],
700
+ clientType: [],
701
+ entitledApplicationArn: [],
702
+ grantTypes: (_) => _json(_),
703
+ issuerUrl: [],
704
+ redirectUris: (_) => _json(_),
705
+ scopes: (_) => _json(_),
706
+ }));
707
+ b.m("POST").h(headers).b(body);
708
+ return b.build();
709
+ };
710
+ const se_StartDeviceAuthorizationCommand = async (input, context) => {
711
+ const b = requestBuilder(input, context);
712
+ const headers = {
713
+ "content-type": "application/json",
714
+ };
715
+ b.bp("/device_authorization");
716
+ let body;
717
+ body = JSON.stringify(take(input, {
718
+ clientId: [],
719
+ clientSecret: [],
720
+ startUrl: [],
721
+ }));
722
+ b.m("POST").h(headers).b(body);
723
+ return b.build();
724
+ };
725
+ const de_CreateTokenCommand = async (output, context) => {
726
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
727
+ return de_CommandError(output, context);
728
+ }
729
+ const contents = map({
730
+ $metadata: deserializeMetadata(output),
731
+ });
732
+ const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
733
+ const doc = take(data, {
734
+ accessToken: expectString,
735
+ expiresIn: expectInt32,
736
+ idToken: expectString,
737
+ refreshToken: expectString,
738
+ tokenType: expectString,
739
+ });
740
+ Object.assign(contents, doc);
741
+ return contents;
742
+ };
743
+ const de_CreateTokenWithIAMCommand = async (output, context) => {
744
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
745
+ return de_CommandError(output, context);
746
+ }
747
+ const contents = map({
748
+ $metadata: deserializeMetadata(output),
749
+ });
750
+ const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
751
+ const doc = take(data, {
752
+ accessToken: expectString,
753
+ expiresIn: expectInt32,
754
+ idToken: expectString,
755
+ issuedTokenType: expectString,
756
+ refreshToken: expectString,
757
+ scope: _json,
758
+ tokenType: expectString,
759
+ });
760
+ Object.assign(contents, doc);
761
+ return contents;
762
+ };
763
+ const de_RegisterClientCommand = async (output, context) => {
764
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
765
+ return de_CommandError(output, context);
766
+ }
767
+ const contents = map({
768
+ $metadata: deserializeMetadata(output),
769
+ });
770
+ const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
771
+ const doc = take(data, {
772
+ authorizationEndpoint: expectString,
773
+ clientId: expectString,
774
+ clientIdIssuedAt: expectLong,
775
+ clientSecret: expectString,
776
+ clientSecretExpiresAt: expectLong,
777
+ tokenEndpoint: expectString,
778
+ });
779
+ Object.assign(contents, doc);
780
+ return contents;
781
+ };
782
+ const de_StartDeviceAuthorizationCommand = async (output, context) => {
783
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
784
+ return de_CommandError(output, context);
785
+ }
786
+ const contents = map({
787
+ $metadata: deserializeMetadata(output),
788
+ });
789
+ const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
790
+ const doc = take(data, {
791
+ deviceCode: expectString,
792
+ expiresIn: expectInt32,
793
+ interval: expectInt32,
794
+ userCode: expectString,
795
+ verificationUri: expectString,
796
+ verificationUriComplete: expectString,
797
+ });
798
+ Object.assign(contents, doc);
799
+ return contents;
800
+ };
801
+ const de_CommandError = async (output, context) => {
802
+ const parsedOutput = {
803
+ ...output,
804
+ body: await parseJsonErrorBody(output.body, context),
805
+ };
806
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
807
+ switch (errorCode) {
808
+ case "AccessDeniedException":
809
+ case "com.amazonaws.ssooidc#AccessDeniedException":
810
+ throw await de_AccessDeniedExceptionRes(parsedOutput);
811
+ case "AuthorizationPendingException":
812
+ case "com.amazonaws.ssooidc#AuthorizationPendingException":
813
+ throw await de_AuthorizationPendingExceptionRes(parsedOutput);
814
+ case "ExpiredTokenException":
815
+ case "com.amazonaws.ssooidc#ExpiredTokenException":
816
+ throw await de_ExpiredTokenExceptionRes(parsedOutput);
817
+ case "InternalServerException":
818
+ case "com.amazonaws.ssooidc#InternalServerException":
819
+ throw await de_InternalServerExceptionRes(parsedOutput);
820
+ case "InvalidClientException":
821
+ case "com.amazonaws.ssooidc#InvalidClientException":
822
+ throw await de_InvalidClientExceptionRes(parsedOutput);
823
+ case "InvalidGrantException":
824
+ case "com.amazonaws.ssooidc#InvalidGrantException":
825
+ throw await de_InvalidGrantExceptionRes(parsedOutput);
826
+ case "InvalidRequestException":
827
+ case "com.amazonaws.ssooidc#InvalidRequestException":
828
+ throw await de_InvalidRequestExceptionRes(parsedOutput);
829
+ case "InvalidScopeException":
830
+ case "com.amazonaws.ssooidc#InvalidScopeException":
831
+ throw await de_InvalidScopeExceptionRes(parsedOutput);
832
+ case "SlowDownException":
833
+ case "com.amazonaws.ssooidc#SlowDownException":
834
+ throw await de_SlowDownExceptionRes(parsedOutput);
835
+ case "UnauthorizedClientException":
836
+ case "com.amazonaws.ssooidc#UnauthorizedClientException":
837
+ throw await de_UnauthorizedClientExceptionRes(parsedOutput);
838
+ case "UnsupportedGrantTypeException":
839
+ case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
840
+ throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput);
841
+ case "InvalidRequestRegionException":
842
+ case "com.amazonaws.ssooidc#InvalidRequestRegionException":
843
+ throw await de_InvalidRequestRegionExceptionRes(parsedOutput);
844
+ case "InvalidClientMetadataException":
845
+ case "com.amazonaws.ssooidc#InvalidClientMetadataException":
846
+ throw await de_InvalidClientMetadataExceptionRes(parsedOutput);
847
+ case "InvalidRedirectUriException":
848
+ case "com.amazonaws.ssooidc#InvalidRedirectUriException":
849
+ throw await de_InvalidRedirectUriExceptionRes(parsedOutput);
850
+ default:
851
+ const parsedBody = parsedOutput.body;
852
+ return throwDefaultError({
853
+ output,
854
+ parsedBody,
855
+ errorCode,
856
+ });
857
+ }
858
+ };
859
+ const throwDefaultError = withBaseException(SSOOIDCServiceException);
860
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
861
+ const contents = map({});
862
+ const data = parsedOutput.body;
863
+ const doc = take(data, {
864
+ error: expectString,
865
+ error_description: expectString,
866
+ });
867
+ Object.assign(contents, doc);
868
+ const exception = new AccessDeniedException({
869
+ $metadata: deserializeMetadata(parsedOutput),
870
+ ...contents,
871
+ });
872
+ return decorateServiceException(exception, parsedOutput.body);
873
+ };
874
+ const de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => {
875
+ const contents = map({});
876
+ const data = parsedOutput.body;
877
+ const doc = take(data, {
878
+ error: expectString,
879
+ error_description: expectString,
880
+ });
881
+ Object.assign(contents, doc);
882
+ const exception = new AuthorizationPendingException({
883
+ $metadata: deserializeMetadata(parsedOutput),
884
+ ...contents,
885
+ });
886
+ return decorateServiceException(exception, parsedOutput.body);
887
+ };
888
+ const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
889
+ const contents = map({});
890
+ const data = parsedOutput.body;
891
+ const doc = take(data, {
892
+ error: expectString,
893
+ error_description: expectString,
894
+ });
895
+ Object.assign(contents, doc);
896
+ const exception = new ExpiredTokenException({
897
+ $metadata: deserializeMetadata(parsedOutput),
898
+ ...contents,
899
+ });
900
+ return decorateServiceException(exception, parsedOutput.body);
901
+ };
902
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
903
+ const contents = map({});
904
+ const data = parsedOutput.body;
905
+ const doc = take(data, {
906
+ error: expectString,
907
+ error_description: expectString,
908
+ });
909
+ Object.assign(contents, doc);
910
+ const exception = new InternalServerException({
911
+ $metadata: deserializeMetadata(parsedOutput),
912
+ ...contents,
913
+ });
914
+ return decorateServiceException(exception, parsedOutput.body);
915
+ };
916
+ const de_InvalidClientExceptionRes = async (parsedOutput, context) => {
917
+ const contents = map({});
918
+ const data = parsedOutput.body;
919
+ const doc = take(data, {
920
+ error: expectString,
921
+ error_description: expectString,
922
+ });
923
+ Object.assign(contents, doc);
924
+ const exception = new InvalidClientException({
925
+ $metadata: deserializeMetadata(parsedOutput),
926
+ ...contents,
927
+ });
928
+ return decorateServiceException(exception, parsedOutput.body);
929
+ };
930
+ const de_InvalidClientMetadataExceptionRes = async (parsedOutput, context) => {
931
+ const contents = map({});
932
+ const data = parsedOutput.body;
933
+ const doc = take(data, {
934
+ error: expectString,
935
+ error_description: expectString,
936
+ });
937
+ Object.assign(contents, doc);
938
+ const exception = new InvalidClientMetadataException({
939
+ $metadata: deserializeMetadata(parsedOutput),
940
+ ...contents,
941
+ });
942
+ return decorateServiceException(exception, parsedOutput.body);
943
+ };
944
+ const de_InvalidGrantExceptionRes = async (parsedOutput, context) => {
945
+ const contents = map({});
946
+ const data = parsedOutput.body;
947
+ const doc = take(data, {
948
+ error: expectString,
949
+ error_description: expectString,
950
+ });
951
+ Object.assign(contents, doc);
952
+ const exception = new InvalidGrantException({
953
+ $metadata: deserializeMetadata(parsedOutput),
954
+ ...contents,
955
+ });
956
+ return decorateServiceException(exception, parsedOutput.body);
957
+ };
958
+ const de_InvalidRedirectUriExceptionRes = async (parsedOutput, context) => {
959
+ const contents = map({});
960
+ const data = parsedOutput.body;
961
+ const doc = take(data, {
962
+ error: expectString,
963
+ error_description: expectString,
964
+ });
965
+ Object.assign(contents, doc);
966
+ const exception = new InvalidRedirectUriException({
967
+ $metadata: deserializeMetadata(parsedOutput),
968
+ ...contents,
969
+ });
970
+ return decorateServiceException(exception, parsedOutput.body);
971
+ };
972
+ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
973
+ const contents = map({});
974
+ const data = parsedOutput.body;
975
+ const doc = take(data, {
976
+ error: expectString,
977
+ error_description: expectString,
978
+ });
979
+ Object.assign(contents, doc);
980
+ const exception = new InvalidRequestException({
981
+ $metadata: deserializeMetadata(parsedOutput),
982
+ ...contents,
983
+ });
984
+ return decorateServiceException(exception, parsedOutput.body);
985
+ };
986
+ const de_InvalidRequestRegionExceptionRes = async (parsedOutput, context) => {
987
+ const contents = map({});
988
+ const data = parsedOutput.body;
989
+ const doc = take(data, {
990
+ endpoint: expectString,
991
+ error: expectString,
992
+ error_description: expectString,
993
+ region: expectString,
994
+ });
995
+ Object.assign(contents, doc);
996
+ const exception = new InvalidRequestRegionException({
997
+ $metadata: deserializeMetadata(parsedOutput),
998
+ ...contents,
999
+ });
1000
+ return decorateServiceException(exception, parsedOutput.body);
1001
+ };
1002
+ const de_InvalidScopeExceptionRes = async (parsedOutput, context) => {
1003
+ const contents = map({});
1004
+ const data = parsedOutput.body;
1005
+ const doc = take(data, {
1006
+ error: expectString,
1007
+ error_description: expectString,
1008
+ });
1009
+ Object.assign(contents, doc);
1010
+ const exception = new InvalidScopeException({
1011
+ $metadata: deserializeMetadata(parsedOutput),
1012
+ ...contents,
1013
+ });
1014
+ return decorateServiceException(exception, parsedOutput.body);
1015
+ };
1016
+ const de_SlowDownExceptionRes = async (parsedOutput, context) => {
1017
+ const contents = map({});
1018
+ const data = parsedOutput.body;
1019
+ const doc = take(data, {
1020
+ error: expectString,
1021
+ error_description: expectString,
1022
+ });
1023
+ Object.assign(contents, doc);
1024
+ const exception = new SlowDownException({
1025
+ $metadata: deserializeMetadata(parsedOutput),
1026
+ ...contents,
1027
+ });
1028
+ return decorateServiceException(exception, parsedOutput.body);
1029
+ };
1030
+ const de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => {
1031
+ const contents = map({});
1032
+ const data = parsedOutput.body;
1033
+ const doc = take(data, {
1034
+ error: expectString,
1035
+ error_description: expectString,
1036
+ });
1037
+ Object.assign(contents, doc);
1038
+ const exception = new UnauthorizedClientException({
1039
+ $metadata: deserializeMetadata(parsedOutput),
1040
+ ...contents,
1041
+ });
1042
+ return decorateServiceException(exception, parsedOutput.body);
1043
+ };
1044
+ const de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => {
1045
+ const contents = map({});
1046
+ const data = parsedOutput.body;
1047
+ const doc = take(data, {
1048
+ error: expectString,
1049
+ error_description: expectString,
1050
+ });
1051
+ Object.assign(contents, doc);
1052
+ const exception = new UnsupportedGrantTypeException({
1053
+ $metadata: deserializeMetadata(parsedOutput),
1054
+ ...contents,
1055
+ });
1056
+ return decorateServiceException(exception, parsedOutput.body);
1057
+ };
1058
+ const deserializeMetadata = (output) => ({
1059
+ httpStatusCode: output.statusCode,
1060
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1061
+ extendedRequestId: output.headers["x-amz-id-2"],
1062
+ cfId: output.headers["x-amz-cf-id"],
1063
+ });
1064
+ const _ai = "aws_iam";
1065
+
1066
+ class CreateTokenCommand extends Command
1067
+ .classBuilder()
1068
+ .ep(commonParams)
1069
+ .m(function (Command, cs, config, o) {
1070
+ return [
1071
+ getSerdePlugin(config, this.serialize, this.deserialize),
1072
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1073
+ ];
1074
+ })
1075
+ .s("AWSSSOOIDCService", "CreateToken", {})
1076
+ .n("SSOOIDCClient", "CreateTokenCommand")
1077
+ .f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog)
1078
+ .ser(se_CreateTokenCommand)
1079
+ .de(de_CreateTokenCommand)
1080
+ .build() {
1081
+ }
1082
+
1083
+ class CreateTokenWithIAMCommand extends Command
1084
+ .classBuilder()
1085
+ .ep(commonParams)
1086
+ .m(function (Command, cs, config, o) {
1087
+ return [
1088
+ getSerdePlugin(config, this.serialize, this.deserialize),
1089
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1090
+ ];
1091
+ })
1092
+ .s("AWSSSOOIDCService", "CreateTokenWithIAM", {})
1093
+ .n("SSOOIDCClient", "CreateTokenWithIAMCommand")
1094
+ .f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog)
1095
+ .ser(se_CreateTokenWithIAMCommand)
1096
+ .de(de_CreateTokenWithIAMCommand)
1097
+ .build() {
1098
+ }
1099
+
1100
+ class RegisterClientCommand extends Command
1101
+ .classBuilder()
1102
+ .ep(commonParams)
1103
+ .m(function (Command, cs, config, o) {
1104
+ return [
1105
+ getSerdePlugin(config, this.serialize, this.deserialize),
1106
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1107
+ ];
1108
+ })
1109
+ .s("AWSSSOOIDCService", "RegisterClient", {})
1110
+ .n("SSOOIDCClient", "RegisterClientCommand")
1111
+ .f(undefined, RegisterClientResponseFilterSensitiveLog)
1112
+ .ser(se_RegisterClientCommand)
1113
+ .de(de_RegisterClientCommand)
1114
+ .build() {
1115
+ }
1116
+
1117
+ class StartDeviceAuthorizationCommand extends Command
1118
+ .classBuilder()
1119
+ .ep(commonParams)
1120
+ .m(function (Command, cs, config, o) {
1121
+ return [
1122
+ getSerdePlugin(config, this.serialize, this.deserialize),
1123
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1124
+ ];
1125
+ })
1126
+ .s("AWSSSOOIDCService", "StartDeviceAuthorization", {})
1127
+ .n("SSOOIDCClient", "StartDeviceAuthorizationCommand")
1128
+ .f(StartDeviceAuthorizationRequestFilterSensitiveLog, undefined)
1129
+ .ser(se_StartDeviceAuthorizationCommand)
1130
+ .de(de_StartDeviceAuthorizationCommand)
1131
+ .build() {
1132
+ }
1133
+
1134
+ const commands = {
1135
+ CreateTokenCommand,
1136
+ CreateTokenWithIAMCommand,
1137
+ RegisterClientCommand,
1138
+ StartDeviceAuthorizationCommand,
1139
+ };
1140
+ class SSOOIDC extends SSOOIDCClient {
1141
+ }
1142
+ createAggregatedClient(commands, SSOOIDC);
1143
+
1144
+ export { Command as $Command, AccessDeniedException, AuthorizationPendingException, CreateTokenCommand, CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog, CreateTokenWithIAMCommand, CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidClientMetadataException, InvalidGrantException, InvalidRedirectUriException, InvalidRequestException, InvalidRequestRegionException, InvalidScopeException, RegisterClientCommand, RegisterClientResponseFilterSensitiveLog, SSOOIDC, SSOOIDCClient, SSOOIDCServiceException, SlowDownException, StartDeviceAuthorizationCommand, StartDeviceAuthorizationRequestFilterSensitiveLog, UnauthorizedClientException, UnsupportedGrantTypeException, Client as __Client };
1145
+ //# sourceMappingURL=index-BpMCSgn8.js.map