@digipair/skill-s3 0.136.0 → 0.136.3

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.
@@ -1,224 +1,19 @@
1
- import { g as getSSOTokenFilepath, a as getSSOTokenFromFile } from './getSSOTokenFromFile.esm.js';
2
- import { P as ProviderError, I as IniSectionType, o as CONFIG_PREFIX_SEPARATOR, r as readFile, q as getConfigFilepath, u as parseIni, k as getProfileName, C as CredentialsProviderError, s as setCredentialFeature } from './index.esm3.js';
3
- import { promises } from 'fs';
4
- import { p as parseKnownFiles } from './parseKnownFiles.esm.js';
5
- import 'fs/promises';
6
- import 'crypto';
7
- import 'path';
8
- import 'buffer';
9
- import 'os';
1
+ import { a6 as resolveAwsSdkSigV4Config, a7 as normalizeProvider, a8 as getSmithyContext, a9 as EndpointCache, aa as awsEndpointFunctions, ab as customEndpointFunctions, ac as ServiceException, ad as TypeRegistry, t as toUtf8, i as fromUtf8, ae as parseUrl, af as NoOpLogger, ag as AwsSdkSigV4Signer, Z as toBase64, Q as fromBase64, ah as emitWarningIfUnsupportedVersion, ai as resolveDefaultsModeConfig, aj as emitWarningIfUnsupportedVersion$1, ak as loadConfig, al as NODE_APP_ID_CONFIG_OPTIONS, am as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, an as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, ao as streamCollector, ap as Hash, N as NodeHttpHandler, aq as NODE_REGION_CONFIG_OPTIONS, ar as NODE_MAX_ATTEMPT_CONFIG_OPTIONS, as as createDefaultUserAgentProvider, at as calculateBodyLength, au as NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, av as loadConfigsForDefaultMode, aw as NODE_RETRY_MODE_CONFIG_OPTIONS, ax as NODE_REGION_CONFIG_FILE_OPTIONS, ay as DEFAULT_RETRY_MODE, az as getAwsRegionExtensionConfiguration, aA as getDefaultExtensionConfiguration, aB as getHttpHandlerExtensionConfiguration, aC as resolveAwsRegionExtensionConfiguration, aD as resolveDefaultRuntimeConfig, aE as resolveHttpHandlerRuntimeConfig, aF as resolveUserAgentConfig, aG as resolveRetryConfig, aH as resolveRegionConfig, aI as resolveEndpointConfig, aJ as getSchemaSerdePlugin, aK as getUserAgentPlugin, aL as getRetryPlugin, aM as getContentLengthPlugin, aN as getHostHeaderPlugin, aO as getLoggerPlugin, aP as getRecursionDetectionPlugin, aQ as getHttpAuthSchemeEndpointRuleSetPlugin, aR as getHttpSigningPlugin, aS as resolveHostHeaderConfig, aT as Client, aU as DefaultIdentityProviderConfig, aV as Command, aW as getEndpointPlugin } from './index.esm3.js';
2
+ import { B as BinaryDecisionDiagram, d as decideEndpoint, N as NoAuthSigner, p as packageInfo } from './package.esm.js';
3
+ import { A as AwsRestJsonProtocol } from './AwsRestJsonProtocol.esm.js';
4
+ import { c as createAggregatedClient } from './create-aggregated-client.esm.js';
5
+ import 'node:crypto';
6
+ import 'node:path';
7
+ import 'node:os';
10
8
  import 'node:fs/promises';
11
- import 'stream';
12
9
  import 'node:stream';
13
- import 'http';
14
- import 'https';
15
- import 'process';
10
+ import 'node:process';
11
+ import 'buffer';
16
12
  import 'node:fs';
17
- import 'zlib';
18
-
19
- function _assert_this_initialized(self) {
20
- if (self === void 0) {
21
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
22
- }
23
- return self;
24
- }
25
- function _class_call_check(instance, Constructor) {
26
- if (!(instance instanceof Constructor)) {
27
- throw new TypeError("Cannot call a class as a function");
28
- }
29
- }
30
- function _define_property$3(obj, key, value) {
31
- if (key in obj) {
32
- Object.defineProperty(obj, key, {
33
- value: value,
34
- enumerable: true,
35
- configurable: true,
36
- writable: true
37
- });
38
- } else {
39
- obj[key] = value;
40
- }
41
- return obj;
42
- }
43
- function _get_prototype_of(o) {
44
- _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
45
- return o.__proto__ || Object.getPrototypeOf(o);
46
- };
47
- return _get_prototype_of(o);
48
- }
49
- function _inherits(subClass, superClass) {
50
- if (typeof superClass !== "function" && superClass !== null) {
51
- throw new TypeError("Super expression must either be null or a function");
52
- }
53
- subClass.prototype = Object.create(superClass && superClass.prototype, {
54
- constructor: {
55
- value: subClass,
56
- writable: true,
57
- configurable: true
58
- }
59
- });
60
- if (superClass) _set_prototype_of(subClass, superClass);
61
- }
62
- function _possible_constructor_return(self, call) {
63
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
64
- return call;
65
- }
66
- return _assert_this_initialized(self);
67
- }
68
- function _set_prototype_of(o, p) {
69
- _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
70
- o.__proto__ = p;
71
- return o;
72
- };
73
- return _set_prototype_of(o, p);
74
- }
75
- function _type_of(obj) {
76
- "@swc/helpers - typeof";
77
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
78
- }
79
- function _is_native_reflect_construct() {
80
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
81
- if (Reflect.construct.sham) return false;
82
- if (typeof Proxy === "function") return true;
83
- try {
84
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
85
- return true;
86
- } catch (e) {
87
- return false;
88
- }
89
- }
90
- function _create_super(Derived) {
91
- var hasNativeReflectConstruct = _is_native_reflect_construct();
92
- return function _createSuperInternal() {
93
- var Super = _get_prototype_of(Derived), result;
94
- if (hasNativeReflectConstruct) {
95
- var NewTarget = _get_prototype_of(this).constructor;
96
- result = Reflect.construct(Super, arguments, NewTarget);
97
- } else {
98
- result = Super.apply(this, arguments);
99
- }
100
- return _possible_constructor_return(this, result);
101
- };
102
- }
103
- var TokenProviderError = /*#__PURE__*/ function(ProviderError) {
104
- _inherits(TokenProviderError, ProviderError);
105
- var _super = _create_super(TokenProviderError);
106
- function TokenProviderError(message) {
107
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
108
- _class_call_check(this, TokenProviderError);
109
- var _this;
110
- _this = _super.call(this, message, options);
111
- _define_property$3(_assert_this_initialized(_this), "name", "TokenProviderError");
112
- Object.setPrototypeOf(_assert_this_initialized(_this), TokenProviderError.prototype);
113
- return _this;
114
- }
115
- return TokenProviderError;
116
- }(ProviderError);
117
-
118
- function _array_like_to_array(arr, len) {
119
- if (len == null || len > arr.length) len = arr.length;
120
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
121
- return arr2;
122
- }
123
- function _array_with_holes(arr) {
124
- if (Array.isArray(arr)) return arr;
125
- }
126
- function _define_property$2(obj, key, value) {
127
- if (key in obj) {
128
- Object.defineProperty(obj, key, {
129
- value: value,
130
- enumerable: true,
131
- configurable: true,
132
- writable: true
133
- });
134
- } else {
135
- obj[key] = value;
136
- }
137
- return obj;
138
- }
139
- function _iterable_to_array_limit(arr, i) {
140
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
141
- if (_i == null) return;
142
- var _arr = [];
143
- var _n = true;
144
- var _d = false;
145
- var _s, _e;
146
- try {
147
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
148
- _arr.push(_s.value);
149
- if (i && _arr.length === i) break;
150
- }
151
- } catch (err) {
152
- _d = true;
153
- _e = err;
154
- } finally{
155
- try {
156
- if (!_n && _i["return"] != null) _i["return"]();
157
- } finally{
158
- if (_d) throw _e;
159
- }
160
- }
161
- return _arr;
162
- }
163
- function _non_iterable_rest() {
164
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
165
- }
166
- function _object_spread$2(target) {
167
- for(var i = 1; i < arguments.length; i++){
168
- var source = arguments[i] != null ? arguments[i] : {};
169
- var ownKeys = Object.keys(source);
170
- if (typeof Object.getOwnPropertySymbols === "function") {
171
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
172
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
173
- }));
174
- }
175
- ownKeys.forEach(function(key) {
176
- _define_property$2(target, key, source[key]);
177
- });
178
- }
179
- return target;
180
- }
181
- function ownKeys$1(object, enumerableOnly) {
182
- var keys = Object.keys(object);
183
- if (Object.getOwnPropertySymbols) {
184
- var symbols = Object.getOwnPropertySymbols(object);
185
- keys.push.apply(keys, symbols);
186
- }
187
- return keys;
188
- }
189
- function _object_spread_props$1(target, source) {
190
- source = source != null ? source : {};
191
- if (Object.getOwnPropertyDescriptors) {
192
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
193
- } else {
194
- ownKeys$1(Object(source)).forEach(function(key) {
195
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
196
- });
197
- }
198
- return target;
199
- }
200
- function _sliced_to_array(arr, i) {
201
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
202
- }
203
- function _unsupported_iterable_to_array(o, minLen) {
204
- if (!o) return;
205
- if (typeof o === "string") return _array_like_to_array(o, minLen);
206
- var n = Object.prototype.toString.call(o).slice(8, -1);
207
- if (n === "Object" && o.constructor) n = o.constructor.name;
208
- if (n === "Map" || n === "Set") return Array.from(n);
209
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
210
- }
211
- var getSsoSessionData = function(data) {
212
- return Object.entries(data).filter(function(param) {
213
- var _param = _sliced_to_array(param, 1), key = _param[0];
214
- return key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR);
215
- }).reduce(function(acc, param) {
216
- var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
217
- return _object_spread_props$1(_object_spread$2({}, acc), _define_property$2({}, key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1), value));
218
- }, {});
219
- };
13
+ import 'node:https';
14
+ import 'node:zlib';
220
15
 
221
- function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
16
+ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
222
17
  try {
223
18
  var info = gen[key](arg);
224
19
  var value = info.value;
@@ -232,22 +27,22 @@ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
232
27
  Promise.resolve(value).then(_next, _throw);
233
28
  }
234
29
  }
