@karmaniverous/get-dotenv 7.0.1 → 7.0.2

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 (38) hide show
  1. package/dist/chunks/{AwsRestJsonProtocol-DeiE3wkO.mjs → AwsRestJsonProtocol-Bh3OvjNM.mjs} +158 -81
  2. package/dist/chunks/{createCli-B9-MIwWj.mjs → createCli-wmAcTdWR.mjs} +4 -4
  3. package/dist/chunks/{externalDataInterceptor-gi2RH4ez.mjs → externalDataInterceptor-BBvsYwZE.mjs} +2 -2
  4. package/dist/chunks/{getSSOTokenFromFile-BfAhZf_d.mjs → getSSOTokenFromFile-BSeYpbLi.mjs} +4 -4
  5. package/dist/chunks/{index-98yxYe1W.mjs → index-BZrYAvLs.mjs} +281 -205
  6. package/dist/chunks/{index-CAtxK29A.mjs → index-BhMXFr37.mjs} +12 -9
  7. package/dist/chunks/{index-DY7wYcXW.mjs → index-C-9h7h7x.mjs} +14 -17
  8. package/dist/chunks/{index-AssUn9IY.mjs → index-CGG9e0xu.mjs} +11157 -8059
  9. package/dist/chunks/{index-CMSCF_uw.mjs → index-CQoEnkSc.mjs} +493 -254
  10. package/dist/chunks/{index-xRi3oKvY.mjs → index-CnnI9zSQ.mjs} +10 -12
  11. package/dist/chunks/{index-D8S1lJ24.mjs → index-DLciMnJ6.mjs} +271 -181
  12. package/dist/chunks/{index-B6r8O7PJ.mjs → index-DmynYewb.mjs} +14 -17
  13. package/dist/chunks/{index-C21RHLO4.mjs → index-DyRIwYWf.mjs} +33 -18
  14. package/dist/chunks/{index-mPj0Vhpw.mjs → index-GcL_Hrrr.mjs} +13 -15
  15. package/dist/chunks/{index-DfvhftMN.mjs → index-aUz_8rS_.mjs} +29 -28
  16. package/dist/chunks/index-cIL2r09o.mjs +31 -0
  17. package/dist/chunks/{index-Ccay5Db0.mjs → index-tlD9zcww.mjs} +16 -19
  18. package/dist/chunks/{loadSso-C-y9gQEz.mjs → loadSso-9hx2nl0k.mjs} +242 -180
  19. package/dist/chunks/{package-DiDNabNr.mjs → package-DbbYaehr.mjs} +1 -1
  20. package/dist/chunks/{parseKnownFiles-KczcjlE0.mjs → parseKnownFiles-CewXrtbo.mjs} +1 -1
  21. package/dist/chunks/{readDotenvCascade-HLU7FsEQ.mjs → readDotenvCascade-Dgx4SC1p.mjs} +3 -7
  22. package/dist/chunks/{readMergedOptions-D6niy_Ep.mjs → readMergedOptions-atT1xkoe.mjs} +5 -3
  23. package/dist/chunks/{resolveCliOptions-PWF1aEM9.mjs → resolveCliOptions-BLSqCGm7.mjs} +1 -1
  24. package/dist/chunks/{sdk-stream-mixin-blFikF4G.mjs → sdk-stream-mixin-CMdQ7nO8.mjs} +145 -5
  25. package/dist/chunks/{spawnEnv-5kdIVv0x.mjs → spawnEnv-CKgnHGpr.mjs} +5 -5
  26. package/dist/chunks/{types-Bp3u5-IH.mjs → types-BdKCfPRW.mjs} +1 -1
  27. package/dist/cli.mjs +12 -14
  28. package/dist/cliHost.mjs +5 -5
  29. package/dist/env-overlay.mjs +2 -2
  30. package/dist/getdotenv.cli.mjs +12 -14
  31. package/dist/index.mjs +16 -18
  32. package/dist/plugins-aws.mjs +3 -3
  33. package/dist/plugins-batch.mjs +3 -3
  34. package/dist/plugins-cmd.mjs +5 -5
  35. package/dist/plugins-init.mjs +4 -4
  36. package/dist/plugins.mjs +11 -13
  37. package/package.json +1 -1
  38. package/dist/chunks/index-DtdHVcXz.mjs +0 -27
