@karmaniverous/get-dotenv 7.0.6 → 7.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/chunks/{createCli-BkHLeYXL.mjs → createCli-CUPiFVdZ.mjs} +27 -10
  2. package/dist/chunks/index-CNXekCQC.mjs +96 -0
  3. package/dist/chunks/{index-Dd6S1nZ-.mjs → index-DnG3N6yj.mjs} +6 -6
  4. package/dist/chunks/{loader-V1vbmtyw.mjs → loader-C3DtD6HB.mjs} +4 -2
  5. package/dist/chunks/{readDotenvCascade-Dgx4SC1p.mjs → readDotenvCascade-CfFPgLCp.mjs} +52 -21
  6. package/dist/chunks/{readMergedOptions-CraAnYdB.mjs → readMergedOptions-BT1C87_u.mjs} +53 -13
  7. package/dist/chunks/{resolveCliOptions-BMBkWDYJ.mjs → resolveCliOptions-BbfouWSK.mjs} +1 -1
  8. package/dist/chunks/{spawnEnv-CKgnHGpr.mjs → spawnEnv-DvisqPiU.mjs} +28 -3
  9. package/dist/chunks/{types-BthqmnDr.mjs → types-BkQxnyZK.mjs} +1 -1
  10. package/dist/cli.d.ts +29 -8
  11. package/dist/cli.mjs +11 -15
  12. package/dist/cliHost.d.ts +29 -8
  13. package/dist/cliHost.mjs +6 -6
  14. package/dist/config.d.ts +1 -1
  15. package/dist/config.mjs +1 -1
  16. package/dist/env-overlay.d.ts +13 -9
  17. package/dist/env-overlay.mjs +2 -2
  18. package/dist/getdotenv.cli.mjs +11 -15
  19. package/dist/index.d.ts +30 -9
  20. package/dist/index.mjs +31 -23
  21. package/dist/plugins-aws.d.ts +12 -1
  22. package/dist/plugins-aws.mjs +8 -7
  23. package/dist/plugins-batch.d.ts +28 -1
  24. package/dist/plugins-batch.mjs +202 -68
  25. package/dist/plugins-cmd.d.ts +12 -1
  26. package/dist/plugins-cmd.mjs +6 -6
  27. package/dist/plugins-init.d.ts +12 -1
  28. package/dist/plugins-init.mjs +3 -3
  29. package/dist/plugins.d.ts +14 -1
  30. package/dist/plugins.mjs +10 -14
  31. package/package.json +40 -40
  32. package/schema/getdotenv.config.schema.json +207 -0
  33. package/dist/chunks/AwsRestJsonProtocol-4m7HHwvS.mjs +0 -1026
  34. package/dist/chunks/externalDataInterceptor-DyDNbv-D.mjs +0 -19
  35. package/dist/chunks/getSSOTokenFromFile-CkYcEieD.mjs +0 -22
  36. package/dist/chunks/index-B35hOhgq.mjs +0 -669
  37. package/dist/chunks/index-B3fM_U6F.mjs +0 -349
  38. package/dist/chunks/index-B_yJRqty.mjs +0 -541
  39. package/dist/chunks/index-BuxEK_Z4.mjs +0 -12529
  40. package/dist/chunks/index-C58EanKv.mjs +0 -383
  41. package/dist/chunks/index-CjWZ4uNg.mjs +0 -103
  42. package/dist/chunks/index-CsI5JuIM.mjs +0 -188
  43. package/dist/chunks/index-D-a5vkZL.mjs +0 -82
  44. package/dist/chunks/index-D6iVe1wh.mjs +0 -946
  45. package/dist/chunks/index-Dl8qC51H.mjs +0 -290
  46. package/dist/chunks/index-FT37CtcF.mjs +0 -31
  47. package/dist/chunks/index-QkVZTs6l.mjs +0 -519
  48. package/dist/chunks/loadSso-DF7GLUZf.mjs +0 -488
  49. package/dist/chunks/package-DbbYaehr.mjs +0 -5
  50. package/dist/chunks/parseKnownFiles-BZNrX_JE.mjs +0 -23
  51. package/dist/chunks/sdk-stream-mixin-BL49AxZx.mjs +0 -307
