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,615 @@
1
+ import { z as toBase64, A as parseUrl, B as fromUtf8, C as toUtf8, G as loadConfig, N as NodeHttpHandler, I as streamCollector, K as expectNonNull, O as expectObject, J as expectString } from './index.js';
2
+ 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, a0 as withBaseException, $ as decorateServiceException, C as Command, g as getSerdePlugin, a as getEndpointPlugin } from './index-DeZeG5u4.js';
3
+ import 'node:buffer';
4
+ import { r as requestBuilder } from './requestBuilder-CuNXirlx.js';
5
+ import { m as map, p as parseJsonBody, t as take, _ as _json, a as parseJsonErrorBody, l as loadRestJsonErrorCode } from './parseJsonBody-C_mcRkFo.js';
6
+ import 'commander';
7
+ import 'node:crypto';
8
+ import 'node:fs';
9
+ import 'node:os';
10
+ import 'node:path';
11
+ import 'posthog-node';
12
+ import 'node:url';
13
+ import 'node:process';
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:stream';
27
+ import 'node:string_decoder';
28
+ import '@opentelemetry/api';
29
+ import '@opentelemetry/auto-instrumentations-node';
30
+ import '@opentelemetry/exporter-trace-otlp-http';
31
+ import '@opentelemetry/resources';
32
+ import '@opentelemetry/sdk-node';
33
+ import '@opentelemetry/sdk-trace-base';
34
+ import '@opentelemetry/semantic-conventions';
35
+ import 'node:http';
36
+ import 'node:https';
37
+ import 'node:punycode';
38
+ import 'node:zlib';
39
+ import 'fs-extra';
40
+ import './extended-encode-uri-component-Dlbpb2Wd.js';
41
+
42
+ const isSerializableHeaderValue = (value) => {
43
+ return value != null;
44
+ };
45
+
46
+ const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
47
+ return {
48
+ operation: getSmithyContext(context).operation,
49
+ region: (await normalizeProvider(config.region)()) ||
50
+ (() => {
51
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
52
+ })(),
53
+ };
54
+ };
55
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
56
+ return {
57
+ schemeId: "aws.auth#sigv4",
58
+ signingProperties: {
59
+ name: "awsssoportal",
60
+ region: authParameters.region,
61
+ },
62
+ propertiesExtractor: (config, context) => ({
63
+ signingProperties: {
64
+ config,
65
+ context,
66
+ },
67
+ }),
68
+ };
69
+ }
70
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
71
+ return {
72
+ schemeId: "smithy.api#noAuth",
73
+ };
74
+ }
75
+ const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
76
+ const options = [];
77
+ switch (authParameters.operation) {
78
+ case "GetRoleCredentials": {
79
+ options.push(createSmithyApiNoAuthHttpAuthOption());
80
+ break;
81
+ }
82
+ case "ListAccountRoles": {
83
+ options.push(createSmithyApiNoAuthHttpAuthOption());
84
+ break;
85
+ }
86
+ case "ListAccounts": {
87
+ options.push(createSmithyApiNoAuthHttpAuthOption());
88
+ break;
89
+ }
90
+ case "Logout": {
91
+ options.push(createSmithyApiNoAuthHttpAuthOption());
92
+ break;
93
+ }
94
+ default: {
95
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
96
+ }
97
+ }
98
+ return options;
99
+ };
100
+ const resolveHttpAuthSchemeConfig = (config) => {
101
+ const config_0 = resolveAwsSdkSigV4Config(config);
102
+ return {
103
+ ...config_0,
104
+ };
105
+ };
106
+
107
+ const resolveClientEndpointParameters = (options) => {
108
+ return {
109
+ ...options,
110
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
111
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
112
+ defaultSigningName: "awsssoportal",
113
+ };
114
+ };
115
+ const commonParams = {
116
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
117
+ Endpoint: { type: "builtInParams", name: "endpoint" },
118
+ Region: { type: "builtInParams", name: "region" },
119
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
120
+ };
121
+
122
+ var name = "@aws-sdk/client-sso";
123
+ var description = "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native";
124
+ var version = "3.716.0";
125
+ var scripts = {
126
+ build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
127
+ "build:cjs": "node ../../scripts/compilation/inline client-sso",
128
+ "build:es": "tsc -p tsconfig.es.json",
129
+ "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
130
+ "build:types": "tsc -p tsconfig.types.json",
131
+ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
132
+ clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
133
+ "extract:docs": "api-extractor run --local",
134
+ "generate:client": "node ../../scripts/generate-clients/single-service --solo sso"
135
+ };
136
+ var main = "./dist-cjs/index.js";
137
+ var types = "./dist-types/index.d.ts";
138
+ var module = "./dist-es/index.js";
139
+ var sideEffects = false;
140
+ var dependencies = {
141
+ "@aws-crypto/sha256-browser": "5.2.0",
142
+ "@aws-crypto/sha256-js": "5.2.0",
143
+ "@aws-sdk/core": "3.716.0",
144
+ "@aws-sdk/middleware-host-header": "3.714.0",
145
+ "@aws-sdk/middleware-logger": "3.714.0",
146
+ "@aws-sdk/middleware-recursion-detection": "3.714.0",
147
+ "@aws-sdk/middleware-user-agent": "3.716.0",
148
+ "@aws-sdk/region-config-resolver": "3.714.0",
149
+ "@aws-sdk/types": "3.714.0",
150
+ "@aws-sdk/util-endpoints": "3.714.0",
151
+ "@aws-sdk/util-user-agent-browser": "3.714.0",
152
+ "@aws-sdk/util-user-agent-node": "3.716.0",
153
+ "@smithy/config-resolver": "^3.0.13",
154
+ "@smithy/core": "^2.5.5",
155
+ "@smithy/fetch-http-handler": "^4.1.2",
156
+ "@smithy/hash-node": "^3.0.11",
157
+ "@smithy/invalid-dependency": "^3.0.11",
158
+ "@smithy/middleware-content-length": "^3.0.13",
159
+ "@smithy/middleware-endpoint": "^3.2.6",
160
+ "@smithy/middleware-retry": "^3.0.31",
161
+ "@smithy/middleware-serde": "^3.0.11",
162
+ "@smithy/middleware-stack": "^3.0.11",
163
+ "@smithy/node-config-provider": "^3.1.12",
164
+ "@smithy/node-http-handler": "^3.3.2",
165
+ "@smithy/protocol-http": "^4.1.8",
166
+ "@smithy/smithy-client": "^3.5.1",
167
+ "@smithy/types": "^3.7.2",
168
+ "@smithy/url-parser": "^3.0.11",
169
+ "@smithy/util-base64": "^3.0.0",
170
+ "@smithy/util-body-length-browser": "^3.0.0",
171
+ "@smithy/util-body-length-node": "^3.0.0",
172
+ "@smithy/util-defaults-mode-browser": "^3.0.31",
173
+ "@smithy/util-defaults-mode-node": "^3.0.31",
174
+ "@smithy/util-endpoints": "^2.1.7",
175
+ "@smithy/util-middleware": "^3.0.11",
176
+ "@smithy/util-retry": "^3.0.11",
177
+ "@smithy/util-utf8": "^3.0.0",
178
+ tslib: "^2.6.2"
179
+ };
180
+ var devDependencies = {
181
+ "@tsconfig/node16": "16.1.3",
182
+ "@types/node": "^16.18.96",
183
+ concurrently: "7.0.0",
184
+ "downlevel-dts": "0.10.1",
185
+ rimraf: "3.0.2",
186
+ typescript: "~4.9.5"
187
+ };
188
+ var engines = {
189
+ node: ">=16.0.0"
190
+ };
191
+ var typesVersions = {
192
+ "<4.0": {
193
+ "dist-types/*": [
194
+ "dist-types/ts3.4/*"
195
+ ]
196
+ }
197
+ };
198
+ var files = [
199
+ "dist-*/**"
200
+ ];
201
+ var author = {
202
+ name: "AWS SDK for JavaScript Team",
203
+ url: "https://aws.amazon.com/javascript/"
204
+ };
205
+ var license = "Apache-2.0";
206
+ var browser = {
207
+ "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
208
+ };
209
+ var homepage = "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso";
210
+ var repository = {
211
+ type: "git",
212
+ url: "https://github.com/aws/aws-sdk-js-v3.git",
213
+ directory: "clients/client-sso"
214
+ };
215
+ var packageInfo = {
216
+ name: name,
217
+ description: description,
218
+ version: version,
219
+ scripts: scripts,
220
+ main: main,
221
+ types: types,
222
+ module: module,
223
+ sideEffects: sideEffects,
224
+ dependencies: dependencies,
225
+ devDependencies: devDependencies,
226
+ engines: engines,
227
+ typesVersions: typesVersions,
228
+ files: files,
229
+ author: author,
230
+ license: license,
231
+ browser: browser,
232
+ "react-native": {
233
+ "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
234
+ },
235
+ homepage: homepage,
236
+ repository: repository
237
+ };
238
+
239
+ const u = "required", v = "fn", w = "argv", x = "ref";
240
+ 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" }];
241
+ 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://portal.sso-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://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-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://portal.sso.{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://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
242
+ const ruleSet = _data;
243
+
244
+ const cache = new EndpointCache({
245
+ size: 50,
246
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
247
+ });
248
+ const defaultEndpointResolver = (endpointParams, context = {}) => {
249
+ return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
250
+ endpointParams: endpointParams,
251
+ logger: context.logger,
252
+ }));
253
+ };
254
+ customEndpointFunctions.aws = awsEndpointFunctions;
255
+
256
+ const getRuntimeConfig$1 = (config) => {
257
+ return {
258
+ apiVersion: "2019-06-10",
259
+ base64Decoder: config?.base64Decoder ?? fromBase64,
260
+ base64Encoder: config?.base64Encoder ?? toBase64,
261
+ disableHostPrefix: config?.disableHostPrefix ?? false,
262
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
263
+ extensions: config?.extensions ?? [],
264
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
265
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
266
+ {
267
+ schemeId: "aws.auth#sigv4",
268
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
269
+ signer: new AwsSdkSigV4Signer(),
270
+ },
271
+ {
272
+ schemeId: "smithy.api#noAuth",
273
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
274
+ signer: new NoAuthSigner(),
275
+ },
276
+ ],
277
+ logger: config?.logger ?? new NoOpLogger(),
278
+ serviceId: config?.serviceId ?? "SSO",
279
+ urlParser: config?.urlParser ?? parseUrl,
280
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
281
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
282
+ };
283
+ };
284
+
285
+ const getRuntimeConfig = (config) => {
286
+ emitWarningIfUnsupportedVersion(process.version);
287
+ const defaultsMode = resolveDefaultsModeConfig(config);
288
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
289
+ const clientSharedValues = getRuntimeConfig$1(config);
290
+ emitWarningIfUnsupportedVersion$1(process.version);
291
+ const profileConfig = { profile: config?.profile };
292
+ return {
293
+ ...clientSharedValues,
294
+ ...config,
295
+ runtime: "node",
296
+ defaultsMode,
297
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
298
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
299
+ createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
300
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
301
+ region: config?.region ??
302
+ loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
303
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
304
+ retryMode: config?.retryMode ??
305
+ loadConfig({
306
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
307
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
308
+ }, config),
309
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
310
+ streamCollector: config?.streamCollector ?? streamCollector,
311
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
312
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
313
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
314
+ };
315
+ };
316
+
317
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
318
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
319
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
320
+ let _credentials = runtimeConfig.credentials;
321
+ return {
322
+ setHttpAuthScheme(httpAuthScheme) {
323
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
324
+ if (index === -1) {
325
+ _httpAuthSchemes.push(httpAuthScheme);
326
+ }
327
+ else {
328
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
329
+ }
330
+ },
331
+ httpAuthSchemes() {
332
+ return _httpAuthSchemes;
333
+ },
334
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
335
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
336
+ },
337
+ httpAuthSchemeProvider() {
338
+ return _httpAuthSchemeProvider;
339
+ },
340
+ setCredentials(credentials) {
341
+ _credentials = credentials;
342
+ },
343
+ credentials() {
344
+ return _credentials;
345
+ },
346
+ };
347
+ };
348
+ const resolveHttpAuthRuntimeConfig = (config) => {
349
+ return {
350
+ httpAuthSchemes: config.httpAuthSchemes(),
351
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
352
+ credentials: config.credentials(),
353
+ };
354
+ };
355
+
356
+ const asPartial = (t) => t;
357
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
358
+ const extensionConfiguration = {
359
+ ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
360
+ ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
361
+ ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
362
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
363
+ };
364
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
365
+ return {
366
+ ...runtimeConfig,
367
+ ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
368
+ ...resolveDefaultRuntimeConfig(extensionConfiguration),
369
+ ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
370
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration),
371
+ };
372
+ };
373
+
374
+ class SSOClient extends Client {
375
+ constructor(...[configuration]) {
376
+ const _config_0 = getRuntimeConfig(configuration || {});
377
+ const _config_1 = resolveClientEndpointParameters(_config_0);
378
+ const _config_2 = resolveUserAgentConfig(_config_1);
379
+ const _config_3 = resolveRetryConfig(_config_2);
380
+ const _config_4 = resolveRegionConfig(_config_3);
381
+ const _config_5 = resolveHostHeaderConfig(_config_4);
382
+ const _config_6 = resolveEndpointConfig(_config_5);
383
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
384
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
385
+ super(_config_8);
386
+ this.config = _config_8;
387
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
388
+ this.middlewareStack.use(getRetryPlugin(this.config));
389
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
390
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
391
+ this.middlewareStack.use(getLoggerPlugin(this.config));
392
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
393
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
394
+ httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
395
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
396
+ "aws.auth#sigv4": config.credentials,
397
+ }),
398
+ }));
399
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
400
+ }
401
+ destroy() {
402
+ super.destroy();
403
+ }
404
+ }
405
+
406
+ class SSOServiceException extends ServiceException {
407
+ constructor(options) {
408
+ super(options);
409
+ Object.setPrototypeOf(this, SSOServiceException.prototype);
410
+ }
411
+ }
412
+
413
+ class InvalidRequestException extends SSOServiceException {
414
+ constructor(opts) {
415
+ super({
416
+ name: "InvalidRequestException",
417
+ $fault: "client",
418
+ ...opts,
419
+ });
420
+ this.name = "InvalidRequestException";
421
+ this.$fault = "client";
422
+ Object.setPrototypeOf(this, InvalidRequestException.prototype);
423
+ }
424
+ }
425
+ class ResourceNotFoundException extends SSOServiceException {
426
+ constructor(opts) {
427
+ super({
428
+ name: "ResourceNotFoundException",
429
+ $fault: "client",
430
+ ...opts,
431
+ });
432
+ this.name = "ResourceNotFoundException";
433
+ this.$fault = "client";
434
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
435
+ }
436
+ }
437
+ class TooManyRequestsException extends SSOServiceException {
438
+ constructor(opts) {
439
+ super({
440
+ name: "TooManyRequestsException",
441
+ $fault: "client",
442
+ ...opts,
443
+ });
444
+ this.name = "TooManyRequestsException";
445
+ this.$fault = "client";
446
+ Object.setPrototypeOf(this, TooManyRequestsException.prototype);
447
+ }
448
+ }
449
+ class UnauthorizedException extends SSOServiceException {
450
+ constructor(opts) {
451
+ super({
452
+ name: "UnauthorizedException",
453
+ $fault: "client",
454
+ ...opts,
455
+ });
456
+ this.name = "UnauthorizedException";
457
+ this.$fault = "client";
458
+ Object.setPrototypeOf(this, UnauthorizedException.prototype);
459
+ }
460
+ }
461
+ const GetRoleCredentialsRequestFilterSensitiveLog = (obj) => ({
462
+ ...obj,
463
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
464
+ });
465
+ const RoleCredentialsFilterSensitiveLog = (obj) => ({
466
+ ...obj,
467
+ ...(obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING }),
468
+ ...(obj.sessionToken && { sessionToken: SENSITIVE_STRING }),
469
+ });
470
+ const GetRoleCredentialsResponseFilterSensitiveLog = (obj) => ({
471
+ ...obj,
472
+ ...(obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }),
473
+ });
474
+
475
+ const se_GetRoleCredentialsCommand = async (input, context) => {
476
+ const b = requestBuilder(input, context);
477
+ const headers = map({}, isSerializableHeaderValue, {
478
+ [_xasbt]: input[_aT],
479
+ });
480
+ b.bp("/federation/credentials");
481
+ const query = map({
482
+ [_rn]: [, expectNonNull(input[_rN], `roleName`)],
483
+ [_ai]: [, expectNonNull(input[_aI], `accountId`)],
484
+ });
485
+ let body;
486
+ b.m("GET").h(headers).q(query).b(body);
487
+ return b.build();
488
+ };
489
+ const de_GetRoleCredentialsCommand = async (output, context) => {
490
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
491
+ return de_CommandError(output, context);
492
+ }
493
+ const contents = map({
494
+ $metadata: deserializeMetadata(output),
495
+ });
496
+ const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
497
+ const doc = take(data, {
498
+ roleCredentials: _json,
499
+ });
500
+ Object.assign(contents, doc);
501
+ return contents;
502
+ };
503
+ const de_CommandError = async (output, context) => {
504
+ const parsedOutput = {
505
+ ...output,
506
+ body: await parseJsonErrorBody(output.body, context),
507
+ };
508
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
509
+ switch (errorCode) {
510
+ case "InvalidRequestException":
511
+ case "com.amazonaws.sso#InvalidRequestException":
512
+ throw await de_InvalidRequestExceptionRes(parsedOutput);
513
+ case "ResourceNotFoundException":
514
+ case "com.amazonaws.sso#ResourceNotFoundException":
515
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput);
516
+ case "TooManyRequestsException":
517
+ case "com.amazonaws.sso#TooManyRequestsException":
518
+ throw await de_TooManyRequestsExceptionRes(parsedOutput);
519
+ case "UnauthorizedException":
520
+ case "com.amazonaws.sso#UnauthorizedException":
521
+ throw await de_UnauthorizedExceptionRes(parsedOutput);
522
+ default:
523
+ const parsedBody = parsedOutput.body;
524
+ return throwDefaultError({
525
+ output,
526
+ parsedBody,
527
+ errorCode,
528
+ });
529
+ }
530
+ };
531
+ const throwDefaultError = withBaseException(SSOServiceException);
532
+ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
533
+ const contents = map({});
534
+ const data = parsedOutput.body;
535
+ const doc = take(data, {
536
+ message: expectString,
537
+ });
538
+ Object.assign(contents, doc);
539
+ const exception = new InvalidRequestException({
540
+ $metadata: deserializeMetadata(parsedOutput),
541
+ ...contents,
542
+ });
543
+ return decorateServiceException(exception, parsedOutput.body);
544
+ };
545
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
546
+ const contents = map({});
547
+ const data = parsedOutput.body;
548
+ const doc = take(data, {
549
+ message: expectString,
550
+ });
551
+ Object.assign(contents, doc);
552
+ const exception = new ResourceNotFoundException({
553
+ $metadata: deserializeMetadata(parsedOutput),
554
+ ...contents,
555
+ });
556
+ return decorateServiceException(exception, parsedOutput.body);
557
+ };
558
+ const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
559
+ const contents = map({});
560
+ const data = parsedOutput.body;
561
+ const doc = take(data, {
562
+ message: expectString,
563
+ });
564
+ Object.assign(contents, doc);
565
+ const exception = new TooManyRequestsException({
566
+ $metadata: deserializeMetadata(parsedOutput),
567
+ ...contents,
568
+ });
569
+ return decorateServiceException(exception, parsedOutput.body);
570
+ };
571
+ const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
572
+ const contents = map({});
573
+ const data = parsedOutput.body;
574
+ const doc = take(data, {
575
+ message: expectString,
576
+ });
577
+ Object.assign(contents, doc);
578
+ const exception = new UnauthorizedException({
579
+ $metadata: deserializeMetadata(parsedOutput),
580
+ ...contents,
581
+ });
582
+ return decorateServiceException(exception, parsedOutput.body);
583
+ };
584
+ const deserializeMetadata = (output) => ({
585
+ httpStatusCode: output.statusCode,
586
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
587
+ extendedRequestId: output.headers["x-amz-id-2"],
588
+ cfId: output.headers["x-amz-cf-id"],
589
+ });
590
+ const _aI = "accountId";
591
+ const _aT = "accessToken";
592
+ const _ai = "account_id";
593
+ const _rN = "roleName";
594
+ const _rn = "role_name";
595
+ const _xasbt = "x-amz-sso_bearer_token";
596
+
597
+ class GetRoleCredentialsCommand extends Command
598
+ .classBuilder()
599
+ .ep(commonParams)
600
+ .m(function (Command, cs, config, o) {
601
+ return [
602
+ getSerdePlugin(config, this.serialize, this.deserialize),
603
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
604
+ ];
605
+ })
606
+ .s("SWBPortalService", "GetRoleCredentials", {})
607
+ .n("SSOClient", "GetRoleCredentialsCommand")
608
+ .f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog)
609
+ .ser(se_GetRoleCredentialsCommand)
610
+ .de(de_GetRoleCredentialsCommand)
611
+ .build() {
612
+ }
613
+
614
+ export { GetRoleCredentialsCommand, SSOClient };
615
+ //# sourceMappingURL=loadSso-MEAVww3h.js.map