@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,820 @@
1
+ import {
2
+ package_default
3
+ } from "./chunk-IEZY5C3G.js";
4
+ import {
5
+ loadRestJsonErrorCode,
6
+ parseJsonBody,
7
+ parseJsonErrorBody
8
+ } from "./chunk-SX6SVQKS.js";
9
+ import {
10
+ AwsSdkSigV4Signer,
11
+ DEFAULT_RETRY_MODE,
12
+ DefaultIdentityProviderConfig,
13
+ EndpointCache,
14
+ Hash,
15
+ NODE_APP_ID_CONFIG_OPTIONS,
16
+ NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,
17
+ NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
18
+ NODE_REGION_CONFIG_FILE_OPTIONS,
19
+ NODE_REGION_CONFIG_OPTIONS,
20
+ NODE_RETRY_MODE_CONFIG_OPTIONS,
21
+ NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
22
+ NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
23
+ NoAuthSigner,
24
+ awsEndpointFunctions,
25
+ calculateBodyLength,
26
+ createDefaultUserAgentProvider,
27
+ customEndpointFunctions,
28
+ emitWarningIfUnsupportedVersion as emitWarningIfUnsupportedVersion2,
29
+ getAwsRegionExtensionConfiguration,
30
+ getContentLengthPlugin,
31
+ getEndpointPlugin,
32
+ getHostHeaderPlugin,
33
+ getHttpAuthSchemeEndpointRuleSetPlugin,
34
+ getHttpSigningPlugin,
35
+ getLoggerPlugin,
36
+ getRecursionDetectionPlugin,
37
+ getRetryPlugin,
38
+ getSerdePlugin,
39
+ getSmithyContext,
40
+ getUserAgentPlugin,
41
+ normalizeProvider,
42
+ resolveAwsRegionExtensionConfiguration,
43
+ resolveAwsSdkSigV4Config,
44
+ resolveDefaultsModeConfig,
45
+ resolveEndpoint,
46
+ resolveEndpointConfig,
47
+ resolveHostHeaderConfig,
48
+ resolveRegionConfig,
49
+ resolveRetryConfig,
50
+ resolveUserAgentConfig
51
+ } from "./chunk-QAE2S7MG.js";
52
+ import {
53
+ loadConfig,
54
+ parseUrl
55
+ } from "./chunk-X6XO7USX.js";
56
+ import {
57
+ Client,
58
+ Command,
59
+ NoOpLogger,
60
+ NodeHttpHandler,
61
+ SENSITIVE_STRING,
62
+ ServiceException,
63
+ _json,
64
+ createAggregatedClient,
65
+ decorateServiceException,
66
+ emitWarningIfUnsupportedVersion,
67
+ expectInt32,
68
+ expectNonNull,
69
+ expectObject,
70
+ expectString,
71
+ fromBase64,
72
+ fromUtf8,
73
+ getDefaultExtensionConfiguration,
74
+ getHttpHandlerExtensionConfiguration,
75
+ loadConfigsForDefaultMode,
76
+ map,
77
+ requestBuilder,
78
+ resolveDefaultRuntimeConfig,
79
+ resolveHttpHandlerRuntimeConfig,
80
+ streamCollector,
81
+ take,
82
+ toBase64,
83
+ toUtf8,
84
+ withBaseException
85
+ } from "./chunk-UT2RMOJS.js";
86
+ import "./chunk-TJ744C2T.js";
87
+ import "./chunk-64IS37V6.js";
88
+ import "./chunk-XLUI7RQ4.js";
89
+ import {
90
+ init_esm_shims
91
+ } from "./chunk-JBVMOFGH.js";
92
+ import "./chunk-JSBRDJBE.js";
93
+
94
+ // ../deployment-manager/dist/sso-oidc-PKO5GYK5.js
95
+ init_esm_shims();
96
+ init_esm_shims();
97
+ init_esm_shims();
98
+ var defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
99
+ return {
100
+ operation: getSmithyContext(context).operation,
101
+ region: await normalizeProvider(config.region)() || (() => {
102
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
103
+ })()
104
+ };
105
+ };
106
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
107
+ return {
108
+ schemeId: "aws.auth#sigv4",
109
+ signingProperties: {
110
+ name: "sso-oauth",
111
+ region: authParameters.region
112
+ },
113
+ propertiesExtractor: (config, context) => ({
114
+ signingProperties: {
115
+ config,
116
+ context
117
+ }
118
+ })
119
+ };
120
+ }
121
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
122
+ return {
123
+ schemeId: "smithy.api#noAuth"
124
+ };
125
+ }
126
+ var defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
127
+ const options = [];
128
+ switch (authParameters.operation) {
129
+ case "CreateToken": {
130
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
131
+ break;
132
+ }
133
+ default: {
134
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
135
+ }
136
+ }
137
+ return options;
138
+ };
139
+ var resolveHttpAuthSchemeConfig = (config) => {
140
+ const config_0 = resolveAwsSdkSigV4Config(config);
141
+ return Object.assign(config_0, {
142
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
143
+ });
144
+ };
145
+ init_esm_shims();
146
+ var resolveClientEndpointParameters = (options) => {
147
+ return Object.assign(options, {
148
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
149
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
150
+ defaultSigningName: "sso-oauth"
151
+ });
152
+ };
153
+ var commonParams = {
154
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
155
+ Endpoint: { type: "builtInParams", name: "endpoint" },
156
+ Region: { type: "builtInParams", name: "region" },
157
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
158
+ };
159
+ init_esm_shims();
160
+ init_esm_shims();
161
+ init_esm_shims();
162
+ init_esm_shims();
163
+ var u = "required";
164
+ var v = "fn";
165
+ var w = "argv";
166
+ var x = "ref";
167
+ var a = true;
168
+ var b = "isSet";
169
+ var c = "booleanEquals";
170
+ var d = "error";
171
+ var e = "endpoint";
172
+ var f = "tree";
173
+ var g = "PartitionResult";
174
+ var h = "getAttr";
175
+ var i = { [u]: false, "type": "String" };
176
+ var j = { [u]: true, "default": false, "type": "Boolean" };
177
+ var k = { [x]: "Endpoint" };
178
+ var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] };
179
+ var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] };
180
+ var n = {};
181
+ var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] };
182
+ var p = { [x]: g };
183
+ var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] };
184
+ var r = [l];
185
+ var s = [m];
186
+ var t = [{ [x]: "Region" }];
187
+ 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://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 }] };
188
+ var ruleSet = _data;
189
+ var cache = new EndpointCache({
190
+ size: 50,
191
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
192
+ });
193
+ var defaultEndpointResolver = (endpointParams, context = {}) => {
194
+ return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
195
+ endpointParams,
196
+ logger: context.logger
197
+ }));
198
+ };
199
+ customEndpointFunctions.aws = awsEndpointFunctions;
200
+ var getRuntimeConfig = (config) => {
201
+ return {
202
+ apiVersion: "2019-06-10",
203
+ base64Decoder: config?.base64Decoder ?? fromBase64,
204
+ base64Encoder: config?.base64Encoder ?? toBase64,
205
+ disableHostPrefix: config?.disableHostPrefix ?? false,
206
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
207
+ extensions: config?.extensions ?? [],
208
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider,
209
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
210
+ {
211
+ schemeId: "aws.auth#sigv4",
212
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
213
+ signer: new AwsSdkSigV4Signer()
214
+ },
215
+ {
216
+ schemeId: "smithy.api#noAuth",
217
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
218
+ signer: new NoAuthSigner()
219
+ }
220
+ ],
221
+ logger: config?.logger ?? new NoOpLogger(),
222
+ serviceId: config?.serviceId ?? "SSO OIDC",
223
+ urlParser: config?.urlParser ?? parseUrl,
224
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
225
+ utf8Encoder: config?.utf8Encoder ?? toUtf8
226
+ };
227
+ };
228
+ var getRuntimeConfig2 = (config) => {
229
+ emitWarningIfUnsupportedVersion(process.version);
230
+ const defaultsMode = resolveDefaultsModeConfig(config);
231
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
232
+ const clientSharedValues = getRuntimeConfig(config);
233
+ emitWarningIfUnsupportedVersion2(process.version);
234
+ const loaderConfig = {
235
+ profile: config?.profile,
236
+ logger: clientSharedValues.logger
237
+ };
238
+ return {
239
+ ...clientSharedValues,
240
+ ...config,
241
+ runtime: "node",
242
+ defaultsMode,
243
+ authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
244
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
245
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }),
246
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
247
+ region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
248
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
249
+ retryMode: config?.retryMode ?? loadConfig({
250
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
251
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE
252
+ }, config),
253
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
254
+ streamCollector: config?.streamCollector ?? streamCollector,
255
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
256
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
257
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
258
+ };
259
+ };
260
+ init_esm_shims();
261
+ init_esm_shims();
262
+ var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
263
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
264
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
265
+ let _credentials = runtimeConfig.credentials;
266
+ return {
267
+ setHttpAuthScheme(httpAuthScheme) {
268
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
269
+ if (index === -1) {
270
+ _httpAuthSchemes.push(httpAuthScheme);
271
+ } else {
272
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
273
+ }
274
+ },
275
+ httpAuthSchemes() {
276
+ return _httpAuthSchemes;
277
+ },
278
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
279
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
280
+ },
281
+ httpAuthSchemeProvider() {
282
+ return _httpAuthSchemeProvider;
283
+ },
284
+ setCredentials(credentials) {
285
+ _credentials = credentials;
286
+ },
287
+ credentials() {
288
+ return _credentials;
289
+ }
290
+ };
291
+ };
292
+ var resolveHttpAuthRuntimeConfig = (config) => {
293
+ return {
294
+ httpAuthSchemes: config.httpAuthSchemes(),
295
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
296
+ credentials: config.credentials()
297
+ };
298
+ };
299
+ var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
300
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
301
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
302
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
303
+ };
304
+ var SSOOIDCClient = class extends Client {
305
+ config;
306
+ constructor(...[configuration]) {
307
+ const _config_0 = getRuntimeConfig2(configuration || {});
308
+ super(_config_0);
309
+ this.initConfig = _config_0;
310
+ const _config_1 = resolveClientEndpointParameters(_config_0);
311
+ const _config_2 = resolveUserAgentConfig(_config_1);
312
+ const _config_3 = resolveRetryConfig(_config_2);
313
+ const _config_4 = resolveRegionConfig(_config_3);
314
+ const _config_5 = resolveHostHeaderConfig(_config_4);
315
+ const _config_6 = resolveEndpointConfig(_config_5);
316
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
317
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
318
+ this.config = _config_8;
319
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
320
+ this.middlewareStack.use(getRetryPlugin(this.config));
321
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
322
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
323
+ this.middlewareStack.use(getLoggerPlugin(this.config));
324
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
325
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
326
+ httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider,
327
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
328
+ "aws.auth#sigv4": config.credentials
329
+ })
330
+ }));
331
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
332
+ }
333
+ destroy() {
334
+ super.destroy();
335
+ }
336
+ };
337
+ init_esm_shims();
338
+ init_esm_shims();
339
+ init_esm_shims();
340
+ init_esm_shims();
341
+ var SSOOIDCServiceException = class _SSOOIDCServiceException extends ServiceException {
342
+ constructor(options) {
343
+ super(options);
344
+ Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype);
345
+ }
346
+ };
347
+ var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException {
348
+ name = "AccessDeniedException";
349
+ $fault = "client";
350
+ error;
351
+ error_description;
352
+ constructor(opts) {
353
+ super({
354
+ name: "AccessDeniedException",
355
+ $fault: "client",
356
+ ...opts
357
+ });
358
+ Object.setPrototypeOf(this, _AccessDeniedException.prototype);
359
+ this.error = opts.error;
360
+ this.error_description = opts.error_description;
361
+ }
362
+ };
363
+ var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException {
364
+ name = "AuthorizationPendingException";
365
+ $fault = "client";
366
+ error;
367
+ error_description;
368
+ constructor(opts) {
369
+ super({
370
+ name: "AuthorizationPendingException",
371
+ $fault: "client",
372
+ ...opts
373
+ });
374
+ Object.setPrototypeOf(this, _AuthorizationPendingException.prototype);
375
+ this.error = opts.error;
376
+ this.error_description = opts.error_description;
377
+ }
378
+ };
379
+ var CreateTokenRequestFilterSensitiveLog = (obj) => ({
380
+ ...obj,
381
+ ...obj.clientSecret && { clientSecret: SENSITIVE_STRING },
382
+ ...obj.refreshToken && { refreshToken: SENSITIVE_STRING },
383
+ ...obj.codeVerifier && { codeVerifier: SENSITIVE_STRING }
384
+ });
385
+ var CreateTokenResponseFilterSensitiveLog = (obj) => ({
386
+ ...obj,
387
+ ...obj.accessToken && { accessToken: SENSITIVE_STRING },
388
+ ...obj.refreshToken && { refreshToken: SENSITIVE_STRING },
389
+ ...obj.idToken && { idToken: SENSITIVE_STRING }
390
+ });
391
+ var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException {
392
+ name = "ExpiredTokenException";
393
+ $fault = "client";
394
+ error;
395
+ error_description;
396
+ constructor(opts) {
397
+ super({
398
+ name: "ExpiredTokenException",
399
+ $fault: "client",
400
+ ...opts
401
+ });
402
+ Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
403
+ this.error = opts.error;
404
+ this.error_description = opts.error_description;
405
+ }
406
+ };
407
+ var InternalServerException = class _InternalServerException extends SSOOIDCServiceException {
408
+ name = "InternalServerException";
409
+ $fault = "server";
410
+ error;
411
+ error_description;
412
+ constructor(opts) {
413
+ super({
414
+ name: "InternalServerException",
415
+ $fault: "server",
416
+ ...opts
417
+ });
418
+ Object.setPrototypeOf(this, _InternalServerException.prototype);
419
+ this.error = opts.error;
420
+ this.error_description = opts.error_description;
421
+ }
422
+ };
423
+ var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException {
424
+ name = "InvalidClientException";
425
+ $fault = "client";
426
+ error;
427
+ error_description;
428
+ constructor(opts) {
429
+ super({
430
+ name: "InvalidClientException",
431
+ $fault: "client",
432
+ ...opts
433
+ });
434
+ Object.setPrototypeOf(this, _InvalidClientException.prototype);
435
+ this.error = opts.error;
436
+ this.error_description = opts.error_description;
437
+ }
438
+ };
439
+ var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException {
440
+ name = "InvalidGrantException";
441
+ $fault = "client";
442
+ error;
443
+ error_description;
444
+ constructor(opts) {
445
+ super({
446
+ name: "InvalidGrantException",
447
+ $fault: "client",
448
+ ...opts
449
+ });
450
+ Object.setPrototypeOf(this, _InvalidGrantException.prototype);
451
+ this.error = opts.error;
452
+ this.error_description = opts.error_description;
453
+ }
454
+ };
455
+ var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException {
456
+ name = "InvalidRequestException";
457
+ $fault = "client";
458
+ error;
459
+ error_description;
460
+ constructor(opts) {
461
+ super({
462
+ name: "InvalidRequestException",
463
+ $fault: "client",
464
+ ...opts
465
+ });
466
+ Object.setPrototypeOf(this, _InvalidRequestException.prototype);
467
+ this.error = opts.error;
468
+ this.error_description = opts.error_description;
469
+ }
470
+ };
471
+ var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException {
472
+ name = "InvalidScopeException";
473
+ $fault = "client";
474
+ error;
475
+ error_description;
476
+ constructor(opts) {
477
+ super({
478
+ name: "InvalidScopeException",
479
+ $fault: "client",
480
+ ...opts
481
+ });
482
+ Object.setPrototypeOf(this, _InvalidScopeException.prototype);
483
+ this.error = opts.error;
484
+ this.error_description = opts.error_description;
485
+ }
486
+ };
487
+ var SlowDownException = class _SlowDownException extends SSOOIDCServiceException {
488
+ name = "SlowDownException";
489
+ $fault = "client";
490
+ error;
491
+ error_description;
492
+ constructor(opts) {
493
+ super({
494
+ name: "SlowDownException",
495
+ $fault: "client",
496
+ ...opts
497
+ });
498
+ Object.setPrototypeOf(this, _SlowDownException.prototype);
499
+ this.error = opts.error;
500
+ this.error_description = opts.error_description;
501
+ }
502
+ };
503
+ var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException {
504
+ name = "UnauthorizedClientException";
505
+ $fault = "client";
506
+ error;
507
+ error_description;
508
+ constructor(opts) {
509
+ super({
510
+ name: "UnauthorizedClientException",
511
+ $fault: "client",
512
+ ...opts
513
+ });
514
+ Object.setPrototypeOf(this, _UnauthorizedClientException.prototype);
515
+ this.error = opts.error;
516
+ this.error_description = opts.error_description;
517
+ }
518
+ };
519
+ var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException {
520
+ name = "UnsupportedGrantTypeException";
521
+ $fault = "client";
522
+ error;
523
+ error_description;
524
+ constructor(opts) {
525
+ super({
526
+ name: "UnsupportedGrantTypeException",
527
+ $fault: "client",
528
+ ...opts
529
+ });
530
+ Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype);
531
+ this.error = opts.error;
532
+ this.error_description = opts.error_description;
533
+ }
534
+ };
535
+ init_esm_shims();
536
+ var se_CreateTokenCommand = async (input, context) => {
537
+ const b2 = requestBuilder(input, context);
538
+ const headers = {
539
+ "content-type": "application/json"
540
+ };
541
+ b2.bp("/token");
542
+ let body;
543
+ body = JSON.stringify(take(input, {
544
+ clientId: [],
545
+ clientSecret: [],
546
+ code: [],
547
+ codeVerifier: [],
548
+ deviceCode: [],
549
+ grantType: [],
550
+ redirectUri: [],
551
+ refreshToken: [],
552
+ scope: (_) => _json(_)
553
+ }));
554
+ b2.m("POST").h(headers).b(body);
555
+ return b2.build();
556
+ };
557
+ var de_CreateTokenCommand = async (output, context) => {
558
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
559
+ return de_CommandError(output, context);
560
+ }
561
+ const contents = map({
562
+ $metadata: deserializeMetadata(output)
563
+ });
564
+ const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
565
+ const doc = take(data, {
566
+ accessToken: expectString,
567
+ expiresIn: expectInt32,
568
+ idToken: expectString,
569
+ refreshToken: expectString,
570
+ tokenType: expectString
571
+ });
572
+ Object.assign(contents, doc);
573
+ return contents;
574
+ };
575
+ var de_CommandError = async (output, context) => {
576
+ const parsedOutput = {
577
+ ...output,
578
+ body: await parseJsonErrorBody(output.body, context)
579
+ };
580
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
581
+ switch (errorCode) {
582
+ case "AccessDeniedException":
583
+ case "com.amazonaws.ssooidc#AccessDeniedException":
584
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
585
+ case "AuthorizationPendingException":
586
+ case "com.amazonaws.ssooidc#AuthorizationPendingException":
587
+ throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
588
+ case "ExpiredTokenException":
589
+ case "com.amazonaws.ssooidc#ExpiredTokenException":
590
+ throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
591
+ case "InternalServerException":
592
+ case "com.amazonaws.ssooidc#InternalServerException":
593
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
594
+ case "InvalidClientException":
595
+ case "com.amazonaws.ssooidc#InvalidClientException":
596
+ throw await de_InvalidClientExceptionRes(parsedOutput, context);
597
+ case "InvalidGrantException":
598
+ case "com.amazonaws.ssooidc#InvalidGrantException":
599
+ throw await de_InvalidGrantExceptionRes(parsedOutput, context);
600
+ case "InvalidRequestException":
601
+ case "com.amazonaws.ssooidc#InvalidRequestException":
602
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context);
603
+ case "InvalidScopeException":
604
+ case "com.amazonaws.ssooidc#InvalidScopeException":
605
+ throw await de_InvalidScopeExceptionRes(parsedOutput, context);
606
+ case "SlowDownException":
607
+ case "com.amazonaws.ssooidc#SlowDownException":
608
+ throw await de_SlowDownExceptionRes(parsedOutput, context);
609
+ case "UnauthorizedClientException":
610
+ case "com.amazonaws.ssooidc#UnauthorizedClientException":
611
+ throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
612
+ case "UnsupportedGrantTypeException":
613
+ case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
614
+ throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
615
+ default:
616
+ const parsedBody = parsedOutput.body;
617
+ return throwDefaultError({
618
+ output,
619
+ parsedBody,
620
+ errorCode
621
+ });
622
+ }
623
+ };
624
+ var throwDefaultError = withBaseException(SSOOIDCServiceException);
625
+ var de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
626
+ const contents = map({});
627
+ const data = parsedOutput.body;
628
+ const doc = take(data, {
629
+ error: expectString,
630
+ error_description: expectString
631
+ });
632
+ Object.assign(contents, doc);
633
+ const exception = new AccessDeniedException({
634
+ $metadata: deserializeMetadata(parsedOutput),
635
+ ...contents
636
+ });
637
+ return decorateServiceException(exception, parsedOutput.body);
638
+ };
639
+ var de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => {
640
+ const contents = map({});
641
+ const data = parsedOutput.body;
642
+ const doc = take(data, {
643
+ error: expectString,
644
+ error_description: expectString
645
+ });
646
+ Object.assign(contents, doc);
647
+ const exception = new AuthorizationPendingException({
648
+ $metadata: deserializeMetadata(parsedOutput),
649
+ ...contents
650
+ });
651
+ return decorateServiceException(exception, parsedOutput.body);
652
+ };
653
+ var de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
654
+ const contents = map({});
655
+ const data = parsedOutput.body;
656
+ const doc = take(data, {
657
+ error: expectString,
658
+ error_description: expectString
659
+ });
660
+ Object.assign(contents, doc);
661
+ const exception = new ExpiredTokenException({
662
+ $metadata: deserializeMetadata(parsedOutput),
663
+ ...contents
664
+ });
665
+ return decorateServiceException(exception, parsedOutput.body);
666
+ };
667
+ var de_InternalServerExceptionRes = async (parsedOutput, context) => {
668
+ const contents = map({});
669
+ const data = parsedOutput.body;
670
+ const doc = take(data, {
671
+ error: expectString,
672
+ error_description: expectString
673
+ });
674
+ Object.assign(contents, doc);
675
+ const exception = new InternalServerException({
676
+ $metadata: deserializeMetadata(parsedOutput),
677
+ ...contents
678
+ });
679
+ return decorateServiceException(exception, parsedOutput.body);
680
+ };
681
+ var de_InvalidClientExceptionRes = async (parsedOutput, context) => {
682
+ const contents = map({});
683
+ const data = parsedOutput.body;
684
+ const doc = take(data, {
685
+ error: expectString,
686
+ error_description: expectString
687
+ });
688
+ Object.assign(contents, doc);
689
+ const exception = new InvalidClientException({
690
+ $metadata: deserializeMetadata(parsedOutput),
691
+ ...contents
692
+ });
693
+ return decorateServiceException(exception, parsedOutput.body);
694
+ };
695
+ var de_InvalidGrantExceptionRes = async (parsedOutput, context) => {
696
+ const contents = map({});
697
+ const data = parsedOutput.body;
698
+ const doc = take(data, {
699
+ error: expectString,
700
+ error_description: expectString
701
+ });
702
+ Object.assign(contents, doc);
703
+ const exception = new InvalidGrantException({
704
+ $metadata: deserializeMetadata(parsedOutput),
705
+ ...contents
706
+ });
707
+ return decorateServiceException(exception, parsedOutput.body);
708
+ };
709
+ var de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
710
+ const contents = map({});
711
+ const data = parsedOutput.body;
712
+ const doc = take(data, {
713
+ error: expectString,
714
+ error_description: expectString
715
+ });
716
+ Object.assign(contents, doc);
717
+ const exception = new InvalidRequestException({
718
+ $metadata: deserializeMetadata(parsedOutput),
719
+ ...contents
720
+ });
721
+ return decorateServiceException(exception, parsedOutput.body);
722
+ };
723
+ var de_InvalidScopeExceptionRes = async (parsedOutput, context) => {
724
+ const contents = map({});
725
+ const data = parsedOutput.body;
726
+ const doc = take(data, {
727
+ error: expectString,
728
+ error_description: expectString
729
+ });
730
+ Object.assign(contents, doc);
731
+ const exception = new InvalidScopeException({
732
+ $metadata: deserializeMetadata(parsedOutput),
733
+ ...contents
734
+ });
735
+ return decorateServiceException(exception, parsedOutput.body);
736
+ };
737
+ var de_SlowDownExceptionRes = async (parsedOutput, context) => {
738
+ const contents = map({});
739
+ const data = parsedOutput.body;
740
+ const doc = take(data, {
741
+ error: expectString,
742
+ error_description: expectString
743
+ });
744
+ Object.assign(contents, doc);
745
+ const exception = new SlowDownException({
746
+ $metadata: deserializeMetadata(parsedOutput),
747
+ ...contents
748
+ });
749
+ return decorateServiceException(exception, parsedOutput.body);
750
+ };
751
+ var de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => {
752
+ const contents = map({});
753
+ const data = parsedOutput.body;
754
+ const doc = take(data, {
755
+ error: expectString,
756
+ error_description: expectString
757
+ });
758
+ Object.assign(contents, doc);
759
+ const exception = new UnauthorizedClientException({
760
+ $metadata: deserializeMetadata(parsedOutput),
761
+ ...contents
762
+ });
763
+ return decorateServiceException(exception, parsedOutput.body);
764
+ };
765
+ var de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => {
766
+ const contents = map({});
767
+ const data = parsedOutput.body;
768
+ const doc = take(data, {
769
+ error: expectString,
770
+ error_description: expectString
771
+ });
772
+ Object.assign(contents, doc);
773
+ const exception = new UnsupportedGrantTypeException({
774
+ $metadata: deserializeMetadata(parsedOutput),
775
+ ...contents
776
+ });
777
+ return decorateServiceException(exception, parsedOutput.body);
778
+ };
779
+ var deserializeMetadata = (output) => ({
780
+ httpStatusCode: output.statusCode,
781
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
782
+ extendedRequestId: output.headers["x-amz-id-2"],
783
+ cfId: output.headers["x-amz-cf-id"]
784
+ });
785
+ var CreateTokenCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
786
+ return [
787
+ getSerdePlugin(config, this.serialize, this.deserialize),
788
+ getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
789
+ ];
790
+ }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() {
791
+ };
792
+ var commands = {
793
+ CreateTokenCommand
794
+ };
795
+ var SSOOIDC = class extends SSOOIDCClient {
796
+ };
797
+ createAggregatedClient(commands, SSOOIDC);
798
+ init_esm_shims();
799
+ init_esm_shims();
800
+ export {
801
+ Command as $Command,
802
+ AccessDeniedException,
803
+ AuthorizationPendingException,
804
+ CreateTokenCommand,
805
+ CreateTokenRequestFilterSensitiveLog,
806
+ CreateTokenResponseFilterSensitiveLog,
807
+ ExpiredTokenException,
808
+ InternalServerException,
809
+ InvalidClientException,
810
+ InvalidGrantException,
811
+ InvalidRequestException,
812
+ InvalidScopeException,
813
+ SSOOIDC,
814
+ SSOOIDCClient,
815
+ SSOOIDCServiceException,
816
+ SlowDownException,
817
+ UnauthorizedClientException,
818
+ UnsupportedGrantTypeException,
819
+ Client as __Client
820
+ };