@granite-js/pulumi-aws 0.1.19 → 0.1.21

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