@@ -1,669 +0,0 @@
1
- import { aE as resolveAwsSdkSigV4Config, au as normalizeProvider, ap as getSmithyContext, B as BinaryDecisionDiagram, l as EndpointCache, $ as decideEndpoint, Q as awsEndpointFunctions, Z as customEndpointFunctions, M as ServiceException, T as TypeRegistry, aT as toUtf8, a8 as fromUtf8, aA as parseUrl, x as NoOpLogger, b as AwsSdkSigV4Signer, w as NoAuthSigner, aR as toBase64, a6 as fromBase64, a1 as emitWarningIfUnsupportedVersion, aG as resolveDefaultsModeConfig, a2 as emitWarningIfUnsupportedVersion$1, aQ as streamCollector, V as calculateBodyLength, ar as loadConfig, N as NODE_APP_ID_CONFIG_OPTIONS, v as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, u as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, H as Hash, s as NODE_RETRY_MODE_CONFIG_OPTIONS, D as DEFAULT_RETRY_MODE, y as NodeHttpHandler, q as NODE_REGION_CONFIG_FILE_OPTIONS, r as NODE_REGION_CONFIG_OPTIONS, p as NODE_MAX_ATTEMPT_CONFIG_OPTIONS, Y as createDefaultUserAgentProvider, o as NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, as as loadConfigsForDefaultMode, aa as getAwsRegionExtensionConfiguration, ad as getDefaultExtensionConfiguration, ai as getHttpHandlerExtensionConfiguration, aC as resolveAwsRegionExtensionConfiguration, aF as resolveDefaultRuntimeConfig, aJ as resolveHttpHandlerRuntimeConfig, c as Client, aN as resolveUserAgentConfig, aM as resolveRetryConfig, aL as resolveRegionConfig, aH as resolveEndpointConfig, ao as getSchemaSerdePlugin, aq as getUserAgentPlugin, an as getRetryPlugin, ac as getContentLengthPlugin, ag as getHostHeaderPlugin, ak as getLoggerPlugin, am as getRecursionDetectionPlugin, ah as getHttpAuthSchemeEndpointRuleSetPlugin, f as DefaultIdentityProviderConfig, aj as getHttpSigningPlugin, aI as resolveHostHeaderConfig, d as Command, ae as getEndpointPlugin } from './index-BuxEK_Z4.mjs';
2
- import { p as packageInfo } from './package-DbbYaehr.mjs';
3
- import 'node:crypto';
4
- import { A as AwsRestJsonProtocol } from './AwsRestJsonProtocol-4m7HHwvS.mjs';
5
- import './readMergedOptions-CraAnYdB.mjs';
6
- import 'zod';
7
- import '@commander-js/extra-typings';
8
- import './readDotenvCascade-Dgx4SC1p.mjs';
9
- import 'fs-extra';
10
- import 'radash';
11
- import 'node:buffer';
12
- import 'node:path';
13
- import './loadModuleDefault-Dj8B3Stt.mjs';
14
- import 'crypto';
15
- import 'path';
16
- import 'url';
17
- import 'dotenv';
18
- import 'nanoid';
19
- import './loader-V1vbmtyw.mjs';
20
- import 'package-directory';
21
- import 'yaml';
22
- import 'execa';
23
- import 'node:os';
24
- import 'node:fs/promises';
25
- import 'node:stream';
26
- import 'node:fs';
27
- import 'node:https';
28
- import 'node:process';
29
- import './sdk-stream-mixin-BL49AxZx.mjs';
30
-
31
- const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
32
- return {
33
- operation: getSmithyContext(context).operation,
34
- region: (await normalizeProvider(config.region)()) ||
35
- (() => {
36
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
37
- })(),
38
- };
39
- };
40
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
41
- return {
42
- schemeId: "aws.auth#sigv4",
43
- signingProperties: {
44
- name: "sso-oauth",
45
- region: authParameters.region,
46
- },
47
- propertiesExtractor: (config, context) => ({
48
- signingProperties: {
49
- config,
50
- context,
51
- },
52
- }),
53
- };
54
- }
55
- function createSmithyApiNoAuthHttpAuthOption(authParameters) {
56
- return {
57
- schemeId: "smithy.api#noAuth",
58
- };
59
- }
60
- const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
61
- const options = [];
62
- switch (authParameters.operation) {
63
- case "CreateToken": {
64
- options.push(createSmithyApiNoAuthHttpAuthOption());
65
- break;
66
- }
67
- default: {
68
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
69
- }
70
- }
71
- return options;
72
- };
73
- const resolveHttpAuthSchemeConfig = (config) => {
74
- const config_0 = resolveAwsSdkSigV4Config(config);
75
- return Object.assign(config_0, {
76
- authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
77
- });
78
- };
79
-
80
- const resolveClientEndpointParameters = (options) => {
81
- return Object.assign(options, {
82
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
83
- useFipsEndpoint: options.useFipsEndpoint ?? false,
84
- defaultSigningName: "sso-oauth",
85
- });
86
- };
87
- const commonParams = {
88
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
89
- Endpoint: { type: "builtInParams", name: "endpoint" },
90
- Region: { type: "builtInParams", name: "region" },
91
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
92
- };
93
-
94
- const k = "ref";
95
- const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
96
- const _data = {
97
- conditions: [
98
- [c, [g]],
99
- [c, j],
100
- ["aws.partition", j, d],
101
- [e, [{ [k]: "UseFIPS" }, b]],
102
- [e, [{ [k]: "UseDualStack" }, b]],
103
- [e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]],
104
- [e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]],
105
- ["stringEquals", [{ fn: f, argv: [h, "name"] }, "aws-us-gov"]],
106
- ],
107
- results: [
108
- [a],
109
- [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
110
- [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
111
- [g, i],
112
- ["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
113
- [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
114
- ["https://oidc.{Region}.amazonaws.com", i],
115
- ["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", i],
116
- [a, "FIPS is enabled but this partition does not support FIPS"],
117
- ["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
118
- [a, "DualStack is enabled but this partition does not support DualStack"],
119
- ["https://oidc.{Region}.{PartitionResult#dnsSuffix}", i],
120
- [a, "Invalid Configuration: Missing Region"],
121
- ],
122
- };
123
- const root = 2;
124
- const r = 100_000_000;
125
- const nodes = new Int32Array([
126
- -1,
127
- 1,
128
- -1,
129
- 0,
130
- 13,
131
- 3,
132
- 1,
133
- 4,
134
- r + 12,
135
- 2,
136
- 5,
137
- r + 12,
138
- 3,
139
- 8,
140
- 6,
141
- 4,
142
- 7,
143
- r + 11,
144
- 5,
145
- r + 9,
146
- r + 10,
147
- 4,
148
- 11,
149
- 9,
150
- 6,
151
- 10,
152
- r + 8,
153
- 7,
154
- r + 6,
155
- r + 7,
156
- 5,
157
- 12,
158
- r + 5,
159
- 6,
160
- r + 4,
161
- r + 5,
162
- 3,
163
- r + 1,
164
- 14,
165
- 4,
166
- r + 2,
167
- r + 3,
168
- ]);
169
- const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
170
-
171
- const cache = new EndpointCache({
172
- size: 50,
173
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
174
- });
175
- const defaultEndpointResolver = (endpointParams, context = {}) => {
176
- return cache.get(endpointParams, () => decideEndpoint(bdd, {
177
- endpointParams: endpointParams,
178
- logger: context.logger,
179
- }));
180
- };
181
- customEndpointFunctions.aws = awsEndpointFunctions;
182
-
183
- class SSOOIDCServiceException extends ServiceException {
184
- constructor(options) {
185
- super(options);
186
- Object.setPrototypeOf(this, SSOOIDCServiceException.prototype);
187
- }
188
- }
189
-
190
- class AccessDeniedException extends SSOOIDCServiceException {
191
- name = "AccessDeniedException";
192
- $fault = "client";
193
- error;
194
- reason;
195
- error_description;
196
- constructor(opts) {
197
- super({
198
- name: "AccessDeniedException",
199
- $fault: "client",
200
- ...opts,
201
- });
202
- Object.setPrototypeOf(this, AccessDeniedException.prototype);
203
- this.error = opts.error;
204
- this.reason = opts.reason;
205
- this.error_description = opts.error_description;
206
- }
207
- }
208
- class AuthorizationPendingException extends SSOOIDCServiceException {
209
- name = "AuthorizationPendingException";
210
- $fault = "client";
211
- error;
212
- error_description;
213
- constructor(opts) {
214
- super({
215
- name: "AuthorizationPendingException",
216
- $fault: "client",
217
- ...opts,
218
- });
219
- Object.setPrototypeOf(this, AuthorizationPendingException.prototype);
220
- this.error = opts.error;
221
- this.error_description = opts.error_description;
222
- }
223
- }
224
- class ExpiredTokenException extends SSOOIDCServiceException {
225
- name = "ExpiredTokenException";
226
- $fault = "client";
227
- error;
228
- error_description;
229
- constructor(opts) {
230
- super({
231
- name: "ExpiredTokenException",
232
- $fault: "client",
233
- ...opts,
234
- });
235
- Object.setPrototypeOf(this, ExpiredTokenException.prototype);
236
- this.error = opts.error;
237
- this.error_description = opts.error_description;
238
- }
239
- }
240
- class InternalServerException extends SSOOIDCServiceException {
241
- name = "InternalServerException";
242
- $fault = "server";
243
- error;
244
- error_description;
245
- constructor(opts) {
246
- super({
247
- name: "InternalServerException",
248
- $fault: "server",
249
- ...opts,
250
- });
251
- Object.setPrototypeOf(this, InternalServerException.prototype);
252
- this.error = opts.error;
253
- this.error_description = opts.error_description;
254
- }
255
- }
256
- class InvalidClientException extends SSOOIDCServiceException {
257
- name = "InvalidClientException";
258
- $fault = "client";
259
- error;
260
- error_description;
261
- constructor(opts) {
262
- super({
263
- name: "InvalidClientException",
264
- $fault: "client",
265
- ...opts,
266
- });
267
- Object.setPrototypeOf(this, InvalidClientException.prototype);
268
- this.error = opts.error;
269
- this.error_description = opts.error_description;
270
- }
271
- }
272
- class InvalidGrantException extends SSOOIDCServiceException {
273
- name = "InvalidGrantException";
274
- $fault = "client";
275
- error;
276
- error_description;
277
- constructor(opts) {
278
- super({
279
- name: "InvalidGrantException",
280
- $fault: "client",
281
- ...opts,
282
- });
283
- Object.setPrototypeOf(this, InvalidGrantException.prototype);
284
- this.error = opts.error;
285
- this.error_description = opts.error_description;
286
- }
287
- }
288
- class InvalidRequestException extends SSOOIDCServiceException {
289
- name = "InvalidRequestException";
290
- $fault = "client";
291
- error;
292
- reason;
293
- error_description;
294
- constructor(opts) {
295
- super({
296
- name: "InvalidRequestException",
297
- $fault: "client",
298
- ...opts,
299
- });
300
- Object.setPrototypeOf(this, InvalidRequestException.prototype);
301
- this.error = opts.error;
302
- this.reason = opts.reason;
303
- this.error_description = opts.error_description;
304
- }
305
- }
306
- class InvalidScopeException extends SSOOIDCServiceException {
307
- name = "InvalidScopeException";
308
- $fault = "client";
309
- error;
310
- error_description;
311
- constructor(opts) {
312
- super({
313
- name: "InvalidScopeException",
314
- $fault: "client",
315
- ...opts,
316
- });
317
- Object.setPrototypeOf(this, InvalidScopeException.prototype);
318
- this.error = opts.error;
319
- this.error_description = opts.error_description;
320
- }
321
- }
322
- class SlowDownException extends SSOOIDCServiceException {
323
- name = "SlowDownException";
324
- $fault = "client";
325
- error;
326
- error_description;
327
- constructor(opts) {
328
- super({
329
- name: "SlowDownException",
330
- $fault: "client",
331
- ...opts,
332
- });
333
- Object.setPrototypeOf(this, SlowDownException.prototype);
334
- this.error = opts.error;
335
- this.error_description = opts.error_description;
336
- }
337
- }
338
- class UnauthorizedClientException extends SSOOIDCServiceException {
339
- name = "UnauthorizedClientException";
340
- $fault = "client";
341
- error;
342
- error_description;
343
- constructor(opts) {
344
- super({
345
- name: "UnauthorizedClientException",
346
- $fault: "client",
347
- ...opts,
348
- });
349
- Object.setPrototypeOf(this, UnauthorizedClientException.prototype);
350
- this.error = opts.error;
351
- this.error_description = opts.error_description;
352
- }
353
- }
354
- class UnsupportedGrantTypeException extends SSOOIDCServiceException {
355
- name = "UnsupportedGrantTypeException";
356
- $fault = "client";
357
- error;
358
- error_description;
359
- constructor(opts) {
360
- super({
361
- name: "UnsupportedGrantTypeException",
362
- $fault: "client",
363
- ...opts,
364
- });
365
- Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype);
366
- this.error = opts.error;
367
- this.error_description = opts.error_description;
368
- }
369
- }
370
-
371
- const _ADE = "AccessDeniedException";
372
- const _APE = "AuthorizationPendingException";
373
- const _AT = "AccessToken";
374
- const _CS = "ClientSecret";
375
- const _CT = "CreateToken";
376
- const _CTR = "CreateTokenRequest";
377
- const _CTRr = "CreateTokenResponse";
378
- const _CV = "CodeVerifier";
379
- const _ETE = "ExpiredTokenException";
380
- const _ICE = "InvalidClientException";
381
- const _IGE = "InvalidGrantException";
382
- const _IRE = "InvalidRequestException";
383
- const _ISE = "InternalServerException";
384
- const _ISEn = "InvalidScopeException";
385
- const _IT = "IdToken";
386
- const _RT = "RefreshToken";
387
- const _SDE = "SlowDownException";
388
- const _UCE = "UnauthorizedClientException";
389
- const _UGTE = "UnsupportedGrantTypeException";
390
- const _aT = "accessToken";
391
- const _c = "client";
392
- const _cI = "clientId";
393
- const _cS = "clientSecret";
394
- const _cV = "codeVerifier";
395
- const _co = "code";
396
- const _dC = "deviceCode";
397
- const _e = "error";
398
- const _eI = "expiresIn";
399
- const _ed = "error_description";
400
- const _gT = "grantType";
401
- const _h = "http";
402
- const _hE = "httpError";
403
- const _iT = "idToken";
404
- const _r = "reason";
405
- const _rT = "refreshToken";
406
- const _rU = "redirectUri";
407
- const _s = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc";
408
- const _sc = "scope";
409
- const _se = "server";
410
- const _tT = "tokenType";
411
- const n0 = "com.amazonaws.ssooidc";
412
- const _s_registry = TypeRegistry.for(_s);
413
- var SSOOIDCServiceException$ = [-3, _s, "SSOOIDCServiceException", 0, [], []];
414
- _s_registry.registerError(SSOOIDCServiceException$, SSOOIDCServiceException);
415
- const n0_registry = TypeRegistry.for(n0);
416
- var AccessDeniedException$ = [
417
- -3,
418
- n0,
419
- _ADE,
420
- { [_e]: _c, [_hE]: 400 },
421
- [_e, _r, _ed],
422
- [0, 0, 0],
423
- ];
424
- n0_registry.registerError(AccessDeniedException$, AccessDeniedException);
425
- var AuthorizationPendingException$ = [
426
- -3,
427
- n0,
428
- _APE,
429
- { [_e]: _c, [_hE]: 400 },
430
- [_e, _ed],
431
- [0, 0],
432
- ];
433
- n0_registry.registerError(AuthorizationPendingException$, AuthorizationPendingException);
434
- var ExpiredTokenException$ = [-3, n0, _ETE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
435
- n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException);
436
- var InternalServerException$ = [-3, n0, _ISE, { [_e]: _se, [_hE]: 500 }, [_e, _ed], [0, 0]];
437
- n0_registry.registerError(InternalServerException$, InternalServerException);
438
- var InvalidClientException$ = [-3, n0, _ICE, { [_e]: _c, [_hE]: 401 }, [_e, _ed], [0, 0]];
439
- n0_registry.registerError(InvalidClientException$, InvalidClientException);
440
- var InvalidGrantException$ = [-3, n0, _IGE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
441
- n0_registry.registerError(InvalidGrantException$, InvalidGrantException);
442
- var InvalidRequestException$ = [
443
- -3,
444
- n0,
445
- _IRE,
446
- { [_e]: _c, [_hE]: 400 },
447
- [_e, _r, _ed],
448
- [0, 0, 0],
449
- ];
450
- n0_registry.registerError(InvalidRequestException$, InvalidRequestException);
451
- var InvalidScopeException$ = [-3, n0, _ISEn, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
452
- n0_registry.registerError(InvalidScopeException$, InvalidScopeException);
453
- var SlowDownException$ = [-3, n0, _SDE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
454
- n0_registry.registerError(SlowDownException$, SlowDownException);
455
- var UnauthorizedClientException$ = [
456
- -3,
457
- n0,
458
- _UCE,
459
- { [_e]: _c, [_hE]: 400 },
460
- [_e, _ed],
461
- [0, 0],
462
- ];
463
- n0_registry.registerError(UnauthorizedClientException$, UnauthorizedClientException);
464
- var UnsupportedGrantTypeException$ = [
465
- -3,
466
- n0,
467
- _UGTE,
468
- { [_e]: _c, [_hE]: 400 },
469
- [_e, _ed],
470
- [0, 0],
471
- ];
472
- n0_registry.registerError(UnsupportedGrantTypeException$, UnsupportedGrantTypeException);
473
- const errorTypeRegistries = [_s_registry, n0_registry];
474
- var AccessToken = [0, n0, _AT, 8, 0];
475
- var ClientSecret = [0, n0, _CS, 8, 0];
476
- var CodeVerifier = [0, n0, _CV, 8, 0];
477
- var IdToken = [0, n0, _IT, 8, 0];
478
- var RefreshToken = [0, n0, _RT, 8, 0];
479
- var CreateTokenRequest$ = [
480
- 3,
481
- n0,
482
- _CTR,
483
- 0,
484
- [_cI, _cS, _gT, _dC, _co, _rT, _sc, _rU, _cV],
485
- [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]],
486
- 3,
487
- ];
488
- var CreateTokenResponse$ = [
489
- 3,
490
- n0,
491
- _CTRr,
492
- 0,
493
- [_aT, _tT, _eI, _rT, _iT],
494
- [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]],
495
- ];
496
- var CreateToken$ = [
497
- 9,
498
- n0,
499
- _CT,
500
- { [_h]: ["POST", "/token", 200] },
501
- () => CreateTokenRequest$,
502
- () => CreateTokenResponse$,
503
- ];
504
-
505
- const getRuntimeConfig$1 = (config) => {
506
- return {
507
- apiVersion: "2019-06-10",
508
- base64Decoder: config?.base64Decoder ?? fromBase64,
509
- base64Encoder: config?.base64Encoder ?? toBase64,
510
- disableHostPrefix: config?.disableHostPrefix ?? false,
511
- endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
512
- extensions: config?.extensions ?? [],
513
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider,
514
- httpAuthSchemes: config?.httpAuthSchemes ?? [
515
- {
516
- schemeId: "aws.auth#sigv4",
517
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
518
- signer: new AwsSdkSigV4Signer(),
519
- },
520
- {
521
- schemeId: "smithy.api#noAuth",
522
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
523
- signer: new NoAuthSigner(),
524
- },
525
- ],
526
- logger: config?.logger ?? new NoOpLogger(),
527
- protocol: config?.protocol ?? AwsRestJsonProtocol,
528
- protocolSettings: config?.protocolSettings ?? {
529
- defaultNamespace: "com.amazonaws.ssooidc",
530
- errorTypeRegistries,
531
- version: "2019-06-10",
532
- serviceTarget: "AWSSSOOIDCService",
533
- },
534
- serviceId: config?.serviceId ?? "SSO OIDC",
535
- urlParser: config?.urlParser ?? parseUrl,
536
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
537
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
538
- };
539
- };
540
-
541
- const getRuntimeConfig = (config) => {
542
- emitWarningIfUnsupportedVersion(process.version);
543
- const defaultsMode = resolveDefaultsModeConfig(config);
544
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
545
- const clientSharedValues = getRuntimeConfig$1(config);
546
- emitWarningIfUnsupportedVersion$1(process.version);
547
- const loaderConfig = {
548
- profile: config?.profile,
549
- logger: clientSharedValues.logger,
550
- };
551
- return {
552
- ...clientSharedValues,
553
- ...config,
554
- runtime: "node",
555
- defaultsMode,
556
- authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
557
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
558
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
559
- createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
560
- maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
561
- region: config?.region ??
562
- loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
563
- requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
564
- retryMode: config?.retryMode ??
565
- loadConfig({
566
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
567
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
568
- }, config),
569
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
570
- streamCollector: config?.streamCollector ?? streamCollector,
571
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
572
- useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
573
- userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
574
- };
575
- };
576
-
577
- const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
578
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
579
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
580
- let _credentials = runtimeConfig.credentials;
581
- return {
582
- setHttpAuthScheme(httpAuthScheme) {
583
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
584
- if (index === -1) {
585
- _httpAuthSchemes.push(httpAuthScheme);
586
- }
587
- else {
588
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
589
- }
590
- },
591
- httpAuthSchemes() {
592
- return _httpAuthSchemes;
593
- },
594
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
595
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
596
- },
597
- httpAuthSchemeProvider() {
598
- return _httpAuthSchemeProvider;
599
- },
600
- setCredentials(credentials) {
601
- _credentials = credentials;
602
- },
603
- credentials() {
604
- return _credentials;
605
- },
606
- };
607
- };
608
- const resolveHttpAuthRuntimeConfig = (config) => {
609
- return {
610
- httpAuthSchemes: config.httpAuthSchemes(),
611
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
612
- credentials: config.credentials(),
613
- };
614
- };
615
-
616
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
617
- const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
618
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
619
- return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
620
- };
621
-
622
- class SSOOIDCClient extends Client {
623
- config;
624
- constructor(...[configuration]) {
625
- const _config_0 = getRuntimeConfig(configuration || {});
626
- super(_config_0);
627
- this.initConfig = _config_0;
628
- const _config_1 = resolveClientEndpointParameters(_config_0);
629
- const _config_2 = resolveUserAgentConfig(_config_1);
630
- const _config_3 = resolveRetryConfig(_config_2);
631
- const _config_4 = resolveRegionConfig(_config_3);
632
- const _config_5 = resolveHostHeaderConfig(_config_4);
633
- const _config_6 = resolveEndpointConfig(_config_5);
634
- const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
635
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
636
- this.config = _config_8;
637
- this.middlewareStack.use(getSchemaSerdePlugin(this.config));
638
- this.middlewareStack.use(getUserAgentPlugin(this.config));
639
- this.middlewareStack.use(getRetryPlugin(this.config));
640
- this.middlewareStack.use(getContentLengthPlugin(this.config));
641
- this.middlewareStack.use(getHostHeaderPlugin(this.config));
642
- this.middlewareStack.use(getLoggerPlugin(this.config));
643
- this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
644
- this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
645
- httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider,
646
- identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
647
- "aws.auth#sigv4": config.credentials,
648
- }),
649
- }));
650
- this.middlewareStack.use(getHttpSigningPlugin(this.config));
651
- }
652
- destroy() {
653
- super.destroy();
654
- }
655
- }
656
-
657
- class CreateTokenCommand extends Command
658
- .classBuilder()
659
- .ep(commonParams)
660
- .m(function (Command, cs, config, o) {
661
- return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
662
- })
663
- .s("AWSSSOOIDCService", "CreateToken", {})
664
- .n("SSOOIDCClient", "CreateTokenCommand")
665
- .sc(CreateToken$)
666
- .build() {
667
- }
668
-
669
- export { Command as $Command, AccessDeniedException, AccessDeniedException$, AuthorizationPendingException, AuthorizationPendingException$, CreateToken$, CreateTokenCommand, CreateTokenRequest$, CreateTokenResponse$, ExpiredTokenException, ExpiredTokenException$, InternalServerException, InternalServerException$, InvalidClientException, InvalidClientException$, InvalidGrantException, InvalidGrantException$, InvalidRequestException, InvalidRequestException$, InvalidScopeException, InvalidScopeException$, SSOOIDCClient, SSOOIDCServiceException, SSOOIDCServiceException$, SlowDownException, SlowDownException$, UnauthorizedClientException, UnauthorizedClientException$, UnsupportedGrantTypeException, UnsupportedGrantTypeException$, Client as __Client, errorTypeRegistries };