235
- function _async_to_generator$5(fn) {
30
+ function _async_to_generator$3(fn) {
236
31
  return function() {
237
32
  var self = this, args = arguments;
238
33
  return new Promise(function(resolve, reject) {
239
34
  var gen = fn.apply(self, args);
240
35
  function _next(value) {
241
- asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
36
+ asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
242
37
  }
243
38
  function _throw(err) {
244
- asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
39
+ asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
245
40
  }
246
41
  _next(undefined);
247
42
  });
248
43
  };
249
44
  }
250
- function _ts_generator$5(thisArg, body) {
45
+ function _ts_generator$3(thisArg, body) {
251
46
  var f, y, t, g, _ = {
252
47
  label: 0,
253
48
  sent: function() {
@@ -342,188 +137,900 @@ function _ts_generator$5(thisArg, body) {
342
137
  };
343
138
  }
344
139
  }
345
- var swallowError = function() {
346
- return {};
347
- };
348
- var loadSsoSessionData = function() {
349
- var _ref = _async_to_generator$5(function() {
350
- var init, _init_configFilepath;
351
- var _arguments = arguments;
352
- return _ts_generator$5(this, function(_state) {
353
- init = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
354
- return [
355
- 2,
356
- readFile((_init_configFilepath = init.configFilepath) !== null && _init_configFilepath !== void 0 ? _init_configFilepath : getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError)
357
- ];
140
+ var defaultSigninHttpAuthSchemeParametersProvider = function() {
141
+ var _ref = _async_to_generator$3(function(config, context, input) {
142
+ var _tmp;
143
+ return _ts_generator$3(this, function(_state) {
144
+ switch(_state.label){
145
+ case 0:
146
+ _tmp = {
147
+ operation: getSmithyContext(context).operation
148
+ };
149
+ return [
150
+ 4,
151
+ normalizeProvider(config.region)()
152
+ ];
153
+ case 1:
154
+ return [
155
+ 2,
156
+ (_tmp.region = _state.sent() || function() {
157
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
158
+ }(), _tmp)
159
+ ];
160
+ }
358
161
  });
359
162
  });
360
- return function loadSsoSessionData() {
163
+ return function defaultSigninHttpAuthSchemeParametersProvider(config, context, input) {
361
164
  return _ref.apply(this, arguments);
362
165
  };
363
166
  }();
364
-
365
- var isSsoProfile = function(arg) {
366
- return arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
167
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
168
+ return {
169
+ schemeId: "aws.auth#sigv4",
170
+ signingProperties: {
171
+ name: "signin",
172
+ region: authParameters.region
173
+ },
174
+ propertiesExtractor: function(config, context) {
175
+ return {
176
+ signingProperties: {
177
+ config: config,
178
+ context: context
179
+ }
180
+ };
181
+ }
182
+ };
183
+ }
184
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
185
+ return {
186
+ schemeId: "smithy.api#noAuth"
187
+ };
188
+ }
189
+ var defaultSigninHttpAuthSchemeProvider = function(authParameters) {
190
+ var options = [];
191
+ switch(authParameters.operation){
192
+ case "CreateOAuth2Token":
193
+ {
194
+ options.push(createSmithyApiNoAuthHttpAuthOption());
195
+ break;
196
+ }
197
+ default:
198
+ {
199
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
200
+ }
201
+ }
202
+ return options;
203
+ };
204
+ var resolveHttpAuthSchemeConfig = function(config) {
205
+ var config_0 = resolveAwsSdkSigV4Config(config);
206
+ var _config_authSchemePreference;
207
+ return Object.assign(config_0, {
208
+ authSchemePreference: normalizeProvider((_config_authSchemePreference = config.authSchemePreference) !== null && _config_authSchemePreference !== void 0 ? _config_authSchemePreference : [])
209
+ });
367
210
  };
368
211
 
369
- var EXPIRE_WINDOW_MS = 5 * 60 * 1000;
370
- var REFRESH_MESSAGE = "To refresh this SSO session run 'aws sso login' with the corresponding profile.";
371
-
372
- function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
373
- try {
374
- var info = gen[key](arg);
375
- var value = info.value;
376
- } catch (error) {
377
- reject(error);
378
- return;
212
+ var resolveClientEndpointParameters = function(options) {
213
+ var _options_useDualstackEndpoint, _options_useFipsEndpoint;
214
+ return Object.assign(options, {
215
+ useDualstackEndpoint: (_options_useDualstackEndpoint = options.useDualstackEndpoint) !== null && _options_useDualstackEndpoint !== void 0 ? _options_useDualstackEndpoint : false,
216
+ useFipsEndpoint: (_options_useFipsEndpoint = options.useFipsEndpoint) !== null && _options_useFipsEndpoint !== void 0 ? _options_useFipsEndpoint : false,
217
+ defaultSigningName: "signin"
218
+ });
219
+ };
220
+ var commonParams = {
221
+ UseFIPS: {
222
+ type: "builtInParams",
223
+ name: "useFipsEndpoint"
224
+ },
225
+ Endpoint: {
226
+ type: "builtInParams",
227
+ name: "endpoint"
228
+ },
229
+ Region: {
230
+ type: "builtInParams",
231
+ name: "region"
232
+ },
233
+ UseDualStack: {
234
+ type: "builtInParams",
235
+ name: "useDualstackEndpoint"
379
236
  }
380
- if (info.done) {
381
- resolve(value);
237
+ };
238
+
239
+ function _define_property$4(obj, key, value) {
240
+ if (key in obj) {
241
+ Object.defineProperty(obj, key, {
242
+ value: value,
243
+ enumerable: true,
244
+ configurable: true,
245
+ writable: true
246
+ });
382
247
  } else {
383
- Promise.resolve(value).then(_next, _throw);
248
+ obj[key] = value;
384
249
  }
250
+ return obj;
385
251
  }
386
- function _async_to_generator$4(fn) {
387
- return function() {
388
- var self = this, args = arguments;
389
- return new Promise(function(resolve, reject) {
390
- var gen = fn.apply(self, args);
391
- function _next(value) {
392
- asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
393
- }
394
- function _throw(err) {
395
- asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
396
- }
397
- _next(undefined);
252
+ var m = "ref";
253
+ var a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = "stringEquals", h = _define_property$4({}, m, "Endpoint"), i = _define_property$4({}, m, d), j = {
254
+ "fn": f,
255
+ "argv": [
256
+ i,
257
+ "name"
258
+ ]
259
+ }, k = {}, l = [
260
+ _define_property$4({}, m, "Region")
261
+ ];
262
+ var _data = {
263
+ conditions: [
264
+ [
265
+ c,
266
+ [
267
+ h
268
+ ]
269
+ ],
270
+ [
271
+ c,
272
+ l
273
+ ],
274
+ [
275
+ "aws.partition",
276
+ l,
277
+ d
278
+ ],
279
+ [
280
+ e,
281
+ [
282
+ _define_property$4({}, m, "UseFIPS"),
283
+ b
284
+ ]
285
+ ],
286
+ [
287
+ e,
288
+ [
289
+ _define_property$4({}, m, "UseDualStack"),
290
+ b
291
+ ]
292
+ ],
293
+ [
294
+ e,
295
+ [
296
+ {
297
+ fn: f,
298
+ argv: [
299
+ i,
300
+ "supportsDualStack"
301
+ ]
302
+ },
303
+ b
304
+ ]
305
+ ],
306
+ [
307
+ e,
308
+ [
309
+ {
310
+ fn: f,
311
+ argv: [
312
+ i,
313
+ "supportsFIPS"
314
+ ]
315
+ },
316
+ b
317
+ ]
318
+ ],
319
+ [
320
+ g,
321
+ [
322
+ j,
323
+ "aws"
324
+ ]
325
+ ],
326
+ [
327
+ g,
328
+ [
329
+ j,
330
+ "aws-cn"
331
+ ]
332
+ ],
333
+ [
334
+ g,
335
+ [
336
+ j,
337
+ "aws-us-gov"
338
+ ]
339
+ ]
340
+ ],
341
+ results: [
342
+ [
343
+ a
344
+ ],
345
+ [
346
+ a,
347
+ "Invalid Configuration: FIPS and custom endpoint are not supported"
348
+ ],
349
+ [
350
+ a,
351
+ "Invalid Configuration: Dualstack and custom endpoint are not supported"
352
+ ],
353
+ [
354
+ h,
355
+ k
356
+ ],
357
+ [
358
+ "https://{Region}.signin.aws.amazon.com",
359
+ k
360
+ ],
361
+ [
362
+ "https://{Region}.signin.amazonaws.cn",
363
+ k
364
+ ],
365
+ [
366
+ "https://{Region}.signin.amazonaws-us-gov.com",
367
+ k
368
+ ],
369
+ [
370
+ "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
371
+ k
372
+ ],
373
+ [
374
+ a,
375
+ "FIPS and DualStack are enabled, but this partition does not support one or both"
376
+ ],
377
+ [
378
+ "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",
379
+ k
380
+ ],
381
+ [
382
+ a,
383
+ "FIPS is enabled but this partition does not support FIPS"
384
+ ],
385
+ [
386
+ "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",
387
+ k
388
+ ],
389
+ [
390
+ a,
391
+ "DualStack is enabled but this partition does not support DualStack"
392
+ ],
393
+ [
394
+ "https://signin.{Region}.{PartitionResult#dnsSuffix}",
395
+ k
396
+ ],
397
+ [
398
+ a,
399
+ "Invalid Configuration: Missing Region"
400
+ ]
401
+ ]
402
+ };
403
+ var root = 2;
404
+ var r = 100000000;
405
+ var nodes = new Int32Array([
406
+ -1,
407
+ 1,
408
+ -1,
409
+ 0,
410
+ 15,
411
+ 3,
412
+ 1,
413
+ 4,
414
+ r + 14,
415
+ 2,
416
+ 5,
417
+ r + 14,
418
+ 3,
419
+ 11,
420
+ 6,
421
+ 4,
422
+ 10,
423
+ 7,
424
+ 7,
425
+ r + 4,
426
+ 8,
427
+ 8,
428
+ r + 5,
429
+ 9,
430
+ 9,
431
+ r + 6,
432
+ r + 13,
433
+ 5,
434
+ r + 11,
435
+ r + 12,
436
+ 4,
437
+ 13,
438
+ 12,
439
+ 6,
440
+ r + 9,
441
+ r + 10,
442
+ 5,
443
+ 14,
444
+ r + 8,
445
+ 6,
446
+ r + 7,
447
+ r + 8,
448
+ 3,
449
+ r + 1,
450
+ 16,
451
+ 4,
452
+ r + 2,
453
+ r + 3
454
+ ]);
455
+ var bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
456
+
457
+ var cache = new EndpointCache({
458
+ size: 50,
459
+ params: [
460
+ "Endpoint",
461
+ "Region",
462
+ "UseDualStack",
463
+ "UseFIPS"
464
+ ]
465
+ });
466
+ var defaultEndpointResolver = function(endpointParams) {
467
+ var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
468
+ return cache.get(endpointParams, function() {
469
+ return decideEndpoint(bdd, {
470
+ endpointParams: endpointParams,
471
+ logger: context.logger
398
472
  });
399
- };
473
+ });
474
+ };
475
+ customEndpointFunctions.aws = awsEndpointFunctions;
476
+
477
+ function _assert_this_initialized$4(self) {
478
+ if (self === void 0) {
479
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
480
+ }
481
+ return self;
400
482
  }
401
- function _ts_generator$4(thisArg, body) {
402
- var f, y, t, g, _ = {
403
- label: 0,
404
- sent: function() {
405
- if (t[0] & 1) throw t[1];
406
- return t[1];
407
- },
408
- trys: [],
409
- ops: []
483
+ function _class_call_check$4(instance, Constructor) {
484
+ if (!(instance instanceof Constructor)) {
485
+ throw new TypeError("Cannot call a class as a function");
486
+ }
487
+ }
488
+ function _get_prototype_of$4(o) {
489
+ _get_prototype_of$4 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
490
+ return o.__proto__ || Object.getPrototypeOf(o);
410
491
  };
411
- return g = {
412
- next: verb(0),
413
- "throw": verb(1),
414
- "return": verb(2)
415
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
416
- return this;
417
- }), g;
418
- function verb(n) {
419
- return function(v) {
420
- return step([
421
- n,
422
- v
423
- ]);
424
- };
492
+ return _get_prototype_of$4(o);
493
+ }
494
+ function _inherits$4(subClass, superClass) {
495
+ if (typeof superClass !== "function" && superClass !== null) {
496
+ throw new TypeError("Super expression must either be null or a function");
425
497
  }
426
- function step(op) {
427
- if (f) throw new TypeError("Generator is already executing.");
428
- while(_)try {
429
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
430
- if (y = 0, t) op = [
431
- op[0] & 2,
432
- t.value
433
- ];
434
- switch(op[0]){
435
- case 0:
436
- case 1:
437
- t = op;
438
- break;
439
- case 4:
440
- _.label++;
441
- return {
442
- value: op[1],
443
- done: false
444
- };
445
- case 5:
446
- _.label++;
447
- y = op[1];
448
- op = [
449
- 0
450
- ];
451
- continue;
452
- case 7:
453
- op = _.ops.pop();
454
- _.trys.pop();
455
- continue;
456
- default:
457
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
458
- _ = 0;
459
- continue;
460
- }
461
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
462
- _.label = op[1];
463
- break;
464
- }
465
- if (op[0] === 6 && _.label < t[1]) {
466
- _.label = t[1];
467
- t = op;
468
- break;
469
- }
470
- if (t && _.label < t[2]) {
471
- _.label = t[2];
472
- _.ops.push(op);
473
- break;
474
- }
475
- if (t[2]) _.ops.pop();
476
- _.trys.pop();
477
- continue;
478
- }
479
- op = body.call(thisArg, _);
480
- } catch (e) {
481
- op = [
482
- 6,
483
- e
484
- ];
485
- y = 0;
486
- } finally{
487
- f = t = 0;
498
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
499
+ constructor: {
500
+ value: subClass,
501
+ writable: true,
502
+ configurable: true
488
503
  }
489
- if (op[0] & 5) throw op[1];
490
- return {
491
- value: op[0] ? op[1] : void 0,
492
- done: true
493
- };
504
+ });
505
+ if (superClass) _set_prototype_of$4(subClass, superClass);
506
+ }
507
+ function _possible_constructor_return$4(self, call) {
508
+ if (call && (_type_of$4(call) === "object" || typeof call === "function")) {
509
+ return call;
494
510
  }
511
+ return _assert_this_initialized$4(self);
495
512
  }
496
- var getSsoOidcClient = function() {
497
- var _ref = _async_to_generator$4(function(ssoRegion) {
498
- var init, _init_clientConfig, _init_clientConfig1, _init_parentClientConfig, SSOOIDCClient, _init_clientConfig2, _init_clientConfig_logger, ssoOidcClient;
499
- var _arguments = arguments;
500
- return _ts_generator$4(this, function(_state) {
501
- switch(_state.label){
502
- case 0:
503
- init = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
504
- return [
505
- 4,
506
- import('./index.esm12.js')
507
- ];
508
- case 1:
509
- SSOOIDCClient = _state.sent().SSOOIDCClient;
510
- ssoOidcClient = new SSOOIDCClient(Object.assign({}, (_init_clientConfig2 = init.clientConfig) !== null && _init_clientConfig2 !== void 0 ? _init_clientConfig2 : {}, {
511
- region: ssoRegion !== null && ssoRegion !== void 0 ? ssoRegion : (_init_clientConfig = init.clientConfig) === null || _init_clientConfig === void 0 ? void 0 : _init_clientConfig.region,
512
- logger: (_init_clientConfig_logger = (_init_clientConfig1 = init.clientConfig) === null || _init_clientConfig1 === void 0 ? void 0 : _init_clientConfig1.logger) !== null && _init_clientConfig_logger !== void 0 ? _init_clientConfig_logger : (_init_parentClientConfig = init.parentClientConfig) === null || _init_parentClientConfig === void 0 ? void 0 : _init_parentClientConfig.logger
513
- }));
514
- return [
515
- 2,
516
- ssoOidcClient
517
- ];
518
- }
513
+ function _set_prototype_of$4(o, p) {
514
+ _set_prototype_of$4 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
515
+ o.__proto__ = p;
516
+ return o;
517
+ };
518
+ return _set_prototype_of$4(o, p);
519
+ }
520
+ function _type_of$4(obj) {
521
+ "@swc/helpers - typeof";
522
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
523
+ }
524
+ function _is_native_reflect_construct$4() {
525
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
526
+ if (Reflect.construct.sham) return false;
527
+ if (typeof Proxy === "function") return true;
528
+ try {
529
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
530
+ return true;
531
+ } catch (e) {
532
+ return false;
533
+ }
534
+ }
535
+ function _create_super$4(Derived) {
536
+ var hasNativeReflectConstruct = _is_native_reflect_construct$4();
537
+ return function _createSuperInternal() {
538
+ var Super = _get_prototype_of$4(Derived), result;
539
+ if (hasNativeReflectConstruct) {
540
+ var NewTarget = _get_prototype_of$4(this).constructor;
541
+ result = Reflect.construct(Super, arguments, NewTarget);
542
+ } else {
543
+ result = Super.apply(this, arguments);
544
+ }
545
+ return _possible_constructor_return$4(this, result);
546
+ };
547
+ }
548
+ var SigninServiceException = /*#__PURE__*/ function(__ServiceException) {
549
+ _inherits$4(SigninServiceException, __ServiceException);
550
+ var _super = _create_super$4(SigninServiceException);
551
+ function SigninServiceException(options) {
552
+ _class_call_check$4(this, SigninServiceException);
553
+ var _this;
554
+ _this = _super.call(this, options);
555
+ Object.setPrototypeOf(_assert_this_initialized$4(_this), SigninServiceException.prototype);
556
+ return _this;
557
+ }
558
+ return SigninServiceException;
559
+ }(ServiceException);
560
+
561
+ function _assert_this_initialized$3(self) {
562
+ if (self === void 0) {
563
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
564
+ }
565
+ return self;
566
+ }
567
+ function _class_call_check$3(instance, Constructor) {
568
+ if (!(instance instanceof Constructor)) {
569
+ throw new TypeError("Cannot call a class as a function");
570
+ }
571
+ }
572
+ function _define_property$3(obj, key, value) {
573
+ if (key in obj) {
574
+ Object.defineProperty(obj, key, {
575
+ value: value,
576
+ enumerable: true,
577
+ configurable: true,
578
+ writable: true
519
579
  });
580
+ } else {
581
+ obj[key] = value;
582
+ }
583
+ return obj;
584
+ }
585
+ function _get_prototype_of$3(o) {
586
+ _get_prototype_of$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
587
+ return o.__proto__ || Object.getPrototypeOf(o);
588
+ };
589
+ return _get_prototype_of$3(o);
590
+ }
591
+ function _inherits$3(subClass, superClass) {
592
+ if (typeof superClass !== "function" && superClass !== null) {
593
+ throw new TypeError("Super expression must either be null or a function");
594
+ }
595
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
596
+ constructor: {
597
+ value: subClass,
598
+ writable: true,
599
+ configurable: true
600
+ }
520
601
  });
521
- return function getSsoOidcClient(ssoRegion) {
522
- return _ref.apply(this, arguments);
602
+ if (superClass) _set_prototype_of$3(subClass, superClass);
603
+ }
604
+ function _object_spread$1(target) {
605
+ for(var i = 1; i < arguments.length; i++){
606
+ var source = arguments[i] != null ? arguments[i] : {};
607
+ var ownKeys = Object.keys(source);
608
+ if (typeof Object.getOwnPropertySymbols === "function") {
609
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
610
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
611
+ }));
612
+ }
613
+ ownKeys.forEach(function(key) {
614
+ _define_property$3(target, key, source[key]);
615
+ });
616
+ }
617
+ return target;
618
+ }
619
+ function _possible_constructor_return$3(self, call) {
620
+ if (call && (_type_of$3(call) === "object" || typeof call === "function")) {
621
+ return call;
622
+ }
623
+ return _assert_this_initialized$3(self);
624
+ }
625
+ function _set_prototype_of$3(o, p) {
626
+ _set_prototype_of$3 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
627
+ o.__proto__ = p;
628
+ return o;
523
629
  };
524
- }();
630
+ return _set_prototype_of$3(o, p);
631
+ }
632
+ function _type_of$3(obj) {
633
+ "@swc/helpers - typeof";
634
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
635
+ }
636
+ function _is_native_reflect_construct$3() {
637
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
638
+ if (Reflect.construct.sham) return false;
639
+ if (typeof Proxy === "function") return true;
640
+ try {
641
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
642
+ return true;
643
+ } catch (e) {
644
+ return false;
645
+ }
646
+ }
647
+ function _create_super$3(Derived) {
648
+ var hasNativeReflectConstruct = _is_native_reflect_construct$3();
649
+ return function _createSuperInternal() {
650
+ var Super = _get_prototype_of$3(Derived), result;
651
+ if (hasNativeReflectConstruct) {
652
+ var NewTarget = _get_prototype_of$3(this).constructor;
653
+ result = Reflect.construct(Super, arguments, NewTarget);
654
+ } else {
655
+ result = Super.apply(this, arguments);
656
+ }
657
+ return _possible_constructor_return$3(this, result);
658
+ };
659
+ }
660
+ var AccessDeniedException = /*#__PURE__*/ function(__BaseException) {
661
+ _inherits$3(AccessDeniedException, __BaseException);
662
+ var _super = _create_super$3(AccessDeniedException);
663
+ function AccessDeniedException(opts) {
664
+ _class_call_check$3(this, AccessDeniedException);
665
+ var _this;
666
+ _this = _super.call(this, _object_spread$1({
667
+ name: "AccessDeniedException",
668
+ $fault: "client"
669
+ }, opts));
670
+ _define_property$3(_assert_this_initialized$3(_this), "name", "AccessDeniedException");
671
+ _define_property$3(_assert_this_initialized$3(_this), "$fault", "client");
672
+ _define_property$3(_assert_this_initialized$3(_this), "error", void 0);
673
+ Object.setPrototypeOf(_assert_this_initialized$3(_this), AccessDeniedException.prototype);
674
+ _this.error = opts.error;
675
+ return _this;
676
+ }
677
+ return AccessDeniedException;
678
+ }(SigninServiceException);
679
+ var InternalServerException = /*#__PURE__*/ function(__BaseException) {
680
+ _inherits$3(InternalServerException, __BaseException);
681
+ var _super = _create_super$3(InternalServerException);
682
+ function InternalServerException(opts) {
683
+ _class_call_check$3(this, InternalServerException);
684
+ var _this;
685
+ _this = _super.call(this, _object_spread$1({
686
+ name: "InternalServerException",
687
+ $fault: "server"
688
+ }, opts));
689
+ _define_property$3(_assert_this_initialized$3(_this), "name", "InternalServerException");
690
+ _define_property$3(_assert_this_initialized$3(_this), "$fault", "server");
691
+ _define_property$3(_assert_this_initialized$3(_this), "error", void 0);
692
+ Object.setPrototypeOf(_assert_this_initialized$3(_this), InternalServerException.prototype);
693
+ _this.error = opts.error;
694
+ return _this;
695
+ }
696
+ return InternalServerException;
697
+ }(SigninServiceException);
698
+ var TooManyRequestsError = /*#__PURE__*/ function(__BaseException) {
699
+ _inherits$3(TooManyRequestsError, __BaseException);
700
+ var _super = _create_super$3(TooManyRequestsError);
701
+ function TooManyRequestsError(opts) {
702
+ _class_call_check$3(this, TooManyRequestsError);
703
+ var _this;
704
+ _this = _super.call(this, _object_spread$1({
705
+ name: "TooManyRequestsError",
706
+ $fault: "client"
707
+ }, opts));
708
+ _define_property$3(_assert_this_initialized$3(_this), "name", "TooManyRequestsError");
709
+ _define_property$3(_assert_this_initialized$3(_this), "$fault", "client");
710
+ _define_property$3(_assert_this_initialized$3(_this), "error", void 0);
711
+ Object.setPrototypeOf(_assert_this_initialized$3(_this), TooManyRequestsError.prototype);
712
+ _this.error = opts.error;
713
+ return _this;
714
+ }
715
+ return TooManyRequestsError;
716
+ }(SigninServiceException);
717
+ var ValidationException = /*#__PURE__*/ function(__BaseException) {
718
+ _inherits$3(ValidationException, __BaseException);
719
+ var _super = _create_super$3(ValidationException);
720
+ function ValidationException(opts) {
721
+ _class_call_check$3(this, ValidationException);
722
+ var _this;
723
+ _this = _super.call(this, _object_spread$1({
724
+ name: "ValidationException",
725
+ $fault: "client"
726
+ }, opts));
727
+ _define_property$3(_assert_this_initialized$3(_this), "name", "ValidationException");
728
+ _define_property$3(_assert_this_initialized$3(_this), "$fault", "client");
729
+ _define_property$3(_assert_this_initialized$3(_this), "error", void 0);
730
+ Object.setPrototypeOf(_assert_this_initialized$3(_this), ValidationException.prototype);
731
+ _this.error = opts.error;
732
+ return _this;
733
+ }
734
+ return ValidationException;
735
+ }(SigninServiceException);
525
736
 
526
- function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
737
+ function _define_property$2(obj, key, value) {
738
+ if (key in obj) {
739
+ Object.defineProperty(obj, key, {
740
+ value: value,
741
+ enumerable: true,
742
+ configurable: true,
743
+ writable: true
744
+ });
745
+ } else {
746
+ obj[key] = value;
747
+ }
748
+ return obj;
749
+ }
750
+ var _ADE = "AccessDeniedException";
751
+ var _AT = "AccessToken";
752
+ var _COAT = "CreateOAuth2Token";
753
+ var _COATR = "CreateOAuth2TokenRequest";
754
+ var _COATRB = "CreateOAuth2TokenRequestBody";
755
+ var _COATRBr = "CreateOAuth2TokenResponseBody";
756
+ var _COATRr = "CreateOAuth2TokenResponse";
757
+ var _ISE = "InternalServerException";
758
+ var _RT = "RefreshToken";
759
+ var _TMRE = "TooManyRequestsError";
760
+ var _VE = "ValidationException";
761
+ var _aKI = "accessKeyId";
762
+ var _aT = "accessToken";
763
+ var _c = "client";
764
+ var _cI = "clientId";
765
+ var _cV = "codeVerifier";
766
+ var _co = "code";
767
+ var _e = "error";
768
+ var _eI = "expiresIn";
769
+ var _gT = "grantType";
770
+ var _h = "http";
771
+ var _hE = "httpError";
772
+ var _iT = "idToken";
773
+ var _jN = "jsonName";
774
+ var _m = "message";
775
+ var _rT = "refreshToken";
776
+ var _rU = "redirectUri";
777
+ var _s = "smithy.ts.sdk.synthetic.com.amazonaws.signin";
778
+ var _sAK = "secretAccessKey";
779
+ var _sT = "sessionToken";
780
+ var _se = "server";
781
+ var _tI = "tokenInput";
782
+ var _tO = "tokenOutput";
783
+ var _tT = "tokenType";
784
+ var n0 = "com.amazonaws.signin";
785
+ var _s_registry = TypeRegistry.for(_s);
786
+ var SigninServiceException$ = [
787
+ -3,
788
+ _s,
789
+ "SigninServiceException",
790
+ 0,
791
+ [],
792
+ []
793
+ ];
794
+ _s_registry.registerError(SigninServiceException$, SigninServiceException);
795
+ var n0_registry = TypeRegistry.for(n0);
796
+ var AccessDeniedException$ = [
797
+ -3,
798
+ n0,
799
+ _ADE,
800
+ _define_property$2({}, _e, _c),
801
+ [
802
+ _e,
803
+ _m
804
+ ],
805
+ [
806
+ 0,
807
+ 0
808
+ ],
809
+ 2
810
+ ];
811
+ n0_registry.registerError(AccessDeniedException$, AccessDeniedException);
812
+ var _obj;
813
+ var InternalServerException$ = [
814
+ -3,
815
+ n0,
816
+ _ISE,
817
+ (_obj = {}, _define_property$2(_obj, _e, _se), _define_property$2(_obj, _hE, 500), _obj),
818
+ [
819
+ _e,
820
+ _m
821
+ ],
822
+ [
823
+ 0,
824
+ 0
825
+ ],
826
+ 2
827
+ ];
828
+ n0_registry.registerError(InternalServerException$, InternalServerException);
829
+ var _obj1;
830
+ var TooManyRequestsError$ = [
831
+ -3,
832
+ n0,
833
+ _TMRE,
834
+ (_obj1 = {}, _define_property$2(_obj1, _e, _c), _define_property$2(_obj1, _hE, 429), _obj1),
835
+ [
836
+ _e,
837
+ _m
838
+ ],
839
+ [
840
+ 0,
841
+ 0
842
+ ],
843
+ 2
844
+ ];
845
+ n0_registry.registerError(TooManyRequestsError$, TooManyRequestsError);
846
+ var _obj2;
847
+ var ValidationException$ = [
848
+ -3,
849
+ n0,
850
+ _VE,
851
+ (_obj2 = {}, _define_property$2(_obj2, _e, _c), _define_property$2(_obj2, _hE, 400), _obj2),
852
+ [
853
+ _e,
854
+ _m
855
+ ],
856
+ [
857
+ 0,
858
+ 0
859
+ ],
860
+ 2
861
+ ];
862
+ n0_registry.registerError(ValidationException$, ValidationException);
863
+ var errorTypeRegistries = [
864
+ _s_registry,
865
+ n0_registry
866
+ ];
867
+ var RefreshToken = [
868
+ 0,
869
+ n0,
870
+ _RT,
871
+ 8,
872
+ 0
873
+ ];
874
+ var AccessToken$ = [
875
+ 3,
876
+ n0,
877
+ _AT,
878
+ 8,
879
+ [
880
+ _aKI,
881
+ _sAK,
882
+ _sT
883
+ ],
884
+ [
885
+ [
886
+ 0,
887
+ _define_property$2({}, _jN, _aKI)
888
+ ],
889
+ [
890
+ 0,
891
+ _define_property$2({}, _jN, _sAK)
892
+ ],
893
+ [
894
+ 0,
895
+ _define_property$2({}, _jN, _sT)
896
+ ]
897
+ ],
898
+ 3
899
+ ];
900
+ var CreateOAuth2TokenRequest$ = [
901
+ 3,
902
+ n0,
903
+ _COATR,
904
+ 0,
905
+ [
906
+ _tI
907
+ ],
908
+ [
909
+ [
910
+ function() {
911
+ return CreateOAuth2TokenRequestBody$;
912
+ },
913
+ 16
914
+ ]
915
+ ],
916
+ 1
917
+ ];
918
+ var CreateOAuth2TokenRequestBody$ = [
919
+ 3,
920
+ n0,
921
+ _COATRB,
922
+ 0,
923
+ [
924
+ _cI,
925
+ _gT,
926
+ _co,
927
+ _rU,
928
+ _cV,
929
+ _rT
930
+ ],
931
+ [
932
+ [
933
+ 0,
934
+ _define_property$2({}, _jN, _cI)
935
+ ],
936
+ [
937
+ 0,
938
+ _define_property$2({}, _jN, _gT)
939
+ ],
940
+ 0,
941
+ [
942
+ 0,
943
+ _define_property$2({}, _jN, _rU)
944
+ ],
945
+ [
946
+ 0,
947
+ _define_property$2({}, _jN, _cV)
948
+ ],
949
+ [
950
+ function() {
951
+ return RefreshToken;
952
+ },
953
+ _define_property$2({}, _jN, _rT)
954
+ ]
955
+ ],
956
+ 2
957
+ ];
958
+ var CreateOAuth2TokenResponse$ = [
959
+ 3,
960
+ n0,
961
+ _COATRr,
962
+ 0,
963
+ [
964
+ _tO
965
+ ],
966
+ [
967
+ [
968
+ function() {
969
+ return CreateOAuth2TokenResponseBody$;
970
+ },
971
+ 16
972
+ ]
973
+ ],
974
+ 1
975
+ ];
976
+ var CreateOAuth2TokenResponseBody$ = [
977
+ 3,
978
+ n0,
979
+ _COATRBr,
980
+ 0,
981
+ [
982
+ _aT,
983
+ _tT,
984
+ _eI,
985
+ _rT,
986
+ _iT
987
+ ],
988
+ [
989
+ [
990
+ function() {
991
+ return AccessToken$;
992
+ },
993
+ _define_property$2({}, _jN, _aT)
994
+ ],
995
+ [
996
+ 0,
997
+ _define_property$2({}, _jN, _tT)
998
+ ],
999
+ [
1000
+ 1,
1001
+ _define_property$2({}, _jN, _eI)
1002
+ ],
1003
+ [
1004
+ function() {
1005
+ return RefreshToken;
1006
+ },
1007
+ _define_property$2({}, _jN, _rT)
1008
+ ],
1009
+ [
1010
+ 0,
1011
+ _define_property$2({}, _jN, _iT)
1012
+ ]
1013
+ ],
1014
+ 4
1015
+ ];
1016
+ var CreateOAuth2Token$ = [
1017
+ 9,
1018
+ n0,
1019
+ _COAT,
1020
+ _define_property$2({}, _h, [
1021
+ "POST",
1022
+ "/v1/token",
1023
+ 200
1024
+ ]),
1025
+ function() {
1026
+ return CreateOAuth2TokenRequest$;
1027
+ },
1028
+ function() {
1029
+ return CreateOAuth2TokenResponse$;
1030
+ }
1031
+ ];
1032
+
1033
+ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
527
1034
  try {
528
1035
  var info = gen[key](arg);
529
1036
  var value = info.value;
@@ -537,22 +1044,22 @@ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
537
1044
  Promise.resolve(value).then(_next, _throw);
538
1045
  }
539
1046
  }
540
- function _async_to_generator$3(fn) {
1047
+ function _async_to_generator$2(fn) {
541
1048
  return function() {
542
1049
  var self = this, args = arguments;
543
1050
  return new Promise(function(resolve, reject) {
544
1051
  var gen = fn.apply(self, args);
545
1052
  function _next(value) {
546
- asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
1053
+ asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
547
1054
  }
548
1055
  function _throw(err) {
549
- asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
1056
+ asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
550
1057
  }
551
1058
  _next(undefined);
552
1059
  });
553
1060
  };
554
1061
  }
555
- function _ts_generator$3(thisArg, body) {
1062
+ function _ts_generator$2(thisArg, body) {
556
1063
  var f, y, t, g, _ = {
557
1064
  label: 0,
558
1065
  sent: function() {
@@ -647,64 +1154,55 @@ function _ts_generator$3(thisArg, body) {
647
1154
  };
648
1155
  }
649
1156
  }
650
- var getNewSsoOidcToken = function() {
651
- var _ref = _async_to_generator$3(function(ssoToken, ssoRegion) {
652
- var init, CreateTokenCommand, ssoOidcClient;
653
- var _arguments = arguments;
654
- return _ts_generator$3(this, function(_state) {
655
- switch(_state.label){
656
- case 0:
657
- init = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
658
- return [
659
- 4,
660
- import('./index.esm12.js')
661
- ];
662
- case 1:
663
- CreateTokenCommand = _state.sent().CreateTokenCommand;
664
- return [
665
- 4,
666
- getSsoOidcClient(ssoRegion, init)
667
- ];
668
- case 2:
669
- ssoOidcClient = _state.sent();
670
- return [
671
- 2,
672
- ssoOidcClient.send(new CreateTokenCommand({
673
- clientId: ssoToken.clientId,
674
- clientSecret: ssoToken.clientSecret,
675
- refreshToken: ssoToken.refreshToken,
676
- grantType: "refresh_token"
677
- }))
678
- ];
1157
+ var getRuntimeConfig$1 = function(config) {
1158
+ var _config_base64Decoder, _config_base64Encoder, _config_disableHostPrefix, _config_endpointProvider, _config_extensions, _config_httpAuthSchemeProvider, _config_httpAuthSchemes, _config_logger, _config_protocol, _config_protocolSettings, _config_serviceId, _config_urlParser, _config_utf8Decoder, _config_utf8Encoder;
1159
+ return {
1160
+ apiVersion: "2023-01-01",
1161
+ base64Decoder: (_config_base64Decoder = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _config_base64Decoder !== void 0 ? _config_base64Decoder : fromBase64,
1162
+ base64Encoder: (_config_base64Encoder = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _config_base64Encoder !== void 0 ? _config_base64Encoder : toBase64,
1163
+ disableHostPrefix: (_config_disableHostPrefix = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _config_disableHostPrefix !== void 0 ? _config_disableHostPrefix : false,
1164
+ endpointProvider: (_config_endpointProvider = config === null || config === void 0 ? void 0 : config.endpointProvider) !== null && _config_endpointProvider !== void 0 ? _config_endpointProvider : defaultEndpointResolver,
1165
+ extensions: (_config_extensions = config === null || config === void 0 ? void 0 : config.extensions) !== null && _config_extensions !== void 0 ? _config_extensions : [],
1166
+ httpAuthSchemeProvider: (_config_httpAuthSchemeProvider = config === null || config === void 0 ? void 0 : config.httpAuthSchemeProvider) !== null && _config_httpAuthSchemeProvider !== void 0 ? _config_httpAuthSchemeProvider : defaultSigninHttpAuthSchemeProvider,
1167
+ httpAuthSchemes: (_config_httpAuthSchemes = config === null || config === void 0 ? void 0 : config.httpAuthSchemes) !== null && _config_httpAuthSchemes !== void 0 ? _config_httpAuthSchemes : [
1168
+ {
1169
+ schemeId: "aws.auth#sigv4",
1170
+ identityProvider: function(ipc) {
1171
+ return ipc.getIdentityProvider("aws.auth#sigv4");
1172
+ },
1173
+ signer: new AwsSdkSigV4Signer()
1174
+ },
1175
+ {
1176
+ schemeId: "smithy.api#noAuth",
1177
+ identityProvider: function(ipc) {
1178
+ return ipc.getIdentityProvider("smithy.api#noAuth") || /*#__PURE__*/ _async_to_generator$2(function() {
1179
+ return _ts_generator$2(this, function(_state) {
1180
+ return [
1181
+ 2,
1182
+ {}
1183
+ ];
1184
+ });
1185
+ });
1186
+ },
1187
+ signer: new NoAuthSigner()
679
1188
  }
680
- });
681
- });
682
- return function getNewSsoOidcToken(ssoToken, ssoRegion) {
683
- return _ref.apply(this, arguments);
1189
+ ],
1190
+ logger: (_config_logger = config === null || config === void 0 ? void 0 : config.logger) !== null && _config_logger !== void 0 ? _config_logger : new NoOpLogger(),
1191
+ protocol: (_config_protocol = config === null || config === void 0 ? void 0 : config.protocol) !== null && _config_protocol !== void 0 ? _config_protocol : AwsRestJsonProtocol,
1192
+ protocolSettings: (_config_protocolSettings = config === null || config === void 0 ? void 0 : config.protocolSettings) !== null && _config_protocolSettings !== void 0 ? _config_protocolSettings : {
1193
+ defaultNamespace: "com.amazonaws.signin",
1194
+ errorTypeRegistries: errorTypeRegistries,
1195
+ version: "2023-01-01",
1196
+ serviceTarget: "Signin"
1197
+ },
1198
+ serviceId: (_config_serviceId = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _config_serviceId !== void 0 ? _config_serviceId : "Signin",
1199
+ urlParser: (_config_urlParser = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _config_urlParser !== void 0 ? _config_urlParser : parseUrl,
1200
+ utf8Decoder: (_config_utf8Decoder = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _config_utf8Decoder !== void 0 ? _config_utf8Decoder : fromUtf8,
1201
+ utf8Encoder: (_config_utf8Encoder = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _config_utf8Encoder !== void 0 ? _config_utf8Encoder : toUtf8
684
1202
  };
685
- }();
686
-
687
- var validateTokenExpiry = function(token) {
688
- if (token.expiration && token.expiration.getTime() < Date.now()) {
689
- throw new TokenProviderError("Token is expired. ".concat(REFRESH_MESSAGE), false);
690
- }
691
- };
692
-
693
- var validateTokenKey = function(key, value) {
694
- var forRefresh = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
695
- if (typeof value === "undefined") {
696
- throw new TokenProviderError("Value not present for '".concat(key, "' in SSO Token").concat(forRefresh ? ". Cannot refresh" : "", ". ").concat(REFRESH_MESSAGE), false);
697
- }
698
1203
  };
699
1204
 
700
- var writeFile = promises.writeFile;
701
- var writeSSOTokenToFile = function(id, ssoToken) {
702
- var tokenFilepath = getSSOTokenFilepath(id);
703
- var tokenString = JSON.stringify(ssoToken, null, 2);
704
- return writeFile(tokenFilepath, tokenString);
705
- };
706
-
707
- function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
1205
+ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
708
1206
  try {
709
1207
  var info = gen[key](arg);
710
1208
  var value = info.value;
@@ -718,16 +1216,16 @@ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
718
1216
  Promise.resolve(value).then(_next, _throw);
719
1217
  }
720
1218
  }
721
- function _async_to_generator$2(fn) {
1219
+ function _async_to_generator$1(fn) {
722
1220
  return function() {
723
1221
  var self = this, args = arguments;
724
1222
  return new Promise(function(resolve, reject) {
725
1223
  var gen = fn.apply(self, args);
726
1224
  function _next(value) {
727
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
1225
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
728
1226
  }
729
1227
  function _throw(err) {
730
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
1228
+ asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
731
1229
  }
732
1230
  _next(undefined);
733
1231
  });
@@ -746,7 +1244,7 @@ function _define_property$1(obj, key, value) {
746
1244
  }
747
1245
  return obj;
748
1246
  }
749
- function _object_spread$1(target) {
1247
+ function _object_spread(target) {
750
1248
  for(var i = 1; i < arguments.length; i++){
751
1249
  var source = arguments[i] != null ? arguments[i] : {};
752
1250
  var ownKeys = Object.keys(source);
@@ -780,7 +1278,7 @@ function _object_spread_props(target, source) {
780
1278
  }
781
1279
  return target;
782
1280
  }
783
- function _ts_generator$2(thisArg, body) {
1281
+ function _ts_generator$1(thisArg, body) {
784
1282
  var f, y, t, g, _ = {
785
1283
  label: 0,
786
1284
  sent: function() {
@@ -875,173 +1373,120 @@ function _ts_generator$2(thisArg, body) {
875
1373
  };
876
1374
  }
877
1375
  }
878
- var lastRefreshAttemptTime = new Date(0);
879
- var fromSso = function() {
880
- var _init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
881
- return /*#__PURE__*/ _async_to_generator$2(function() {
882
- var callerClientConfig, _init_logger, init, profiles, _init_profile, profileName, profile, ssoSessionName, ssoSessions, ssoSession, _i, _iter, ssoSessionRequiredKey, ssoRegion, ssoToken, accessToken, expiresAt, existingToken, newSsoOidcToken, newTokenExpiration;
883
- var _arguments = arguments;
884
- return _ts_generator$2(this, function(_state) {
885
- switch(_state.label){
886
- case 0:
887
- callerClientConfig = (_arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}).callerClientConfig;
888
- init = _object_spread_props(_object_spread$1({}, _init), {
889
- parentClientConfig: _object_spread$1({}, callerClientConfig, _init.parentClientConfig)
890
- });
891
- (_init_logger = init.logger) === null || _init_logger === void 0 ? void 0 : _init_logger.debug("@aws-sdk/token-providers - fromSso");
892
- return [
893
- 4,
894
- parseKnownFiles(init)
895
- ];
896
- case 1:
897
- profiles = _state.sent();
898
- profileName = getProfileName({
899
- profile: (_init_profile = init.profile) !== null && _init_profile !== void 0 ? _init_profile : callerClientConfig === null || callerClientConfig === void 0 ? void 0 : callerClientConfig.profile
900
- });
901
- profile = profiles[profileName];
902
- if (!profile) {
903
- throw new TokenProviderError("Profile '".concat(profileName, "' could not be found in shared credentials file."), false);
904
- } else if (!profile["sso_session"]) {
905
- throw new TokenProviderError("Profile '".concat(profileName, "' is missing required property 'sso_session'."));
906
- }
907
- ssoSessionName = profile["sso_session"];
908
- return [
909
- 4,
910
- loadSsoSessionData(init)
911
- ];
912
- case 2:
913
- ssoSessions = _state.sent();
914
- ssoSession = ssoSessions[ssoSessionName];
915
- if (!ssoSession) {
916
- throw new TokenProviderError("Sso session '".concat(ssoSessionName, "' could not be found in shared credentials file."), false);
917
- }
918
- for(_i = 0, _iter = [
919
- "sso_start_url",
920
- "sso_region"
921
- ]; _i < _iter.length; _i++){
922
- ssoSessionRequiredKey = _iter[_i];
923
- if (!ssoSession[ssoSessionRequiredKey]) {
924
- throw new TokenProviderError("Sso session '".concat(ssoSessionName, "' is missing required property '").concat(ssoSessionRequiredKey, "'."), false);
925
- }
926
- }
927
- ssoSession["sso_start_url"];
928
- ssoRegion = ssoSession["sso_region"];
929
- _state.label = 3;
930
- case 3:
931
- _state.trys.push([
932
- 3,
933
- 5,
934
- ,
935
- 6
936
- ]);
937
- return [
938
- 4,
939
- getSSOTokenFromFile(ssoSessionName)
940
- ];
941
- case 4:
942
- ssoToken = _state.sent();
943
- return [
944
- 3,
945
- 6
946
- ];
947
- case 5:
948
- _state.sent();
949
- throw new TokenProviderError("The SSO session token associated with profile=".concat(profileName, " was not found or is invalid. ").concat(REFRESH_MESSAGE), false);
950
- case 6:
951
- validateTokenKey("accessToken", ssoToken.accessToken);
952
- validateTokenKey("expiresAt", ssoToken.expiresAt);
953
- accessToken = ssoToken.accessToken, expiresAt = ssoToken.expiresAt;
954
- existingToken = {
955
- token: accessToken,
956
- expiration: new Date(expiresAt)
957
- };
958
- if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
959
- return [
960
- 2,
961
- existingToken
962
- ];
963
- }
964
- if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {
965
- validateTokenExpiry(existingToken);
966
- return [
967
- 2,
968
- existingToken
969
- ];
1376
+ var getRuntimeConfig = function(config) {
1377
+ emitWarningIfUnsupportedVersion(process.version);
1378
+ var defaultsMode = resolveDefaultsModeConfig(config);
1379
+ var defaultConfigProvider = function() {
1380
+ return defaultsMode().then(loadConfigsForDefaultMode);
1381
+ };
1382
+ var clientSharedValues = getRuntimeConfig$1(config);
1383
+ emitWarningIfUnsupportedVersion$1(process.version);
1384
+ var loaderConfig = {
1385
+ profile: config === null || config === void 0 ? void 0 : config.profile,
1386
+ logger: clientSharedValues.logger
1387
+ };
1388
+ var _config_authSchemePreference, _config_bodyLengthChecker, _config_defaultUserAgentProvider, _config_maxAttempts, _config_region, _config_requestHandler, _config_retryMode, _config_sha256, _config_streamCollector, _config_useDualstackEndpoint, _config_useFipsEndpoint, _config_userAgentAppId;
1389
+ return _object_spread_props(_object_spread({}, clientSharedValues, config), {
1390
+ runtime: "node",
1391
+ defaultsMode: defaultsMode,
1392
+ authSchemePreference: (_config_authSchemePreference = config === null || config === void 0 ? void 0 : config.authSchemePreference) !== null && _config_authSchemePreference !== void 0 ? _config_authSchemePreference : loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
1393
+ bodyLengthChecker: (_config_bodyLengthChecker = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _config_bodyLengthChecker !== void 0 ? _config_bodyLengthChecker : calculateBodyLength,
1394
+ defaultUserAgentProvider: (_config_defaultUserAgentProvider = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _config_defaultUserAgentProvider !== void 0 ? _config_defaultUserAgentProvider : createDefaultUserAgentProvider({
1395
+ serviceId: clientSharedValues.serviceId,
1396
+ clientVersion: packageInfo.version
1397
+ }),
1398
+ maxAttempts: (_config_maxAttempts = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _config_maxAttempts !== void 0 ? _config_maxAttempts : loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
1399
+ region: (_config_region = config === null || config === void 0 ? void 0 : config.region) !== null && _config_region !== void 0 ? _config_region : loadConfig(NODE_REGION_CONFIG_OPTIONS, _object_spread({}, NODE_REGION_CONFIG_FILE_OPTIONS, loaderConfig)),
1400
+ requestHandler: NodeHttpHandler.create((_config_requestHandler = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _config_requestHandler !== void 0 ? _config_requestHandler : defaultConfigProvider),
1401
+ retryMode: (_config_retryMode = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _config_retryMode !== void 0 ? _config_retryMode : loadConfig(_object_spread_props(_object_spread({}, NODE_RETRY_MODE_CONFIG_OPTIONS), {
1402
+ default: /*#__PURE__*/ _async_to_generator$1(function() {
1403
+ return _ts_generator$1(this, function(_state) {
1404
+ switch(_state.label){
1405
+ case 0:
1406
+ return [
1407
+ 4,
1408
+ defaultConfigProvider()
1409
+ ];
1410
+ case 1:
1411
+ return [
1412
+ 2,
1413
+ _state.sent().retryMode || DEFAULT_RETRY_MODE
1414
+ ];
970
1415
  }
971
- validateTokenKey("clientId", ssoToken.clientId, true);
972
- validateTokenKey("clientSecret", ssoToken.clientSecret, true);
973
- validateTokenKey("refreshToken", ssoToken.refreshToken, true);
974
- _state.label = 7;
975
- case 7:
976
- _state.trys.push([
977
- 7,
978
- 13,
979
- ,
980
- 14
981
- ]);
982
- lastRefreshAttemptTime.setTime(Date.now());
983
- return [
984
- 4,
985
- getNewSsoOidcToken(ssoToken, ssoRegion, init)
986
- ];
987
- case 8:
988
- newSsoOidcToken = _state.sent();
989
- validateTokenKey("accessToken", newSsoOidcToken.accessToken);
990
- validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
991
- newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);
992
- _state.label = 9;
993
- case 9:
994
- _state.trys.push([
995
- 9,
996
- 11,
997
- ,
998
- 12
999
- ]);
1000
- return [
1001
- 4,
1002
- writeSSOTokenToFile(ssoSessionName, _object_spread_props(_object_spread$1({}, ssoToken), {
1003
- accessToken: newSsoOidcToken.accessToken,
1004
- expiresAt: newTokenExpiration.toISOString(),
1005
- refreshToken: newSsoOidcToken.refreshToken
1006
- }))
1007
- ];
1008
- case 10:
1009
- _state.sent();
1010
- return [
1011
- 3,
1012
- 12
1013
- ];
1014
- case 11:
1015
- _state.sent();
1016
- return [
1017
- 3,
1018
- 12
1019
- ];
1020
- case 12:
1021
- return [
1022
- 2,
1023
- {
1024
- token: newSsoOidcToken.accessToken,
1025
- expiration: newTokenExpiration
1026
- }
1027
- ];
1028
- case 13:
1029
- _state.sent();
1030
- validateTokenExpiry(existingToken);
1031
- return [
1032
- 2,
1033
- existingToken
1034
- ];
1035
- case 14:
1036
- return [
1037
- 2
1038
- ];
1416
+ });
1417
+ })
1418
+ }), config),
1419
+ sha256: (_config_sha256 = config === null || config === void 0 ? void 0 : config.sha256) !== null && _config_sha256 !== void 0 ? _config_sha256 : Hash.bind(null, "sha256"),
1420
+ streamCollector: (_config_streamCollector = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _config_streamCollector !== void 0 ? _config_streamCollector : streamCollector,
1421
+ useDualstackEndpoint: (_config_useDualstackEndpoint = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _config_useDualstackEndpoint !== void 0 ? _config_useDualstackEndpoint : loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
1422
+ useFipsEndpoint: (_config_useFipsEndpoint = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _config_useFipsEndpoint !== void 0 ? _config_useFipsEndpoint : loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
1423
+ userAgentAppId: (_config_userAgentAppId = config === null || config === void 0 ? void 0 : config.userAgentAppId) !== null && _config_userAgentAppId !== void 0 ? _config_userAgentAppId : loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
1424
+ });
1425
+ };
1426
+
1427
+ var getHttpAuthExtensionConfiguration = function(runtimeConfig) {
1428
+ var _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
1429
+ var _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
1430
+ var _credentials = runtimeConfig.credentials;
1431
+ return {
1432
+ setHttpAuthScheme: function setHttpAuthScheme(httpAuthScheme) {
1433
+ var index = _httpAuthSchemes.findIndex(function(scheme) {
1434
+ return scheme.schemeId === httpAuthScheme.schemeId;
1435
+ });
1436
+ if (index === -1) {
1437
+ _httpAuthSchemes.push(httpAuthScheme);
1438
+ } else {
1439
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
1039
1440
  }
1040
- });
1441
+ },
1442
+ httpAuthSchemes: function httpAuthSchemes() {
1443
+ return _httpAuthSchemes;
1444
+ },
1445
+ setHttpAuthSchemeProvider: function setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
1446
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
1447
+ },
1448
+ httpAuthSchemeProvider: function httpAuthSchemeProvider() {
1449
+ return _httpAuthSchemeProvider;
1450
+ },
1451
+ setCredentials: function setCredentials(credentials) {
1452
+ _credentials = credentials;
1453
+ },
1454
+ credentials: function credentials() {
1455
+ return _credentials;
1456
+ }
1457
+ };
1458
+ };
1459
+ var resolveHttpAuthRuntimeConfig = function(config) {
1460
+ return {
1461
+ httpAuthSchemes: config.httpAuthSchemes(),
1462
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
1463
+ credentials: config.credentials()
1464
+ };
1465
+ };
1466
+
1467
+ var resolveRuntimeExtensions = function(runtimeConfig, extensions) {
1468
+ var extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
1469
+ extensions.forEach(function(extension) {
1470
+ return extension.configure(extensionConfiguration);
1041
1471
  });
1472
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
1042
1473
  };
1043
1474
 
1044
- function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
1475
+ function _array_like_to_array(arr, len) {
1476
+ if (len == null || len > arr.length) len = arr.length;
1477
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1478
+ return arr2;
1479
+ }
1480
+ function _array_with_holes(arr) {
1481
+ if (Array.isArray(arr)) return arr;
1482
+ }
1483
+ function _assert_this_initialized$2(self) {
1484
+ if (self === void 0) {
1485
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1486
+ }
1487
+ return self;
1488
+ }
1489
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1045
1490
  try {
1046
1491
  var info = gen[key](arg);
1047
1492
  var value = info.value;
@@ -1055,21 +1500,39 @@ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
1055
1500
  Promise.resolve(value).then(_next, _throw);
1056
1501
  }
1057
1502
  }
1058
- function _async_to_generator$1(fn) {
1503
+ function _async_to_generator(fn) {
1059
1504
  return function() {
1060
1505
  var self = this, args = arguments;
1061
1506
  return new Promise(function(resolve, reject) {
1062
1507
  var gen = fn.apply(self, args);
1063
1508
  function _next(value) {
1064
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
1509
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1065
1510
  }
1066
1511
  function _throw(err) {
1067
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
1512
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1068
1513
  }
1069
1514
  _next(undefined);
1070
1515
  });
1071
1516
  };
1072
1517
  }
1518
+ function _class_call_check$2(instance, Constructor) {
1519
+ if (!(instance instanceof Constructor)) {
1520
+ throw new TypeError("Cannot call a class as a function");
1521
+ }
1522
+ }
1523
+ function _defineProperties(target, props) {
1524
+ for(var i = 0; i < props.length; i++){
1525
+ var descriptor = props[i];
1526
+ descriptor.enumerable = descriptor.enumerable || false;
1527
+ descriptor.configurable = true;
1528
+ if ("value" in descriptor) descriptor.writable = true;
1529
+ Object.defineProperty(target, descriptor.key, descriptor);
1530
+ }
1531
+ }
1532
+ function _create_class(Constructor, protoProps, staticProps) {
1533
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1534
+ return Constructor;
1535
+ }
1073
1536
  function _define_property(obj, key, value) {
1074
1537
  if (key in obj) {
1075
1538
  Object.defineProperty(obj, key, {
@@ -1083,22 +1546,128 @@ function _define_property(obj, key, value) {
1083
1546
  }
1084
1547
  return obj;
1085
1548
  }
1086
- function _object_spread(target) {
1087
- for(var i = 1; i < arguments.length; i++){
1088
- var source = arguments[i] != null ? arguments[i] : {};
1089
- var ownKeys = Object.keys(source);
1090
- if (typeof Object.getOwnPropertySymbols === "function") {
1091
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1092
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1093
- }));
1549
+ function _get(target, property, receiver) {
1550
+ if (typeof Reflect !== "undefined" && Reflect.get) {
1551
+ _get = Reflect.get;
1552
+ } else {
1553
+ _get = function get(target, property, receiver) {
1554
+ var base = _super_prop_base(target, property);
1555
+ if (!base) return;
1556
+ var desc = Object.getOwnPropertyDescriptor(base, property);
1557
+ if (desc.get) {
1558
+ return desc.get.call(receiver || target);
1559
+ }
1560
+ return desc.value;
1561
+ };
1562
+ }
1563
+ return _get(target, property, receiver || target);
1564
+ }
1565
+ function _get_prototype_of$2(o) {
1566
+ _get_prototype_of$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1567
+ return o.__proto__ || Object.getPrototypeOf(o);
1568
+ };
1569
+ return _get_prototype_of$2(o);
1570
+ }
1571
+ function _inherits$2(subClass, superClass) {
1572
+ if (typeof superClass !== "function" && superClass !== null) {
1573
+ throw new TypeError("Super expression must either be null or a function");
1574
+ }
1575
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1576
+ constructor: {
1577
+ value: subClass,
1578
+ writable: true,
1579
+ configurable: true
1580
+ }
1581
+ });
1582
+ if (superClass) _set_prototype_of$2(subClass, superClass);
1583
+ }
1584
+ function _iterable_to_array_limit(arr, i) {
1585
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1586
+ if (_i == null) return;
1587
+ var _arr = [];
1588
+ var _n = true;
1589
+ var _d = false;
1590
+ var _s, _e;
1591
+ try {
1592
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
1593
+ _arr.push(_s.value);
1594
+ if (i && _arr.length === i) break;
1595
+ }
1596
+ } catch (err) {
1597
+ _d = true;
1598
+ _e = err;
1599
+ } finally{
1600
+ try {
1601
+ if (!_n && _i["return"] != null) _i["return"]();
1602
+ } finally{
1603
+ if (_d) throw _e;
1094
1604
  }
1095
- ownKeys.forEach(function(key) {
1096
- _define_property(target, key, source[key]);
1097
- });
1098
1605
  }
1099
- return target;
1606
+ return _arr;
1100
1607
  }
1101
- function _ts_generator$1(thisArg, body) {
1608
+ function _non_iterable_rest() {
1609
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1610
+ }
1611
+ function _possible_constructor_return$2(self, call) {
1612
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
1613
+ return call;
1614
+ }
1615
+ return _assert_this_initialized$2(self);
1616
+ }
1617
+ function _set_prototype_of$2(o, p) {
1618
+ _set_prototype_of$2 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1619
+ o.__proto__ = p;
1620
+ return o;
1621
+ };
1622
+ return _set_prototype_of$2(o, p);
1623
+ }
1624
+ function _sliced_to_array(arr, i) {
1625
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
1626
+ }
1627
+ function _super_prop_base(object, property) {
1628
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
1629
+ object = _get_prototype_of$2(object);
1630
+ if (object === null) break;
1631
+ }
1632
+ return object;
1633
+ }
1634
+ function _type_of$2(obj) {
1635
+ "@swc/helpers - typeof";
1636
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1637
+ }
1638
+ function _unsupported_iterable_to_array(o, minLen) {
1639
+ if (!o) return;
1640
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
1641
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1642
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1643
+ if (n === "Map" || n === "Set") return Array.from(n);
1644
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
1645
+ }
1646
+ function _is_native_reflect_construct$2() {
1647
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1648
+ if (Reflect.construct.sham) return false;
1649
+ if (typeof Proxy === "function") return true;
1650
+ try {
1651
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1652
+ return true;
1653
+ } catch (e) {
1654
+ return false;
1655
+ }
1656
+ }
1657
+ function _create_super$2(Derived) {
1658
+ var hasNativeReflectConstruct = _is_native_reflect_construct$2();
1659
+ return function _createSuperInternal() {
1660
+ var Super = _get_prototype_of$2(Derived), result;
1661
+ if (hasNativeReflectConstruct) {
1662
+ var NewTarget = _get_prototype_of$2(this).constructor;
1663
+ result = Reflect.construct(Super, arguments, NewTarget);
1664
+ } else {
1665
+ result = Super.apply(this, arguments);
1666
+ }
1667
+ return _possible_constructor_return$2(this, result);
1668
+ };
1669
+ }
1670
+ function _ts_generator(thisArg, body) {
1102
1671
  var f, y, t, g, _ = {
1103
1672
  label: 0,
1104
1673
  sent: function() {
@@ -1193,412 +1762,245 @@ function _ts_generator$1(thisArg, body) {
1193
1762
  };
1194
1763
  }
1195
1764
  }
1196
- var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
1197
- var resolveSSOCredentials = function() {
1198
- var _ref = _async_to_generator$1(function(param) {
1199
- var ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger, token, refreshMessage, _token, e, accessToken, _ref, SSOClient, GetRoleCredentialsCommand, _clientConfig_logger, _clientConfig_region, sso, ssoResp, e2, tmp, _ref1, accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId, credentials;
1200
- return _ts_generator$1(this, function(_state) {
1201
- switch(_state.label){
1202
- case 0:
1203
- ssoStartUrl = param.ssoStartUrl, ssoSession = param.ssoSession, ssoAccountId = param.ssoAccountId, ssoRegion = param.ssoRegion, ssoRoleName = param.ssoRoleName, ssoClient = param.ssoClient, clientConfig = param.clientConfig, parentClientConfig = param.parentClientConfig, profile = param.profile, filepath = param.filepath, configFilepath = param.configFilepath, ignoreCache = param.ignoreCache, logger = param.logger;
1204
- refreshMessage = "To refresh this SSO session run aws sso login with the corresponding profile.";
1205
- if (!ssoSession) return [
1206
- 3,
1207
- 5
1208
- ];
1209
- _state.label = 1;
1210
- case 1:
1211
- _state.trys.push([
1212
- 1,
1213
- 3,
1214
- ,
1215
- 4
1216
- ]);
1217
- return [
1218
- 4,
1219
- fromSso({
1220
- profile: profile,
1221
- filepath: filepath,
1222
- configFilepath: configFilepath,
1223
- ignoreCache: ignoreCache
1224
- })()
1225
- ];
1226
- case 2:
1227
- _token = _state.sent();
1228
- token = {
1229
- accessToken: _token.token,
1230
- expiresAt: new Date(_token.expiration).toISOString()
1231
- };
1232
- return [
1233
- 3,
1234
- 4
1235
- ];
1236
- case 3:
1237
- e = _state.sent();
1238
- throw new CredentialsProviderError(e.message, {
1239
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
1240
- logger: logger
1241
- });
1242
- case 4:
1243
- return [
1244
- 3,
1245
- 8
1246
- ];
1247
- case 5:
1248
- _state.trys.push([
1249
- 5,
1250
- 7,
1251
- ,
1252
- 8
1253
- ]);
1254
- return [
1255
- 4,
1256
- getSSOTokenFromFile(ssoStartUrl)
1257
- ];
1258
- case 6:
1259
- token = _state.sent();
1260
- return [
1261
- 3,
1262
- 8
1263
- ];
1264
- case 7:
1265
- _state.sent();
1266
- throw new CredentialsProviderError("The SSO session associated with this profile is invalid. ".concat(refreshMessage), {
1267
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
1268
- logger: logger
1765
+ var SigninClient = /*#__PURE__*/ function(__Client) {
1766
+ _inherits$2(SigninClient, __Client);
1767
+ var _super = _create_super$2(SigninClient);
1768
+ function SigninClient() {
1769
+ for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++){
1770
+ _tmp[_key] = arguments[_key];
1771
+ }
1772
+ var _tmp1 = _sliced_to_array(_tmp, 1), configuration = _tmp1[0];
1773
+ _class_call_check$2(this, SigninClient);
1774
+ var _this;
1775
+ var _config_0 = getRuntimeConfig(configuration || {});
1776
+ _this = _super.call(this, _config_0);
1777
+ _define_property(_assert_this_initialized$2(_this), "config", void 0);
1778
+ _this.initConfig = _config_0;
1779
+ var _config_1 = resolveClientEndpointParameters(_config_0);
1780
+ var _config_2 = resolveUserAgentConfig(_config_1);
1781
+ var _config_3 = resolveRetryConfig(_config_2);
1782
+ var _config_4 = resolveRegionConfig(_config_3);
1783
+ var _config_5 = resolveHostHeaderConfig(_config_4);
1784
+ var _config_6 = resolveEndpointConfig(_config_5);
1785
+ var _config_7 = resolveHttpAuthSchemeConfig(_config_6);
1786
+ var _config_8 = resolveRuntimeExtensions(_config_7, (configuration === null || configuration === void 0 ? void 0 : configuration.extensions) || []);
1787
+ _this.config = _config_8;
1788
+ _this.middlewareStack.use(getSchemaSerdePlugin(_this.config));
1789
+ _this.middlewareStack.use(getUserAgentPlugin(_this.config));
1790
+ _this.middlewareStack.use(getRetryPlugin(_this.config));
1791
+ _this.middlewareStack.use(getContentLengthPlugin(_this.config));
1792
+ _this.middlewareStack.use(getHostHeaderPlugin(_this.config));
1793
+ _this.middlewareStack.use(getLoggerPlugin(_this.config));
1794
+ _this.middlewareStack.use(getRecursionDetectionPlugin(_this.config));
1795
+ _this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(_this.config, {
1796
+ httpAuthSchemeParametersProvider: defaultSigninHttpAuthSchemeParametersProvider,
1797
+ identityProviderConfigProvider: function() {
1798
+ var _ref = _async_to_generator(function(config) {
1799
+ return _ts_generator(this, function(_state) {
1800
+ return [
1801
+ 2,
1802
+ new DefaultIdentityProviderConfig({
1803
+ "aws.auth#sigv4": config.credentials
1804
+ })
1805
+ ];
1269
1806
  });
1270
- case 8:
1271
- if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
1272
- throw new CredentialsProviderError("The SSO session associated with this profile has expired. ".concat(refreshMessage), {
1273
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
1274
- logger: logger
1275
- });
1276
- }
1277
- accessToken = token.accessToken;
1278
- return [
1279
- 4,
1280
- import('./loadSso.esm.js')
1281
- ];
1282
- case 9:
1283
- _ref = _state.sent(), SSOClient = _ref.SSOClient, GetRoleCredentialsCommand = _ref.GetRoleCredentialsCommand;
1284
- sso = ssoClient || new SSOClient(Object.assign({}, clientConfig !== null && clientConfig !== void 0 ? clientConfig : {}, {
1285
- logger: (_clientConfig_logger = clientConfig === null || clientConfig === void 0 ? void 0 : clientConfig.logger) !== null && _clientConfig_logger !== void 0 ? _clientConfig_logger : parentClientConfig === null || parentClientConfig === void 0 ? void 0 : parentClientConfig.logger,
1286
- region: (_clientConfig_region = clientConfig === null || clientConfig === void 0 ? void 0 : clientConfig.region) !== null && _clientConfig_region !== void 0 ? _clientConfig_region : ssoRegion
1287
- }));
1288
- _state.label = 10;
1289
- case 10:
1290
- _state.trys.push([
1291
- 10,
1292
- 12,
1293
- ,
1294
- 13
1295
- ]);
1296
- return [
1297
- 4,
1298
- sso.send(new GetRoleCredentialsCommand({
1299
- accountId: ssoAccountId,
1300
- roleName: ssoRoleName,
1301
- accessToken: accessToken
1302
- }))
1303
- ];
1304
- case 11:
1305
- ssoResp = _state.sent();
1306
- return [
1307
- 3,
1308
- 13
1309
- ];
1310
- case 12:
1311
- e2 = _state.sent();
1312
- throw new CredentialsProviderError(e2, {
1313
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
1314
- logger: logger
1315
- });
1316
- case 13:
1317
- tmp = ssoResp.roleCredentials, _ref1 = tmp === void 0 ? {} : tmp, accessKeyId = _ref1.accessKeyId, secretAccessKey = _ref1.secretAccessKey, sessionToken = _ref1.sessionToken, expiration = _ref1.expiration, credentialScope = _ref1.credentialScope, accountId = _ref1.accountId;
1318
- if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
1319
- throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
1320
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
1321
- logger: logger
1322
- });
1323
- }
1324
- credentials = _object_spread({
1325
- accessKeyId: accessKeyId,
1326
- secretAccessKey: secretAccessKey,
1327
- sessionToken: sessionToken,
1328
- expiration: new Date(expiration)
1329
- }, credentialScope && {
1330
- credentialScope: credentialScope
1331
- }, accountId && {
1332
- accountId: accountId
1333
- });
1334
- if (ssoSession) {
1335
- setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
1336
- } else {
1337
- setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
1338
- }
1339
- return [
1340
- 2,
1341
- credentials
1342
- ];
1807
+ });
1808
+ return function(config) {
1809
+ return _ref.apply(this, arguments);
1810
+ };
1811
+ }()
1812
+ }));
1813
+ _this.middlewareStack.use(getHttpSigningPlugin(_this.config));
1814
+ return _this;
1815
+ }
1816
+ _create_class(SigninClient, [
1817
+ {
1818
+ key: "destroy",
1819
+ value: function destroy() {
1820
+ _get(_get_prototype_of$2(SigninClient.prototype), "destroy", this).call(this);
1343
1821
  }
1344
- });
1822
+ }
1823
+ ]);
1824
+ return SigninClient;
1825
+ }(Client);
1826
+
1827
+ function _assert_this_initialized$1(self) {
1828
+ if (self === void 0) {
1829
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1830
+ }
1831
+ return self;
1832
+ }
1833
+ function _class_call_check$1(instance, Constructor) {
1834
+ if (!(instance instanceof Constructor)) {
1835
+ throw new TypeError("Cannot call a class as a function");
1836
+ }
1837
+ }
1838
+ function _get_prototype_of$1(o) {
1839
+ _get_prototype_of$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1840
+ return o.__proto__ || Object.getPrototypeOf(o);
1841
+ };
1842
+ return _get_prototype_of$1(o);
1843
+ }
1844
+ function _inherits$1(subClass, superClass) {
1845
+ if (typeof superClass !== "function" && superClass !== null) {
1846
+ throw new TypeError("Super expression must either be null or a function");
1847
+ }
1848
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1849
+ constructor: {
1850
+ value: subClass,
1851
+ writable: true,
1852
+ configurable: true
1853
+ }
1345
1854
  });
1346
- return function resolveSSOCredentials(_) {
1347
- return _ref.apply(this, arguments);
1855
+ if (superClass) _set_prototype_of$1(subClass, superClass);
1856
+ }
1857
+ function _possible_constructor_return$1(self, call) {
1858
+ if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
1859
+ return call;
1860
+ }
1861
+ return _assert_this_initialized$1(self);
1862
+ }
1863
+ function _set_prototype_of$1(o, p) {
1864
+ _set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1865
+ o.__proto__ = p;
1866
+ return o;
1348
1867
  };
1349
- }();
1350
-
1351
- var validateSsoProfile = function(profile, logger) {
1352
- var sso_start_url = profile.sso_start_url, sso_account_id = profile.sso_account_id, sso_region = profile.sso_region, sso_role_name = profile.sso_role_name;
1353
- if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
1354
- throw new CredentialsProviderError('Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ' + '"sso_region", "sso_role_name", "sso_start_url". Got '.concat(Object.keys(profile).join(", "), "\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html"), {
1355
- tryNextLink: false,
1356
- logger: logger
1357
- });
1868
+ return _set_prototype_of$1(o, p);
1869
+ }
1870
+ function _type_of$1(obj) {
1871
+ "@swc/helpers - typeof";
1872
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1873
+ }
1874
+ function _is_native_reflect_construct$1() {
1875
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1876
+ if (Reflect.construct.sham) return false;
1877
+ if (typeof Proxy === "function") return true;
1878
+ try {
1879
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1880
+ return true;
1881
+ } catch (e) {
1882
+ return false;
1358
1883
  }
1359
- return profile;
1360
- };
1884
+ }
1885
+ function _create_super$1(Derived) {
1886
+ var hasNativeReflectConstruct = _is_native_reflect_construct$1();
1887
+ return function _createSuperInternal() {
1888
+ var Super = _get_prototype_of$1(Derived), result;
1889
+ if (hasNativeReflectConstruct) {
1890
+ var NewTarget = _get_prototype_of$1(this).constructor;
1891
+ result = Reflect.construct(Super, arguments, NewTarget);
1892
+ } else {
1893
+ result = Super.apply(this, arguments);
1894
+ }
1895
+ return _possible_constructor_return$1(this, result);
1896
+ };
1897
+ }
1898
+ var CreateOAuth2TokenCommand = /*#__PURE__*/ function(_$Command_classBuilder_ep_m_s_n_sc_build) {
1899
+ _inherits$1(CreateOAuth2TokenCommand, _$Command_classBuilder_ep_m_s_n_sc_build);
1900
+ var _super = _create_super$1(CreateOAuth2TokenCommand);
1901
+ function CreateOAuth2TokenCommand() {
1902
+ _class_call_check$1(this, CreateOAuth2TokenCommand);
1903
+ return _super.apply(this, arguments);
1904
+ }
1905
+ return CreateOAuth2TokenCommand;
1906
+ }(Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1907
+ return [
1908
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions())
1909
+ ];
1910
+ }).s("Signin", "CreateOAuth2Token", {}).n("SigninClient", "CreateOAuth2TokenCommand").sc(CreateOAuth2Token$).build());
1361
1911
 
1362
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1363
- try {
1364
- var info = gen[key](arg);
1365
- var value = info.value;
1366
- } catch (error) {
1367
- reject(error);
1368
- return;
1912
+ function _assert_this_initialized(self) {
1913
+ if (self === void 0) {
1914
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1369
1915
  }
1370
- if (info.done) {
1371
- resolve(value);
1372
- } else {
1373
- Promise.resolve(value).then(_next, _throw);
1916
+ return self;
1917
+ }
1918
+ function _class_call_check(instance, Constructor) {
1919
+ if (!(instance instanceof Constructor)) {
1920
+ throw new TypeError("Cannot call a class as a function");
1374
1921
  }
1375
1922
  }
1376
- function _async_to_generator(fn) {
1377
- return function() {
1378
- var self = this, args = arguments;
1379
- return new Promise(function(resolve, reject) {
1380
- var gen = fn.apply(self, args);
1381
- function _next(value) {
1382
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1383
- }
1384
- function _throw(err) {
1385
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1386
- }
1387
- _next(undefined);
1388
- });
1923
+ function _get_prototype_of(o) {
1924
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1925
+ return o.__proto__ || Object.getPrototypeOf(o);
1389
1926
  };
1927
+ return _get_prototype_of(o);
1390
1928
  }
1391
- function _ts_generator(thisArg, body) {
1392
- var f, y, t, g, _ = {
1393
- label: 0,
1394
- sent: function() {
1395
- if (t[0] & 1) throw t[1];
1396
- return t[1];
1397
- },
1398
- trys: [],
1399
- ops: []
1400
- };
1401
- return g = {
1402
- next: verb(0),
1403
- "throw": verb(1),
1404
- "return": verb(2)
1405
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
1406
- return this;
1407
- }), g;
1408
- function verb(n) {
1409
- return function(v) {
1410
- return step([
1411
- n,
1412
- v
1413
- ]);
1414
- };
1929
+ function _inherits(subClass, superClass) {
1930
+ if (typeof superClass !== "function" && superClass !== null) {
1931
+ throw new TypeError("Super expression must either be null or a function");
1415
1932
  }
1416
- function step(op) {
1417
- if (f) throw new TypeError("Generator is already executing.");
1418
- while(_)try {
1419
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1420
- if (y = 0, t) op = [
1421
- op[0] & 2,
1422
- t.value
1423
- ];
1424
- switch(op[0]){
1425
- case 0:
1426
- case 1:
1427
- t = op;
1428
- break;
1429
- case 4:
1430
- _.label++;
1431
- return {
1432
- value: op[1],
1433
- done: false
1434
- };
1435
- case 5:
1436
- _.label++;
1437
- y = op[1];
1438
- op = [
1439
- 0
1440
- ];
1441
- continue;
1442
- case 7:
1443
- op = _.ops.pop();
1444
- _.trys.pop();
1445
- continue;
1446
- default:
1447
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1448
- _ = 0;
1449
- continue;
1450
- }
1451
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
1452
- _.label = op[1];
1453
- break;
1454
- }
1455
- if (op[0] === 6 && _.label < t[1]) {
1456
- _.label = t[1];
1457
- t = op;
1458
- break;
1459
- }
1460
- if (t && _.label < t[2]) {
1461
- _.label = t[2];
1462
- _.ops.push(op);
1463
- break;
1464
- }
1465
- if (t[2]) _.ops.pop();
1466
- _.trys.pop();
1467
- continue;
1468
- }
1469
- op = body.call(thisArg, _);
1470
- } catch (e) {
1471
- op = [
1472
- 6,
1473
- e
1474
- ];
1475
- y = 0;
1476
- } finally{
1477
- f = t = 0;
1933
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1934
+ constructor: {
1935
+ value: subClass,
1936
+ writable: true,
1937
+ configurable: true
1478
1938
  }
1479
- if (op[0] & 5) throw op[1];
1480
- return {
1481
- value: op[0] ? op[1] : void 0,
1482
- done: true
1483
- };
1939
+ });
1940
+ if (superClass) _set_prototype_of(subClass, superClass);
1941
+ }
1942
+ function _possible_constructor_return(self, call) {
1943
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
1944
+ return call;
1484
1945
  }
1946
+ return _assert_this_initialized(self);
1485
1947
  }
1486
- var fromSSO = function() {
1487
- var init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1488
- return /*#__PURE__*/ _async_to_generator(function() {
1489
- var callerClientConfig, _init_logger, ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession, ssoClient, _init_profile, profileName, profiles, profile, ssoSessions, session, conflictMsg, _validateSsoProfile, sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session;
1490
- var _arguments = arguments;
1491
- return _ts_generator(this, function(_state) {
1492
- switch(_state.label){
1493
- case 0:
1494
- callerClientConfig = (_arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}).callerClientConfig;
1495
- (_init_logger = init.logger) === null || _init_logger === void 0 ? void 0 : _init_logger.debug("@aws-sdk/credential-provider-sso - fromSSO");
1496
- ssoStartUrl = init.ssoStartUrl, ssoAccountId = init.ssoAccountId, ssoRegion = init.ssoRegion, ssoRoleName = init.ssoRoleName, ssoSession = init.ssoSession;
1497
- ssoClient = init.ssoClient;
1498
- profileName = getProfileName({
1499
- profile: (_init_profile = init.profile) !== null && _init_profile !== void 0 ? _init_profile : callerClientConfig === null || callerClientConfig === void 0 ? void 0 : callerClientConfig.profile
1500
- });
1501
- if (!(!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession)) return [
1502
- 3,
1503
- 4
1504
- ];
1505
- return [
1506
- 4,
1507
- parseKnownFiles(init)
1508
- ];
1509
- case 1:
1510
- profiles = _state.sent();
1511
- profile = profiles[profileName];
1512
- if (!profile) {
1513
- throw new CredentialsProviderError("Profile ".concat(profileName, " was not found."), {
1514
- logger: init.logger
1515
- });
1516
- }
1517
- if (!isSsoProfile(profile)) {
1518
- throw new CredentialsProviderError("Profile ".concat(profileName, " is not configured with SSO credentials."), {
1519
- logger: init.logger
1520
- });
1521
- }
1522
- if (!(profile === null || profile === void 0 ? void 0 : profile.sso_session)) return [
1523
- 3,
1524
- 3
1525
- ];
1526
- return [
1527
- 4,
1528
- loadSsoSessionData(init)
1529
- ];
1530
- case 2:
1531
- ssoSessions = _state.sent();
1532
- session = ssoSessions[profile.sso_session];
1533
- conflictMsg = " configurations in profile ".concat(profileName, " and sso-session ").concat(profile.sso_session);
1534
- if (ssoRegion && ssoRegion !== session.sso_region) {
1535
- throw new CredentialsProviderError("Conflicting SSO region" + conflictMsg, {
1536
- tryNextLink: false,
1537
- logger: init.logger
1538
- });
1539
- }
1540
- if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
1541
- throw new CredentialsProviderError("Conflicting SSO start_url" + conflictMsg, {
1542
- tryNextLink: false,
1543
- logger: init.logger
1544
- });
1545
- }
1546
- profile.sso_region = session.sso_region;
1547
- profile.sso_start_url = session.sso_start_url;
1548
- _state.label = 3;
1549
- case 3:
1550
- _validateSsoProfile = validateSsoProfile(profile, init.logger), sso_start_url = _validateSsoProfile.sso_start_url, sso_account_id = _validateSsoProfile.sso_account_id, sso_region = _validateSsoProfile.sso_region, sso_role_name = _validateSsoProfile.sso_role_name, sso_session = _validateSsoProfile.sso_session;
1551
- return [
1552
- 2,
1553
- resolveSSOCredentials({
1554
- ssoStartUrl: sso_start_url,
1555
- ssoSession: sso_session,
1556
- ssoAccountId: sso_account_id,
1557
- ssoRegion: sso_region,
1558
- ssoRoleName: sso_role_name,
1559
- ssoClient: ssoClient,
1560
- clientConfig: init.clientConfig,
1561
- parentClientConfig: init.parentClientConfig,
1562
- profile: profileName,
1563
- filepath: init.filepath,
1564
- configFilepath: init.configFilepath,
1565
- ignoreCache: init.ignoreCache,
1566
- logger: init.logger
1567
- })
1568
- ];
1569
- case 4:
1570
- if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
1571
- throw new CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', {
1572
- tryNextLink: false,
1573
- logger: init.logger
1574
- });
1575
- } else {
1576
- return [
1577
- 2,
1578
- resolveSSOCredentials({
1579
- ssoStartUrl: ssoStartUrl,
1580
- ssoSession: ssoSession,
1581
- ssoAccountId: ssoAccountId,
1582
- ssoRegion: ssoRegion,
1583
- ssoRoleName: ssoRoleName,
1584
- ssoClient: ssoClient,
1585
- clientConfig: init.clientConfig,
1586
- parentClientConfig: init.parentClientConfig,
1587
- profile: profileName,
1588
- filepath: init.filepath,
1589
- configFilepath: init.configFilepath,
1590
- ignoreCache: init.ignoreCache,
1591
- logger: init.logger
1592
- })
1593
- ];
1594
- }
1595
- case 5:
1596
- return [
1597
- 2
1598
- ];
1599
- }
1600
- });
1601
- });
1948
+ function _set_prototype_of(o, p) {
1949
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1950
+ o.__proto__ = p;
1951
+ return o;
1952
+ };
1953
+ return _set_prototype_of(o, p);
1954
+ }
1955
+ function _type_of(obj) {
1956
+ "@swc/helpers - typeof";
1957
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1958
+ }
1959
+ function _is_native_reflect_construct() {
1960
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1961
+ if (Reflect.construct.sham) return false;
1962
+ if (typeof Proxy === "function") return true;
1963
+ try {
1964
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1965
+ return true;
1966
+ } catch (e) {
1967
+ return false;
1968
+ }
1969
+ }
1970
+ function _create_super(Derived) {
1971
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
1972
+ return function _createSuperInternal() {
1973
+ var Super = _get_prototype_of(Derived), result;
1974
+ if (hasNativeReflectConstruct) {
1975
+ var NewTarget = _get_prototype_of(this).constructor;
1976
+ result = Reflect.construct(Super, arguments, NewTarget);
1977
+ } else {
1978
+ result = Super.apply(this, arguments);
1979
+ }
1980
+ return _possible_constructor_return(this, result);
1981
+ };
1982
+ }
1983
+ var commands = {
1984
+ CreateOAuth2TokenCommand: CreateOAuth2TokenCommand
1985
+ };
1986
+ var Signin = /*#__PURE__*/ function(SigninClient) {
1987
+ _inherits(Signin, SigninClient);
1988
+ var _super = _create_super(Signin);
1989
+ function Signin() {
1990
+ _class_call_check(this, Signin);
1991
+ return _super.apply(this, arguments);
1992
+ }
1993
+ return Signin;
1994
+ }(SigninClient);
1995
+ createAggregatedClient(commands, Signin);
1996
+
1997
+ var OAuth2ErrorCode = {
1998
+ AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED",
1999
+ INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS",
2000
+ INVALID_REQUEST: "INVALID_REQUEST",
2001
+ SERVER_ERROR: "server_error",
2002
+ TOKEN_EXPIRED: "TOKEN_EXPIRED",
2003
+ USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED"
1602
2004
  };
1603
2005
 
1604
- export { fromSSO, isSsoProfile, validateSsoProfile };
2006
+ export { Command as $Command, AccessDeniedException, AccessDeniedException$, AccessToken$, CreateOAuth2Token$, CreateOAuth2TokenCommand, CreateOAuth2TokenRequest$, CreateOAuth2TokenRequestBody$, CreateOAuth2TokenResponse$, CreateOAuth2TokenResponseBody$, InternalServerException, InternalServerException$, OAuth2ErrorCode, Signin, SigninClient, SigninServiceException, SigninServiceException$, TooManyRequestsError, TooManyRequestsError$, ValidationException, ValidationException$, Client as __Client, errorTypeRegistries };