@@ -1,10 +1,11 @@
1
- import { w as resolveAwsSdkSigV4Config, x as normalizeProvider, y as getSmithyContext, z as EndpointCache, A as resolveEndpoint, B as awsEndpointFunctions, D as customEndpointFunctions, t as toUtf8, i as fromUtf8, F as parseUrl, G as NoOpLogger, I as AwsSdkSigV4Signer, J as NoAuthSigner, n as toBase64, m as fromBase64, K as emitWarningIfUnsupportedVersion, L as resolveDefaultsModeConfig, M as emitWarningIfUnsupportedVersion$1, O as loadConfig, r as streamCollector, P as Hash, N as NodeHttpHandler, Q as createDefaultUserAgentProvider, R as calculateBodyLength, S as NODE_APP_ID_CONFIG_OPTIONS, T as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, U as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, V as NODE_RETRY_MODE_CONFIG_OPTIONS, W as DEFAULT_RETRY_MODE, X as NODE_REGION_CONFIG_FILE_OPTIONS, Y as NODE_REGION_CONFIG_OPTIONS, Z as NODE_MAX_ATTEMPT_CONFIG_OPTIONS, _ as NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, $ as loadConfigsForDefaultMode, a0 as getAwsRegionExtensionConfiguration, a1 as getDefaultExtensionConfiguration, a2 as getHttpHandlerExtensionConfiguration, a3 as resolveAwsRegionExtensionConfiguration, a4 as resolveDefaultRuntimeConfig, a5 as resolveHttpHandlerRuntimeConfig, a6 as Client, a7 as resolveUserAgentConfig, a8 as resolveRetryConfig, a9 as resolveRegionConfig, aa as resolveEndpointConfig, ab as resolveHostHeaderConfig, ac as getSchemaSerdePlugin, ad as getUserAgentPlugin, ae as getRetryPlugin, af as getContentLengthPlugin, ag as getHostHeaderPlugin, ah as getLoggerPlugin, ai as getRecursionDetectionPlugin, aj as getHttpAuthSchemeEndpointRuleSetPlugin, ak as DefaultIdentityProviderConfig, al as getHttpSigningPlugin, am as ServiceException, an as TypeRegistry, ao as Command, ap as getEndpointPlugin } from './index-AssUn9IY.mjs';
2
- import { p as packageInfo } from './package-DiDNabNr.mjs';
3
- import { A as AwsRestJsonProtocol } from './AwsRestJsonProtocol-DeiE3wkO.mjs';
4
- import './readMergedOptions-D6niy_Ep.mjs';
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-CGG9e0xu.mjs';
2
+ import { p as packageInfo } from './package-DbbYaehr.mjs';
3
+ import 'node:crypto';
4
+ import { A as AwsRestJsonProtocol } from './AwsRestJsonProtocol-Bh3OvjNM.mjs';
5
+ import './readMergedOptions-atT1xkoe.mjs';
5
6
  import 'zod';
6
7
  import '@commander-js/extra-typings';
7
- import './readDotenvCascade-HLU7FsEQ.mjs';
8
+ import './readDotenvCascade-Dgx4SC1p.mjs';
8
9
  import 'fs-extra';
9
10
  import 'radash';
10
11
  import 'node:buffer';
@@ -19,15 +20,13 @@ import './loader-CE4HSRN4.mjs';
19
20
  import 'package-directory';
20
21
  import 'yaml';
21
22
  import 'execa';
22
- import 'buffer';
23
- import 'os';
23
+ import 'node:os';
24
24
  import 'node:fs/promises';
25
- import 'http';
26
- import 'https';
27
- import 'stream';
28
- import 'process';
25
+ import 'node:stream';
29
26
  import 'node:fs';
30
- import './sdk-stream-mixin-blFikF4G.mjs';
27
+ import 'node:https';
28
+ import 'node:process';
29
+ import './sdk-stream-mixin-CMdQ7nO8.mjs';
31
30
 
32
31
  const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
33
32
  return {
@@ -92,174 +91,95 @@ const commonParams = {
92
91
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
93
92
  };
94
93
 
95
- const u = "required", v = "fn", w = "argv", x = "ref";
96
- const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "string" }, j = { [u]: true, "default": false, "type": "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }];
97
- const _data = { parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
98
- const ruleSet = _data;
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);
99
170
 
100
171
  const cache = new EndpointCache({
101
172
  size: 50,
102
173
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
103
174
  });
104
175
  const defaultEndpointResolver = (endpointParams, context = {}) => {
105
- return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
176
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
106
177
  endpointParams: endpointParams,
107
178
  logger: context.logger,
108
179
  }));
109
180
  };
110
181
  customEndpointFunctions.aws = awsEndpointFunctions;
111
182
 
112
- const getRuntimeConfig$1 = (config) => {
113
- return {
114
- apiVersion: "2019-06-10",
115
- base64Decoder: config?.base64Decoder ?? fromBase64,
116
- base64Encoder: config?.base64Encoder ?? toBase64,
117
- disableHostPrefix: config?.disableHostPrefix ?? false,
118
- endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
119
- extensions: config?.extensions ?? [],
120
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider,
121
- httpAuthSchemes: config?.httpAuthSchemes ?? [
122
- {
123
- schemeId: "aws.auth#sigv4",
124
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
125
- signer: new AwsSdkSigV4Signer(),
126
- },
127
- {
128
- schemeId: "smithy.api#noAuth",
129
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
130
- signer: new NoAuthSigner(),
131
- },
132
- ],
133
- logger: config?.logger ?? new NoOpLogger(),
134
- protocol: config?.protocol ?? AwsRestJsonProtocol,
135
- protocolSettings: config?.protocolSettings ?? {
136
- defaultNamespace: "com.amazonaws.ssooidc",
137
- version: "2019-06-10",
138
- serviceTarget: "AWSSSOOIDCService",
139
- },
140
- serviceId: config?.serviceId ?? "SSO OIDC",
141
- urlParser: config?.urlParser ?? parseUrl,
142
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
143
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
144
- };
145
- };
146
-
147
- const getRuntimeConfig = (config) => {
148
- emitWarningIfUnsupportedVersion(process.version);
149
- const defaultsMode = resolveDefaultsModeConfig(config);
150
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
151
- const clientSharedValues = getRuntimeConfig$1(config);
152
- emitWarningIfUnsupportedVersion$1(process.version);
153
- const loaderConfig = {
154
- profile: config?.profile,
155
- logger: clientSharedValues.logger,
156
- };
157
- return {
158
- ...clientSharedValues,
159
- ...config,
160
- runtime: "node",
161
- defaultsMode,
162
- authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
163
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
164
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
165
- createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
166
- maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
167
- region: config?.region ??
168
- loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
169
- requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
170
- retryMode: config?.retryMode ??
171
- loadConfig({
172
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
173
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
174
- }, config),
175
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
176
- streamCollector: config?.streamCollector ?? streamCollector,
177
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
178
- useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
179
- userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
180
- };
181
- };
182
-
183
- const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
184
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
185
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
186
- let _credentials = runtimeConfig.credentials;
187
- return {
188
- setHttpAuthScheme(httpAuthScheme) {
189
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
190
- if (index === -1) {
191
- _httpAuthSchemes.push(httpAuthScheme);
192
- }
193
- else {
194
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
195
- }
196
- },
197
- httpAuthSchemes() {
198
- return _httpAuthSchemes;
199
- },
200
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
201
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
202
- },
203
- httpAuthSchemeProvider() {
204
- return _httpAuthSchemeProvider;
205
- },
206
- setCredentials(credentials) {
207
- _credentials = credentials;
208
- },
209
- credentials() {
210
- return _credentials;
211
- },
212
- };
213
- };
214
- const resolveHttpAuthRuntimeConfig = (config) => {
215
- return {
216
- httpAuthSchemes: config.httpAuthSchemes(),
217
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
218
- credentials: config.credentials(),
219
- };
220
- };
221
-
222
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
223
- const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
224
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
225
- return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
226
- };
227
-
228
- class SSOOIDCClient extends Client {
229
- config;
230
- constructor(...[configuration]) {
231
- const _config_0 = getRuntimeConfig(configuration || {});
232
- super(_config_0);
233
- this.initConfig = _config_0;
234
- const _config_1 = resolveClientEndpointParameters(_config_0);
235
- const _config_2 = resolveUserAgentConfig(_config_1);
236
- const _config_3 = resolveRetryConfig(_config_2);
237
- const _config_4 = resolveRegionConfig(_config_3);
238
- const _config_5 = resolveHostHeaderConfig(_config_4);
239
- const _config_6 = resolveEndpointConfig(_config_5);
240
- const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
241
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
242
- this.config = _config_8;
243
- this.middlewareStack.use(getSchemaSerdePlugin(this.config));
244
- this.middlewareStack.use(getUserAgentPlugin(this.config));
245
- this.middlewareStack.use(getRetryPlugin(this.config));
246
- this.middlewareStack.use(getContentLengthPlugin(this.config));
247
- this.middlewareStack.use(getHostHeaderPlugin(this.config));
248
- this.middlewareStack.use(getLoggerPlugin(this.config));
249
- this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
250
- this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
251
- httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider,
252
- identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
253
- "aws.auth#sigv4": config.credentials,
254
- }),
255
- }));
256
- this.middlewareStack.use(getHttpSigningPlugin(this.config));
257
- }
258
- destroy() {
259
- super.destroy();
260
- }
261
- }
262
-
263
183
  class SSOOIDCServiceException extends ServiceException {
264
184
  constructor(options) {
265
185
  super(options);
@@ -484,16 +404,15 @@ const _iT = "idToken";
484
404
  const _r = "reason";
485
405
  const _rT = "refreshToken";
486
406
  const _rU = "redirectUri";
487
- const _s = "scope";
407
+ const _s = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc";
408
+ const _sc = "scope";
488
409
  const _se = "server";
489
- const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc";
490
410
  const _tT = "tokenType";
491
411
  const n0 = "com.amazonaws.ssooidc";
492
- var AccessToken = [0, n0, _AT, 8, 0];
493
- var ClientSecret = [0, n0, _CS, 8, 0];
494
- var CodeVerifier = [0, n0, _CV, 8, 0];
495
- var IdToken = [0, n0, _IT, 8, 0];
496
- var RefreshToken = [0, n0, _RT, 8, 0];
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);
497
416
  var AccessDeniedException$ = [
498
417
  -3,
499
418
  n0,
@@ -502,7 +421,7 @@ var AccessDeniedException$ = [
502
421
  [_e, _r, _ed],
503
422
  [0, 0, 0],
504
423
  ];
505
- TypeRegistry.for(n0).registerError(AccessDeniedException$, AccessDeniedException);
424
+ n0_registry.registerError(AccessDeniedException$, AccessDeniedException);
506
425
  var AuthorizationPendingException$ = [
507
426
  -3,
508
427
  n0,
@@ -511,31 +430,15 @@ var AuthorizationPendingException$ = [
511
430
  [_e, _ed],
512
431
  [0, 0],
513
432
  ];
514
- TypeRegistry.for(n0).registerError(AuthorizationPendingException$, AuthorizationPendingException);
515
- var CreateTokenRequest$ = [
516
- 3,
517
- n0,
518
- _CTR,
519
- 0,
520
- [_cI, _cS, _gT, _dC, _co, _rT, _s, _rU, _cV],
521
- [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]],
522
- ];
523
- var CreateTokenResponse$ = [
524
- 3,
525
- n0,
526
- _CTRr,
527
- 0,
528
- [_aT, _tT, _eI, _rT, _iT],
529
- [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]],
530
- ];
433
+ n0_registry.registerError(AuthorizationPendingException$, AuthorizationPendingException);
531
434
  var ExpiredTokenException$ = [-3, n0, _ETE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
532
- TypeRegistry.for(n0).registerError(ExpiredTokenException$, ExpiredTokenException);
435
+ n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException);
533
436
  var InternalServerException$ = [-3, n0, _ISE, { [_e]: _se, [_hE]: 500 }, [_e, _ed], [0, 0]];
534
- TypeRegistry.for(n0).registerError(InternalServerException$, InternalServerException);
437
+ n0_registry.registerError(InternalServerException$, InternalServerException);
535
438
  var InvalidClientException$ = [-3, n0, _ICE, { [_e]: _c, [_hE]: 401 }, [_e, _ed], [0, 0]];
536
- TypeRegistry.for(n0).registerError(InvalidClientException$, InvalidClientException);
439
+ n0_registry.registerError(InvalidClientException$, InvalidClientException);
537
440
  var InvalidGrantException$ = [-3, n0, _IGE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
538
- TypeRegistry.for(n0).registerError(InvalidGrantException$, InvalidGrantException);
441
+ n0_registry.registerError(InvalidGrantException$, InvalidGrantException);
539
442
  var InvalidRequestException$ = [
540
443
  -3,
541
444
  n0,
@@ -544,11 +447,11 @@ var InvalidRequestException$ = [
544
447
  [_e, _r, _ed],
545
448
  [0, 0, 0],
546
449
  ];
547
- TypeRegistry.for(n0).registerError(InvalidRequestException$, InvalidRequestException);
450
+ n0_registry.registerError(InvalidRequestException$, InvalidRequestException);
548
451
  var InvalidScopeException$ = [-3, n0, _ISEn, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
549
- TypeRegistry.for(n0).registerError(InvalidScopeException$, InvalidScopeException);
452
+ n0_registry.registerError(InvalidScopeException$, InvalidScopeException);
550
453
  var SlowDownException$ = [-3, n0, _SDE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]];
551
- TypeRegistry.for(n0).registerError(SlowDownException$, SlowDownException);
454
+ n0_registry.registerError(SlowDownException$, SlowDownException);
552
455
  var UnauthorizedClientException$ = [
553
456
  -3,
554
457
  n0,
@@ -557,7 +460,7 @@ var UnauthorizedClientException$ = [
557
460
  [_e, _ed],
558
461
  [0, 0],
559
462
  ];
560
- TypeRegistry.for(n0).registerError(UnauthorizedClientException$, UnauthorizedClientException);
463
+ n0_registry.registerError(UnauthorizedClientException$, UnauthorizedClientException);
561
464
  var UnsupportedGrantTypeException$ = [
562
465
  -3,
563
466
  n0,
@@ -566,9 +469,30 @@ var UnsupportedGrantTypeException$ = [
566
469
  [_e, _ed],
567
470
  [0, 0],
568
471
  ];
569
- TypeRegistry.for(n0).registerError(UnsupportedGrantTypeException$, UnsupportedGrantTypeException);
570
- var SSOOIDCServiceException$ = [-3, _sm, "SSOOIDCServiceException", 0, [], []];
571
- TypeRegistry.for(_sm).registerError(SSOOIDCServiceException$, SSOOIDCServiceException);
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
+ ];
572
496
  var CreateToken$ = [
573
497
  9,
574
498
  n0,
@@ -578,6 +502,158 @@ var CreateToken$ = [
578
502
  () => CreateTokenResponse$,
579
503
  ];
580
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
+
581
657
  class CreateTokenCommand extends Command
582
658
  .classBuilder()
583
659
  .ep(commonParams)
@@ -590,4 +666,4 @@ class CreateTokenCommand extends Command
590
666
  .build() {
591
667
  }
592
668
 
593
- 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 };
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 };
@@ -1,5 +1,5 @@
1
1
  import { camel } from 'radash';
2
- import { r as readMergedOptions, g as getDotenvCliOptions2Options, d as definePlugin } from './readMergedOptions-D6niy_Ep.mjs';
2
+ import { r as readMergedOptions, d as defaultsDeep, h as getDotenvCliOptions2Options, g as definePlugin } from './readMergedOptions-atT1xkoe.mjs';
3
3
  import 'execa';
4
4
  import 'node:buffer';
5
5
  import 'fs-extra';
@@ -10,14 +10,14 @@ import 'url';
10
10
  import '@commander-js/extra-typings';
11
11
  import 'nanoid';
12
12
  import 'dotenv';
13
- import './loader-CE4HSRN4.mjs';
13
+ import { r as resolveGetDotenvConfigSources } from './loader-CE4HSRN4.mjs';
14
14
  import 'package-directory';
15
15
  import 'yaml';
16
16
  import { z } from 'zod';
17
- import { b as resolveCommand, c as resolveShell, t as tokenize, s as shouldCapture, r as runCommand, d as buildSpawnEnv } from './spawnEnv-5kdIVv0x.mjs';
17
+ import { r as resolveCommand, a as resolveShell, t as tokenize, s as shouldCapture, c as runCommand, b as buildSpawnEnv } from './spawnEnv-CKgnHGpr.mjs';
18
18
  import { m as maybePreserveNodeEvalArgv, c as composeNestedEnv, s as stripOne } from './invoke-DuRPU1oC.mjs';
19
- import { f as dotenvExpandFromProcessEnv } from './readDotenvCascade-HLU7FsEQ.mjs';
20
- import { r as resolveCliOptions, b as baseGetDotenvCliOptions } from './resolveCliOptions-PWF1aEM9.mjs';
19
+ import { f as dotenvExpandFromProcessEnv } from './readDotenvCascade-Dgx4SC1p.mjs';
20
+ import { b as baseGetDotenvCliOptions, r as resolveCliOptions } from './resolveCliOptions-BLSqCGm7.mjs';
21
21
 
22
22
  /** src/diagnostics/entropy.ts
23
23
  * Entropy diagnostics (presentation-only).
@@ -350,8 +350,7 @@ const attachCmdParentInvoker = (cli, options, plugin) => {
350
350
  };
351
351
  const aliasKey = deriveKey(aliasSpec.flags);
352
352
  // Expose the option on the parent (root) command.
353
- const parentCmd = cli.parent ??
354
- cli;
353
+ const parentCmd = cli.parent ?? cli;
355
354
  const desc = aliasSpec.description ??
356
355
  'alias of cmd subcommand; provide command tokens (variadic)';
357
356
  parentCmd.option(aliasSpec.flags, desc);
@@ -400,7 +399,11 @@ const attachCmdParentInvoker = (cli, options, plugin) => {
400
399
  return; // do not run alias when an explicit subcommand is present
401
400
  aliasState.handled = true;
402
401
  // Merge CLI options and resolve dotenv context for this invocation.
403
- const { merged } = resolveCliOptions(raw, baseGetDotenvCliOptions, process.env.getDotenvCliOptions);
402
+ // Use config-enriched defaults (not bare baseGetDotenvCliOptions) so
403
+ // project rootOptionDefaults (paths, defaultEnv, etc.) are respected.
404
+ const sources = await resolveGetDotenvConfigSources(import.meta.url);
405
+ const enrichedDefaults = defaultsDeep(baseGetDotenvCliOptions, sources.packaged?.rootOptionDefaults, sources.project?.public?.rootOptionDefaults, sources.project?.local?.rootOptionDefaults);
406
+ const { merged } = resolveCliOptions(raw, enrichedDefaults, process.env.getDotenvCliOptions);
404
407
  const serviceOptions = getDotenvCliOptions2Options(merged);
405
408
  await cli.resolveAndLoad(serviceOptions);
406
409
  // Build input string and apply optional expansion (by config default).
@@ -477,4 +480,4 @@ const cmdPlugin = (options = {}) => {
477
480
  return plugin;
478
481
  };
479
482
 
480
- export { redactDisplay as a, cmdPlugin as c, maybeWarnEntropy as m, redactObject as r, traceChildEnv as t };
483
+ export { redactObject as a, cmdPlugin as c, maybeWarnEntropy as m, redactDisplay as r, traceChildEnv as t };