diff --git a/.github/workflows/check-transpiled-code.yaml b/.github/workflows/check-transpiled-code.yaml
index 470c567..beb88bd 100644
--- a/.github/workflows/check-transpiled-code.yaml
+++ b/.github/workflows/check-transpiled-code.yaml
@@ -2,7 +2,7 @@ name: Check Transpiled Code
on:
push:
- branches: '*'
+ branches: '**'
permissions:
contents: read
diff --git a/.github/workflows/node-publish.yaml b/.github/workflows/node-publish.yaml
index 82b68a3..b6bf188 100644
--- a/.github/workflows/node-publish.yaml
+++ b/.github/workflows/node-publish.yaml
@@ -5,7 +5,7 @@ on:
release:
types: published
push:
- branches: '*'
+ branches: '**'
workflow_dispatch:
jobs:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 7f87d1b..e114760 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -3,7 +3,7 @@ run-name: Tests [${{ github.ref_name }}] triggered by [${{ github.event_name }}/
on:
push:
- branches: '*'
+ branches: '**'
workflow_dispatch:
permissions:
diff --git a/dist/index.js b/dist/index.js
index c9edfb6..b49f2ba 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -3546,8 +3546,8 @@ var __copyProps = (to, from, except, desc) => {
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
-var src_exports = {};
-__export(src_exports, {
+var index_exports = {};
+__export(index_exports, {
ActionsSuppressedBy: () => ActionsSuppressedBy,
AlarmType: () => AlarmType,
AnomalyDetectorStateValue: () => AnomalyDetectorStateValue,
@@ -3631,7 +3631,7 @@ __export(src_exports, {
waitUntilAlarmExists: () => waitUntilAlarmExists,
waitUntilCompositeAlarmExists: () => waitUntilCompositeAlarmExists
});
-module.exports = __toCommonJS(src_exports);
+module.exports = __toCommonJS(index_exports);
// src/CloudWatchClient.ts
var import_middleware_host_header = __nccwpck_require__(52590);
@@ -3730,7 +3730,14 @@ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions
}, "resolveRuntimeExtensions");
// src/CloudWatchClient.ts
-var _CloudWatchClient = class _CloudWatchClient extends import_smithy_client.Client {
+var CloudWatchClient = class extends import_smithy_client.Client {
+ static {
+ __name(this, "CloudWatchClient");
+ }
+ /**
+ * The resolved configuration of CloudWatchClient class. This is resolved and normalized from the {@link CloudWatchClientConfig | constructor configuration interface}.
+ */
+ config;
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
@@ -3741,7 +3748,7 @@ var _CloudWatchClient = class _CloudWatchClient extends import_smithy_client.Cli
const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = (0, import_middleware_compression.resolveCompressionConfig)(_config_7);
- const _config_9 = resolveRuntimeExtensions(_config_8, (configuration == null ? void 0 : configuration.extensions) || []);
+ const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []);
super(_config_9);
this.config = _config_9;
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
@@ -3753,9 +3760,9 @@ var _CloudWatchClient = class _CloudWatchClient extends import_smithy_client.Cli
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultCloudWatchHttpAuthSchemeParametersProvider,
- identityProviderConfigProvider: async (config) => new import_core.DefaultIdentityProviderConfig({
+ identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials
- })
+ }), "identityProviderConfigProvider")
})
);
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
@@ -3769,8 +3776,6 @@ var _CloudWatchClient = class _CloudWatchClient extends import_smithy_client.Cli
super.destroy();
}
};
-__name(_CloudWatchClient, "CloudWatchClient");
-var CloudWatchClient = _CloudWatchClient;
// src/CloudWatch.ts
@@ -3787,7 +3792,10 @@ var import_core2 = __nccwpck_require__(8704);
// src/models/CloudWatchServiceException.ts
-var _CloudWatchServiceException = class _CloudWatchServiceException extends import_smithy_client.ServiceException {
+var CloudWatchServiceException = class _CloudWatchServiceException extends import_smithy_client.ServiceException {
+ static {
+ __name(this, "CloudWatchServiceException");
+ }
/**
* @internal
*/
@@ -3796,8 +3804,6 @@ var _CloudWatchServiceException = class _CloudWatchServiceException extends impo
Object.setPrototypeOf(this, _CloudWatchServiceException.prototype);
}
};
-__name(_CloudWatchServiceException, "CloudWatchServiceException");
-var CloudWatchServiceException = _CloudWatchServiceException;
// src/models/models_0.ts
var ActionsSuppressedBy = {
@@ -3866,7 +3872,13 @@ var StateValue = {
INSUFFICIENT_DATA: "INSUFFICIENT_DATA",
OK: "OK"
};
-var _ConcurrentModificationException = class _ConcurrentModificationException extends CloudWatchServiceException {
+var ConcurrentModificationException = class _ConcurrentModificationException extends CloudWatchServiceException {
+ static {
+ __name(this, "ConcurrentModificationException");
+ }
+ name = "ConcurrentModificationException";
+ $fault = "client";
+ Message;
/**
* @internal
*/
@@ -3876,15 +3888,17 @@ var _ConcurrentModificationException = class _ConcurrentModificationException ex
$fault: "client",
...opts
});
- this.name = "ConcurrentModificationException";
- this.$fault = "client";
Object.setPrototypeOf(this, _ConcurrentModificationException.prototype);
this.Message = opts.Message;
}
};
-__name(_ConcurrentModificationException, "ConcurrentModificationException");
-var ConcurrentModificationException = _ConcurrentModificationException;
-var _DashboardInvalidInputError = class _DashboardInvalidInputError extends CloudWatchServiceException {
+var DashboardInvalidInputError = class _DashboardInvalidInputError extends CloudWatchServiceException {
+ static {
+ __name(this, "DashboardInvalidInputError");
+ }
+ name = "DashboardInvalidInputError";
+ $fault = "client";
+ dashboardValidationMessages;
/**
* @internal
*/
@@ -3894,15 +3908,16 @@ var _DashboardInvalidInputError = class _DashboardInvalidInputError extends Clou
$fault: "client",
...opts
});
- this.name = "DashboardInvalidInputError";
- this.$fault = "client";
Object.setPrototypeOf(this, _DashboardInvalidInputError.prototype);
this.dashboardValidationMessages = opts.dashboardValidationMessages;
}
};
-__name(_DashboardInvalidInputError, "DashboardInvalidInputError");
-var DashboardInvalidInputError = _DashboardInvalidInputError;
-var _DashboardNotFoundError = class _DashboardNotFoundError extends CloudWatchServiceException {
+var DashboardNotFoundError = class _DashboardNotFoundError extends CloudWatchServiceException {
+ static {
+ __name(this, "DashboardNotFoundError");
+ }
+ name = "DashboardNotFoundError";
+ $fault = "client";
/**
* @internal
*/
@@ -3912,14 +3927,15 @@ var _DashboardNotFoundError = class _DashboardNotFoundError extends CloudWatchSe
$fault: "client",
...opts
});
- this.name = "DashboardNotFoundError";
- this.$fault = "client";
Object.setPrototypeOf(this, _DashboardNotFoundError.prototype);
}
};
-__name(_DashboardNotFoundError, "DashboardNotFoundError");
-var DashboardNotFoundError = _DashboardNotFoundError;
-var _ResourceNotFound = class _ResourceNotFound extends CloudWatchServiceException {
+var ResourceNotFound = class _ResourceNotFound extends CloudWatchServiceException {
+ static {
+ __name(this, "ResourceNotFound");
+ }
+ name = "ResourceNotFound";
+ $fault = "client";
/**
* @internal
*/
@@ -3929,14 +3945,20 @@ var _ResourceNotFound = class _ResourceNotFound extends CloudWatchServiceExcepti
$fault: "client",
...opts
});
- this.name = "ResourceNotFound";
- this.$fault = "client";
Object.setPrototypeOf(this, _ResourceNotFound.prototype);
}
};
-__name(_ResourceNotFound, "ResourceNotFound");
-var ResourceNotFound = _ResourceNotFound;
-var _InternalServiceFault = class _InternalServiceFault extends CloudWatchServiceException {
+var InternalServiceFault = class _InternalServiceFault extends CloudWatchServiceException {
+ static {
+ __name(this, "InternalServiceFault");
+ }
+ name = "InternalServiceFault";
+ $fault = "server";
+ /**
+ *
+ * @public
+ */
+ Message;
/**
* @internal
*/
@@ -3946,15 +3968,16 @@ var _InternalServiceFault = class _InternalServiceFault extends CloudWatchServic
$fault: "server",
...opts
});
- this.name = "InternalServiceFault";
- this.$fault = "server";
Object.setPrototypeOf(this, _InternalServiceFault.prototype);
this.Message = opts.Message;
}
};
-__name(_InternalServiceFault, "InternalServiceFault");
-var InternalServiceFault = _InternalServiceFault;
-var _InvalidParameterCombinationException = class _InvalidParameterCombinationException extends CloudWatchServiceException {
+var InvalidParameterCombinationException = class _InvalidParameterCombinationException extends CloudWatchServiceException {
+ static {
+ __name(this, "InvalidParameterCombinationException");
+ }
+ name = "InvalidParameterCombinationException";
+ $fault = "client";
/**
* @internal
*/
@@ -3964,14 +3987,15 @@ var _InvalidParameterCombinationException = class _InvalidParameterCombinationEx
$fault: "client",
...opts
});
- this.name = "InvalidParameterCombinationException";
- this.$fault = "client";
Object.setPrototypeOf(this, _InvalidParameterCombinationException.prototype);
}
};
-__name(_InvalidParameterCombinationException, "InvalidParameterCombinationException");
-var InvalidParameterCombinationException = _InvalidParameterCombinationException;
-var _InvalidParameterValueException = class _InvalidParameterValueException extends CloudWatchServiceException {
+var InvalidParameterValueException = class _InvalidParameterValueException extends CloudWatchServiceException {
+ static {
+ __name(this, "InvalidParameterValueException");
+ }
+ name = "InvalidParameterValueException";
+ $fault = "client";
/**
* @internal
*/
@@ -3981,14 +4005,15 @@ var _InvalidParameterValueException = class _InvalidParameterValueException exte
$fault: "client",
...opts
});
- this.name = "InvalidParameterValueException";
- this.$fault = "client";
Object.setPrototypeOf(this, _InvalidParameterValueException.prototype);
}
};
-__name(_InvalidParameterValueException, "InvalidParameterValueException");
-var InvalidParameterValueException = _InvalidParameterValueException;
-var _MissingRequiredParameterException = class _MissingRequiredParameterException extends CloudWatchServiceException {
+var MissingRequiredParameterException = class _MissingRequiredParameterException extends CloudWatchServiceException {
+ static {
+ __name(this, "MissingRequiredParameterException");
+ }
+ name = "MissingRequiredParameterException";
+ $fault = "client";
/**
* @internal
*/
@@ -3998,14 +4023,18 @@ var _MissingRequiredParameterException = class _MissingRequiredParameterExceptio
$fault: "client",
...opts
});
- this.name = "MissingRequiredParameterException";
- this.$fault = "client";
Object.setPrototypeOf(this, _MissingRequiredParameterException.prototype);
}
};
-__name(_MissingRequiredParameterException, "MissingRequiredParameterException");
-var MissingRequiredParameterException = _MissingRequiredParameterException;
-var _ResourceNotFoundException = class _ResourceNotFoundException extends CloudWatchServiceException {
+var ResourceNotFoundException = class _ResourceNotFoundException extends CloudWatchServiceException {
+ static {
+ __name(this, "ResourceNotFoundException");
+ }
+ name = "ResourceNotFoundException";
+ $fault = "client";
+ ResourceType;
+ ResourceId;
+ Message;
/**
* @internal
*/
@@ -4015,21 +4044,22 @@ var _ResourceNotFoundException = class _ResourceNotFoundException extends CloudW
$fault: "client",
...opts
});
- this.name = "ResourceNotFoundException";
- this.$fault = "client";
Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
this.ResourceType = opts.ResourceType;
this.ResourceId = opts.ResourceId;
this.Message = opts.Message;
}
};
-__name(_ResourceNotFoundException, "ResourceNotFoundException");
-var ResourceNotFoundException = _ResourceNotFoundException;
var ScanBy = {
TIMESTAMP_ASCENDING: "TimestampAscending",
TIMESTAMP_DESCENDING: "TimestampDescending"
};
-var _InvalidNextToken = class _InvalidNextToken extends CloudWatchServiceException {
+var InvalidNextToken = class _InvalidNextToken extends CloudWatchServiceException {
+ static {
+ __name(this, "InvalidNextToken");
+ }
+ name = "InvalidNextToken";
+ $fault = "client";
/**
* @internal
*/
@@ -4039,13 +4069,9 @@ var _InvalidNextToken = class _InvalidNextToken extends CloudWatchServiceExcepti
$fault: "client",
...opts
});
- this.name = "InvalidNextToken";
- this.$fault = "client";
Object.setPrototypeOf(this, _InvalidNextToken.prototype);
}
};
-__name(_InvalidNextToken, "InvalidNextToken");
-var InvalidNextToken = _InvalidNextToken;
var EvaluationState = {
PARTIAL_DATA: "PARTIAL_DATA"
};
@@ -4056,7 +4082,13 @@ var Statistic = {
SampleCount: "SampleCount",
Sum: "Sum"
};
-var _LimitExceededException = class _LimitExceededException extends CloudWatchServiceException {
+var LimitExceededException = class _LimitExceededException extends CloudWatchServiceException {
+ static {
+ __name(this, "LimitExceededException");
+ }
+ name = "LimitExceededException";
+ $fault = "client";
+ Message;
/**
* @internal
*/
@@ -4066,14 +4098,10 @@ var _LimitExceededException = class _LimitExceededException extends CloudWatchSe
$fault: "client",
...opts
});
- this.name = "LimitExceededException";
- this.$fault = "client";
Object.setPrototypeOf(this, _LimitExceededException.prototype);
this.Message = opts.Message;
}
};
-__name(_LimitExceededException, "LimitExceededException");
-var LimitExceededException = _LimitExceededException;
var StatusCode = {
COMPLETE: "Complete",
FORBIDDEN: "Forbidden",
@@ -4088,7 +4116,12 @@ var MetricStreamOutputFormat = {
var RecentlyActive = {
PT3H: "PT3H"
};
-var _LimitExceededFault = class _LimitExceededFault extends CloudWatchServiceException {
+var LimitExceededFault = class _LimitExceededFault extends CloudWatchServiceException {
+ static {
+ __name(this, "LimitExceededFault");
+ }
+ name = "LimitExceededFault";
+ $fault = "client";
/**
* @internal
*/
@@ -4098,14 +4131,15 @@ var _LimitExceededFault = class _LimitExceededFault extends CloudWatchServiceExc
$fault: "client",
...opts
});
- this.name = "LimitExceededFault";
- this.$fault = "client";
Object.setPrototypeOf(this, _LimitExceededFault.prototype);
}
};
-__name(_LimitExceededFault, "LimitExceededFault");
-var LimitExceededFault = _LimitExceededFault;
-var _InvalidFormatFault = class _InvalidFormatFault extends CloudWatchServiceException {
+var InvalidFormatFault = class _InvalidFormatFault extends CloudWatchServiceException {
+ static {
+ __name(this, "InvalidFormatFault");
+ }
+ name = "InvalidFormatFault";
+ $fault = "client";
/**
* @internal
*/
@@ -4115,13 +4149,9 @@ var _InvalidFormatFault = class _InvalidFormatFault extends CloudWatchServiceExc
$fault: "client",
...opts
});
- this.name = "InvalidFormatFault";
- this.$fault = "client";
Object.setPrototypeOf(this, _InvalidFormatFault.prototype);
}
};
-__name(_InvalidFormatFault, "InvalidFormatFault");
-var InvalidFormatFault = _InvalidFormatFault;
// src/protocols/Aws_query.ts
var se_DeleteAlarmsCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -5162,11 +5192,10 @@ var se_AlarmTypes = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_AlarmTypes");
var se_AnomalyDetectorConfiguration = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_ETR] != null) {
const memberEntries = se_AnomalyDetectorExcludedTimeRanges(input[_ETR], context);
- if (((_a = input[_ETR]) == null ? void 0 : _a.length) === 0) {
+ if (input[_ETR]?.length === 0) {
entries.ExcludedTimeRanges = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5231,11 +5260,10 @@ var se_DashboardNames = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DashboardNames");
var se_DeleteAlarmsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_AN] != null) {
const memberEntries = se_AlarmNames(input[_AN], context);
- if (((_a = input[_AN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_AN]?.length === 0) {
entries.AlarmNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5246,7 +5274,6 @@ var se_DeleteAlarmsInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DeleteAlarmsInput");
var se_DeleteAnomalyDetectorInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
@@ -5256,7 +5283,7 @@ var se_DeleteAnomalyDetectorInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5284,11 +5311,10 @@ var se_DeleteAnomalyDetectorInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DeleteAnomalyDetectorInput");
var se_DeleteDashboardsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_DN] != null) {
const memberEntries = se_DashboardNames(input[_DN], context);
- if (((_a = input[_DN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_DN]?.length === 0) {
entries.DashboardNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5299,11 +5325,10 @@ var se_DeleteDashboardsInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DeleteDashboardsInput");
var se_DeleteInsightRulesInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RN] != null) {
const memberEntries = se_InsightRuleNames(input[_RN], context);
- if (((_a = input[_RN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_RN]?.length === 0) {
entries.RuleNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5321,14 +5346,13 @@ var se_DeleteMetricStreamInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DeleteMetricStreamInput");
var se_DescribeAlarmHistoryInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_ANl] != null) {
entries[_ANl] = input[_ANl];
}
if (input[_AT] != null) {
const memberEntries = se_AlarmTypes(input[_AT], context);
- if (((_a = input[_AT]) == null ? void 0 : _a.length) === 0) {
+ if (input[_AT]?.length === 0) {
entries.AlarmTypes = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5357,7 +5381,6 @@ var se_DescribeAlarmHistoryInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DescribeAlarmHistoryInput");
var se_DescribeAlarmsForMetricInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_MN] != null) {
entries[_MN] = input[_MN];
@@ -5373,7 +5396,7 @@ var se_DescribeAlarmsForMetricInput = /* @__PURE__ */ __name((input, context) =>
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5390,11 +5413,10 @@ var se_DescribeAlarmsForMetricInput = /* @__PURE__ */ __name((input, context) =>
return entries;
}, "se_DescribeAlarmsForMetricInput");
var se_DescribeAlarmsInput = /* @__PURE__ */ __name((input, context) => {
- var _a, _b;
const entries = {};
if (input[_AN] != null) {
const memberEntries = se_AlarmNames(input[_AN], context);
- if (((_a = input[_AN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_AN]?.length === 0) {
entries.AlarmNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5407,7 +5429,7 @@ var se_DescribeAlarmsInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_AT] != null) {
const memberEntries = se_AlarmTypes(input[_AT], context);
- if (((_b = input[_AT]) == null ? void 0 : _b.length) === 0) {
+ if (input[_AT]?.length === 0) {
entries.AlarmTypes = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5436,7 +5458,6 @@ var se_DescribeAlarmsInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DescribeAlarmsInput");
var se_DescribeAnomalyDetectorsInput = /* @__PURE__ */ __name((input, context) => {
- var _a, _b;
const entries = {};
if (input[_NT] != null) {
entries[_NT] = input[_NT];
@@ -5452,7 +5473,7 @@ var se_DescribeAnomalyDetectorsInput = /* @__PURE__ */ __name((input, context) =
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5462,7 +5483,7 @@ var se_DescribeAnomalyDetectorsInput = /* @__PURE__ */ __name((input, context) =
}
if (input[_ADT] != null) {
const memberEntries = se_AnomalyDetectorTypes(input[_ADT], context);
- if (((_b = input[_ADT]) == null ? void 0 : _b.length) === 0) {
+ if (input[_ADT]?.length === 0) {
entries.AnomalyDetectorTypes = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5533,11 +5554,10 @@ var se_Dimensions = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_Dimensions");
var se_DisableAlarmActionsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_AN] != null) {
const memberEntries = se_AlarmNames(input[_AN], context);
- if (((_a = input[_AN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_AN]?.length === 0) {
entries.AlarmNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5548,11 +5568,10 @@ var se_DisableAlarmActionsInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DisableAlarmActionsInput");
var se_DisableInsightRulesInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RN] != null) {
const memberEntries = se_InsightRuleNames(input[_RN], context);
- if (((_a = input[_RN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_RN]?.length === 0) {
entries.RuleNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5563,11 +5582,10 @@ var se_DisableInsightRulesInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_DisableInsightRulesInput");
var se_EnableAlarmActionsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_AN] != null) {
const memberEntries = se_AlarmNames(input[_AN], context);
- if (((_a = input[_AN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_AN]?.length === 0) {
entries.AlarmNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5578,11 +5596,10 @@ var se_EnableAlarmActionsInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_EnableAlarmActionsInput");
var se_EnableInsightRulesInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RN] != null) {
const memberEntries = se_InsightRuleNames(input[_RN], context);
- if (((_a = input[_RN]) == null ? void 0 : _a.length) === 0) {
+ if (input[_RN]?.length === 0) {
entries.RuleNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5592,6 +5609,80 @@ var se_EnableInsightRulesInput = /* @__PURE__ */ __name((input, context) => {
}
return entries;
}, "se_EnableInsightRulesInput");
+var se_Entity = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_KA] != null) {
+ const memberEntries = se_EntityKeyAttributesMap(input[_KA], context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `KeyAttributes.${key}`;
+ entries[loc] = value;
+ });
+ }
+ if (input[_At] != null) {
+ const memberEntries = se_EntityAttributesMap(input[_At], context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `Attributes.${key}`;
+ entries[loc] = value;
+ });
+ }
+ return entries;
+}, "se_Entity");
+var se_EntityAttributesMap = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ Object.keys(input).filter((key) => input[key] != null).forEach((key) => {
+ entries[`entry.${counter}.key`] = key;
+ entries[`entry.${counter}.value`] = input[key];
+ counter++;
+ });
+ return entries;
+}, "se_EntityAttributesMap");
+var se_EntityKeyAttributesMap = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ Object.keys(input).filter((key) => input[key] != null).forEach((key) => {
+ entries[`entry.${counter}.key`] = key;
+ entries[`entry.${counter}.value`] = input[key];
+ counter++;
+ });
+ return entries;
+}, "se_EntityKeyAttributesMap");
+var se_EntityMetricData = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_E] != null) {
+ const memberEntries = se_Entity(input[_E], context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `Entity.${key}`;
+ entries[loc] = value;
+ });
+ }
+ if (input[_MD] != null) {
+ const memberEntries = se_MetricData(input[_MD], context);
+ if (input[_MD]?.length === 0) {
+ entries.MetricData = [];
+ }
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `MetricData.${key}`;
+ entries[loc] = value;
+ });
+ }
+ return entries;
+}, "se_EntityMetricData");
+var se_EntityMetricDataList = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ for (const entry of input) {
+ if (entry === null) {
+ continue;
+ }
+ const memberEntries = se_EntityMetricData(entry, context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ entries[`member.${counter}.${key}`] = value;
+ });
+ counter++;
+ }
+ return entries;
+}, "se_EntityMetricDataList");
var se_ExtendedStatistics = /* @__PURE__ */ __name((input, context) => {
const entries = {};
let counter = 1;
@@ -5612,7 +5703,6 @@ var se_GetDashboardInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_GetDashboardInput");
var se_GetInsightRuleReportInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RNu] != null) {
entries[_RNu] = input[_RNu];
@@ -5631,7 +5721,7 @@ var se_GetInsightRuleReportInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_M] != null) {
const memberEntries = se_InsightRuleMetricList(input[_M], context);
- if (((_a = input[_M]) == null ? void 0 : _a.length) === 0) {
+ if (input[_M]?.length === 0) {
entries.Metrics = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5645,11 +5735,10 @@ var se_GetInsightRuleReportInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_GetInsightRuleReportInput");
var se_GetMetricDataInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_MDQ] != null) {
const memberEntries = se_MetricDataQueries(input[_MDQ], context);
- if (((_a = input[_MDQ]) == null ? void 0 : _a.length) === 0) {
+ if (input[_MDQ]?.length === 0) {
entries.MetricDataQueries = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5669,8 +5758,8 @@ var se_GetMetricDataInput = /* @__PURE__ */ __name((input, context) => {
if (input[_SB] != null) {
entries[_SB] = input[_SB];
}
- if (input[_MD] != null) {
- entries[_MD] = input[_MD];
+ if (input[_MDa] != null) {
+ entries[_MDa] = input[_MDa];
}
if (input[_LO] != null) {
const memberEntries = se_LabelOptions(input[_LO], context);
@@ -5682,7 +5771,6 @@ var se_GetMetricDataInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_GetMetricDataInput");
var se_GetMetricStatisticsInput = /* @__PURE__ */ __name((input, context) => {
- var _a, _b, _c;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
@@ -5692,7 +5780,7 @@ var se_GetMetricStatisticsInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5711,7 +5799,7 @@ var se_GetMetricStatisticsInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Sta] != null) {
const memberEntries = se_Statistics(input[_Sta], context);
- if (((_b = input[_Sta]) == null ? void 0 : _b.length) === 0) {
+ if (input[_Sta]?.length === 0) {
entries.Statistics = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5721,7 +5809,7 @@ var se_GetMetricStatisticsInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_ESx] != null) {
const memberEntries = se_ExtendedStatistics(input[_ESx], context);
- if (((_c = input[_ESx]) == null ? void 0 : _c.length) === 0) {
+ if (input[_ESx]?.length === 0) {
entries.ExtendedStatistics = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5806,7 +5894,6 @@ var se_ListManagedInsightRulesInput = /* @__PURE__ */ __name((input, context) =>
return entries;
}, "se_ListManagedInsightRulesInput");
var se_ListMetricsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
@@ -5816,7 +5903,7 @@ var se_ListMetricsInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_D] != null) {
const memberEntries = se_DimensionFilters(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5856,7 +5943,6 @@ var se_ListTagsForResourceInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_ListTagsForResourceInput");
var se_ManagedRule = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_TN] != null) {
entries[_TN] = input[_TN];
@@ -5866,7 +5952,7 @@ var se_ManagedRule = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Ta] != null) {
const memberEntries = se_TagList(input[_Ta], context);
- if (((_a = input[_Ta]) == null ? void 0 : _a.length) === 0) {
+ if (input[_Ta]?.length === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5892,7 +5978,6 @@ var se_ManagedRules = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_ManagedRules");
var se_Metric = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
@@ -5902,7 +5987,7 @@ var se_Metric = /* @__PURE__ */ __name((input, context) => {
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -5961,8 +6046,8 @@ var se_MetricDataQuery = /* @__PURE__ */ __name((input, context) => {
entries[loc] = value;
});
}
- if (input[_E] != null) {
- entries[_E] = input[_E];
+ if (input[_Ex] != null) {
+ entries[_Ex] = input[_Ex];
}
if (input[_L] != null) {
entries[_L] = input[_L];
@@ -5979,14 +6064,13 @@ var se_MetricDataQuery = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_MetricDataQuery");
var se_MetricDatum = /* @__PURE__ */ __name((input, context) => {
- var _a, _b, _c;
const entries = {};
if (input[_MN] != null) {
entries[_MN] = input[_MN];
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6009,7 +6093,7 @@ var se_MetricDatum = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Val] != null) {
const memberEntries = se_Values(input[_Val], context);
- if (((_b = input[_Val]) == null ? void 0 : _b.length) === 0) {
+ if (input[_Val]?.length === 0) {
entries.Values = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6019,7 +6103,7 @@ var se_MetricDatum = /* @__PURE__ */ __name((input, context) => {
}
if (input[_C] != null) {
const memberEntries = se_Counts(input[_C], context);
- if (((_c = input[_C]) == null ? void 0 : _c.length) === 0) {
+ if (input[_C]?.length === 0) {
entries.Counts = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6036,11 +6120,10 @@ var se_MetricDatum = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_MetricDatum");
var se_MetricMathAnomalyDetector = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_MDQ] != null) {
const memberEntries = se_MetricDataQueries(input[_MDQ], context);
- if (((_a = input[_MDQ]) == null ? void 0 : _a.length) === 0) {
+ if (input[_MDQ]?.length === 0) {
entries.MetricDataQueries = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6071,14 +6154,13 @@ var se_MetricStat = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_MetricStat");
var se_MetricStreamFilter = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
}
if (input[_MNe] != null) {
const memberEntries = se_MetricStreamFilterMetricNames(input[_MNe], context);
- if (((_a = input[_MNe]) == null ? void 0 : _a.length) === 0) {
+ if (input[_MNe]?.length === 0) {
entries.MetricNames = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6140,11 +6222,10 @@ var se_MetricStreamStatisticsAdditionalStatistics = /* @__PURE__ */ __name((inpu
return entries;
}, "se_MetricStreamStatisticsAdditionalStatistics");
var se_MetricStreamStatisticsConfiguration = /* @__PURE__ */ __name((input, context) => {
- var _a, _b;
const entries = {};
if (input[_IM] != null) {
const memberEntries = se_MetricStreamStatisticsIncludeMetrics(input[_IM], context);
- if (((_a = input[_IM]) == null ? void 0 : _a.length) === 0) {
+ if (input[_IM]?.length === 0) {
entries.IncludeMetrics = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6154,7 +6235,7 @@ var se_MetricStreamStatisticsConfiguration = /* @__PURE__ */ __name((input, cont
}
if (input[_AS] != null) {
const memberEntries = se_MetricStreamStatisticsAdditionalStatistics(input[_AS], context);
- if (((_b = input[_AS]) == null ? void 0 : _b.length) === 0) {
+ if (input[_AS]?.length === 0) {
entries.AdditionalStatistics = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6205,7 +6286,6 @@ var se_MetricStreamStatisticsMetric = /* @__PURE__ */ __name((input, context) =>
return entries;
}, "se_MetricStreamStatisticsMetric");
var se_PutAnomalyDetectorInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
@@ -6215,7 +6295,7 @@ var se_PutAnomalyDetectorInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6257,14 +6337,13 @@ var se_PutAnomalyDetectorInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_PutAnomalyDetectorInput");
var se_PutCompositeAlarmInput = /* @__PURE__ */ __name((input, context) => {
- var _a, _b, _c, _d;
const entries = {};
if (input[_AE] != null) {
entries[_AE] = input[_AE];
}
if (input[_AA] != null) {
const memberEntries = se_ResourceList(input[_AA], context);
- if (((_a = input[_AA]) == null ? void 0 : _a.length) === 0) {
+ if (input[_AA]?.length === 0) {
entries.AlarmActions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6283,7 +6362,7 @@ var se_PutCompositeAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_IDA] != null) {
const memberEntries = se_ResourceList(input[_IDA], context);
- if (((_b = input[_IDA]) == null ? void 0 : _b.length) === 0) {
+ if (input[_IDA]?.length === 0) {
entries.InsufficientDataActions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6293,7 +6372,7 @@ var se_PutCompositeAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_OKA] != null) {
const memberEntries = se_ResourceList(input[_OKA], context);
- if (((_c = input[_OKA]) == null ? void 0 : _c.length) === 0) {
+ if (input[_OKA]?.length === 0) {
entries.OKActions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6303,7 +6382,7 @@ var se_PutCompositeAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Ta] != null) {
const memberEntries = se_TagList(input[_Ta], context);
- if (((_d = input[_Ta]) == null ? void 0 : _d.length) === 0) {
+ if (input[_Ta]?.length === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6333,7 +6412,6 @@ var se_PutDashboardInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_PutDashboardInput");
var se_PutInsightRuleInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RNu] != null) {
entries[_RNu] = input[_RNu];
@@ -6346,7 +6424,7 @@ var se_PutInsightRuleInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Ta] != null) {
const memberEntries = se_TagList(input[_Ta], context);
- if (((_a = input[_Ta]) == null ? void 0 : _a.length) === 0) {
+ if (input[_Ta]?.length === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6357,11 +6435,10 @@ var se_PutInsightRuleInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_PutInsightRuleInput");
var se_PutManagedInsightRulesInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_MRan] != null) {
const memberEntries = se_ManagedRules(input[_MRan], context);
- if (((_a = input[_MRan]) == null ? void 0 : _a.length) === 0) {
+ if (input[_MRan]?.length === 0) {
entries.ManagedRules = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6372,7 +6449,6 @@ var se_PutManagedInsightRulesInput = /* @__PURE__ */ __name((input, context) =>
return entries;
}, "se_PutManagedInsightRulesInput");
var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
- var _a, _b, _c, _d, _e2, _f;
const entries = {};
if (input[_ANl] != null) {
entries[_ANl] = input[_ANl];
@@ -6385,7 +6461,7 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_OKA] != null) {
const memberEntries = se_ResourceList(input[_OKA], context);
- if (((_a = input[_OKA]) == null ? void 0 : _a.length) === 0) {
+ if (input[_OKA]?.length === 0) {
entries.OKActions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6395,7 +6471,7 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_AA] != null) {
const memberEntries = se_ResourceList(input[_AA], context);
- if (((_b = input[_AA]) == null ? void 0 : _b.length) === 0) {
+ if (input[_AA]?.length === 0) {
entries.AlarmActions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6405,7 +6481,7 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_IDA] != null) {
const memberEntries = se_ResourceList(input[_IDA], context);
- if (((_c = input[_IDA]) == null ? void 0 : _c.length) === 0) {
+ if (input[_IDA]?.length === 0) {
entries.InsufficientDataActions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6427,7 +6503,7 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_d = input[_D]) == null ? void 0 : _d.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6461,7 +6537,7 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_M] != null) {
const memberEntries = se_MetricDataQueries(input[_M], context);
- if (((_e2 = input[_M]) == null ? void 0 : _e2.length) === 0) {
+ if (input[_M]?.length === 0) {
entries.Metrics = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6471,7 +6547,7 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Ta] != null) {
const memberEntries = se_TagList(input[_Ta], context);
- if (((_f = input[_Ta]) == null ? void 0 : _f.length) === 0) {
+ if (input[_Ta]?.length === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6485,14 +6561,13 @@ var se_PutMetricAlarmInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_PutMetricAlarmInput");
var se_PutMetricDataInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
}
- if (input[_MDe] != null) {
- const memberEntries = se_MetricData(input[_MDe], context);
- if (((_a = input[_MDe]) == null ? void 0 : _a.length) === 0) {
+ if (input[_MD] != null) {
+ const memberEntries = se_MetricData(input[_MD], context);
+ if (input[_MD]?.length === 0) {
entries.MetricData = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6500,17 +6575,29 @@ var se_PutMetricDataInput = /* @__PURE__ */ __name((input, context) => {
entries[loc] = value;
});
}
+ if (input[_EMD] != null) {
+ const memberEntries = se_EntityMetricDataList(input[_EMD], context);
+ if (input[_EMD]?.length === 0) {
+ entries.EntityMetricData = [];
+ }
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `EntityMetricData.${key}`;
+ entries[loc] = value;
+ });
+ }
+ if (input[_SEV] != null) {
+ entries[_SEV] = input[_SEV];
+ }
return entries;
}, "se_PutMetricDataInput");
var se_PutMetricStreamInput = /* @__PURE__ */ __name((input, context) => {
- var _a, _b, _c, _d;
const entries = {};
if (input[_Na] != null) {
entries[_Na] = input[_Na];
}
if (input[_IF] != null) {
const memberEntries = se_MetricStreamFilters(input[_IF], context);
- if (((_a = input[_IF]) == null ? void 0 : _a.length) === 0) {
+ if (input[_IF]?.length === 0) {
entries.IncludeFilters = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6520,7 +6607,7 @@ var se_PutMetricStreamInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_EF] != null) {
const memberEntries = se_MetricStreamFilters(input[_EF], context);
- if (((_b = input[_EF]) == null ? void 0 : _b.length) === 0) {
+ if (input[_EF]?.length === 0) {
entries.ExcludeFilters = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6539,7 +6626,7 @@ var se_PutMetricStreamInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_Ta] != null) {
const memberEntries = se_TagList(input[_Ta], context);
- if (((_c = input[_Ta]) == null ? void 0 : _c.length) === 0) {
+ if (input[_Ta]?.length === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6549,7 +6636,7 @@ var se_PutMetricStreamInput = /* @__PURE__ */ __name((input, context) => {
}
if (input[_SC] != null) {
const memberEntries = se_MetricStreamStatisticsConfigurations(input[_SC], context);
- if (((_d = input[_SC]) == null ? void 0 : _d.length) === 0) {
+ if (input[_SC]?.length === 0) {
entries.StatisticsConfigurations = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6601,7 +6688,6 @@ var se_SetAlarmStateInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_SetAlarmStateInput");
var se_SingleMetricAnomalyDetector = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_AI] != null) {
entries[_AI] = input[_AI];
@@ -6614,7 +6700,7 @@ var se_SingleMetricAnomalyDetector = /* @__PURE__ */ __name((input, context) =>
}
if (input[_D] != null) {
const memberEntries = se_Dimensions(input[_D], context);
- if (((_a = input[_D]) == null ? void 0 : _a.length) === 0) {
+ if (input[_D]?.length === 0) {
entries.Dimensions = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6628,11 +6714,10 @@ var se_SingleMetricAnomalyDetector = /* @__PURE__ */ __name((input, context) =>
return entries;
}, "se_SingleMetricAnomalyDetector");
var se_StartMetricStreamsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_Nam] != null) {
const memberEntries = se_MetricStreamNames(input[_Nam], context);
- if (((_a = input[_Nam]) == null ? void 0 : _a.length) === 0) {
+ if (input[_Nam]?.length === 0) {
entries.Names = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6671,11 +6756,10 @@ var se_StatisticSet = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_StatisticSet");
var se_StopMetricStreamsInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_Nam] != null) {
const memberEntries = se_MetricStreamNames(input[_Nam], context);
- if (((_a = input[_Nam]) == null ? void 0 : _a.length) === 0) {
+ if (input[_Nam]?.length === 0) {
entries.Names = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6723,14 +6807,13 @@ var se_TagList = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_TagList");
var se_TagResourceInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RARN] != null) {
entries[_RARN] = input[_RARN];
}
if (input[_Ta] != null) {
const memberEntries = se_TagList(input[_Ta], context);
- if (((_a = input[_Ta]) == null ? void 0 : _a.length) === 0) {
+ if (input[_Ta]?.length === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -6741,14 +6824,13 @@ var se_TagResourceInput = /* @__PURE__ */ __name((input, context) => {
return entries;
}, "se_TagResourceInput");
var se_UntagResourceInput = /* @__PURE__ */ __name((input, context) => {
- var _a;
const entries = {};
if (input[_RARN] != null) {
entries[_RARN] = input[_RARN];
}
if (input[_TK] != null) {
const memberEntries = se_TagKeyList(input[_TK], context);
- if (((_a = input[_TK]) == null ? void 0 : _a.length) === 0) {
+ if (input[_TK]?.length === 0) {
entries.TagKeys = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
@@ -7184,9 +7266,9 @@ var de_GetInsightRuleReportOutput = /* @__PURE__ */ __name((output, context) =>
contents[_Con] = de_InsightRuleContributors((0, import_smithy_client.getArrayIfSingleItem)(output[_Con][_m]), context);
}
if (output.MetricDatapoints === "") {
- contents[_MDet] = [];
- } else if (output[_MDet] != null && output[_MDet][_m] != null) {
- contents[_MDet] = de_InsightRuleMetricDatapoints((0, import_smithy_client.getArrayIfSingleItem)(output[_MDet][_m]), context);
+ contents[_MDe] = [];
+ } else if (output[_MDe] != null && output[_MDe][_m] != null) {
+ contents[_MDe] = de_InsightRuleMetricDatapoints((0, import_smithy_client.getArrayIfSingleItem)(output[_MDe][_m]), context);
}
return contents;
}, "de_GetInsightRuleReportOutput");
@@ -7666,8 +7748,8 @@ var de_MetricDataQuery = /* @__PURE__ */ __name((output, context) => {
if (output[_MS] != null) {
contents[_MS] = de_MetricStat(output[_MS], context);
}
- if (output[_E] != null) {
- contents[_E] = (0, import_smithy_client.expectString)(output[_E]);
+ if (output[_Ex] != null) {
+ contents[_Ex] = (0, import_smithy_client.expectString)(output[_Ex]);
}
if (output[_L] != null) {
contents[_L] = (0, import_smithy_client.expectString)(output[_L]);
@@ -8053,6 +8135,7 @@ var _AUC = "ApproximateUniqueCount";
var _AV = "AggregateValue";
var _AVp = "ApproximateValue";
var _Ar = "Arn";
+var _At = "Attributes";
var _Av = "Average";
var _C = "Counts";
var _CA = "CompositeAlarms";
@@ -8086,12 +8169,13 @@ var _DTA = "DatapointsToAlarm";
var _DVM = "DashboardValidationMessages";
var _Da = "Datapoints";
var _De = "Definition";
-var _E = "Expression";
+var _E = "Entity";
var _EAA = "EnableAlarmActions";
var _ED = "EndDate";
var _EF = "ExcludeFilters";
var _EIR = "EnableInsightRules";
var _ELSCP = "EvaluateLowSampleCountPercentile";
+var _EMD = "EntityMetricData";
var _EP = "EvaluationPeriods";
var _ES = "ExtendedStatistic";
var _ESv = "EvaluationState";
@@ -8100,6 +8184,7 @@ var _ET = "EndTime";
var _ETR = "ExcludedTimeRanges";
var _ETx = "ExceptionType";
var _En = "Entries";
+var _Ex = "Expression";
var _F = "Failures";
var _FA = "FirehoseArn";
var _FC = "FailureCode";
@@ -8122,6 +8207,7 @@ var _ILAM = "IncludeLinkedAccountsMetrics";
var _IM = "IncludeMetrics";
var _IR = "InsightRules";
var _K = "Key";
+var _KA = "KeyAttributes";
var _KL = "KeyLabels";
var _Ke = "Keys";
var _L = "Label";
@@ -8138,11 +8224,11 @@ var _MA = "MetricAlarms";
var _MC = "MetricCharacteristics";
var _MCC = "MaxContributorCount";
var _MCV = "MaxContributorValue";
-var _MD = "MaxDatapoints";
+var _MD = "MetricData";
var _MDQ = "MetricDataQueries";
var _MDR = "MetricDataResults";
-var _MDe = "MetricData";
-var _MDet = "MetricDatapoints";
+var _MDa = "MaxDatapoints";
+var _MDe = "MetricDatapoints";
var _MMAD = "MetricMathAnomalyDetector";
var _MN = "MetricName";
var _MNe = "MetricNames";
@@ -8196,6 +8282,7 @@ var _SC = "StatisticsConfigurations";
var _SCa = "SampleCount";
var _SCt = "StatusCode";
var _SD = "StartDate";
+var _SEV = "StrictEntityValidation";
var _SMAD = "SingleMetricAnomalyDetector";
var _SMS = "StartMetricStreams";
var _SMSt = "StopMetricStreams";
@@ -8235,8 +8322,7 @@ var _m = "member";
var _me = "message";
var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString");
var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
- var _a;
- if (((_a = data.Error) == null ? void 0 : _a.Code) !== void 0) {
+ if (data.Error?.Code !== void 0) {
return data.Error.Code;
}
if (output.statusCode == 404) {
@@ -8245,442 +8331,473 @@ var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
}, "loadQueryErrorCode");
// src/commands/DeleteAlarmsCommand.ts
-var _DeleteAlarmsCommand = class _DeleteAlarmsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DeleteAlarmsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DeleteAlarms", {}).n("CloudWatchClient", "DeleteAlarmsCommand").f(void 0, void 0).ser(se_DeleteAlarmsCommand).de(de_DeleteAlarmsCommand).build() {
+ static {
+ __name(this, "DeleteAlarmsCommand");
+ }
};
-__name(_DeleteAlarmsCommand, "DeleteAlarmsCommand");
-var DeleteAlarmsCommand = _DeleteAlarmsCommand;
// src/commands/DeleteAnomalyDetectorCommand.ts
-var _DeleteAnomalyDetectorCommand = class _DeleteAnomalyDetectorCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DeleteAnomalyDetectorCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DeleteAnomalyDetector", {}).n("CloudWatchClient", "DeleteAnomalyDetectorCommand").f(void 0, void 0).ser(se_DeleteAnomalyDetectorCommand).de(de_DeleteAnomalyDetectorCommand).build() {
+ static {
+ __name(this, "DeleteAnomalyDetectorCommand");
+ }
};
-__name(_DeleteAnomalyDetectorCommand, "DeleteAnomalyDetectorCommand");
-var DeleteAnomalyDetectorCommand = _DeleteAnomalyDetectorCommand;
// src/commands/DeleteDashboardsCommand.ts
-var _DeleteDashboardsCommand = class _DeleteDashboardsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DeleteDashboardsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DeleteDashboards", {}).n("CloudWatchClient", "DeleteDashboardsCommand").f(void 0, void 0).ser(se_DeleteDashboardsCommand).de(de_DeleteDashboardsCommand).build() {
+ static {
+ __name(this, "DeleteDashboardsCommand");
+ }
};
-__name(_DeleteDashboardsCommand, "DeleteDashboardsCommand");
-var DeleteDashboardsCommand = _DeleteDashboardsCommand;
// src/commands/DeleteInsightRulesCommand.ts
-var _DeleteInsightRulesCommand = class _DeleteInsightRulesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DeleteInsightRulesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DeleteInsightRules", {}).n("CloudWatchClient", "DeleteInsightRulesCommand").f(void 0, void 0).ser(se_DeleteInsightRulesCommand).de(de_DeleteInsightRulesCommand).build() {
+ static {
+ __name(this, "DeleteInsightRulesCommand");
+ }
};
-__name(_DeleteInsightRulesCommand, "DeleteInsightRulesCommand");
-var DeleteInsightRulesCommand = _DeleteInsightRulesCommand;
// src/commands/DeleteMetricStreamCommand.ts
-var _DeleteMetricStreamCommand = class _DeleteMetricStreamCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DeleteMetricStreamCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DeleteMetricStream", {}).n("CloudWatchClient", "DeleteMetricStreamCommand").f(void 0, void 0).ser(se_DeleteMetricStreamCommand).de(de_DeleteMetricStreamCommand).build() {
+ static {
+ __name(this, "DeleteMetricStreamCommand");
+ }
};
-__name(_DeleteMetricStreamCommand, "DeleteMetricStreamCommand");
-var DeleteMetricStreamCommand = _DeleteMetricStreamCommand;
// src/commands/DescribeAlarmHistoryCommand.ts
-var _DescribeAlarmHistoryCommand = class _DescribeAlarmHistoryCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DescribeAlarmHistoryCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DescribeAlarmHistory", {}).n("CloudWatchClient", "DescribeAlarmHistoryCommand").f(void 0, void 0).ser(se_DescribeAlarmHistoryCommand).de(de_DescribeAlarmHistoryCommand).build() {
+ static {
+ __name(this, "DescribeAlarmHistoryCommand");
+ }
};
-__name(_DescribeAlarmHistoryCommand, "DescribeAlarmHistoryCommand");
-var DescribeAlarmHistoryCommand = _DescribeAlarmHistoryCommand;
// src/commands/DescribeAlarmsCommand.ts
-var _DescribeAlarmsCommand = class _DescribeAlarmsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DescribeAlarmsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DescribeAlarms", {}).n("CloudWatchClient", "DescribeAlarmsCommand").f(void 0, void 0).ser(se_DescribeAlarmsCommand).de(de_DescribeAlarmsCommand).build() {
+ static {
+ __name(this, "DescribeAlarmsCommand");
+ }
};
-__name(_DescribeAlarmsCommand, "DescribeAlarmsCommand");
-var DescribeAlarmsCommand = _DescribeAlarmsCommand;
// src/commands/DescribeAlarmsForMetricCommand.ts
-var _DescribeAlarmsForMetricCommand = class _DescribeAlarmsForMetricCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DescribeAlarmsForMetricCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DescribeAlarmsForMetric", {}).n("CloudWatchClient", "DescribeAlarmsForMetricCommand").f(void 0, void 0).ser(se_DescribeAlarmsForMetricCommand).de(de_DescribeAlarmsForMetricCommand).build() {
+ static {
+ __name(this, "DescribeAlarmsForMetricCommand");
+ }
};
-__name(_DescribeAlarmsForMetricCommand, "DescribeAlarmsForMetricCommand");
-var DescribeAlarmsForMetricCommand = _DescribeAlarmsForMetricCommand;
// src/commands/DescribeAnomalyDetectorsCommand.ts
-var _DescribeAnomalyDetectorsCommand = class _DescribeAnomalyDetectorsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DescribeAnomalyDetectorsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DescribeAnomalyDetectors", {}).n("CloudWatchClient", "DescribeAnomalyDetectorsCommand").f(void 0, void 0).ser(se_DescribeAnomalyDetectorsCommand).de(de_DescribeAnomalyDetectorsCommand).build() {
+ static {
+ __name(this, "DescribeAnomalyDetectorsCommand");
+ }
};
-__name(_DescribeAnomalyDetectorsCommand, "DescribeAnomalyDetectorsCommand");
-var DescribeAnomalyDetectorsCommand = _DescribeAnomalyDetectorsCommand;
// src/commands/DescribeInsightRulesCommand.ts
-var _DescribeInsightRulesCommand = class _DescribeInsightRulesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DescribeInsightRulesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DescribeInsightRules", {}).n("CloudWatchClient", "DescribeInsightRulesCommand").f(void 0, void 0).ser(se_DescribeInsightRulesCommand).de(de_DescribeInsightRulesCommand).build() {
+ static {
+ __name(this, "DescribeInsightRulesCommand");
+ }
};
-__name(_DescribeInsightRulesCommand, "DescribeInsightRulesCommand");
-var DescribeInsightRulesCommand = _DescribeInsightRulesCommand;
// src/commands/DisableAlarmActionsCommand.ts
-var _DisableAlarmActionsCommand = class _DisableAlarmActionsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DisableAlarmActionsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DisableAlarmActions", {}).n("CloudWatchClient", "DisableAlarmActionsCommand").f(void 0, void 0).ser(se_DisableAlarmActionsCommand).de(de_DisableAlarmActionsCommand).build() {
+ static {
+ __name(this, "DisableAlarmActionsCommand");
+ }
};
-__name(_DisableAlarmActionsCommand, "DisableAlarmActionsCommand");
-var DisableAlarmActionsCommand = _DisableAlarmActionsCommand;
// src/commands/DisableInsightRulesCommand.ts
-var _DisableInsightRulesCommand = class _DisableInsightRulesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var DisableInsightRulesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "DisableInsightRules", {}).n("CloudWatchClient", "DisableInsightRulesCommand").f(void 0, void 0).ser(se_DisableInsightRulesCommand).de(de_DisableInsightRulesCommand).build() {
+ static {
+ __name(this, "DisableInsightRulesCommand");
+ }
};
-__name(_DisableInsightRulesCommand, "DisableInsightRulesCommand");
-var DisableInsightRulesCommand = _DisableInsightRulesCommand;
// src/commands/EnableAlarmActionsCommand.ts
-var _EnableAlarmActionsCommand = class _EnableAlarmActionsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var EnableAlarmActionsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "EnableAlarmActions", {}).n("CloudWatchClient", "EnableAlarmActionsCommand").f(void 0, void 0).ser(se_EnableAlarmActionsCommand).de(de_EnableAlarmActionsCommand).build() {
+ static {
+ __name(this, "EnableAlarmActionsCommand");
+ }
};
-__name(_EnableAlarmActionsCommand, "EnableAlarmActionsCommand");
-var EnableAlarmActionsCommand = _EnableAlarmActionsCommand;
// src/commands/EnableInsightRulesCommand.ts
-var _EnableInsightRulesCommand = class _EnableInsightRulesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var EnableInsightRulesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "EnableInsightRules", {}).n("CloudWatchClient", "EnableInsightRulesCommand").f(void 0, void 0).ser(se_EnableInsightRulesCommand).de(de_EnableInsightRulesCommand).build() {
+ static {
+ __name(this, "EnableInsightRulesCommand");
+ }
};
-__name(_EnableInsightRulesCommand, "EnableInsightRulesCommand");
-var EnableInsightRulesCommand = _EnableInsightRulesCommand;
// src/commands/GetDashboardCommand.ts
-var _GetDashboardCommand = class _GetDashboardCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var GetDashboardCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "GetDashboard", {}).n("CloudWatchClient", "GetDashboardCommand").f(void 0, void 0).ser(se_GetDashboardCommand).de(de_GetDashboardCommand).build() {
+ static {
+ __name(this, "GetDashboardCommand");
+ }
};
-__name(_GetDashboardCommand, "GetDashboardCommand");
-var GetDashboardCommand = _GetDashboardCommand;
// src/commands/GetInsightRuleReportCommand.ts
-var _GetInsightRuleReportCommand = class _GetInsightRuleReportCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var GetInsightRuleReportCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "GetInsightRuleReport", {}).n("CloudWatchClient", "GetInsightRuleReportCommand").f(void 0, void 0).ser(se_GetInsightRuleReportCommand).de(de_GetInsightRuleReportCommand).build() {
+ static {
+ __name(this, "GetInsightRuleReportCommand");
+ }
};
-__name(_GetInsightRuleReportCommand, "GetInsightRuleReportCommand");
-var GetInsightRuleReportCommand = _GetInsightRuleReportCommand;
// src/commands/GetMetricDataCommand.ts
-var _GetMetricDataCommand = class _GetMetricDataCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var GetMetricDataCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "GetMetricData", {}).n("CloudWatchClient", "GetMetricDataCommand").f(void 0, void 0).ser(se_GetMetricDataCommand).de(de_GetMetricDataCommand).build() {
+ static {
+ __name(this, "GetMetricDataCommand");
+ }
};
-__name(_GetMetricDataCommand, "GetMetricDataCommand");
-var GetMetricDataCommand = _GetMetricDataCommand;
// src/commands/GetMetricStatisticsCommand.ts
-var _GetMetricStatisticsCommand = class _GetMetricStatisticsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var GetMetricStatisticsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "GetMetricStatistics", {}).n("CloudWatchClient", "GetMetricStatisticsCommand").f(void 0, void 0).ser(se_GetMetricStatisticsCommand).de(de_GetMetricStatisticsCommand).build() {
+ static {
+ __name(this, "GetMetricStatisticsCommand");
+ }
};
-__name(_GetMetricStatisticsCommand, "GetMetricStatisticsCommand");
-var GetMetricStatisticsCommand = _GetMetricStatisticsCommand;
// src/commands/GetMetricStreamCommand.ts
-var _GetMetricStreamCommand = class _GetMetricStreamCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var GetMetricStreamCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "GetMetricStream", {}).n("CloudWatchClient", "GetMetricStreamCommand").f(void 0, void 0).ser(se_GetMetricStreamCommand).de(de_GetMetricStreamCommand).build() {
+ static {
+ __name(this, "GetMetricStreamCommand");
+ }
};
-__name(_GetMetricStreamCommand, "GetMetricStreamCommand");
-var GetMetricStreamCommand = _GetMetricStreamCommand;
// src/commands/GetMetricWidgetImageCommand.ts
-var _GetMetricWidgetImageCommand = class _GetMetricWidgetImageCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var GetMetricWidgetImageCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "GetMetricWidgetImage", {}).n("CloudWatchClient", "GetMetricWidgetImageCommand").f(void 0, void 0).ser(se_GetMetricWidgetImageCommand).de(de_GetMetricWidgetImageCommand).build() {
+ static {
+ __name(this, "GetMetricWidgetImageCommand");
+ }
};
-__name(_GetMetricWidgetImageCommand, "GetMetricWidgetImageCommand");
-var GetMetricWidgetImageCommand = _GetMetricWidgetImageCommand;
// src/commands/ListDashboardsCommand.ts
-var _ListDashboardsCommand = class _ListDashboardsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListDashboardsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "ListDashboards", {}).n("CloudWatchClient", "ListDashboardsCommand").f(void 0, void 0).ser(se_ListDashboardsCommand).de(de_ListDashboardsCommand).build() {
+ static {
+ __name(this, "ListDashboardsCommand");
+ }
};
-__name(_ListDashboardsCommand, "ListDashboardsCommand");
-var ListDashboardsCommand = _ListDashboardsCommand;
// src/commands/ListManagedInsightRulesCommand.ts
-var _ListManagedInsightRulesCommand = class _ListManagedInsightRulesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListManagedInsightRulesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "ListManagedInsightRules", {}).n("CloudWatchClient", "ListManagedInsightRulesCommand").f(void 0, void 0).ser(se_ListManagedInsightRulesCommand).de(de_ListManagedInsightRulesCommand).build() {
+ static {
+ __name(this, "ListManagedInsightRulesCommand");
+ }
};
-__name(_ListManagedInsightRulesCommand, "ListManagedInsightRulesCommand");
-var ListManagedInsightRulesCommand = _ListManagedInsightRulesCommand;
// src/commands/ListMetricsCommand.ts
-var _ListMetricsCommand = class _ListMetricsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListMetricsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "ListMetrics", {}).n("CloudWatchClient", "ListMetricsCommand").f(void 0, void 0).ser(se_ListMetricsCommand).de(de_ListMetricsCommand).build() {
+ static {
+ __name(this, "ListMetricsCommand");
+ }
};
-__name(_ListMetricsCommand, "ListMetricsCommand");
-var ListMetricsCommand = _ListMetricsCommand;
// src/commands/ListMetricStreamsCommand.ts
-var _ListMetricStreamsCommand = class _ListMetricStreamsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListMetricStreamsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "ListMetricStreams", {}).n("CloudWatchClient", "ListMetricStreamsCommand").f(void 0, void 0).ser(se_ListMetricStreamsCommand).de(de_ListMetricStreamsCommand).build() {
+ static {
+ __name(this, "ListMetricStreamsCommand");
+ }
};
-__name(_ListMetricStreamsCommand, "ListMetricStreamsCommand");
-var ListMetricStreamsCommand = _ListMetricStreamsCommand;
// src/commands/ListTagsForResourceCommand.ts
-var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListTagsForResourceCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "ListTagsForResource", {}).n("CloudWatchClient", "ListTagsForResourceCommand").f(void 0, void 0).ser(se_ListTagsForResourceCommand).de(de_ListTagsForResourceCommand).build() {
+ static {
+ __name(this, "ListTagsForResourceCommand");
+ }
};
-__name(_ListTagsForResourceCommand, "ListTagsForResourceCommand");
-var ListTagsForResourceCommand = _ListTagsForResourceCommand;
// src/commands/PutAnomalyDetectorCommand.ts
-var _PutAnomalyDetectorCommand = class _PutAnomalyDetectorCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutAnomalyDetectorCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutAnomalyDetector", {}).n("CloudWatchClient", "PutAnomalyDetectorCommand").f(void 0, void 0).ser(se_PutAnomalyDetectorCommand).de(de_PutAnomalyDetectorCommand).build() {
+ static {
+ __name(this, "PutAnomalyDetectorCommand");
+ }
};
-__name(_PutAnomalyDetectorCommand, "PutAnomalyDetectorCommand");
-var PutAnomalyDetectorCommand = _PutAnomalyDetectorCommand;
// src/commands/PutCompositeAlarmCommand.ts
-var _PutCompositeAlarmCommand = class _PutCompositeAlarmCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutCompositeAlarmCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutCompositeAlarm", {}).n("CloudWatchClient", "PutCompositeAlarmCommand").f(void 0, void 0).ser(se_PutCompositeAlarmCommand).de(de_PutCompositeAlarmCommand).build() {
+ static {
+ __name(this, "PutCompositeAlarmCommand");
+ }
};
-__name(_PutCompositeAlarmCommand, "PutCompositeAlarmCommand");
-var PutCompositeAlarmCommand = _PutCompositeAlarmCommand;
// src/commands/PutDashboardCommand.ts
-var _PutDashboardCommand = class _PutDashboardCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutDashboardCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutDashboard", {}).n("CloudWatchClient", "PutDashboardCommand").f(void 0, void 0).ser(se_PutDashboardCommand).de(de_PutDashboardCommand).build() {
+ static {
+ __name(this, "PutDashboardCommand");
+ }
};
-__name(_PutDashboardCommand, "PutDashboardCommand");
-var PutDashboardCommand = _PutDashboardCommand;
// src/commands/PutInsightRuleCommand.ts
-var _PutInsightRuleCommand = class _PutInsightRuleCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutInsightRuleCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutInsightRule", {}).n("CloudWatchClient", "PutInsightRuleCommand").f(void 0, void 0).ser(se_PutInsightRuleCommand).de(de_PutInsightRuleCommand).build() {
+ static {
+ __name(this, "PutInsightRuleCommand");
+ }
};
-__name(_PutInsightRuleCommand, "PutInsightRuleCommand");
-var PutInsightRuleCommand = _PutInsightRuleCommand;
// src/commands/PutManagedInsightRulesCommand.ts
-var _PutManagedInsightRulesCommand = class _PutManagedInsightRulesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutManagedInsightRulesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutManagedInsightRules", {}).n("CloudWatchClient", "PutManagedInsightRulesCommand").f(void 0, void 0).ser(se_PutManagedInsightRulesCommand).de(de_PutManagedInsightRulesCommand).build() {
+ static {
+ __name(this, "PutManagedInsightRulesCommand");
+ }
};
-__name(_PutManagedInsightRulesCommand, "PutManagedInsightRulesCommand");
-var PutManagedInsightRulesCommand = _PutManagedInsightRulesCommand;
// src/commands/PutMetricAlarmCommand.ts
-var _PutMetricAlarmCommand = class _PutMetricAlarmCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutMetricAlarmCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutMetricAlarm", {}).n("CloudWatchClient", "PutMetricAlarmCommand").f(void 0, void 0).ser(se_PutMetricAlarmCommand).de(de_PutMetricAlarmCommand).build() {
+ static {
+ __name(this, "PutMetricAlarmCommand");
+ }
};
-__name(_PutMetricAlarmCommand, "PutMetricAlarmCommand");
-var PutMetricAlarmCommand = _PutMetricAlarmCommand;
// src/commands/PutMetricDataCommand.ts
-var _PutMetricDataCommand = class _PutMetricDataCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutMetricDataCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
@@ -8689,93 +8806,100 @@ var _PutMetricDataCommand = class _PutMetricDataCommand extends import_smithy_cl
})
];
}).s("GraniteServiceVersion20100801", "PutMetricData", {}).n("CloudWatchClient", "PutMetricDataCommand").f(void 0, void 0).ser(se_PutMetricDataCommand).de(de_PutMetricDataCommand).build() {
+ static {
+ __name(this, "PutMetricDataCommand");
+ }
};
-__name(_PutMetricDataCommand, "PutMetricDataCommand");
-var PutMetricDataCommand = _PutMetricDataCommand;
// src/commands/PutMetricStreamCommand.ts
-var _PutMetricStreamCommand = class _PutMetricStreamCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var PutMetricStreamCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "PutMetricStream", {}).n("CloudWatchClient", "PutMetricStreamCommand").f(void 0, void 0).ser(se_PutMetricStreamCommand).de(de_PutMetricStreamCommand).build() {
+ static {
+ __name(this, "PutMetricStreamCommand");
+ }
};
-__name(_PutMetricStreamCommand, "PutMetricStreamCommand");
-var PutMetricStreamCommand = _PutMetricStreamCommand;
// src/commands/SetAlarmStateCommand.ts
-var _SetAlarmStateCommand = class _SetAlarmStateCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var SetAlarmStateCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "SetAlarmState", {}).n("CloudWatchClient", "SetAlarmStateCommand").f(void 0, void 0).ser(se_SetAlarmStateCommand).de(de_SetAlarmStateCommand).build() {
+ static {
+ __name(this, "SetAlarmStateCommand");
+ }
};
-__name(_SetAlarmStateCommand, "SetAlarmStateCommand");
-var SetAlarmStateCommand = _SetAlarmStateCommand;
// src/commands/StartMetricStreamsCommand.ts
-var _StartMetricStreamsCommand = class _StartMetricStreamsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var StartMetricStreamsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "StartMetricStreams", {}).n("CloudWatchClient", "StartMetricStreamsCommand").f(void 0, void 0).ser(se_StartMetricStreamsCommand).de(de_StartMetricStreamsCommand).build() {
+ static {
+ __name(this, "StartMetricStreamsCommand");
+ }
};
-__name(_StartMetricStreamsCommand, "StartMetricStreamsCommand");
-var StartMetricStreamsCommand = _StartMetricStreamsCommand;
// src/commands/StopMetricStreamsCommand.ts
-var _StopMetricStreamsCommand = class _StopMetricStreamsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var StopMetricStreamsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "StopMetricStreams", {}).n("CloudWatchClient", "StopMetricStreamsCommand").f(void 0, void 0).ser(se_StopMetricStreamsCommand).de(de_StopMetricStreamsCommand).build() {
+ static {
+ __name(this, "StopMetricStreamsCommand");
+ }
};
-__name(_StopMetricStreamsCommand, "StopMetricStreamsCommand");
-var StopMetricStreamsCommand = _StopMetricStreamsCommand;
// src/commands/TagResourceCommand.ts
-var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var TagResourceCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "TagResource", {}).n("CloudWatchClient", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() {
+ static {
+ __name(this, "TagResourceCommand");
+ }
};
-__name(_TagResourceCommand, "TagResourceCommand");
-var TagResourceCommand = _TagResourceCommand;
// src/commands/UntagResourceCommand.ts
-var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var UntagResourceCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
}).s("GraniteServiceVersion20100801", "UntagResource", {}).n("CloudWatchClient", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() {
+ static {
+ __name(this, "UntagResourceCommand");
+ }
};
-__name(_UntagResourceCommand, "UntagResourceCommand");
-var UntagResourceCommand = _UntagResourceCommand;
// src/CloudWatch.ts
var commands = {
@@ -8818,10 +8942,11 @@ var commands = {
TagResourceCommand,
UntagResourceCommand
};
-var _CloudWatch = class _CloudWatch extends CloudWatchClient {
+var CloudWatch = class extends CloudWatchClient {
+ static {
+ __name(this, "CloudWatch");
+ }
};
-__name(_CloudWatch, "CloudWatch");
-var CloudWatch = _CloudWatch;
(0, import_smithy_client.createAggregatedClient)(commands, CloudWatch);
// src/pagination/DescribeAlarmHistoryPaginator.ts
@@ -8960,6 +9085,7 @@ const getRuntimeConfig = (config) => {
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
+ const profileConfig = { profile: config?.profile };
return {
...clientSharedValues,
...config,
@@ -8969,21 +9095,23 @@ const getRuntimeConfig = (config) => {
credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
(0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
- disableRequestCompression: config?.disableRequestCompression ?? (0, node_config_provider_1.loadConfig)(middleware_compression_1.NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS),
- maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
- region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
+ disableRequestCompression: config?.disableRequestCompression ?? (0, node_config_provider_1.loadConfig)(middleware_compression_1.NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config),
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
+ region: config?.region ??
+ (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
- requestMinCompressionSizeBytes: config?.requestMinCompressionSizeBytes ?? (0, node_config_provider_1.loadConfig)(middleware_compression_1.NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS),
+ requestMinCompressionSizeBytes: config?.requestMinCompressionSizeBytes ??
+ (0, node_config_provider_1.loadConfig)(middleware_compression_1.NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config),
retryMode: config?.retryMode ??
(0, node_config_provider_1.loadConfig)({
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
- }),
+ }, config),
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
- useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
- userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS),
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
};
};
exports.getRuntimeConfig = getRuntimeConfig;
@@ -9032,15 +9160,15 @@ exports.getRuntimeConfig = getRuntimeConfig;
/***/ }),
-/***/ 55295:
+/***/ 62041:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.resolveHttpAuthSchemeConfig = exports.defaultSSOOIDCHttpAuthSchemeProvider = exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0;
+exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;
const core_1 = __nccwpck_require__(8704);
const util_middleware_1 = __nccwpck_require__(76324);
-const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
+const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
return {
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
@@ -9049,12 +9177,12 @@ const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, i
})(),
};
};
-exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider;
+exports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;
function createAwsAuthSigv4HttpAuthOption(authParameters) {
return {
schemeId: "aws.auth#sigv4",
signingProperties: {
- name: "sso-oauth",
+ name: "awsssoportal",
region: authParameters.region,
},
propertiesExtractor: (config, context) => ({
@@ -9070,18 +9198,22 @@ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
schemeId: "smithy.api#noAuth",
};
}
-const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
+const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
const options = [];
switch (authParameters.operation) {
- case "CreateToken": {
+ case "GetRoleCredentials": {
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
+ break;
+ }
+ case "ListAccountRoles": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
- case "RegisterClient": {
+ case "ListAccounts": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
- case "StartDeviceAuthorization": {
+ case "Logout": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
@@ -9091,7 +9223,7 @@ const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
}
return options;
};
-exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider;
+exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;
const resolveHttpAuthSchemeConfig = (config) => {
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
return {
@@ -9103,7 +9235,7 @@ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
/***/ }),
-/***/ 18569:
+/***/ 13903:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
@@ -9111,7 +9243,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.defaultEndpointResolver = void 0;
const util_endpoints_1 = __nccwpck_require__(83068);
const util_endpoints_2 = __nccwpck_require__(79674);
-const ruleset_1 = __nccwpck_require__(78722);
+const ruleset_1 = __nccwpck_require__(41308);
const cache = new util_endpoints_2.EndpointCache({
size: 50,
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
@@ -9128,7 +9260,7 @@ util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunct
/***/ }),
-/***/ 78722:
+/***/ 41308:
/***/ ((__unused_webpack_module, exports) => {
@@ -9136,13 +9268,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ruleSet = void 0;
const u = "required", v = "fn", w = "argv", x = "ref";
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" }];
-const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
+const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
exports.ruleSet = _data;
/***/ }),
-/***/ 29260:
+/***/ 62054:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
@@ -9166,40 +9298,32 @@ var __copyProps = (to, from, except, desc) => {
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- AccessDeniedException: () => AccessDeniedException,
- AuthorizationPendingException: () => AuthorizationPendingException,
- CreateTokenCommand: () => CreateTokenCommand,
- CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog,
- CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog,
- CreateTokenWithIAMCommand: () => CreateTokenWithIAMCommand,
- CreateTokenWithIAMRequestFilterSensitiveLog: () => CreateTokenWithIAMRequestFilterSensitiveLog,
- CreateTokenWithIAMResponseFilterSensitiveLog: () => CreateTokenWithIAMResponseFilterSensitiveLog,
- ExpiredTokenException: () => ExpiredTokenException,
- InternalServerException: () => InternalServerException,
- InvalidClientException: () => InvalidClientException,
- InvalidClientMetadataException: () => InvalidClientMetadataException,
- InvalidGrantException: () => InvalidGrantException,
- InvalidRedirectUriException: () => InvalidRedirectUriException,
+var index_exports = {};
+__export(index_exports, {
+ GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
+ GetRoleCredentialsRequestFilterSensitiveLog: () => GetRoleCredentialsRequestFilterSensitiveLog,
+ GetRoleCredentialsResponseFilterSensitiveLog: () => GetRoleCredentialsResponseFilterSensitiveLog,
InvalidRequestException: () => InvalidRequestException,
- InvalidRequestRegionException: () => InvalidRequestRegionException,
- InvalidScopeException: () => InvalidScopeException,
- RegisterClientCommand: () => RegisterClientCommand,
- RegisterClientResponseFilterSensitiveLog: () => RegisterClientResponseFilterSensitiveLog,
- SSOOIDC: () => SSOOIDC,
- SSOOIDCClient: () => SSOOIDCClient,
- SSOOIDCServiceException: () => SSOOIDCServiceException,
- SlowDownException: () => SlowDownException,
- StartDeviceAuthorizationCommand: () => StartDeviceAuthorizationCommand,
- StartDeviceAuthorizationRequestFilterSensitiveLog: () => StartDeviceAuthorizationRequestFilterSensitiveLog,
- UnauthorizedClientException: () => UnauthorizedClientException,
- UnsupportedGrantTypeException: () => UnsupportedGrantTypeException,
- __Client: () => import_smithy_client.Client
+ ListAccountRolesCommand: () => ListAccountRolesCommand,
+ ListAccountRolesRequestFilterSensitiveLog: () => ListAccountRolesRequestFilterSensitiveLog,
+ ListAccountsCommand: () => ListAccountsCommand,
+ ListAccountsRequestFilterSensitiveLog: () => ListAccountsRequestFilterSensitiveLog,
+ LogoutCommand: () => LogoutCommand,
+ LogoutRequestFilterSensitiveLog: () => LogoutRequestFilterSensitiveLog,
+ ResourceNotFoundException: () => ResourceNotFoundException,
+ RoleCredentialsFilterSensitiveLog: () => RoleCredentialsFilterSensitiveLog,
+ SSO: () => SSO,
+ SSOClient: () => SSOClient,
+ SSOServiceException: () => SSOServiceException,
+ TooManyRequestsException: () => TooManyRequestsException,
+ UnauthorizedException: () => UnauthorizedException,
+ __Client: () => import_smithy_client.Client,
+ paginateListAccountRoles: () => paginateListAccountRoles,
+ paginateListAccounts: () => paginateListAccounts
});
-module.exports = __toCommonJS(src_exports);
+module.exports = __toCommonJS(index_exports);
-// src/SSOOIDCClient.ts
+// src/SSOClient.ts
var import_middleware_host_header = __nccwpck_require__(52590);
var import_middleware_logger = __nccwpck_require__(85242);
var import_middleware_recursion_detection = __nccwpck_require__(81568);
@@ -9210,7 +9334,7 @@ var import_middleware_content_length = __nccwpck_require__(47212);
var import_middleware_endpoint = __nccwpck_require__(40099);
var import_middleware_retry = __nccwpck_require__(19618);
-var import_httpAuthSchemeProvider = __nccwpck_require__(55295);
+var import_httpAuthSchemeProvider = __nccwpck_require__(62041);
// src/endpoint/EndpointParameters.ts
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
@@ -9218,7 +9342,7 @@ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
- defaultSigningName: "sso-oauth"
+ defaultSigningName: "awsssoportal"
};
}, "resolveClientEndpointParameters");
var commonParams = {
@@ -9228,8 +9352,8 @@ var commonParams = {
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
};
-// src/SSOOIDCClient.ts
-var import_runtimeConfig = __nccwpck_require__(37918);
+// src/SSOClient.ts
+var import_runtimeConfig = __nccwpck_require__(82696);
// src/runtimeExtensions.ts
var import_region_config_resolver = __nccwpck_require__(36463);
@@ -9294,8 +9418,15 @@ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions
};
}, "resolveRuntimeExtensions");
-// src/SSOOIDCClient.ts
-var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client.Client {
+// src/SSOClient.ts
+var SSOClient = class extends import_smithy_client.Client {
+ static {
+ __name(this, "SSOClient");
+ }
+ /**
+ * The resolved configuration of SSOClient class. This is resolved and normalized from the {@link SSOClientConfig | constructor configuration interface}.
+ */
+ config;
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
@@ -9305,7 +9436,7 @@ var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client.Client {
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
- const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
@@ -9316,10 +9447,10 @@ var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client.Client {
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider,
- identityProviderConfigProvider: async (config) => new import_core.DefaultIdentityProviderConfig({
+ httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider,
+ identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials
- })
+ }), "identityProviderConfigProvider")
})
);
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
@@ -9333,13 +9464,11 @@ var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client.Client {
super.destroy();
}
};
-__name(_SSOOIDCClient, "SSOOIDCClient");
-var SSOOIDCClient = _SSOOIDCClient;
-// src/SSOOIDC.ts
+// src/SSO.ts
-// src/commands/CreateTokenCommand.ts
+// src/commands/GetRoleCredentialsCommand.ts
var import_middleware_serde = __nccwpck_require__(83255);
@@ -9347,136 +9476,28 @@ var import_middleware_serde = __nccwpck_require__(83255);
// src/models/models_0.ts
-// src/models/SSOOIDCServiceException.ts
+// src/models/SSOServiceException.ts
-var _SSOOIDCServiceException = class _SSOOIDCServiceException extends import_smithy_client.ServiceException {
+var SSOServiceException = class _SSOServiceException extends import_smithy_client.ServiceException {
+ static {
+ __name(this, "SSOServiceException");
+ }
/**
* @internal
*/
constructor(options) {
super(options);
- Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype);
+ Object.setPrototypeOf(this, _SSOServiceException.prototype);
}
};
-__name(_SSOOIDCServiceException, "SSOOIDCServiceException");
-var SSOOIDCServiceException = _SSOOIDCServiceException;
// src/models/models_0.ts
-var _AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "AccessDeniedException",
- $fault: "client",
- ...opts
- });
- this.name = "AccessDeniedException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _AccessDeniedException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- }
-};
-__name(_AccessDeniedException, "AccessDeniedException");
-var AccessDeniedException = _AccessDeniedException;
-var _AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "AuthorizationPendingException",
- $fault: "client",
- ...opts
- });
- this.name = "AuthorizationPendingException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _AuthorizationPendingException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- }
-};
-__name(_AuthorizationPendingException, "AuthorizationPendingException");
-var AuthorizationPendingException = _AuthorizationPendingException;
-var _ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "ExpiredTokenException",
- $fault: "client",
- ...opts
- });
- this.name = "ExpiredTokenException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- }
-};
-__name(_ExpiredTokenException, "ExpiredTokenException");
-var ExpiredTokenException = _ExpiredTokenException;
-var _InternalServerException = class _InternalServerException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InternalServerException",
- $fault: "server",
- ...opts
- });
- this.name = "InternalServerException";
- this.$fault = "server";
- Object.setPrototypeOf(this, _InternalServerException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- }
-};
-__name(_InternalServerException, "InternalServerException");
-var InternalServerException = _InternalServerException;
-var _InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidClientException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidClientException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidClientException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- }
-};
-__name(_InvalidClientException, "InvalidClientException");
-var InvalidClientException = _InvalidClientException;
-var _InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidGrantException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidGrantException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidGrantException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
+var InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
+ static {
+ __name(this, "InvalidRequestException");
}
-};
-__name(_InvalidGrantException, "InvalidGrantException");
-var InvalidGrantException = _InvalidGrantException;
-var _InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException {
+ name = "InvalidRequestException";
+ $fault = "client";
/**
* @internal
*/
@@ -9486,278 +9507,147 @@ var _InvalidRequestException = class _InvalidRequestException extends SSOOIDCSer
$fault: "client",
...opts
});
- this.name = "InvalidRequestException";
- this.$fault = "client";
Object.setPrototypeOf(this, _InvalidRequestException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- }
-};
-__name(_InvalidRequestException, "InvalidRequestException");
-var InvalidRequestException = _InvalidRequestException;
-var _InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidScopeException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidScopeException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidScopeException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
}
};
-__name(_InvalidScopeException, "InvalidScopeException");
-var InvalidScopeException = _InvalidScopeException;
-var _SlowDownException = class _SlowDownException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "SlowDownException",
- $fault: "client",
- ...opts
- });
- this.name = "SlowDownException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _SlowDownException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
+var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
+ static {
+ __name(this, "ResourceNotFoundException");
}
-};
-__name(_SlowDownException, "SlowDownException");
-var SlowDownException = _SlowDownException;
-var _UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException {
+ name = "ResourceNotFoundException";
+ $fault = "client";
/**
* @internal
*/
constructor(opts) {
super({
- name: "UnauthorizedClientException",
+ name: "ResourceNotFoundException",
$fault: "client",
...opts
});
- this.name = "UnauthorizedClientException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _UnauthorizedClientException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
}
};
-__name(_UnauthorizedClientException, "UnauthorizedClientException");
-var UnauthorizedClientException = _UnauthorizedClientException;
-var _UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "UnsupportedGrantTypeException",
- $fault: "client",
- ...opts
- });
- this.name = "UnsupportedGrantTypeException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
+var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
+ static {
+ __name(this, "TooManyRequestsException");
}
-};
-__name(_UnsupportedGrantTypeException, "UnsupportedGrantTypeException");
-var UnsupportedGrantTypeException = _UnsupportedGrantTypeException;
-var _InvalidRequestRegionException = class _InvalidRequestRegionException extends SSOOIDCServiceException {
+ name = "TooManyRequestsException";
+ $fault = "client";
/**
* @internal
*/
constructor(opts) {
super({
- name: "InvalidRequestRegionException",
+ name: "TooManyRequestsException",
$fault: "client",
...opts
});
- this.name = "InvalidRequestRegionException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidRequestRegionException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
- this.endpoint = opts.endpoint;
- this.region = opts.region;
+ Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
}
};
-__name(_InvalidRequestRegionException, "InvalidRequestRegionException");
-var InvalidRequestRegionException = _InvalidRequestRegionException;
-var _InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidClientMetadataException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidClientMetadataException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
+var UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
+ static {
+ __name(this, "UnauthorizedException");
}
-};
-__name(_InvalidClientMetadataException, "InvalidClientMetadataException");
-var InvalidClientMetadataException = _InvalidClientMetadataException;
-var _InvalidRedirectUriException = class _InvalidRedirectUriException extends SSOOIDCServiceException {
+ name = "UnauthorizedException";
+ $fault = "client";
/**
* @internal
*/
constructor(opts) {
super({
- name: "InvalidRedirectUriException",
+ name: "UnauthorizedException",
$fault: "client",
...opts
});
- this.name = "InvalidRedirectUriException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidRedirectUriException.prototype);
- this.error = opts.error;
- this.error_description = opts.error_description;
+ Object.setPrototypeOf(this, _UnauthorizedException.prototype);
}
};
-__name(_InvalidRedirectUriException, "InvalidRedirectUriException");
-var InvalidRedirectUriException = _InvalidRedirectUriException;
-var CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
- ...obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING },
- ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.codeVerifier && { codeVerifier: import_smithy_client.SENSITIVE_STRING }
-}), "CreateTokenRequestFilterSensitiveLog");
-var CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
+}), "GetRoleCredentialsRequestFilterSensitiveLog");
+var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
- ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.idToken && { idToken: import_smithy_client.SENSITIVE_STRING }
-}), "CreateTokenResponseFilterSensitiveLog");
-var CreateTokenWithIAMRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj.secretAccessKey && { secretAccessKey: import_smithy_client.SENSITIVE_STRING },
+ ...obj.sessionToken && { sessionToken: import_smithy_client.SENSITIVE_STRING }
+}), "RoleCredentialsFilterSensitiveLog");
+var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
- ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.assertion && { assertion: import_smithy_client.SENSITIVE_STRING },
- ...obj.subjectToken && { subjectToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.codeVerifier && { codeVerifier: import_smithy_client.SENSITIVE_STRING }
-}), "CreateTokenWithIAMRequestFilterSensitiveLog");
-var CreateTokenWithIAMResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }
+}), "GetRoleCredentialsResponseFilterSensitiveLog");
+var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
- ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING },
- ...obj.idToken && { idToken: import_smithy_client.SENSITIVE_STRING }
-}), "CreateTokenWithIAMResponseFilterSensitiveLog");
-var RegisterClientResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
+}), "ListAccountRolesRequestFilterSensitiveLog");
+var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
- ...obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING }
-}), "RegisterClientResponseFilterSensitiveLog");
-var StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
+}), "ListAccountsRequestFilterSensitiveLog");
+var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
- ...obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING }
-}), "StartDeviceAuthorizationRequestFilterSensitiveLog");
+ ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
+}), "LogoutRequestFilterSensitiveLog");
// src/protocols/Aws_restJson1.ts
var import_core2 = __nccwpck_require__(8704);
-var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
+var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
- const headers = {
- "content-type": "application/json"
- };
- b.bp("/token");
+ const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
+ [_xasbt]: input[_aT]
+ });
+ b.bp("/federation/credentials");
+ const query = (0, import_smithy_client.map)({
+ [_rn]: [, (0, import_smithy_client.expectNonNull)(input[_rN], `roleName`)],
+ [_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
+ });
let body;
- body = JSON.stringify(
- (0, import_smithy_client.take)(input, {
- clientId: [],
- clientSecret: [],
- code: [],
- codeVerifier: [],
- deviceCode: [],
- grantType: [],
- redirectUri: [],
- refreshToken: [],
- scope: (_) => (0, import_smithy_client._json)(_)
- })
- );
- b.m("POST").h(headers).b(body);
+ b.m("GET").h(headers).q(query).b(body);
return b.build();
-}, "se_CreateTokenCommand");
-var se_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (input, context) => {
+}, "se_GetRoleCredentialsCommand");
+var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
- const headers = {
- "content-type": "application/json"
- };
- b.bp("/token");
+ const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
+ [_xasbt]: input[_aT]
+ });
+ b.bp("/assignment/roles");
const query = (0, import_smithy_client.map)({
- [_ai]: [, "t"]
+ [_nt]: [, input[_nT]],
+ [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
+ [_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
});
let body;
- body = JSON.stringify(
- (0, import_smithy_client.take)(input, {
- assertion: [],
- clientId: [],
- code: [],
- codeVerifier: [],
- grantType: [],
- redirectUri: [],
- refreshToken: [],
- requestedTokenType: [],
- scope: (_) => (0, import_smithy_client._json)(_),
- subjectToken: [],
- subjectTokenType: []
- })
- );
- b.m("POST").h(headers).q(query).b(body);
+ b.m("GET").h(headers).q(query).b(body);
return b.build();
-}, "se_CreateTokenWithIAMCommand");
-var se_RegisterClientCommand = /* @__PURE__ */ __name(async (input, context) => {
+}, "se_ListAccountRolesCommand");
+var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
- const headers = {
- "content-type": "application/json"
- };
- b.bp("/client/register");
+ const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
+ [_xasbt]: input[_aT]
+ });
+ b.bp("/assignment/accounts");
+ const query = (0, import_smithy_client.map)({
+ [_nt]: [, input[_nT]],
+ [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()]
+ });
let body;
- body = JSON.stringify(
- (0, import_smithy_client.take)(input, {
- clientName: [],
- clientType: [],
- entitledApplicationArn: [],
- grantTypes: (_) => (0, import_smithy_client._json)(_),
- issuerUrl: [],
- redirectUris: (_) => (0, import_smithy_client._json)(_),
- scopes: (_) => (0, import_smithy_client._json)(_)
- })
- );
- b.m("POST").h(headers).b(body);
+ b.m("GET").h(headers).q(query).b(body);
return b.build();
-}, "se_RegisterClientCommand");
-var se_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (input, context) => {
+}, "se_ListAccountsCommand");
+var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
- const headers = {
- "content-type": "application/json"
- };
- b.bp("/device_authorization");
+ const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
+ [_xasbt]: input[_aT]
+ });
+ b.bp("/logout");
let body;
- body = JSON.stringify(
- (0, import_smithy_client.take)(input, {
- clientId: [],
- clientSecret: [],
- startUrl: []
- })
- );
b.m("POST").h(headers).b(body);
return b.build();
-}, "se_StartDeviceAuthorizationCommand");
-var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
+}, "se_LogoutCommand");
+var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
@@ -9766,16 +9656,12 @@ var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
- accessToken: import_smithy_client.expectString,
- expiresIn: import_smithy_client.expectInt32,
- idToken: import_smithy_client.expectString,
- refreshToken: import_smithy_client.expectString,
- tokenType: import_smithy_client.expectString
+ roleCredentials: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
-}, "de_CreateTokenCommand");
-var de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context) => {
+}, "de_GetRoleCredentialsCommand");
+var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
@@ -9784,18 +9670,13 @@ var de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
- accessToken: import_smithy_client.expectString,
- expiresIn: import_smithy_client.expectInt32,
- idToken: import_smithy_client.expectString,
- issuedTokenType: import_smithy_client.expectString,
- refreshToken: import_smithy_client.expectString,
- scope: import_smithy_client._json,
- tokenType: import_smithy_client.expectString
+ nextToken: import_smithy_client.expectString,
+ roleList: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
-}, "de_CreateTokenWithIAMCommand");
-var de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context) => {
+}, "de_ListAccountRolesCommand");
+var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
@@ -9804,35 +9685,22 @@ var de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context) =>
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
- authorizationEndpoint: import_smithy_client.expectString,
- clientId: import_smithy_client.expectString,
- clientIdIssuedAt: import_smithy_client.expectLong,
- clientSecret: import_smithy_client.expectString,
- clientSecretExpiresAt: import_smithy_client.expectLong,
- tokenEndpoint: import_smithy_client.expectString
+ accountList: import_smithy_client._json,
+ nextToken: import_smithy_client.expectString
});
Object.assign(contents, doc);
return contents;
-}, "de_RegisterClientCommand");
-var de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, context) => {
+}, "de_ListAccountsCommand");
+var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
- const doc = (0, import_smithy_client.take)(data, {
- deviceCode: import_smithy_client.expectString,
- expiresIn: import_smithy_client.expectInt32,
- interval: import_smithy_client.expectInt32,
- userCode: import_smithy_client.expectString,
- verificationUri: import_smithy_client.expectString,
- verificationUriComplete: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
+ await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
-}, "de_StartDeviceAuthorizationCommand");
+}, "de_LogoutCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
const parsedOutput = {
...output,
@@ -9840,48 +9708,18 @@ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
};
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
switch (errorCode) {
- case "AccessDeniedException":
- case "com.amazonaws.ssooidc#AccessDeniedException":
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
- case "AuthorizationPendingException":
- case "com.amazonaws.ssooidc#AuthorizationPendingException":
- throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
- case "ExpiredTokenException":
- case "com.amazonaws.ssooidc#ExpiredTokenException":
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
- case "InternalServerException":
- case "com.amazonaws.ssooidc#InternalServerException":
- throw await de_InternalServerExceptionRes(parsedOutput, context);
- case "InvalidClientException":
- case "com.amazonaws.ssooidc#InvalidClientException":
- throw await de_InvalidClientExceptionRes(parsedOutput, context);
- case "InvalidGrantException":
- case "com.amazonaws.ssooidc#InvalidGrantException":
- throw await de_InvalidGrantExceptionRes(parsedOutput, context);
case "InvalidRequestException":
- case "com.amazonaws.ssooidc#InvalidRequestException":
+ case "com.amazonaws.sso#InvalidRequestException":
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
- case "InvalidScopeException":
- case "com.amazonaws.ssooidc#InvalidScopeException":
- throw await de_InvalidScopeExceptionRes(parsedOutput, context);
- case "SlowDownException":
- case "com.amazonaws.ssooidc#SlowDownException":
- throw await de_SlowDownExceptionRes(parsedOutput, context);
- case "UnauthorizedClientException":
- case "com.amazonaws.ssooidc#UnauthorizedClientException":
- throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
- case "UnsupportedGrantTypeException":
- case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
- throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
- case "InvalidRequestRegionException":
- case "com.amazonaws.ssooidc#InvalidRequestRegionException":
- throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context);
- case "InvalidClientMetadataException":
- case "com.amazonaws.ssooidc#InvalidClientMetadataException":
- throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context);
- case "InvalidRedirectUriException":
- case "com.amazonaws.ssooidc#InvalidRedirectUriException":
- throw await de_InvalidRedirectUriExceptionRes(parsedOutput, context);
+ case "ResourceNotFoundException":
+ case "com.amazonaws.sso#ResourceNotFoundException":
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
+ case "TooManyRequestsException":
+ case "com.amazonaws.sso#TooManyRequestsException":
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
+ case "UnauthorizedException":
+ case "com.amazonaws.sso#UnauthorizedException":
+ throw await de_UnauthorizedExceptionRes(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
return throwDefaultError({
@@ -9891,125 +9729,12 @@ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
});
}
}, "de_CommandError");
-var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOOIDCServiceException);
-var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new AccessDeniedException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_AccessDeniedExceptionRes");
-var de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new AuthorizationPendingException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_AuthorizationPendingExceptionRes");
-var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new ExpiredTokenException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_ExpiredTokenExceptionRes");
-var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InternalServerException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InternalServerExceptionRes");
-var de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidClientException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidClientExceptionRes");
-var de_InvalidClientMetadataExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidClientMetadataException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidClientMetadataExceptionRes");
-var de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidGrantException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidGrantExceptionRes");
-var de_InvalidRedirectUriExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidRedirectUriException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidRedirectUriExceptionRes");
+var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException);
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
+ message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new InvalidRequestException({
@@ -10018,151 +9743,140 @@ var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
-var de_InvalidRequestRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- endpoint: import_smithy_client.expectString,
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString,
- region: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidRequestRegionException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidRequestRegionExceptionRes");
-var de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidScopeException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidScopeExceptionRes");
-var de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
+ message: import_smithy_client.expectString
});
Object.assign(contents, doc);
- const exception = new SlowDownException({
+ const exception = new ResourceNotFoundException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_SlowDownExceptionRes");
-var de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+}, "de_ResourceNotFoundExceptionRes");
+var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
+ message: import_smithy_client.expectString
});
Object.assign(contents, doc);
- const exception = new UnauthorizedClientException({
+ const exception = new TooManyRequestsException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_UnauthorizedClientExceptionRes");
-var de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+}, "de_TooManyRequestsExceptionRes");
+var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
- error: import_smithy_client.expectString,
- error_description: import_smithy_client.expectString
+ message: import_smithy_client.expectString
});
Object.assign(contents, doc);
- const exception = new UnsupportedGrantTypeException({
+ const exception = new UnauthorizedException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_UnsupportedGrantTypeExceptionRes");
+}, "de_UnauthorizedExceptionRes");
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
httpStatusCode: output.statusCode,
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"]
}), "deserializeMetadata");
-var _ai = "aws_iam";
+var _aI = "accountId";
+var _aT = "accessToken";
+var _ai = "account_id";
+var _mR = "maxResults";
+var _mr = "max_result";
+var _nT = "nextToken";
+var _nt = "next_token";
+var _rN = "roleName";
+var _rn = "role_name";
+var _xasbt = "x-amz-sso_bearer_token";
-// src/commands/CreateTokenCommand.ts
-var _CreateTokenCommand = class _CreateTokenCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+// src/commands/GetRoleCredentialsCommand.ts
+var GetRoleCredentialsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
-}).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() {
+}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
+ static {
+ __name(this, "GetRoleCredentialsCommand");
+ }
};
-__name(_CreateTokenCommand, "CreateTokenCommand");
-var CreateTokenCommand = _CreateTokenCommand;
-// src/commands/CreateTokenWithIAMCommand.ts
+// src/commands/ListAccountRolesCommand.ts
-var _CreateTokenWithIAMCommand = class _CreateTokenWithIAMCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListAccountRolesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
-}).s("AWSSSOOIDCService", "CreateTokenWithIAM", {}).n("SSOOIDCClient", "CreateTokenWithIAMCommand").f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog).ser(se_CreateTokenWithIAMCommand).de(de_CreateTokenWithIAMCommand).build() {
+}).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() {
+ static {
+ __name(this, "ListAccountRolesCommand");
+ }
};
-__name(_CreateTokenWithIAMCommand, "CreateTokenWithIAMCommand");
-var CreateTokenWithIAMCommand = _CreateTokenWithIAMCommand;
-// src/commands/RegisterClientCommand.ts
+// src/commands/ListAccountsCommand.ts
-var _RegisterClientCommand = class _RegisterClientCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var ListAccountsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
-}).s("AWSSSOOIDCService", "RegisterClient", {}).n("SSOOIDCClient", "RegisterClientCommand").f(void 0, RegisterClientResponseFilterSensitiveLog).ser(se_RegisterClientCommand).de(de_RegisterClientCommand).build() {
+}).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() {
+ static {
+ __name(this, "ListAccountsCommand");
+ }
};
-__name(_RegisterClientCommand, "RegisterClientCommand");
-var RegisterClientCommand = _RegisterClientCommand;
-// src/commands/StartDeviceAuthorizationCommand.ts
+// src/commands/LogoutCommand.ts
-var _StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+var LogoutCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
];
-}).s("AWSSSOOIDCService", "StartDeviceAuthorization", {}).n("SSOOIDCClient", "StartDeviceAuthorizationCommand").f(StartDeviceAuthorizationRequestFilterSensitiveLog, void 0).ser(se_StartDeviceAuthorizationCommand).de(de_StartDeviceAuthorizationCommand).build() {
+}).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() {
+ static {
+ __name(this, "LogoutCommand");
+ }
};
-__name(_StartDeviceAuthorizationCommand, "StartDeviceAuthorizationCommand");
-var StartDeviceAuthorizationCommand = _StartDeviceAuthorizationCommand;
-// src/SSOOIDC.ts
+// src/SSO.ts
var commands = {
- CreateTokenCommand,
- CreateTokenWithIAMCommand,
- RegisterClientCommand,
- StartDeviceAuthorizationCommand
+ GetRoleCredentialsCommand,
+ ListAccountRolesCommand,
+ ListAccountsCommand,
+ LogoutCommand
};
-var _SSOOIDC = class _SSOOIDC extends SSOOIDCClient {
+var SSO = class extends SSOClient {
+ static {
+ __name(this, "SSO");
+ }
};
-__name(_SSOOIDC, "SSOOIDC");
-var SSOOIDC = _SSOOIDC;
-(0, import_smithy_client.createAggregatedClient)(commands, SSOOIDC);
+(0, import_smithy_client.createAggregatedClient)(commands, SSO);
+
+// src/pagination/ListAccountRolesPaginator.ts
+
+var paginateListAccountRoles = (0, import_core.createPaginator)(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults");
+
+// src/pagination/ListAccountsPaginator.ts
+
+var paginateListAccounts = (0, import_core.createPaginator)(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults");
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
@@ -10171,16 +9885,15 @@ var SSOOIDC = _SSOOIDC;
/***/ }),
-/***/ 37918:
+/***/ 82696:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getRuntimeConfig = void 0;
const tslib_1 = __nccwpck_require__(61860);
-const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(79412));
+const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(45188));
const core_1 = __nccwpck_require__(8704);
-const credential_provider_node_1 = __nccwpck_require__(5861);
const util_user_agent_node_1 = __nccwpck_require__(51656);
const config_resolver_1 = __nccwpck_require__(39316);
const hash_node_1 = __nccwpck_require__(5092);
@@ -10189,7 +9902,7 @@ const node_config_provider_1 = __nccwpck_require__(55704);
const node_http_handler_1 = __nccwpck_require__(61279);
const util_body_length_node_1 = __nccwpck_require__(13638);
const util_retry_1 = __nccwpck_require__(15518);
-const runtimeConfig_shared_1 = __nccwpck_require__(45047);
+const runtimeConfig_shared_1 = __nccwpck_require__(8073);
const smithy_client_1 = __nccwpck_require__(61411);
const util_defaults_mode_node_1 = __nccwpck_require__(15435);
const smithy_client_2 = __nccwpck_require__(61411);
@@ -10199,28 +9912,29 @@ const getRuntimeConfig = (config) => {
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
+ const profileConfig = { profile: config?.profile };
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
(0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
- maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
- region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
+ region: config?.region ??
+ (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
retryMode: config?.retryMode ??
(0, node_config_provider_1.loadConfig)({
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
- }),
+ }, config),
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
- useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
- userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS),
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
};
};
exports.getRuntimeConfig = getRuntimeConfig;
@@ -10228,7 +9942,7 @@ exports.getRuntimeConfig = getRuntimeConfig;
/***/ }),
-/***/ 45047:
+/***/ 8073:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
@@ -10240,8 +9954,8 @@ const smithy_client_1 = __nccwpck_require__(61411);
const url_parser_1 = __nccwpck_require__(14494);
const util_base64_1 = __nccwpck_require__(68385);
const util_utf8_1 = __nccwpck_require__(71577);
-const httpAuthSchemeProvider_1 = __nccwpck_require__(55295);
-const endpointResolver_1 = __nccwpck_require__(18569);
+const httpAuthSchemeProvider_1 = __nccwpck_require__(62041);
+const endpointResolver_1 = __nccwpck_require__(13903);
const getRuntimeConfig = (config) => {
return {
apiVersion: "2019-06-10",
@@ -10250,7 +9964,7 @@ const getRuntimeConfig = (config) => {
disableHostPrefix: config?.disableHostPrefix ?? false,
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
extensions: config?.extensions ?? [],
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOOIDCHttpAuthSchemeProvider,
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,
httpAuthSchemes: config?.httpAuthSchemes ?? [
{
schemeId: "aws.auth#sigv4",
@@ -10264,7 +9978,7 @@ const getRuntimeConfig = (config) => {
},
],
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
- serviceId: config?.serviceId ?? "SSO OIDC",
+ serviceId: config?.serviceId ?? "SSO",
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
@@ -10275,121 +9989,100 @@ exports.getRuntimeConfig = getRuntimeConfig;
/***/ }),
-/***/ 62041:
+/***/ 8704:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;
-const core_1 = __nccwpck_require__(8704);
-const util_middleware_1 = __nccwpck_require__(76324);
-const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
- return {
- operation: (0, util_middleware_1.getSmithyContext)(context).operation,
- region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
- (() => {
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
- })(),
- };
-};
-exports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;
-function createAwsAuthSigv4HttpAuthOption(authParameters) {
- return {
- schemeId: "aws.auth#sigv4",
- signingProperties: {
- name: "awsssoportal",
- region: authParameters.region,
- },
- propertiesExtractor: (config, context) => ({
- signingProperties: {
- config,
- context,
- },
- }),
- };
-}
-function createSmithyApiNoAuthHttpAuthOption(authParameters) {
- return {
- schemeId: "smithy.api#noAuth",
- };
-}
-const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
- const options = [];
- switch (authParameters.operation) {
- case "GetRoleCredentials": {
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
- break;
- }
- case "ListAccountRoles": {
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
- break;
- }
- case "ListAccounts": {
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
- break;
- }
- case "Logout": {
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
- break;
- }
- default: {
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
- }
- }
- return options;
-};
-exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;
-const resolveHttpAuthSchemeConfig = (config) => {
- const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
- return {
- ...config_0,
- };
-};
-exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
+const tslib_1 = __nccwpck_require__(61860);
+tslib_1.__exportStar(__nccwpck_require__(5152), exports);
+tslib_1.__exportStar(__nccwpck_require__(97523), exports);
+tslib_1.__exportStar(__nccwpck_require__(37288), exports);
/***/ }),
-/***/ 13903:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 5152:
+/***/ ((module) => {
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.defaultEndpointResolver = void 0;
-const util_endpoints_1 = __nccwpck_require__(83068);
-const util_endpoints_2 = __nccwpck_require__(79674);
-const ruleset_1 = __nccwpck_require__(41308);
-const cache = new util_endpoints_2.EndpointCache({
- size: 50,
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
-});
-const defaultEndpointResolver = (endpointParams, context = {}) => {
- return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
- endpointParams: endpointParams,
- logger: context.logger,
- }));
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
};
-exports.defaultEndpointResolver = defaultEndpointResolver;
-util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+// src/submodules/client/index.ts
+var index_exports = {};
+__export(index_exports, {
+ emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,
+ setCredentialFeature: () => setCredentialFeature,
+ setFeature: () => setFeature,
+ state: () => state
+});
+module.exports = __toCommonJS(index_exports);
-/***/ }),
+// src/submodules/client/emitWarningIfUnsupportedVersion.ts
+var state = {
+ warningEmitted: false
+};
+var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {
+ if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
+ state.warningEmitted = true;
+ process.emitWarning(
+ `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
+no longer support Node.js 16.x on January 6, 2025.
-/***/ 41308:
-/***/ ((__unused_webpack_module, exports) => {
+To continue receiving updates to AWS services, bug fixes, and security
+updates please upgrade to a supported Node.js LTS version.
+More information can be found at: https://a.co/74kJMmI`
+ );
+ }
+}, "emitWarningIfUnsupportedVersion");
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.ruleSet = void 0;
-const u = "required", v = "fn", w = "argv", x = "ref";
-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" }];
-const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
-exports.ruleSet = _data;
+// src/submodules/client/setCredentialFeature.ts
+function setCredentialFeature(credentials, feature, value) {
+ if (!credentials.$source) {
+ credentials.$source = {};
+ }
+ credentials.$source[feature] = value;
+ return credentials;
+}
+__name(setCredentialFeature, "setCredentialFeature");
+
+// src/submodules/client/setFeature.ts
+function setFeature(context, feature, value) {
+ if (!context.__aws_sdk_context) {
+ context.__aws_sdk_context = {
+ features: {}
+ };
+ } else if (!context.__aws_sdk_context.features) {
+ context.__aws_sdk_context.features = {};
+ }
+ context.__aws_sdk_context.features[feature] = value;
+}
+__name(setFeature, "setFeature");
+// Annotate the CommonJS export names for ESM import in node:
+0 && (0);
/***/ }),
-/***/ 62054:
+/***/ 97523:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
@@ -10412,935 +10105,813 @@ var __copyProps = (to, from, except, desc) => {
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
- GetRoleCredentialsRequestFilterSensitiveLog: () => GetRoleCredentialsRequestFilterSensitiveLog,
- GetRoleCredentialsResponseFilterSensitiveLog: () => GetRoleCredentialsResponseFilterSensitiveLog,
- InvalidRequestException: () => InvalidRequestException,
- ListAccountRolesCommand: () => ListAccountRolesCommand,
- ListAccountRolesRequestFilterSensitiveLog: () => ListAccountRolesRequestFilterSensitiveLog,
- ListAccountsCommand: () => ListAccountsCommand,
- ListAccountsRequestFilterSensitiveLog: () => ListAccountsRequestFilterSensitiveLog,
- LogoutCommand: () => LogoutCommand,
- LogoutRequestFilterSensitiveLog: () => LogoutRequestFilterSensitiveLog,
- ResourceNotFoundException: () => ResourceNotFoundException,
- RoleCredentialsFilterSensitiveLog: () => RoleCredentialsFilterSensitiveLog,
- SSO: () => SSO,
- SSOClient: () => SSOClient,
- SSOServiceException: () => SSOServiceException,
- TooManyRequestsException: () => TooManyRequestsException,
- UnauthorizedException: () => UnauthorizedException,
- __Client: () => import_smithy_client.Client,
- paginateListAccountRoles: () => paginateListAccountRoles,
- paginateListAccounts: () => paginateListAccounts
+// src/submodules/httpAuthSchemes/index.ts
+var index_exports = {};
+__export(index_exports, {
+ AWSSDKSigV4Signer: () => AWSSDKSigV4Signer,
+ AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner,
+ AwsSdkSigV4Signer: () => AwsSdkSigV4Signer,
+ NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS,
+ resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config,
+ resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig,
+ resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config,
+ validateSigningProperties: () => validateSigningProperties
});
-module.exports = __toCommonJS(src_exports);
+module.exports = __toCommonJS(index_exports);
-// src/SSOClient.ts
-var import_middleware_host_header = __nccwpck_require__(52590);
-var import_middleware_logger = __nccwpck_require__(85242);
-var import_middleware_recursion_detection = __nccwpck_require__(81568);
-var import_middleware_user_agent = __nccwpck_require__(32959);
-var import_config_resolver = __nccwpck_require__(39316);
-var import_core = __nccwpck_require__(90402);
-var import_middleware_content_length = __nccwpck_require__(47212);
-var import_middleware_endpoint = __nccwpck_require__(40099);
-var import_middleware_retry = __nccwpck_require__(19618);
+// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts
+var import_protocol_http2 = __nccwpck_require__(72356);
-var import_httpAuthSchemeProvider = __nccwpck_require__(62041);
+// src/submodules/httpAuthSchemes/utils/getDateHeader.ts
+var import_protocol_http = __nccwpck_require__(72356);
+var getDateHeader = /* @__PURE__ */ __name((response) => import_protocol_http.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader");
-// src/endpoint/EndpointParameters.ts
-var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
- return {
- ...options,
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
- useFipsEndpoint: options.useFipsEndpoint ?? false,
- defaultSigningName: "awsssoportal"
- };
-}, "resolveClientEndpointParameters");
-var commonParams = {
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
- Endpoint: { type: "builtInParams", name: "endpoint" },
- Region: { type: "builtInParams", name: "region" },
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
-};
+// src/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.ts
+var getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate");
-// src/SSOClient.ts
-var import_runtimeConfig = __nccwpck_require__(82696);
+// src/submodules/httpAuthSchemes/utils/isClockSkewed.ts
+var isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed");
-// src/runtimeExtensions.ts
-var import_region_config_resolver = __nccwpck_require__(36463);
-var import_protocol_http = __nccwpck_require__(72356);
-var import_smithy_client = __nccwpck_require__(61411);
+// src/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts
+var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => {
+ const clockTimeInMs = Date.parse(clockTime);
+ if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
+ return clockTimeInMs - Date.now();
+ }
+ return currentSystemClockOffset;
+}, "getUpdatedSystemClockOffset");
-// src/auth/httpAuthExtensionConfiguration.ts
-var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
- let _credentials = runtimeConfig.credentials;
+// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts
+var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => {
+ if (!property) {
+ throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
+ }
+ return property;
+}, "throwSigningPropertyError");
+var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
+ const context = throwSigningPropertyError(
+ "context",
+ signingProperties.context
+ );
+ const config = throwSigningPropertyError("config", signingProperties.config);
+ const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
+ const signerFunction = throwSigningPropertyError(
+ "signer",
+ config.signer
+ );
+ const signer = await signerFunction(authScheme);
+ const signingRegion = signingProperties?.signingRegion;
+ const signingRegionSet = signingProperties?.signingRegionSet;
+ const signingName = signingProperties?.signingName;
return {
- setHttpAuthScheme(httpAuthScheme) {
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
- if (index === -1) {
- _httpAuthSchemes.push(httpAuthScheme);
- } else {
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
+ config,
+ signer,
+ signingRegion,
+ signingRegionSet,
+ signingName
+ };
+}, "validateSigningProperties");
+var AwsSdkSigV4Signer = class {
+ static {
+ __name(this, "AwsSdkSigV4Signer");
+ }
+ async sign(httpRequest, identity, signingProperties) {
+ if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
+ throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
+ }
+ const validatedProps = await validateSigningProperties(signingProperties);
+ const { config, signer } = validatedProps;
+ let { signingRegion, signingName } = validatedProps;
+ const handlerExecutionContext = signingProperties.context;
+ if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
+ const [first, second] = handlerExecutionContext.authSchemes;
+ if (first?.name === "sigv4a" && second?.name === "sigv4") {
+ signingRegion = second?.signingRegion ?? signingRegion;
+ signingName = second?.signingName ?? signingName;
}
- },
- httpAuthSchemes() {
- return _httpAuthSchemes;
- },
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
- },
- httpAuthSchemeProvider() {
- return _httpAuthSchemeProvider;
- },
- setCredentials(credentials) {
- _credentials = credentials;
- },
- credentials() {
- return _credentials;
}
- };
-}, "getHttpAuthExtensionConfiguration");
-var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
- return {
- httpAuthSchemes: config.httpAuthSchemes(),
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
- credentials: config.credentials()
- };
-}, "resolveHttpAuthRuntimeConfig");
-
-// src/runtimeExtensions.ts
-var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
-var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
- const extensionConfiguration = {
- ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
- ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
- ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
- ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
- };
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
- return {
- ...runtimeConfig,
- ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
- ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
- ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
- ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
- };
-}, "resolveRuntimeExtensions");
-
-// src/SSOClient.ts
-var _SSOClient = class _SSOClient extends import_smithy_client.Client {
- constructor(...[configuration]) {
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
- const _config_1 = resolveClientEndpointParameters(_config_0);
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
- const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
- super(_config_8);
- this.config = _config_8;
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
- this.middlewareStack.use(
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider,
- identityProviderConfigProvider: async (config) => new import_core.DefaultIdentityProviderConfig({
- "aws.auth#sigv4": config.credentials
- })
- })
- );
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
+ const signedRequest = await signer.sign(httpRequest, {
+ signingDate: getSkewCorrectedDate(config.systemClockOffset),
+ signingRegion,
+ signingService: signingName
+ });
+ return signedRequest;
}
- /**
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
- */
- destroy() {
- super.destroy();
+ errorHandler(signingProperties) {
+ return (error) => {
+ const serverTime = error.ServerTime ?? getDateHeader(error.$response);
+ if (serverTime) {
+ const config = throwSigningPropertyError("config", signingProperties.config);
+ const initialSystemClockOffset = config.systemClockOffset;
+ config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
+ const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
+ if (clockSkewCorrected && error.$metadata) {
+ error.$metadata.clockSkewCorrected = true;
+ }
+ }
+ throw error;
+ };
+ }
+ successHandler(httpResponse, signingProperties) {
+ const dateHeader = getDateHeader(httpResponse);
+ if (dateHeader) {
+ const config = throwSigningPropertyError("config", signingProperties.config);
+ config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
+ }
}
};
-__name(_SSOClient, "SSOClient");
-var SSOClient = _SSOClient;
-
-// src/SSO.ts
+var AWSSDKSigV4Signer = AwsSdkSigV4Signer;
+// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.ts
+var import_protocol_http3 = __nccwpck_require__(72356);
+var AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer {
+ static {
+ __name(this, "AwsSdkSigV4ASigner");
+ }
+ async sign(httpRequest, identity, signingProperties) {
+ if (!import_protocol_http3.HttpRequest.isInstance(httpRequest)) {
+ throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
+ }
+ const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(
+ signingProperties
+ );
+ const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
+ const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
+ const signedRequest = await signer.sign(httpRequest, {
+ signingDate: getSkewCorrectedDate(config.systemClockOffset),
+ signingRegion: multiRegionOverride,
+ signingService: signingName
+ });
+ return signedRequest;
+ }
+};
-// src/commands/GetRoleCredentialsCommand.ts
+// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.ts
+var import_core = __nccwpck_require__(90402);
+var import_property_provider = __nccwpck_require__(71238);
+var resolveAwsSdkSigV4AConfig = /* @__PURE__ */ __name((config) => {
+ config.sigv4aSigningRegionSet = (0, import_core.normalizeProvider)(config.sigv4aSigningRegionSet);
+ return config;
+}, "resolveAwsSdkSigV4AConfig");
+var NODE_SIGV4A_CONFIG_OPTIONS = {
+ environmentVariableSelector(env) {
+ if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
+ return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
+ }
+ throw new import_property_provider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
+ tryNextLink: true
+ });
+ },
+ configFileSelector(profile) {
+ if (profile.sigv4a_signing_region_set) {
+ return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
+ }
+ throw new import_property_provider.ProviderError("sigv4a_signing_region_set not set in profile.", {
+ tryNextLink: true
+ });
+ },
+ default: void 0
+};
-var import_middleware_serde = __nccwpck_require__(83255);
+// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts
+var import_client = __nccwpck_require__(5152);
+var import_core2 = __nccwpck_require__(90402);
+var import_signature_v4 = __nccwpck_require__(75118);
+var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
+ let isUserSupplied = false;
+ let credentialsProvider;
+ if (config.credentials) {
+ isUserSupplied = true;
+ credentialsProvider = (0, import_core2.memoizeIdentityProvider)(config.credentials, import_core2.isIdentityExpired, import_core2.doesIdentityRequireRefresh);
+ }
+ if (!credentialsProvider) {
+ if (config.credentialDefaultProvider) {
+ credentialsProvider = (0, import_core2.normalizeProvider)(
+ config.credentialDefaultProvider(
+ Object.assign({}, config, {
+ parentClientConfig: config
+ })
+ )
+ );
+ } else {
+ credentialsProvider = /* @__PURE__ */ __name(async () => {
+ throw new Error("`credentials` is missing");
+ }, "credentialsProvider");
+ }
+ }
+ const boundCredentialsProvider = /* @__PURE__ */ __name(async (options) => credentialsProvider({ ...options, callerClientConfig: config }), "boundCredentialsProvider");
+ const {
+ // Default for signingEscapePath
+ signingEscapePath = true,
+ // Default for systemClockOffset
+ systemClockOffset = config.systemClockOffset || 0,
+ // No default for sha256 since it is platform dependent
+ sha256
+ } = config;
+ let signer;
+ if (config.signer) {
+ signer = (0, import_core2.normalizeProvider)(config.signer);
+ } else if (config.regionInfoProvider) {
+ signer = /* @__PURE__ */ __name(() => (0, import_core2.normalizeProvider)(config.region)().then(
+ async (region) => [
+ await config.regionInfoProvider(region, {
+ useFipsEndpoint: await config.useFipsEndpoint(),
+ useDualstackEndpoint: await config.useDualstackEndpoint()
+ }) || {},
+ region
+ ]
+ ).then(([regionInfo, region]) => {
+ const { signingRegion, signingService } = regionInfo;
+ config.signingRegion = config.signingRegion || signingRegion || region;
+ config.signingName = config.signingName || signingService || config.serviceId;
+ const params = {
+ ...config,
+ credentials: boundCredentialsProvider,
+ region: config.signingRegion,
+ service: config.signingName,
+ sha256,
+ uriEscapePath: signingEscapePath
+ };
+ const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
+ return new SignerCtor(params);
+ }), "signer");
+ } else {
+ signer = /* @__PURE__ */ __name(async (authScheme) => {
+ authScheme = Object.assign(
+ {},
+ {
+ name: "sigv4",
+ signingName: config.signingName || config.defaultSigningName,
+ signingRegion: await (0, import_core2.normalizeProvider)(config.region)(),
+ properties: {}
+ },
+ authScheme
+ );
+ const signingRegion = authScheme.signingRegion;
+ const signingService = authScheme.signingName;
+ config.signingRegion = config.signingRegion || signingRegion;
+ config.signingName = config.signingName || signingService || config.serviceId;
+ const params = {
+ ...config,
+ credentials: boundCredentialsProvider,
+ region: config.signingRegion,
+ service: config.signingName,
+ sha256,
+ uriEscapePath: signingEscapePath
+ };
+ const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
+ return new SignerCtor(params);
+ }, "signer");
+ }
+ return {
+ ...config,
+ systemClockOffset,
+ signingEscapePath,
+ credentials: isUserSupplied ? async (options) => boundCredentialsProvider(options).then(
+ (creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_CODE", "e")
+ ) : boundCredentialsProvider,
+ signer
+ };
+}, "resolveAwsSdkSigV4Config");
+var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
+// Annotate the CommonJS export names for ESM import in node:
+0 && (0);
-// src/models/models_0.ts
+/***/ }),
+/***/ 37288:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-// src/models/SSOServiceException.ts
-var _SSOServiceException = class _SSOServiceException extends import_smithy_client.ServiceException {
- /**
- * @internal
- */
- constructor(options) {
- super(options);
- Object.setPrototypeOf(this, _SSOServiceException.prototype);
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
+ return to;
};
-__name(_SSOServiceException, "SSOServiceException");
-var SSOServiceException = _SSOServiceException;
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/models/models_0.ts
-var _InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidRequestException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidRequestException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidRequestException.prototype);
+// src/submodules/protocols/index.ts
+var index_exports = {};
+__export(index_exports, {
+ _toBool: () => _toBool,
+ _toNum: () => _toNum,
+ _toStr: () => _toStr,
+ awsExpectUnion: () => awsExpectUnion,
+ loadRestJsonErrorCode: () => loadRestJsonErrorCode,
+ loadRestXmlErrorCode: () => loadRestXmlErrorCode,
+ parseJsonBody: () => parseJsonBody,
+ parseJsonErrorBody: () => parseJsonErrorBody,
+ parseXmlBody: () => parseXmlBody,
+ parseXmlErrorBody: () => parseXmlErrorBody
+});
+module.exports = __toCommonJS(index_exports);
+
+// src/submodules/protocols/coercing-serializers.ts
+var _toStr = /* @__PURE__ */ __name((val) => {
+ if (val == null) {
+ return val;
}
-};
-__name(_InvalidRequestException, "InvalidRequestException");
-var InvalidRequestException = _InvalidRequestException;
-var _ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "ResourceNotFoundException",
- $fault: "client",
- ...opts
- });
- this.name = "ResourceNotFoundException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
+ if (typeof val === "number" || typeof val === "bigint") {
+ const warning = new Error(`Received number ${val} where a string was expected.`);
+ warning.name = "Warning";
+ console.warn(warning);
+ return String(val);
}
-};
-__name(_ResourceNotFoundException, "ResourceNotFoundException");
-var ResourceNotFoundException = _ResourceNotFoundException;
-var _TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "TooManyRequestsException",
- $fault: "client",
- ...opts
- });
- this.name = "TooManyRequestsException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
+ if (typeof val === "boolean") {
+ const warning = new Error(`Received boolean ${val} where a string was expected.`);
+ warning.name = "Warning";
+ console.warn(warning);
+ return String(val);
}
-};
-__name(_TooManyRequestsException, "TooManyRequestsException");
-var TooManyRequestsException = _TooManyRequestsException;
-var _UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "UnauthorizedException",
- $fault: "client",
- ...opts
- });
- this.name = "UnauthorizedException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _UnauthorizedException.prototype);
+ return val;
+}, "_toStr");
+var _toBool = /* @__PURE__ */ __name((val) => {
+ if (val == null) {
+ return val;
}
-};
-__name(_UnauthorizedException, "UnauthorizedException");
-var UnauthorizedException = _UnauthorizedException;
-var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
-}), "GetRoleCredentialsRequestFilterSensitiveLog");
-var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.secretAccessKey && { secretAccessKey: import_smithy_client.SENSITIVE_STRING },
- ...obj.sessionToken && { sessionToken: import_smithy_client.SENSITIVE_STRING }
-}), "RoleCredentialsFilterSensitiveLog");
-var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }
-}), "GetRoleCredentialsResponseFilterSensitiveLog");
-var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
-}), "ListAccountRolesRequestFilterSensitiveLog");
-var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
-}), "ListAccountsRequestFilterSensitiveLog");
-var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
-}), "LogoutRequestFilterSensitiveLog");
+ if (typeof val === "number") {
+ }
+ if (typeof val === "string") {
+ const lowercase = val.toLowerCase();
+ if (val !== "" && lowercase !== "false" && lowercase !== "true") {
+ const warning = new Error(`Received string "${val}" where a boolean was expected.`);
+ warning.name = "Warning";
+ console.warn(warning);
+ }
+ return val !== "" && lowercase !== "false";
+ }
+ return val;
+}, "_toBool");
+var _toNum = /* @__PURE__ */ __name((val) => {
+ if (val == null) {
+ return val;
+ }
+ if (typeof val === "boolean") {
+ }
+ if (typeof val === "string") {
+ const num = Number(val);
+ if (num.toString() !== val) {
+ const warning = new Error(`Received string "${val}" where a number was expected.`);
+ warning.name = "Warning";
+ console.warn(warning);
+ return val;
+ }
+ return num;
+ }
+ return val;
+}, "_toNum");
-// src/protocols/Aws_restJson1.ts
-var import_core2 = __nccwpck_require__(8704);
+// src/submodules/protocols/json/awsExpectUnion.ts
+var import_smithy_client = __nccwpck_require__(61411);
+var awsExpectUnion = /* @__PURE__ */ __name((value) => {
+ if (value == null) {
+ return void 0;
+ }
+ if (typeof value === "object" && "__type" in value) {
+ delete value.__type;
+ }
+ return (0, import_smithy_client.expectUnion)(value);
+}, "awsExpectUnion");
+// src/submodules/protocols/common.ts
+var import_smithy_client2 = __nccwpck_require__(61411);
+var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client2.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
-var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
- const b = (0, import_core.requestBuilder)(input, context);
- const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
- [_xasbt]: input[_aT]
- });
- b.bp("/federation/credentials");
- const query = (0, import_smithy_client.map)({
- [_rn]: [, (0, import_smithy_client.expectNonNull)(input[_rN], `roleName`)],
- [_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
- });
- let body;
- b.m("GET").h(headers).q(query).b(body);
- return b.build();
-}, "se_GetRoleCredentialsCommand");
-var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => {
- const b = (0, import_core.requestBuilder)(input, context);
- const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
- [_xasbt]: input[_aT]
- });
- b.bp("/assignment/roles");
- const query = (0, import_smithy_client.map)({
- [_nt]: [, input[_nT]],
- [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
- [_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
- });
- let body;
- b.m("GET").h(headers).q(query).b(body);
- return b.build();
-}, "se_ListAccountRolesCommand");
-var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => {
- const b = (0, import_core.requestBuilder)(input, context);
- const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
- [_xasbt]: input[_aT]
- });
- b.bp("/assignment/accounts");
- const query = (0, import_smithy_client.map)({
- [_nt]: [, input[_nT]],
- [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()]
- });
- let body;
- b.m("GET").h(headers).q(query).b(body);
- return b.build();
-}, "se_ListAccountsCommand");
-var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => {
- const b = (0, import_core.requestBuilder)(input, context);
- const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
- [_xasbt]: input[_aT]
- });
- b.bp("/logout");
- let body;
- b.m("POST").h(headers).b(body);
- return b.build();
-}, "se_LogoutCommand");
-var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode !== 200 && output.statusCode >= 300) {
- return de_CommandError(output, context);
+// src/submodules/protocols/json/parseJsonBody.ts
+var parseJsonBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
+ if (encoded.length) {
+ try {
+ return JSON.parse(encoded);
+ } catch (e) {
+ if (e?.name === "SyntaxError") {
+ Object.defineProperty(e, "$responseBodyText", {
+ value: encoded
+ });
+ }
+ throw e;
+ }
}
- const contents = (0, import_smithy_client.map)({
- $metadata: deserializeMetadata(output)
- });
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
- const doc = (0, import_smithy_client.take)(data, {
- roleCredentials: import_smithy_client._json
- });
- Object.assign(contents, doc);
- return contents;
-}, "de_GetRoleCredentialsCommand");
-var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode !== 200 && output.statusCode >= 300) {
- return de_CommandError(output, context);
+ return {};
+}), "parseJsonBody");
+var parseJsonErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
+ const value = await parseJsonBody(errorBody, context);
+ value.message = value.message ?? value.Message;
+ return value;
+}, "parseJsonErrorBody");
+var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
+ let cleanValue = rawValue;
+ if (typeof cleanValue === "number") {
+ cleanValue = cleanValue.toString();
+ }
+ if (cleanValue.indexOf(",") >= 0) {
+ cleanValue = cleanValue.split(",")[0];
+ }
+ if (cleanValue.indexOf(":") >= 0) {
+ cleanValue = cleanValue.split(":")[0];
+ }
+ if (cleanValue.indexOf("#") >= 0) {
+ cleanValue = cleanValue.split("#")[1];
+ }
+ return cleanValue;
+ }, "sanitizeErrorCode");
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
+ if (headerKey !== void 0) {
+ return sanitizeErrorCode(output.headers[headerKey]);
}
- const contents = (0, import_smithy_client.map)({
- $metadata: deserializeMetadata(output)
- });
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
- const doc = (0, import_smithy_client.take)(data, {
- nextToken: import_smithy_client.expectString,
- roleList: import_smithy_client._json
- });
- Object.assign(contents, doc);
- return contents;
-}, "de_ListAccountRolesCommand");
-var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode !== 200 && output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (data.code !== void 0) {
+ return sanitizeErrorCode(data.code);
}
- const contents = (0, import_smithy_client.map)({
- $metadata: deserializeMetadata(output)
- });
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
- const doc = (0, import_smithy_client.take)(data, {
- accountList: import_smithy_client._json,
- nextToken: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- return contents;
-}, "de_ListAccountsCommand");
-var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode !== 200 && output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (data["__type"] !== void 0) {
+ return sanitizeErrorCode(data["__type"]);
}
- const contents = (0, import_smithy_client.map)({
- $metadata: deserializeMetadata(output)
- });
- await (0, import_smithy_client.collectBody)(output.body, context);
- return contents;
-}, "de_LogoutCommand");
-var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
- const parsedOutput = {
- ...output,
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
- };
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
- switch (errorCode) {
- case "InvalidRequestException":
- case "com.amazonaws.sso#InvalidRequestException":
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
- case "ResourceNotFoundException":
- case "com.amazonaws.sso#ResourceNotFoundException":
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
- case "TooManyRequestsException":
- case "com.amazonaws.sso#TooManyRequestsException":
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
- case "UnauthorizedException":
- case "com.amazonaws.sso#UnauthorizedException":
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
- default:
- const parsedBody = parsedOutput.body;
- return throwDefaultError({
- output,
- parsedBody,
- errorCode
- });
+}, "loadRestJsonErrorCode");
+
+// src/submodules/protocols/xml/parseXmlBody.ts
+var import_smithy_client3 = __nccwpck_require__(61411);
+var import_fast_xml_parser = __nccwpck_require__(39741);
+var parseXmlBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
+ if (encoded.length) {
+ const parser = new import_fast_xml_parser.XMLParser({
+ attributeNamePrefix: "",
+ htmlEntities: true,
+ ignoreAttributes: false,
+ ignoreDeclaration: true,
+ parseTagValue: false,
+ trimValues: false,
+ tagValueProcessor: /* @__PURE__ */ __name((_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0, "tagValueProcessor")
+ });
+ parser.addEntity("#xD", "\r");
+ parser.addEntity("#10", "\n");
+ let parsedObj;
+ try {
+ parsedObj = parser.parse(encoded, true);
+ } catch (e) {
+ if (e && typeof e === "object") {
+ Object.defineProperty(e, "$responseBodyText", {
+ value: encoded
+ });
+ }
+ throw e;
+ }
+ const textNodeName = "#text";
+ const key = Object.keys(parsedObj)[0];
+ const parsedObjToReturn = parsedObj[key];
+ if (parsedObjToReturn[textNodeName]) {
+ parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
+ delete parsedObjToReturn[textNodeName];
+ }
+ return (0, import_smithy_client3.getValueFromTextNode)(parsedObjToReturn);
}
-}, "de_CommandError");
-var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException);
-var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- message: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new InvalidRequestException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_InvalidRequestExceptionRes");
-var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- message: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new ResourceNotFoundException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_ResourceNotFoundExceptionRes");
-var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- message: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new TooManyRequestsException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_TooManyRequestsExceptionRes");
-var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const contents = (0, import_smithy_client.map)({});
- const data = parsedOutput.body;
- const doc = (0, import_smithy_client.take)(data, {
- message: import_smithy_client.expectString
- });
- Object.assign(contents, doc);
- const exception = new UnauthorizedException({
- $metadata: deserializeMetadata(parsedOutput),
- ...contents
- });
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
-}, "de_UnauthorizedExceptionRes");
-var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
- httpStatusCode: output.statusCode,
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
- extendedRequestId: output.headers["x-amz-id-2"],
- cfId: output.headers["x-amz-cf-id"]
-}), "deserializeMetadata");
-var _aI = "accountId";
-var _aT = "accessToken";
-var _ai = "account_id";
-var _mR = "maxResults";
-var _mr = "max_result";
-var _nT = "nextToken";
-var _nt = "next_token";
-var _rN = "roleName";
-var _rn = "role_name";
-var _xasbt = "x-amz-sso_bearer_token";
+ return {};
+}), "parseXmlBody");
+var parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
+ const value = await parseXmlBody(errorBody, context);
+ if (value.Error) {
+ value.Error.message = value.Error.message ?? value.Error.Message;
+ }
+ return value;
+}, "parseXmlErrorBody");
+var loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => {
+ if (data?.Error?.Code !== void 0) {
+ return data.Error.Code;
+ }
+ if (data?.Code !== void 0) {
+ return data.Code;
+ }
+ if (output.statusCode == 404) {
+ return "NotFound";
+ }
+}, "loadRestXmlErrorCode");
+// Annotate the CommonJS export names for ESM import in node:
+0 && (0);
-// src/commands/GetRoleCredentialsCommand.ts
-var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
-};
-__name(_GetRoleCredentialsCommand, "GetRoleCredentialsCommand");
-var GetRoleCredentialsCommand = _GetRoleCredentialsCommand;
-// src/commands/ListAccountRolesCommand.ts
+/***/ }),
+/***/ 55606:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() {
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
};
-__name(_ListAccountRolesCommand, "ListAccountRolesCommand");
-var ListAccountRolesCommand = _ListAccountRolesCommand;
-
-// src/commands/ListAccountsCommand.ts
-
-
-
-var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() {
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
};
-__name(_ListAccountsCommand, "ListAccountsCommand");
-var ListAccountsCommand = _ListAccountsCommand;
-
-// src/commands/LogoutCommand.ts
-
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
+ ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
+ ENV_EXPIRATION: () => ENV_EXPIRATION,
+ ENV_KEY: () => ENV_KEY,
+ ENV_SECRET: () => ENV_SECRET,
+ ENV_SESSION: () => ENV_SESSION,
+ fromEnv: () => fromEnv
+});
+module.exports = __toCommonJS(index_exports);
-var _LogoutCommand = class _LogoutCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() {
-};
-__name(_LogoutCommand, "LogoutCommand");
-var LogoutCommand = _LogoutCommand;
+// src/fromEnv.ts
+var import_client = __nccwpck_require__(5152);
+var import_property_provider = __nccwpck_require__(71238);
+var ENV_KEY = "AWS_ACCESS_KEY_ID";
+var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
+var ENV_SESSION = "AWS_SESSION_TOKEN";
+var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
+var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
+var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
+var fromEnv = /* @__PURE__ */ __name((init) => async () => {
+ init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
+ const accessKeyId = process.env[ENV_KEY];
+ const secretAccessKey = process.env[ENV_SECRET];
+ const sessionToken = process.env[ENV_SESSION];
+ const expiry = process.env[ENV_EXPIRATION];
+ const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
+ const accountId = process.env[ENV_ACCOUNT_ID];
+ if (accessKeyId && secretAccessKey) {
+ const credentials = {
+ accessKeyId,
+ secretAccessKey,
+ ...sessionToken && { sessionToken },
+ ...expiry && { expiration: new Date(expiry) },
+ ...credentialScope && { credentialScope },
+ ...accountId && { accountId }
+ };
+ (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
+ return credentials;
+ }
+ throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
+}, "fromEnv");
+// Annotate the CommonJS export names for ESM import in node:
-// src/SSO.ts
-var commands = {
- GetRoleCredentialsCommand,
- ListAccountRolesCommand,
- ListAccountsCommand,
- LogoutCommand
-};
-var _SSO = class _SSO extends SSOClient {
-};
-__name(_SSO, "SSO");
-var SSO = _SSO;
-(0, import_smithy_client.createAggregatedClient)(commands, SSO);
+0 && (0);
-// src/pagination/ListAccountRolesPaginator.ts
-var paginateListAccountRoles = (0, import_core.createPaginator)(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults");
-// src/pagination/ListAccountsPaginator.ts
+/***/ }),
-var paginateListAccounts = (0, import_core.createPaginator)(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults");
-// Annotate the CommonJS export names for ESM import in node:
+/***/ 1509:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-0 && (0);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.checkUrl = void 0;
+const property_provider_1 = __nccwpck_require__(71238);
+const LOOPBACK_CIDR_IPv4 = "127.0.0.0/8";
+const LOOPBACK_CIDR_IPv6 = "::1/128";
+const ECS_CONTAINER_HOST = "169.254.170.2";
+const EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
+const EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
+const checkUrl = (url, logger) => {
+ if (url.protocol === "https:") {
+ return;
+ }
+ if (url.hostname === ECS_CONTAINER_HOST ||
+ url.hostname === EKS_CONTAINER_HOST_IPv4 ||
+ url.hostname === EKS_CONTAINER_HOST_IPv6) {
+ return;
+ }
+ if (url.hostname.includes("[")) {
+ if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") {
+ return;
+ }
+ }
+ else {
+ if (url.hostname === "localhost") {
+ return;
+ }
+ const ipComponents = url.hostname.split(".");
+ const inRange = (component) => {
+ const num = parseInt(component, 10);
+ return 0 <= num && num <= 255;
+ };
+ if (ipComponents[0] === "127" &&
+ inRange(ipComponents[1]) &&
+ inRange(ipComponents[2]) &&
+ inRange(ipComponents[3]) &&
+ ipComponents.length === 4) {
+ return;
+ }
+ }
+ throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
+ - ECS container host 169.254.170.2
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger });
+};
+exports.checkUrl = checkUrl;
/***/ }),
-/***/ 82696:
+/***/ 68712:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getRuntimeConfig = void 0;
+exports.fromHttp = void 0;
const tslib_1 = __nccwpck_require__(61860);
-const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(45188));
-const core_1 = __nccwpck_require__(8704);
-const util_user_agent_node_1 = __nccwpck_require__(51656);
-const config_resolver_1 = __nccwpck_require__(39316);
-const hash_node_1 = __nccwpck_require__(5092);
-const middleware_retry_1 = __nccwpck_require__(19618);
-const node_config_provider_1 = __nccwpck_require__(55704);
+const client_1 = __nccwpck_require__(5152);
const node_http_handler_1 = __nccwpck_require__(61279);
-const util_body_length_node_1 = __nccwpck_require__(13638);
-const util_retry_1 = __nccwpck_require__(15518);
-const runtimeConfig_shared_1 = __nccwpck_require__(8073);
-const smithy_client_1 = __nccwpck_require__(61411);
-const util_defaults_mode_node_1 = __nccwpck_require__(15435);
-const smithy_client_2 = __nccwpck_require__(61411);
-const getRuntimeConfig = (config) => {
- (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
- const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
- const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
- const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
- (0, core_1.emitWarningIfUnsupportedVersion)(process.version);
- return {
- ...clientSharedValues,
- ...config,
- runtime: "node",
- defaultsMode,
- bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
- (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
- maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
- region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
- requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
- retryMode: config?.retryMode ??
- (0, node_config_provider_1.loadConfig)({
- ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
- default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
- }),
- sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
- streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
- useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
- userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS),
- };
+const property_provider_1 = __nccwpck_require__(71238);
+const promises_1 = tslib_1.__importDefault(__nccwpck_require__(91943));
+const checkUrl_1 = __nccwpck_require__(1509);
+const requestHelpers_1 = __nccwpck_require__(78914);
+const retry_wrapper_1 = __nccwpck_require__(51122);
+const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
+const DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
+const AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
+const AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
+const AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
+const fromHttp = (options = {}) => {
+ options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
+ let host;
+ const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
+ const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
+ const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
+ const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
+ const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger ? console.warn : options.logger.warn;
+ if (relative && full) {
+ warn("@aws-sdk/credential-provider-http: " +
+ "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
+ warn("awsContainerCredentialsFullUri will take precedence.");
+ }
+ if (token && tokenFile) {
+ warn("@aws-sdk/credential-provider-http: " +
+ "you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
+ warn("awsContainerAuthorizationToken will take precedence.");
+ }
+ if (full) {
+ host = full;
+ }
+ else if (relative) {
+ host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`;
+ }
+ else {
+ throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
+Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
+ }
+ const url = new URL(host);
+ (0, checkUrl_1.checkUrl)(url, options.logger);
+ const requestHandler = new node_http_handler_1.NodeHttpHandler({
+ requestTimeout: options.timeout ?? 1000,
+ connectionTimeout: options.timeout ?? 1000,
+ });
+ return (0, retry_wrapper_1.retryWrapper)(async () => {
+ const request = (0, requestHelpers_1.createGetRequest)(url);
+ if (token) {
+ request.headers.Authorization = token;
+ }
+ else if (tokenFile) {
+ request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString();
+ }
+ try {
+ const result = await requestHandler.handle(request);
+ return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z"));
+ }
+ catch (e) {
+ throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger });
+ }
+ }, options.maxRetries ?? 3, options.timeout ?? 1000);
};
-exports.getRuntimeConfig = getRuntimeConfig;
+exports.fromHttp = fromHttp;
/***/ }),
-/***/ 8073:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getRuntimeConfig = void 0;
-const core_1 = __nccwpck_require__(8704);
-const core_2 = __nccwpck_require__(90402);
-const smithy_client_1 = __nccwpck_require__(61411);
-const url_parser_1 = __nccwpck_require__(14494);
-const util_base64_1 = __nccwpck_require__(68385);
-const util_utf8_1 = __nccwpck_require__(71577);
-const httpAuthSchemeProvider_1 = __nccwpck_require__(62041);
-const endpointResolver_1 = __nccwpck_require__(13903);
-const getRuntimeConfig = (config) => {
- return {
- apiVersion: "2019-06-10",
- base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
- base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
- disableHostPrefix: config?.disableHostPrefix ?? false,
- endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
- extensions: config?.extensions ?? [],
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,
- httpAuthSchemes: config?.httpAuthSchemes ?? [
- {
- schemeId: "aws.auth#sigv4",
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
- signer: new core_1.AwsSdkSigV4Signer(),
- },
- {
- schemeId: "smithy.api#noAuth",
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
- signer: new core_2.NoAuthSigner(),
- },
- ],
- logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
- serviceId: config?.serviceId ?? "SSO",
- urlParser: config?.urlParser ?? url_parser_1.parseUrl,
- utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
- utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
- };
-};
-exports.getRuntimeConfig = getRuntimeConfig;
-
-
-/***/ }),
-
-/***/ 51548:
+/***/ 78914:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.STSClient = exports.__Client = void 0;
-const middleware_host_header_1 = __nccwpck_require__(52590);
-const middleware_logger_1 = __nccwpck_require__(85242);
-const middleware_recursion_detection_1 = __nccwpck_require__(81568);
-const middleware_user_agent_1 = __nccwpck_require__(32959);
-const config_resolver_1 = __nccwpck_require__(39316);
-const core_1 = __nccwpck_require__(90402);
-const middleware_content_length_1 = __nccwpck_require__(47212);
-const middleware_endpoint_1 = __nccwpck_require__(40099);
-const middleware_retry_1 = __nccwpck_require__(19618);
+exports.getCredentials = exports.createGetRequest = void 0;
+const property_provider_1 = __nccwpck_require__(71238);
+const protocol_http_1 = __nccwpck_require__(72356);
const smithy_client_1 = __nccwpck_require__(61411);
-Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } }));
-const httpAuthSchemeProvider_1 = __nccwpck_require__(39232);
-const EndpointParameters_1 = __nccwpck_require__(42912);
-const runtimeConfig_1 = __nccwpck_require__(12769);
-const runtimeExtensions_1 = __nccwpck_require__(60309);
-class STSClient extends smithy_client_1.Client {
- constructor(...[configuration]) {
- const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
- const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
- const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1);
- const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);
- const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);
- const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
- const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5);
- const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);
- const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
- super(_config_8);
- this.config = _config_8;
- this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
- this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
- this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
- this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
- this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
- this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
- this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
- httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider,
- identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({
- "aws.auth#sigv4": config.credentials,
- }),
- }));
- this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));
+const util_stream_1 = __nccwpck_require__(4252);
+function createGetRequest(url) {
+ return new protocol_http_1.HttpRequest({
+ protocol: url.protocol,
+ hostname: url.hostname,
+ port: Number(url.port),
+ path: url.pathname,
+ query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => {
+ acc[k] = v;
+ return acc;
+ }, {}),
+ fragment: url.hash,
+ });
+}
+exports.createGetRequest = createGetRequest;
+async function getCredentials(response, logger) {
+ const stream = (0, util_stream_1.sdkStreamMixin)(response.body);
+ const str = await stream.transformToString();
+ if (response.statusCode === 200) {
+ const parsed = JSON.parse(str);
+ if (typeof parsed.AccessKeyId !== "string" ||
+ typeof parsed.SecretAccessKey !== "string" ||
+ typeof parsed.Token !== "string" ||
+ typeof parsed.Expiration !== "string") {
+ throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: " +
+ "{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger });
+ }
+ return {
+ accessKeyId: parsed.AccessKeyId,
+ secretAccessKey: parsed.SecretAccessKey,
+ sessionToken: parsed.Token,
+ expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration),
+ };
}
- destroy() {
- super.destroy();
+ if (response.statusCode >= 400 && response.statusCode < 500) {
+ let parsedBody = {};
+ try {
+ parsedBody = JSON.parse(str);
+ }
+ catch (e) { }
+ throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), {
+ Code: parsedBody.Code,
+ Message: parsedBody.Message,
+ });
}
+ throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger });
}
-exports.STSClient = STSClient;
+exports.getCredentials = getCredentials;
/***/ }),
-/***/ 79915:
+/***/ 51122:
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;
-const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
- let _credentials = runtimeConfig.credentials;
- return {
- setHttpAuthScheme(httpAuthScheme) {
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
- if (index === -1) {
- _httpAuthSchemes.push(httpAuthScheme);
+exports.retryWrapper = void 0;
+const retryWrapper = (toRetry, maxRetries, delayMs) => {
+ return async () => {
+ for (let i = 0; i < maxRetries; ++i) {
+ try {
+ return await toRetry();
}
- else {
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
+ catch (e) {
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
}
- },
- httpAuthSchemes() {
- return _httpAuthSchemes;
- },
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
- },
- httpAuthSchemeProvider() {
- return _httpAuthSchemeProvider;
- },
- setCredentials(credentials) {
- _credentials = credentials;
- },
- credentials() {
- return _credentials;
- },
- };
-};
-exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;
-const resolveHttpAuthRuntimeConfig = (config) => {
- return {
- httpAuthSchemes: config.httpAuthSchemes(),
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
- credentials: config.credentials(),
- };
-};
-exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;
-
-
-/***/ }),
-
-/***/ 39232:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;
-const core_1 = __nccwpck_require__(8704);
-const util_middleware_1 = __nccwpck_require__(76324);
-const STSClient_1 = __nccwpck_require__(51548);
-const defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
- return {
- operation: (0, util_middleware_1.getSmithyContext)(context).operation,
- region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
- (() => {
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
- })(),
- };
-};
-exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;
-function createAwsAuthSigv4HttpAuthOption(authParameters) {
- return {
- schemeId: "aws.auth#sigv4",
- signingProperties: {
- name: "sts",
- region: authParameters.region,
- },
- propertiesExtractor: (config, context) => ({
- signingProperties: {
- config,
- context,
- },
- }),
- };
-}
-function createSmithyApiNoAuthHttpAuthOption(authParameters) {
- return {
- schemeId: "smithy.api#noAuth",
- };
-}
-const defaultSTSHttpAuthSchemeProvider = (authParameters) => {
- const options = [];
- switch (authParameters.operation) {
- case "AssumeRoleWithSAML": {
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
- break;
- }
- case "AssumeRoleWithWebIdentity": {
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
- break;
- }
- default: {
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
}
- }
- return options;
-};
-exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;
-const resolveStsAuthConfig = (input) => ({
- ...input,
- stsClientCtor: STSClient_1.STSClient,
-});
-exports.resolveStsAuthConfig = resolveStsAuthConfig;
-const resolveHttpAuthSchemeConfig = (config) => {
- const config_0 = (0, exports.resolveStsAuthConfig)(config);
- const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);
- return {
- ...config_1,
- };
-};
-exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
-
-
-/***/ }),
-
-/***/ 42912:
-/***/ ((__unused_webpack_module, exports) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.commonParams = exports.resolveClientEndpointParameters = void 0;
-const resolveClientEndpointParameters = (options) => {
- return {
- ...options,
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
- useFipsEndpoint: options.useFipsEndpoint ?? false,
- useGlobalEndpoint: options.useGlobalEndpoint ?? false,
- defaultSigningName: "sts",
+ return await toRetry();
};
};
-exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
-exports.commonParams = {
- UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
- Endpoint: { type: "builtInParams", name: "endpoint" },
- Region: { type: "builtInParams", name: "region" },
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
-};
+exports.retryWrapper = retryWrapper;
/***/ }),
-/***/ 51030:
+/***/ 98605:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.defaultEndpointResolver = void 0;
-const util_endpoints_1 = __nccwpck_require__(83068);
-const util_endpoints_2 = __nccwpck_require__(79674);
-const ruleset_1 = __nccwpck_require__(46199);
-const cache = new util_endpoints_2.EndpointCache({
- size: 50,
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
-});
-const defaultEndpointResolver = (endpointParams, context = {}) => {
- return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
- endpointParams: endpointParams,
- logger: context.logger,
- }));
-};
-exports.defaultEndpointResolver = defaultEndpointResolver;
-util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
-
-
-/***/ }),
-
-/***/ 46199:
-/***/ ((__unused_webpack_module, exports) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.ruleSet = void 0;
-const F = "required", G = "type", H = "fn", I = "argv", J = "ref";
-const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "String" }, n = { [F]: true, "default": false, [G]: "Boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y];
-const _data = { version: "1.0", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] };
-exports.ruleSet = _data;
+exports.fromHttp = void 0;
+var fromHttp_1 = __nccwpck_require__(68712);
+Object.defineProperty(exports, "fromHttp", ({ enumerable: true, get: function () { return fromHttp_1.fromHttp; } }));
/***/ }),
-/***/ 71695:
+/***/ 75869:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
@@ -11355,1409 +10926,1057 @@ var __copyProps = (to, from, except, desc) => {
}
return to;
};
-var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- AssumeRoleCommand: () => AssumeRoleCommand,
- AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog,
- AssumeRoleWithSAMLCommand: () => AssumeRoleWithSAMLCommand,
- AssumeRoleWithSAMLRequestFilterSensitiveLog: () => AssumeRoleWithSAMLRequestFilterSensitiveLog,
- AssumeRoleWithSAMLResponseFilterSensitiveLog: () => AssumeRoleWithSAMLResponseFilterSensitiveLog,
- AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand,
- AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
- AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
- ClientInputEndpointParameters: () => import_EndpointParameters9.ClientInputEndpointParameters,
- CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
- DecodeAuthorizationMessageCommand: () => DecodeAuthorizationMessageCommand,
- ExpiredTokenException: () => ExpiredTokenException,
- GetAccessKeyInfoCommand: () => GetAccessKeyInfoCommand,
- GetCallerIdentityCommand: () => GetCallerIdentityCommand,
- GetFederationTokenCommand: () => GetFederationTokenCommand,
- GetFederationTokenResponseFilterSensitiveLog: () => GetFederationTokenResponseFilterSensitiveLog,
- GetSessionTokenCommand: () => GetSessionTokenCommand,
- GetSessionTokenResponseFilterSensitiveLog: () => GetSessionTokenResponseFilterSensitiveLog,
- IDPCommunicationErrorException: () => IDPCommunicationErrorException,
- IDPRejectedClaimException: () => IDPRejectedClaimException,
- InvalidAuthorizationMessageException: () => InvalidAuthorizationMessageException,
- InvalidIdentityTokenException: () => InvalidIdentityTokenException,
- MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
- PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
- RegionDisabledException: () => RegionDisabledException,
- STS: () => STS,
- STSServiceException: () => STSServiceException,
- decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
- getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
- getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2
+var index_exports = {};
+__export(index_exports, {
+ fromIni: () => fromIni
});
-module.exports = __toCommonJS(src_exports);
-__reExport(src_exports, __nccwpck_require__(51548), module.exports);
+module.exports = __toCommonJS(index_exports);
-// src/STS.ts
+// src/fromIni.ts
-// src/commands/AssumeRoleCommand.ts
-var import_middleware_endpoint = __nccwpck_require__(40099);
-var import_middleware_serde = __nccwpck_require__(83255);
+// src/resolveProfileData.ts
-var import_EndpointParameters = __nccwpck_require__(42912);
-// src/models/models_0.ts
+// src/resolveAssumeRoleCredentials.ts
-// src/models/STSServiceException.ts
-var import_smithy_client = __nccwpck_require__(61411);
-var _STSServiceException = class _STSServiceException extends import_smithy_client.ServiceException {
- /**
- * @internal
- */
- constructor(options) {
- super(options);
- Object.setPrototypeOf(this, _STSServiceException.prototype);
- }
-};
-__name(_STSServiceException, "STSServiceException");
-var STSServiceException = _STSServiceException;
+var import_shared_ini_file_loader = __nccwpck_require__(94964);
-// src/models/models_0.ts
-var _ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "ExpiredTokenException",
- $fault: "client",
- ...opts
- });
- this.name = "ExpiredTokenException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
+// src/resolveCredentialSource.ts
+var import_client = __nccwpck_require__(5152);
+var import_property_provider = __nccwpck_require__(71238);
+var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger) => {
+ const sourceProvidersMap = {
+ EcsContainer: /* @__PURE__ */ __name(async (options) => {
+ const { fromHttp } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(98605)));
+ const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(40566)));
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
+ return async () => (0, import_property_provider.chain)(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
+ }, "EcsContainer"),
+ Ec2InstanceMetadata: /* @__PURE__ */ __name(async (options) => {
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
+ const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(40566)));
+ return async () => fromInstanceMetadata(options)().then(setNamedProvider);
+ }, "Ec2InstanceMetadata"),
+ Environment: /* @__PURE__ */ __name(async (options) => {
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
+ const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(55606)));
+ return async () => fromEnv(options)().then(setNamedProvider);
+ }, "Environment")
+ };
+ if (credentialSource in sourceProvidersMap) {
+ return sourceProvidersMap[credentialSource];
+ } else {
+ throw new import_property_provider.CredentialsProviderError(
+ `Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,
+ { logger }
+ );
}
-};
-__name(_ExpiredTokenException, "ExpiredTokenException");
-var ExpiredTokenException = _ExpiredTokenException;
-var _MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "MalformedPolicyDocumentException",
- $fault: "client",
- ...opts
- });
- this.name = "MalformedPolicyDocumentException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
+}, "resolveCredentialSource");
+var setNamedProvider = /* @__PURE__ */ __name((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), "setNamedProvider");
+
+// src/resolveAssumeRoleCredentials.ts
+var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger } = {}) => {
+ return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger }));
+}, "isAssumeRoleProfile");
+var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger }) => {
+ const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
+ if (withSourceProfile) {
+ logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
}
-};
-__name(_MalformedPolicyDocumentException, "MalformedPolicyDocumentException");
-var MalformedPolicyDocumentException = _MalformedPolicyDocumentException;
-var _PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "PackedPolicyTooLargeException",
- $fault: "client",
- ...opts
- });
- this.name = "PackedPolicyTooLargeException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
+ return withSourceProfile;
+}, "isAssumeRoleWithSourceProfile");
+var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger }) => {
+ const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
+ if (withProviderProfile) {
+ logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
}
-};
-__name(_PackedPolicyTooLargeException, "PackedPolicyTooLargeException");
-var PackedPolicyTooLargeException = _PackedPolicyTooLargeException;
-var _RegionDisabledException = class _RegionDisabledException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "RegionDisabledException",
- $fault: "client",
- ...opts
- });
- this.name = "RegionDisabledException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _RegionDisabledException.prototype);
+ return withProviderProfile;
+}, "isCredentialSourceProfile");
+var resolveAssumeRoleCredentials = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}) => {
+ options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
+ const profileData = profiles[profileName];
+ const { source_profile, region } = profileData;
+ if (!options.roleAssumer) {
+ const { getDefaultRoleAssumer } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(1136)));
+ options.roleAssumer = getDefaultRoleAssumer(
+ {
+ ...options.clientConfig,
+ credentialProviderLogger: options.logger,
+ parentClientConfig: {
+ ...options?.parentClientConfig,
+ region: region ?? options?.parentClientConfig?.region
+ }
+ },
+ options.clientPlugins
+ );
}
-};
-__name(_RegionDisabledException, "RegionDisabledException");
-var RegionDisabledException = _RegionDisabledException;
-var _IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "IDPRejectedClaimException",
- $fault: "client",
- ...opts
- });
- this.name = "IDPRejectedClaimException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
+ if (source_profile && source_profile in visitedProfiles) {
+ throw new import_property_provider.CredentialsProviderError(
+ `Detected a cycle attempting to resolve credentials for profile ${(0, import_shared_ini_file_loader.getProfileName)(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "),
+ { logger: options.logger }
+ );
}
-};
-__name(_IDPRejectedClaimException, "IDPRejectedClaimException");
-var IDPRejectedClaimException = _IDPRejectedClaimException;
-var _InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidIdentityTokenException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidIdentityTokenException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
+ options.logger?.debug(
+ `@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`
+ );
+ const sourceCredsProvider = source_profile ? resolveProfileData(
+ source_profile,
+ profiles,
+ options,
+ {
+ ...visitedProfiles,
+ [source_profile]: true
+ },
+ isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})
+ ) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
+ if (isCredentialSourceWithoutRoleArn(profileData)) {
+ return sourceCredsProvider.then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
+ } else {
+ const params = {
+ RoleArn: profileData.role_arn,
+ RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
+ ExternalId: profileData.external_id,
+ DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
+ };
+ const { mfa_serial } = profileData;
+ if (mfa_serial) {
+ if (!options.mfaCodeProvider) {
+ throw new import_property_provider.CredentialsProviderError(
+ `Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`,
+ { logger: options.logger, tryNextLink: false }
+ );
+ }
+ params.SerialNumber = mfa_serial;
+ params.TokenCode = await options.mfaCodeProvider(mfa_serial);
+ }
+ const sourceCreds = await sourceCredsProvider;
+ return options.roleAssumer(sourceCreds, params).then(
+ (creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")
+ );
}
-};
-__name(_InvalidIdentityTokenException, "InvalidIdentityTokenException");
-var InvalidIdentityTokenException = _InvalidIdentityTokenException;
-var _IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "IDPCommunicationErrorException",
- $fault: "client",
- ...opts
- });
- this.name = "IDPCommunicationErrorException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
- }
-};
-__name(_IDPCommunicationErrorException, "IDPCommunicationErrorException");
-var IDPCommunicationErrorException = _IDPCommunicationErrorException;
-var _InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException extends STSServiceException {
- /**
- * @internal
- */
- constructor(opts) {
- super({
- name: "InvalidAuthorizationMessageException",
- $fault: "client",
- ...opts
- });
- this.name = "InvalidAuthorizationMessageException";
- this.$fault = "client";
- Object.setPrototypeOf(this, _InvalidAuthorizationMessageException.prototype);
- }
-};
-__name(_InvalidAuthorizationMessageException, "InvalidAuthorizationMessageException");
-var InvalidAuthorizationMessageException = _InvalidAuthorizationMessageException;
-var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client.SENSITIVE_STRING }
-}), "CredentialsFilterSensitiveLog");
-var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
-}), "AssumeRoleResponseFilterSensitiveLog");
-var AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.SAMLAssertion && { SAMLAssertion: import_smithy_client.SENSITIVE_STRING }
-}), "AssumeRoleWithSAMLRequestFilterSensitiveLog");
-var AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
-}), "AssumeRoleWithSAMLResponseFilterSensitiveLog");
-var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client.SENSITIVE_STRING }
-}), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog");
-var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
-}), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog");
-var GetFederationTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
-}), "GetFederationTokenResponseFilterSensitiveLog");
-var GetSessionTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
- ...obj,
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
-}), "GetSessionTokenResponseFilterSensitiveLog");
+}, "resolveAssumeRoleCredentials");
+var isCredentialSourceWithoutRoleArn = /* @__PURE__ */ __name((section) => {
+ return !section.role_arn && !!section.credential_source;
+}, "isCredentialSourceWithoutRoleArn");
-// src/protocols/Aws_query.ts
-var import_core = __nccwpck_require__(8704);
-var import_protocol_http = __nccwpck_require__(72356);
+// src/resolveProcessCredentials.ts
-var se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_AssumeRoleRequest(input, context),
- [_A]: _AR,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_AssumeRoleCommand");
-var se_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_AssumeRoleWithSAMLRequest(input, context),
- [_A]: _ARWSAML,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_AssumeRoleWithSAMLCommand");
-var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_AssumeRoleWithWebIdentityRequest(input, context),
- [_A]: _ARWWI,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_AssumeRoleWithWebIdentityCommand");
-var se_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_DecodeAuthorizationMessageRequest(input, context),
- [_A]: _DAM,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_DecodeAuthorizationMessageCommand");
-var se_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_GetAccessKeyInfoRequest(input, context),
- [_A]: _GAKI,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_GetAccessKeyInfoCommand");
-var se_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_GetCallerIdentityRequest(input, context),
- [_A]: _GCI,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_GetCallerIdentityCommand");
-var se_GetFederationTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_GetFederationTokenRequest(input, context),
- [_A]: _GFT,
- [_V]: _
- });
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_GetFederationTokenCommand");
-var se_GetSessionTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
- const headers = SHARED_HEADERS;
- let body;
- body = buildFormUrlencodedString({
- ...se_GetSessionTokenRequest(input, context),
- [_A]: _GST,
- [_V]: _
+var isProcessProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", "isProcessProfile");
+var resolveProcessCredentials = /* @__PURE__ */ __name(async (options, profile) => Promise.resolve().then(() => __toESM(__nccwpck_require__(75360))).then(
+ ({ fromProcess }) => fromProcess({
+ ...options,
+ profile
+ })().then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))
+), "resolveProcessCredentials");
+
+// src/resolveSsoCredentials.ts
+
+var resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, profileData, options = {}) => {
+ const { fromSSO } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(60998)));
+ return fromSSO({
+ profile,
+ logger: options.logger,
+ parentClientConfig: options.parentClientConfig,
+ clientConfig: options.clientConfig
+ })().then((creds) => {
+ if (profileData.sso_session) {
+ return (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SSO", "r");
+ } else {
+ return (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
+ }
});
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
-}, "se_GetSessionTokenCommand");
-var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
- }
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_AssumeRoleCommand");
-var de_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
- }
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
+}, "resolveSsoCredentials");
+var isSsoProfile = /* @__PURE__ */ __name((arg) => 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"), "isSsoProfile");
+
+// src/resolveStaticCredentials.ts
+
+var isStaticCredsProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1, "isStaticCredsProfile");
+var resolveStaticCredentials = /* @__PURE__ */ __name(async (profile, options) => {
+ options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
+ const credentials = {
+ accessKeyId: profile.aws_access_key_id,
+ secretAccessKey: profile.aws_secret_access_key,
+ sessionToken: profile.aws_session_token,
+ ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
+ ...profile.aws_account_id && { accountId: profile.aws_account_id }
};
- return response;
-}, "de_AssumeRoleWithSAMLCommand");
-var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
+ return (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_PROFILE", "n");
+}, "resolveStaticCredentials");
+
+// src/resolveWebIdentityCredentials.ts
+
+var isWebIdentityProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, "isWebIdentityProfile");
+var resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options) => Promise.resolve().then(() => __toESM(__nccwpck_require__(29956))).then(
+ ({ fromTokenFile }) => fromTokenFile({
+ webIdentityTokenFile: profile.web_identity_token_file,
+ roleArn: profile.role_arn,
+ roleSessionName: profile.role_session_name,
+ roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
+ logger: options.logger,
+ parentClientConfig: options.parentClientConfig
+ })().then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))
+), "resolveWebIdentityCredentials");
+
+// src/resolveProfileData.ts
+var resolveProfileData = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
+ const data = profiles[profileName];
+ if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
+ return resolveStaticCredentials(data, options);
}
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_AssumeRoleWithWebIdentityCommand");
-var de_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
+ return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
}
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_DecodeAuthorizationMessageCommand");
-var de_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (isStaticCredsProfile(data)) {
+ return resolveStaticCredentials(data, options);
}
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_GetAccessKeyInfoCommand");
-var de_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (isWebIdentityProfile(data)) {
+ return resolveWebIdentityCredentials(data, options);
}
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_GetCallerIdentityCommand");
-var de_GetFederationTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (isProcessProfile(data)) {
+ return resolveProcessCredentials(options, profileName);
}
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_GetFederationTokenCommand");
-var de_GetSessionTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
- if (output.statusCode >= 300) {
- return de_CommandError(output, context);
+ if (isSsoProfile(data)) {
+ return await resolveSsoCredentials(profileName, data, options);
}
- const data = await (0, import_core.parseXmlBody)(output.body, context);
- let contents = {};
- contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context);
- const response = {
- $metadata: deserializeMetadata(output),
- ...contents
- };
- return response;
-}, "de_GetSessionTokenCommand");
-var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
- const parsedOutput = {
- ...output,
- body: await (0, import_core.parseXmlErrorBody)(output.body, context)
+ throw new import_property_provider.CredentialsProviderError(
+ `Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`,
+ { logger: options.logger }
+ );
+}, "resolveProfileData");
+
+// src/fromIni.ts
+var fromIni = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => {
+ const init = {
+ ..._init,
+ parentClientConfig: {
+ ...callerClientConfig,
+ ..._init.parentClientConfig
+ }
};
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
- switch (errorCode) {
- case "ExpiredTokenException":
- case "com.amazonaws.sts#ExpiredTokenException":
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
- case "MalformedPolicyDocument":
- case "com.amazonaws.sts#MalformedPolicyDocumentException":
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
- case "PackedPolicyTooLarge":
- case "com.amazonaws.sts#PackedPolicyTooLargeException":
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
- case "RegionDisabledException":
- case "com.amazonaws.sts#RegionDisabledException":
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
- case "IDPRejectedClaim":
- case "com.amazonaws.sts#IDPRejectedClaimException":
- throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
- case "InvalidIdentityToken":
- case "com.amazonaws.sts#InvalidIdentityTokenException":
- throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
- case "IDPCommunicationError":
- case "com.amazonaws.sts#IDPCommunicationErrorException":
- throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
- case "InvalidAuthorizationMessageException":
- case "com.amazonaws.sts#InvalidAuthorizationMessageException":
- throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
- default:
- const parsedBody = parsedOutput.body;
- return throwDefaultError({
- output,
- parsedBody: parsedBody.Error,
- errorCode
- });
+ init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
+ const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
+ return resolveProfileData(
+ (0, import_shared_ini_file_loader.getProfileName)({
+ profile: _init.profile ?? callerClientConfig?.profile
+ }),
+ profiles,
+ init
+ );
+}, "fromIni");
+// Annotate the CommonJS export names for ESM import in node:
+
+0 && (0);
+
+
+
+/***/ }),
+
+/***/ 5861:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
-}, "de_CommandError");
-var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_ExpiredTokenException(body.Error, context);
- const exception = new ExpiredTokenException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_ExpiredTokenExceptionRes");
-var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_IDPCommunicationErrorException(body.Error, context);
- const exception = new IDPCommunicationErrorException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_IDPCommunicationErrorExceptionRes");
-var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_IDPRejectedClaimException(body.Error, context);
- const exception = new IDPRejectedClaimException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_IDPRejectedClaimExceptionRes");
-var de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_InvalidAuthorizationMessageException(body.Error, context);
- const exception = new InvalidAuthorizationMessageException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_InvalidAuthorizationMessageExceptionRes");
-var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_InvalidIdentityTokenException(body.Error, context);
- const exception = new InvalidIdentityTokenException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_InvalidIdentityTokenExceptionRes");
-var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
- const exception = new MalformedPolicyDocumentException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_MalformedPolicyDocumentExceptionRes");
-var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
- const exception = new PackedPolicyTooLargeException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_PackedPolicyTooLargeExceptionRes");
-var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
- const body = parsedOutput.body;
- const deserialized = de_RegionDisabledException(body.Error, context);
- const exception = new RegionDisabledException({
- $metadata: deserializeMetadata(parsedOutput),
- ...deserialized
- });
- return (0, import_smithy_client.decorateServiceException)(exception, body);
-}, "de_RegionDisabledExceptionRes");
-var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => {
- var _a2, _b, _c, _d;
- const entries = {};
- if (input[_RA] != null) {
- entries[_RA] = input[_RA];
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ credentialsTreatedAsExpired: () => credentialsTreatedAsExpired,
+ credentialsWillNeedRefresh: () => credentialsWillNeedRefresh,
+ defaultProvider: () => defaultProvider
+});
+module.exports = __toCommonJS(index_exports);
+
+// src/defaultProvider.ts
+var import_credential_provider_env = __nccwpck_require__(55606);
+
+var import_shared_ini_file_loader = __nccwpck_require__(94964);
+
+// src/remoteProvider.ts
+var import_property_provider = __nccwpck_require__(71238);
+var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
+var remoteProvider = /* @__PURE__ */ __name(async (init) => {
+ const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(40566)));
+ if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
+ init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
+ const { fromHttp } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(98605)));
+ return (0, import_property_provider.chain)(fromHttp(init), fromContainerMetadata(init));
}
- if (input[_RSN] != null) {
- entries[_RSN] = input[_RSN];
+ if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") {
+ return async () => {
+ throw new import_property_provider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger });
+ };
}
- if (input[_PA] != null) {
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
- if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
- entries.PolicyArns = [];
+ init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata");
+ return fromInstanceMetadata(init);
+}, "remoteProvider");
+
+// src/defaultProvider.ts
+var multipleCredentialSourceWarningEmitted = false;
+var defaultProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)(
+ (0, import_property_provider.chain)(
+ async () => {
+ const profile = init.profile ?? process.env[import_shared_ini_file_loader.ENV_PROFILE];
+ if (profile) {
+ const envStaticCredentialsAreSet = process.env[import_credential_provider_env.ENV_KEY] && process.env[import_credential_provider_env.ENV_SECRET];
+ if (envStaticCredentialsAreSet) {
+ if (!multipleCredentialSourceWarningEmitted) {
+ const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" ? init.logger.warn : console.warn;
+ warnFn(
+ `@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
+ Multiple credential sources detected:
+ Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
+ This SDK will proceed with the AWS_PROFILE value.
+
+ However, a future version may change this behavior to prefer the ENV static credentials.
+ Please ensure that your environment only sets either the AWS_PROFILE or the
+ AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
+`
+ );
+ multipleCredentialSourceWarningEmitted = true;
+ }
+ }
+ throw new import_property_provider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", {
+ logger: init.logger,
+ tryNextLink: true
+ });
+ }
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv");
+ return (0, import_credential_provider_env.fromEnv)(init)();
+ },
+ async () => {
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");
+ const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
+ if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
+ throw new import_property_provider.CredentialsProviderError(
+ "Skipping SSO provider in default chain (inputs do not include SSO fields).",
+ { logger: init.logger }
+ );
+ }
+ const { fromSSO } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(60998)));
+ return fromSSO(init)();
+ },
+ async () => {
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
+ const { fromIni } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(75869)));
+ return fromIni(init)();
+ },
+ async () => {
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
+ const { fromProcess } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(75360)));
+ return fromProcess(init)();
+ },
+ async () => {
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
+ const { fromTokenFile } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(29956)));
+ return fromTokenFile(init)();
+ },
+ async () => {
+ init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider");
+ return (await remoteProvider(init))();
+ },
+ async () => {
+ throw new import_property_provider.CredentialsProviderError("Could not load credentials from any providers", {
+ tryNextLink: false,
+ logger: init.logger
+ });
}
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `PolicyArns.${key}`;
- entries[loc] = value;
- });
- }
- if (input[_P] != null) {
- entries[_P] = input[_P];
- }
- if (input[_DS] != null) {
- entries[_DS] = input[_DS];
- }
- if (input[_T] != null) {
- const memberEntries = se_tagListType(input[_T], context);
- if (((_b = input[_T]) == null ? void 0 : _b.length) === 0) {
- entries.Tags = [];
- }
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `Tags.${key}`;
- entries[loc] = value;
- });
- }
- if (input[_TTK] != null) {
- const memberEntries = se_tagKeyListType(input[_TTK], context);
- if (((_c = input[_TTK]) == null ? void 0 : _c.length) === 0) {
- entries.TransitiveTagKeys = [];
- }
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `TransitiveTagKeys.${key}`;
- entries[loc] = value;
- });
- }
- if (input[_EI] != null) {
- entries[_EI] = input[_EI];
- }
- if (input[_SN] != null) {
- entries[_SN] = input[_SN];
+ ),
+ credentialsTreatedAsExpired,
+ credentialsWillNeedRefresh
+), "defaultProvider");
+var credentialsWillNeedRefresh = /* @__PURE__ */ __name((credentials) => credentials?.expiration !== void 0, "credentialsWillNeedRefresh");
+var credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5, "credentialsTreatedAsExpired");
+// Annotate the CommonJS export names for ESM import in node:
+
+0 && (0);
+
+
+
+/***/ }),
+
+/***/ 75360:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
- if (input[_TC] != null) {
- entries[_TC] = input[_TC];
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ fromProcess: () => fromProcess
+});
+module.exports = __toCommonJS(index_exports);
+
+// src/fromProcess.ts
+var import_shared_ini_file_loader = __nccwpck_require__(94964);
+
+// src/resolveProcessCredentials.ts
+var import_property_provider = __nccwpck_require__(71238);
+var import_child_process = __nccwpck_require__(35317);
+var import_util = __nccwpck_require__(39023);
+
+// src/getValidatedProcessCredentials.ts
+var import_client = __nccwpck_require__(5152);
+var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data, profiles) => {
+ if (data.Version !== 1) {
+ throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
}
- if (input[_SI] != null) {
- entries[_SI] = input[_SI];
+ if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) {
+ throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
}
- if (input[_PC] != null) {
- const memberEntries = se_ProvidedContextsListType(input[_PC], context);
- if (((_d = input[_PC]) == null ? void 0 : _d.length) === 0) {
- entries.ProvidedContexts = [];
+ if (data.Expiration) {
+ const currentTime = /* @__PURE__ */ new Date();
+ const expireTime = new Date(data.Expiration);
+ if (expireTime < currentTime) {
+ throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
}
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `ProvidedContexts.${key}`;
- entries[loc] = value;
- });
- }
- return entries;
-}, "se_AssumeRoleRequest");
-var se_AssumeRoleWithSAMLRequest = /* @__PURE__ */ __name((input, context) => {
- var _a2;
- const entries = {};
- if (input[_RA] != null) {
- entries[_RA] = input[_RA];
- }
- if (input[_PAr] != null) {
- entries[_PAr] = input[_PAr];
}
- if (input[_SAMLA] != null) {
- entries[_SAMLA] = input[_SAMLA];
+ let accountId = data.AccountId;
+ if (!accountId && profiles?.[profileName]?.aws_account_id) {
+ accountId = profiles[profileName].aws_account_id;
}
- if (input[_PA] != null) {
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
- if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
- entries.PolicyArns = [];
+ const credentials = {
+ accessKeyId: data.AccessKeyId,
+ secretAccessKey: data.SecretAccessKey,
+ ...data.SessionToken && { sessionToken: data.SessionToken },
+ ...data.Expiration && { expiration: new Date(data.Expiration) },
+ ...data.CredentialScope && { credentialScope: data.CredentialScope },
+ ...accountId && { accountId }
+ };
+ (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_PROCESS", "w");
+ return credentials;
+}, "getValidatedProcessCredentials");
+
+// src/resolveProcessCredentials.ts
+var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger) => {
+ const profile = profiles[profileName];
+ if (profiles[profileName]) {
+ const credentialProcess = profile["credential_process"];
+ if (credentialProcess !== void 0) {
+ const execPromise = (0, import_util.promisify)(import_child_process.exec);
+ try {
+ const { stdout } = await execPromise(credentialProcess);
+ let data;
+ try {
+ data = JSON.parse(stdout.trim());
+ } catch {
+ throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
+ }
+ return getValidatedProcessCredentials(profileName, data, profiles);
+ } catch (error) {
+ throw new import_property_provider.CredentialsProviderError(error.message, { logger });
+ }
+ } else {
+ throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
}
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `PolicyArns.${key}`;
- entries[loc] = value;
+ } else {
+ throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
+ logger
});
}
- if (input[_P] != null) {
- entries[_P] = input[_P];
- }
- if (input[_DS] != null) {
- entries[_DS] = input[_DS];
- }
- return entries;
-}, "se_AssumeRoleWithSAMLRequest");
-var se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context) => {
- var _a2;
- const entries = {};
- if (input[_RA] != null) {
- entries[_RA] = input[_RA];
- }
- if (input[_RSN] != null) {
- entries[_RSN] = input[_RSN];
- }
- if (input[_WIT] != null) {
- entries[_WIT] = input[_WIT];
+}, "resolveProcessCredentials");
+
+// src/fromProcess.ts
+var fromProcess = /* @__PURE__ */ __name((init = {}) => async ({ callerClientConfig } = {}) => {
+ init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
+ const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
+ return resolveProcessCredentials(
+ (0, import_shared_ini_file_loader.getProfileName)({
+ profile: init.profile ?? callerClientConfig?.profile
+ }),
+ profiles,
+ init.logger
+ );
+}, "fromProcess");
+// Annotate the CommonJS export names for ESM import in node:
+
+0 && (0);
+
+
+
+/***/ }),
+
+/***/ 60998:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __esm = (fn, res) => function __init() {
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
+};
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
- if (input[_PI] != null) {
- entries[_PI] = input[_PI];
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/loadSso.ts
+var loadSso_exports = {};
+__export(loadSso_exports, {
+ GetRoleCredentialsCommand: () => import_client_sso.GetRoleCredentialsCommand,
+ SSOClient: () => import_client_sso.SSOClient
+});
+var import_client_sso;
+var init_loadSso = __esm({
+ "src/loadSso.ts"() {
+ "use strict";
+ import_client_sso = __nccwpck_require__(62054);
}
- if (input[_PA] != null) {
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
- if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
- entries.PolicyArns = [];
+});
+
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ fromSSO: () => fromSSO,
+ isSsoProfile: () => isSsoProfile,
+ validateSsoProfile: () => validateSsoProfile
+});
+module.exports = __toCommonJS(index_exports);
+
+// src/fromSSO.ts
+
+
+
+// src/isSsoProfile.ts
+var isSsoProfile = /* @__PURE__ */ __name((arg) => 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"), "isSsoProfile");
+
+// src/resolveSSOCredentials.ts
+var import_client = __nccwpck_require__(5152);
+var import_token_providers = __nccwpck_require__(75433);
+var import_property_provider = __nccwpck_require__(71238);
+var import_shared_ini_file_loader = __nccwpck_require__(94964);
+var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
+var resolveSSOCredentials = /* @__PURE__ */ __name(async ({
+ ssoStartUrl,
+ ssoSession,
+ ssoAccountId,
+ ssoRegion,
+ ssoRoleName,
+ ssoClient,
+ clientConfig,
+ parentClientConfig,
+ profile,
+ logger
+}) => {
+ let token;
+ const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
+ if (ssoSession) {
+ try {
+ const _token = await (0, import_token_providers.fromSso)({ profile })();
+ token = {
+ accessToken: _token.token,
+ expiresAt: new Date(_token.expiration).toISOString()
+ };
+ } catch (e) {
+ throw new import_property_provider.CredentialsProviderError(e.message, {
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
+ logger
+ });
}
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `PolicyArns.${key}`;
- entries[loc] = value;
- });
- }
- if (input[_P] != null) {
- entries[_P] = input[_P];
- }
- if (input[_DS] != null) {
- entries[_DS] = input[_DS];
- }
- return entries;
-}, "se_AssumeRoleWithWebIdentityRequest");
-var se_DecodeAuthorizationMessageRequest = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- if (input[_EM] != null) {
- entries[_EM] = input[_EM];
- }
- return entries;
-}, "se_DecodeAuthorizationMessageRequest");
-var se_GetAccessKeyInfoRequest = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- if (input[_AKI] != null) {
- entries[_AKI] = input[_AKI];
- }
- return entries;
-}, "se_GetAccessKeyInfoRequest");
-var se_GetCallerIdentityRequest = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- return entries;
-}, "se_GetCallerIdentityRequest");
-var se_GetFederationTokenRequest = /* @__PURE__ */ __name((input, context) => {
- var _a2, _b;
- const entries = {};
- if (input[_N] != null) {
- entries[_N] = input[_N];
- }
- if (input[_P] != null) {
- entries[_P] = input[_P];
- }
- if (input[_PA] != null) {
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
- if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
- entries.PolicyArns = [];
+ } else {
+ try {
+ token = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoStartUrl);
+ } catch (e) {
+ throw new import_property_provider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
+ logger
+ });
}
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `PolicyArns.${key}`;
- entries[loc] = value;
- });
}
- if (input[_DS] != null) {
- entries[_DS] = input[_DS];
- }
- if (input[_T] != null) {
- const memberEntries = se_tagListType(input[_T], context);
- if (((_b = input[_T]) == null ? void 0 : _b.length) === 0) {
- entries.Tags = [];
- }
- Object.entries(memberEntries).forEach(([key, value]) => {
- const loc = `Tags.${key}`;
- entries[loc] = value;
+ if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
+ throw new import_property_provider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
+ logger
});
}
- return entries;
-}, "se_GetFederationTokenRequest");
-var se_GetSessionTokenRequest = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- if (input[_DS] != null) {
- entries[_DS] = input[_DS];
- }
- if (input[_SN] != null) {
- entries[_SN] = input[_SN];
- }
- if (input[_TC] != null) {
- entries[_TC] = input[_TC];
- }
- return entries;
-}, "se_GetSessionTokenRequest");
-var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- let counter = 1;
- for (const entry of input) {
- if (entry === null) {
- continue;
- }
- const memberEntries = se_PolicyDescriptorType(entry, context);
- Object.entries(memberEntries).forEach(([key, value]) => {
- entries[`member.${counter}.${key}`] = value;
+ const { accessToken } = token;
+ const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports));
+ const sso = ssoClient || new SSOClient2(
+ Object.assign({}, clientConfig ?? {}, {
+ logger: clientConfig?.logger ?? parentClientConfig?.logger,
+ region: clientConfig?.region ?? ssoRegion
+ })
+ );
+ let ssoResp;
+ try {
+ ssoResp = await sso.send(
+ new GetRoleCredentialsCommand2({
+ accountId: ssoAccountId,
+ roleName: ssoRoleName,
+ accessToken
+ })
+ );
+ } catch (e) {
+ throw new import_property_provider.CredentialsProviderError(e, {
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
+ logger
});
- counter++;
- }
- return entries;
-}, "se_policyDescriptorListType");
-var se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- if (input[_a] != null) {
- entries[_a] = input[_a];
- }
- return entries;
-}, "se_PolicyDescriptorType");
-var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- if (input[_PAro] != null) {
- entries[_PAro] = input[_PAro];
}
- if (input[_CA] != null) {
- entries[_CA] = input[_CA];
- }
- return entries;
-}, "se_ProvidedContext");
-var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- let counter = 1;
- for (const entry of input) {
- if (entry === null) {
- continue;
- }
- const memberEntries = se_ProvidedContext(entry, context);
- Object.entries(memberEntries).forEach(([key, value]) => {
- entries[`member.${counter}.${key}`] = value;
+ const {
+ roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}
+ } = ssoResp;
+ if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
+ throw new import_property_provider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
+ logger
});
- counter++;
}
- return entries;
-}, "se_ProvidedContextsListType");
-var se_Tag = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- if (input[_K] != null) {
- entries[_K] = input[_K];
+ const credentials = {
+ accessKeyId,
+ secretAccessKey,
+ sessionToken,
+ expiration: new Date(expiration),
+ ...credentialScope && { credentialScope },
+ ...accountId && { accountId }
+ };
+ if (ssoSession) {
+ (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_SSO", "s");
+ } else {
+ (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_SSO_LEGACY", "u");
}
- if (input[_Va] != null) {
- entries[_Va] = input[_Va];
+ return credentials;
+}, "resolveSSOCredentials");
+
+// src/validateSsoProfile.ts
+
+var validateSsoProfile = /* @__PURE__ */ __name((profile, logger) => {
+ const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
+ if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
+ throw new import_property_provider.CredentialsProviderError(
+ `Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(
+ ", "
+ )}
+Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,
+ { tryNextLink: false, logger }
+ );
}
- return entries;
-}, "se_Tag");
-var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- let counter = 1;
- for (const entry of input) {
- if (entry === null) {
- continue;
+ return profile;
+}, "validateSsoProfile");
+
+// src/fromSSO.ts
+var fromSSO = /* @__PURE__ */ __name((init = {}) => async ({ callerClientConfig } = {}) => {
+ init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
+ const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
+ const { ssoClient } = init;
+ const profileName = (0, import_shared_ini_file_loader.getProfileName)({
+ profile: init.profile ?? callerClientConfig?.profile
+ });
+ if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
+ const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
+ const profile = profiles[profileName];
+ if (!profile) {
+ throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
}
- entries[`member.${counter}`] = entry;
- counter++;
- }
- return entries;
-}, "se_tagKeyListType");
-var se_tagListType = /* @__PURE__ */ __name((input, context) => {
- const entries = {};
- let counter = 1;
- for (const entry of input) {
- if (entry === null) {
- continue;
+ if (!isSsoProfile(profile)) {
+ throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
+ logger: init.logger
+ });
}
- const memberEntries = se_Tag(entry, context);
- Object.entries(memberEntries).forEach(([key, value]) => {
- entries[`member.${counter}.${key}`] = value;
+ if (profile?.sso_session) {
+ const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
+ const session = ssoSessions[profile.sso_session];
+ const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
+ if (ssoRegion && ssoRegion !== session.sso_region) {
+ throw new import_property_provider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
+ tryNextLink: false,
+ logger: init.logger
+ });
+ }
+ if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
+ throw new import_property_provider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
+ tryNextLink: false,
+ logger: init.logger
+ });
+ }
+ profile.sso_region = session.sso_region;
+ profile.sso_start_url = session.sso_start_url;
+ }
+ const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(
+ profile,
+ init.logger
+ );
+ return resolveSSOCredentials({
+ ssoStartUrl: sso_start_url,
+ ssoSession: sso_session,
+ ssoAccountId: sso_account_id,
+ ssoRegion: sso_region,
+ ssoRoleName: sso_role_name,
+ ssoClient,
+ clientConfig: init.clientConfig,
+ parentClientConfig: init.parentClientConfig,
+ profile: profileName
+ });
+ } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
+ throw new import_property_provider.CredentialsProviderError(
+ 'Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',
+ { tryNextLink: false, logger: init.logger }
+ );
+ } else {
+ return resolveSSOCredentials({
+ ssoStartUrl,
+ ssoSession,
+ ssoAccountId,
+ ssoRegion,
+ ssoRoleName,
+ ssoClient,
+ clientConfig: init.clientConfig,
+ parentClientConfig: init.parentClientConfig,
+ profile: profileName
});
- counter++;
- }
- return entries;
-}, "se_tagListType");
-var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_ARI] != null) {
- contents[_ARI] = (0, import_smithy_client.expectString)(output[_ARI]);
- }
- if (output[_Ar] != null) {
- contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
- }
- return contents;
-}, "de_AssumedRoleUser");
-var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_C] != null) {
- contents[_C] = de_Credentials(output[_C], context);
- }
- if (output[_ARU] != null) {
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
- }
- if (output[_PPS] != null) {
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
- }
- if (output[_SI] != null) {
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
- }
- return contents;
-}, "de_AssumeRoleResponse");
-var de_AssumeRoleWithSAMLResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_C] != null) {
- contents[_C] = de_Credentials(output[_C], context);
- }
- if (output[_ARU] != null) {
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
- }
- if (output[_PPS] != null) {
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
- }
- if (output[_S] != null) {
- contents[_S] = (0, import_smithy_client.expectString)(output[_S]);
- }
- if (output[_ST] != null) {
- contents[_ST] = (0, import_smithy_client.expectString)(output[_ST]);
- }
- if (output[_I] != null) {
- contents[_I] = (0, import_smithy_client.expectString)(output[_I]);
- }
- if (output[_Au] != null) {
- contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]);
- }
- if (output[_NQ] != null) {
- contents[_NQ] = (0, import_smithy_client.expectString)(output[_NQ]);
- }
- if (output[_SI] != null) {
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
- }
- return contents;
-}, "de_AssumeRoleWithSAMLResponse");
-var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_C] != null) {
- contents[_C] = de_Credentials(output[_C], context);
- }
- if (output[_SFWIT] != null) {
- contents[_SFWIT] = (0, import_smithy_client.expectString)(output[_SFWIT]);
- }
- if (output[_ARU] != null) {
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
- }
- if (output[_PPS] != null) {
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
- }
- if (output[_Pr] != null) {
- contents[_Pr] = (0, import_smithy_client.expectString)(output[_Pr]);
- }
- if (output[_Au] != null) {
- contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]);
- }
- if (output[_SI] != null) {
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
- }
- return contents;
-}, "de_AssumeRoleWithWebIdentityResponse");
-var de_Credentials = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_AKI] != null) {
- contents[_AKI] = (0, import_smithy_client.expectString)(output[_AKI]);
- }
- if (output[_SAK] != null) {
- contents[_SAK] = (0, import_smithy_client.expectString)(output[_SAK]);
- }
- if (output[_STe] != null) {
- contents[_STe] = (0, import_smithy_client.expectString)(output[_STe]);
- }
- if (output[_E] != null) {
- contents[_E] = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(output[_E]));
- }
- return contents;
-}, "de_Credentials");
-var de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_DM] != null) {
- contents[_DM] = (0, import_smithy_client.expectString)(output[_DM]);
- }
- return contents;
-}, "de_DecodeAuthorizationMessageResponse");
-var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_ExpiredTokenException");
-var de_FederatedUser = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_FUI] != null) {
- contents[_FUI] = (0, import_smithy_client.expectString)(output[_FUI]);
- }
- if (output[_Ar] != null) {
- contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
- }
- return contents;
-}, "de_FederatedUser");
-var de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_Ac] != null) {
- contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]);
- }
- return contents;
-}, "de_GetAccessKeyInfoResponse");
-var de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_UI] != null) {
- contents[_UI] = (0, import_smithy_client.expectString)(output[_UI]);
- }
- if (output[_Ac] != null) {
- contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]);
- }
- if (output[_Ar] != null) {
- contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
- }
- return contents;
-}, "de_GetCallerIdentityResponse");
-var de_GetFederationTokenResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_C] != null) {
- contents[_C] = de_Credentials(output[_C], context);
- }
- if (output[_FU] != null) {
- contents[_FU] = de_FederatedUser(output[_FU], context);
- }
- if (output[_PPS] != null) {
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
- }
- return contents;
-}, "de_GetFederationTokenResponse");
-var de_GetSessionTokenResponse = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_C] != null) {
- contents[_C] = de_Credentials(output[_C], context);
- }
- return contents;
-}, "de_GetSessionTokenResponse");
-var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_IDPCommunicationErrorException");
-var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_IDPRejectedClaimException");
-var de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_InvalidAuthorizationMessageException");
-var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_InvalidIdentityTokenException");
-var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_MalformedPolicyDocumentException");
-var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_PackedPolicyTooLargeException");
-var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => {
- const contents = {};
- if (output[_m] != null) {
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
- }
- return contents;
-}, "de_RegionDisabledException");
-var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
- httpStatusCode: output.statusCode,
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
- extendedRequestId: output.headers["x-amz-id-2"],
- cfId: output.headers["x-amz-cf-id"]
-}), "deserializeMetadata");
-var throwDefaultError = (0, import_smithy_client.withBaseException)(STSServiceException);
-var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
- const contents = {
- protocol,
- hostname,
- port,
- method: "POST",
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
- headers
- };
- if (resolvedHostname !== void 0) {
- contents.hostname = resolvedHostname;
- }
- if (body !== void 0) {
- contents.body = body;
- }
- return new import_protocol_http.HttpRequest(contents);
-}, "buildHttpRpcRequest");
-var SHARED_HEADERS = {
- "content-type": "application/x-www-form-urlencoded"
-};
-var _ = "2011-06-15";
-var _A = "Action";
-var _AKI = "AccessKeyId";
-var _AR = "AssumeRole";
-var _ARI = "AssumedRoleId";
-var _ARU = "AssumedRoleUser";
-var _ARWSAML = "AssumeRoleWithSAML";
-var _ARWWI = "AssumeRoleWithWebIdentity";
-var _Ac = "Account";
-var _Ar = "Arn";
-var _Au = "Audience";
-var _C = "Credentials";
-var _CA = "ContextAssertion";
-var _DAM = "DecodeAuthorizationMessage";
-var _DM = "DecodedMessage";
-var _DS = "DurationSeconds";
-var _E = "Expiration";
-var _EI = "ExternalId";
-var _EM = "EncodedMessage";
-var _FU = "FederatedUser";
-var _FUI = "FederatedUserId";
-var _GAKI = "GetAccessKeyInfo";
-var _GCI = "GetCallerIdentity";
-var _GFT = "GetFederationToken";
-var _GST = "GetSessionToken";
-var _I = "Issuer";
-var _K = "Key";
-var _N = "Name";
-var _NQ = "NameQualifier";
-var _P = "Policy";
-var _PA = "PolicyArns";
-var _PAr = "PrincipalArn";
-var _PAro = "ProviderArn";
-var _PC = "ProvidedContexts";
-var _PI = "ProviderId";
-var _PPS = "PackedPolicySize";
-var _Pr = "Provider";
-var _RA = "RoleArn";
-var _RSN = "RoleSessionName";
-var _S = "Subject";
-var _SAK = "SecretAccessKey";
-var _SAMLA = "SAMLAssertion";
-var _SFWIT = "SubjectFromWebIdentityToken";
-var _SI = "SourceIdentity";
-var _SN = "SerialNumber";
-var _ST = "SubjectType";
-var _STe = "SessionToken";
-var _T = "Tags";
-var _TC = "TokenCode";
-var _TTK = "TransitiveTagKeys";
-var _UI = "UserId";
-var _V = "Version";
-var _Va = "Value";
-var _WIT = "WebIdentityToken";
-var _a = "arn";
-var _m = "message";
-var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString");
-var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
- var _a2;
- if (((_a2 = data.Error) == null ? void 0 : _a2.Code) !== void 0) {
- return data.Error.Code;
- }
- if (output.statusCode == 404) {
- return "NotFound";
}
-}, "loadQueryErrorCode");
+}, "fromSSO");
+// Annotate the CommonJS export names for ESM import in node:
-// src/commands/AssumeRoleCommand.ts
-var _AssumeRoleCommand = class _AssumeRoleCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() {
-};
-__name(_AssumeRoleCommand, "AssumeRoleCommand");
-var AssumeRoleCommand = _AssumeRoleCommand;
+0 && (0);
-// src/commands/AssumeRoleWithSAMLCommand.ts
+/***/ }),
-var import_EndpointParameters2 = __nccwpck_require__(42912);
-var _AssumeRoleWithSAMLCommand = class _AssumeRoleWithSAMLCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters2.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog).ser(se_AssumeRoleWithSAMLCommand).de(de_AssumeRoleWithSAMLCommand).build() {
+/***/ 88079:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.fromTokenFile = void 0;
+const client_1 = __nccwpck_require__(5152);
+const property_provider_1 = __nccwpck_require__(71238);
+const fs_1 = __nccwpck_require__(79896);
+const fromWebToken_1 = __nccwpck_require__(34453);
+const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
+const ENV_ROLE_ARN = "AWS_ROLE_ARN";
+const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
+const fromTokenFile = (init = {}) => async () => {
+ init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
+ const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
+ const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
+ const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
+ if (!webIdentityTokenFile || !roleArn) {
+ throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", {
+ logger: init.logger,
+ });
+ }
+ const credentials = await (0, fromWebToken_1.fromWebToken)({
+ ...init,
+ webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }),
+ roleArn,
+ roleSessionName,
+ })();
+ if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
+ (0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
+ }
+ return credentials;
};
-__name(_AssumeRoleWithSAMLCommand, "AssumeRoleWithSAMLCommand");
-var AssumeRoleWithSAMLCommand = _AssumeRoleWithSAMLCommand;
+exports.fromTokenFile = fromTokenFile;
-// src/commands/AssumeRoleWithWebIdentityCommand.ts
+/***/ }),
+/***/ 34453:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-var import_EndpointParameters3 = __nccwpck_require__(42912);
-var _AssumeRoleWithWebIdentityCommand = class _AssumeRoleWithWebIdentityCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters3.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() {
+
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.fromWebToken = void 0;
+const fromWebToken = (init) => async (awsIdentityProperties) => {
+ init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
+ const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
+ let { roleAssumerWithWebIdentity } = init;
+ if (!roleAssumerWithWebIdentity) {
+ const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(1136)));
+ roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
+ ...init.clientConfig,
+ credentialProviderLogger: init.logger,
+ parentClientConfig: {
+ ...awsIdentityProperties?.callerClientConfig,
+ ...init.parentClientConfig,
+ },
+ }, init.clientPlugins);
+ }
+ return roleAssumerWithWebIdentity({
+ RoleArn: roleArn,
+ RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
+ WebIdentityToken: webIdentityToken,
+ ProviderId: providerId,
+ PolicyArns: policyArns,
+ Policy: policy,
+ DurationSeconds: durationSeconds,
+ });
};
-__name(_AssumeRoleWithWebIdentityCommand, "AssumeRoleWithWebIdentityCommand");
-var AssumeRoleWithWebIdentityCommand = _AssumeRoleWithWebIdentityCommand;
+exports.fromWebToken = fromWebToken;
-// src/commands/DecodeAuthorizationMessageCommand.ts
+/***/ }),
+/***/ 29956:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var import_EndpointParameters4 = __nccwpck_require__(42912);
-var _DecodeAuthorizationMessageCommand = class _DecodeAuthorizationMessageCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters4.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").f(void 0, void 0).ser(se_DecodeAuthorizationMessageCommand).de(de_DecodeAuthorizationMessageCommand).build() {
+
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
};
-__name(_DecodeAuthorizationMessageCommand, "DecodeAuthorizationMessageCommand");
-var DecodeAuthorizationMessageCommand = _DecodeAuthorizationMessageCommand;
+var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/commands/GetAccessKeyInfoCommand.ts
+// src/index.ts
+var index_exports = {};
+module.exports = __toCommonJS(index_exports);
+__reExport(index_exports, __nccwpck_require__(88079), module.exports);
+__reExport(index_exports, __nccwpck_require__(34453), module.exports);
+// Annotate the CommonJS export names for ESM import in node:
+0 && (0);
-var import_EndpointParameters5 = __nccwpck_require__(42912);
-var _GetAccessKeyInfoCommand = class _GetAccessKeyInfoCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters5.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").f(void 0, void 0).ser(se_GetAccessKeyInfoCommand).de(de_GetAccessKeyInfoCommand).build() {
-};
-__name(_GetAccessKeyInfoCommand, "GetAccessKeyInfoCommand");
-var GetAccessKeyInfoCommand = _GetAccessKeyInfoCommand;
-// src/commands/GetCallerIdentityCommand.ts
+/***/ }),
+/***/ 52590:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var import_EndpointParameters6 = __nccwpck_require__(42912);
-var _GetCallerIdentityCommand = class _GetCallerIdentityCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters6.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").f(void 0, void 0).ser(se_GetCallerIdentityCommand).de(de_GetCallerIdentityCommand).build() {
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
};
-__name(_GetCallerIdentityCommand, "GetCallerIdentityCommand");
-var GetCallerIdentityCommand = _GetCallerIdentityCommand;
-
-// src/commands/GetFederationTokenCommand.ts
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ getHostHeaderPlugin: () => getHostHeaderPlugin,
+ hostHeaderMiddleware: () => hostHeaderMiddleware,
+ hostHeaderMiddlewareOptions: () => hostHeaderMiddlewareOptions,
+ resolveHostHeaderConfig: () => resolveHostHeaderConfig
+});
+module.exports = __toCommonJS(index_exports);
+var import_protocol_http = __nccwpck_require__(72356);
+function resolveHostHeaderConfig(input) {
+ return input;
+}
+__name(resolveHostHeaderConfig, "resolveHostHeaderConfig");
+var hostHeaderMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
+ if (!import_protocol_http.HttpRequest.isInstance(args.request)) return next(args);
+ const { request } = args;
+ const { handlerProtocol = "" } = options.requestHandler.metadata || {};
+ if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
+ delete request.headers["host"];
+ request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
+ } else if (!request.headers["host"]) {
+ let host = request.hostname;
+ if (request.port != null) host += `:${request.port}`;
+ request.headers["host"] = host;
+ }
+ return next(args);
+}, "hostHeaderMiddleware");
+var hostHeaderMiddlewareOptions = {
+ name: "hostHeaderMiddleware",
+ step: "build",
+ priority: "low",
+ tags: ["HOST"],
+ override: true
+};
+var getHostHeaderPlugin = /* @__PURE__ */ __name((options) => ({
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
+ clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
+ }, "applyToStack")
+}), "getHostHeaderPlugin");
+// Annotate the CommonJS export names for ESM import in node:
+0 && (0);
-var import_EndpointParameters7 = __nccwpck_require__(42912);
-var _GetFederationTokenCommand = class _GetFederationTokenCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters7.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").f(void 0, GetFederationTokenResponseFilterSensitiveLog).ser(se_GetFederationTokenCommand).de(de_GetFederationTokenCommand).build() {
-};
-__name(_GetFederationTokenCommand, "GetFederationTokenCommand");
-var GetFederationTokenCommand = _GetFederationTokenCommand;
-// src/commands/GetSessionTokenCommand.ts
+/***/ }),
+/***/ 85242:
+/***/ ((module) => {
-var import_EndpointParameters8 = __nccwpck_require__(42912);
-var _GetSessionTokenCommand = class _GetSessionTokenCommand extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters8.commonParams).m(function(Command, cs, config, o) {
- return [
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
- ];
-}).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").f(void 0, GetSessionTokenResponseFilterSensitiveLog).ser(se_GetSessionTokenCommand).de(de_GetSessionTokenCommand).build() {
-};
-__name(_GetSessionTokenCommand, "GetSessionTokenCommand");
-var GetSessionTokenCommand = _GetSessionTokenCommand;
-// src/STS.ts
-var import_STSClient = __nccwpck_require__(51548);
-var commands = {
- AssumeRoleCommand,
- AssumeRoleWithSAMLCommand,
- AssumeRoleWithWebIdentityCommand,
- DecodeAuthorizationMessageCommand,
- GetAccessKeyInfoCommand,
- GetCallerIdentityCommand,
- GetFederationTokenCommand,
- GetSessionTokenCommand
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
};
-var _STS = class _STS extends import_STSClient.STSClient {
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
};
-__name(_STS, "STS");
-var STS = _STS;
-(0, import_smithy_client.createAggregatedClient)(commands, STS);
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
-var import_EndpointParameters9 = __nccwpck_require__(42912);
+var src_exports = {};
+__export(src_exports, {
+ getLoggerPlugin: () => getLoggerPlugin,
+ loggerMiddleware: () => loggerMiddleware,
+ loggerMiddlewareOptions: () => loggerMiddlewareOptions
+});
+module.exports = __toCommonJS(src_exports);
-// src/defaultStsRoleAssumers.ts
-var import_client = __nccwpck_require__(5152);
-var ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
-var getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => {
- if (typeof (assumedRoleUser == null ? void 0 : assumedRoleUser.Arn) === "string") {
- const arnComponents = assumedRoleUser.Arn.split(":");
- if (arnComponents.length > 4 && arnComponents[4] !== "") {
- return arnComponents[4];
- }
+// src/loggerMiddleware.ts
+var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => {
+ try {
+ const response = await next(args);
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
+ const { $metadata, ...outputWithoutMetadata } = response.output;
+ logger?.info?.({
+ clientName,
+ commandName,
+ input: inputFilterSensitiveLog(args.input),
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
+ metadata: $metadata
+ });
+ return response;
+ } catch (error) {
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
+ logger?.error?.({
+ clientName,
+ commandName,
+ input: inputFilterSensitiveLog(args.input),
+ error,
+ metadata: error.$metadata
+ });
+ throw error;
}
- return void 0;
-}, "getAccountIdFromAssumedRoleUser");
-var resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => {
- var _a2;
- const region = typeof _region === "function" ? await _region() : _region;
- const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
- (_a2 = credentialProviderLogger == null ? void 0 : credentialProviderLogger.debug) == null ? void 0 : _a2.call(
- credentialProviderLogger,
- "@aws-sdk/client-sts::resolveRegion",
- "accepting first of:",
- `${region} (provider)`,
- `${parentRegion} (parent client)`,
- `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`
- );
- return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
-}, "resolveRegion");
-var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => {
- let stsClient;
- let closureSourceCreds;
- return async (sourceCreds, params) => {
- var _a2, _b, _c;
- closureSourceCreds = sourceCreds;
- if (!stsClient) {
- const {
- logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger,
- region,
- requestHandler = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _b.requestHandler,
- credentialProviderLogger
- } = stsOptions;
- const resolvedRegion = await resolveRegion(
- region,
- (_c = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c.region,
- credentialProviderLogger
- );
- const isCompatibleRequestHandler = !isH2(requestHandler);
- stsClient = new stsClientCtor({
- // A hack to make sts client uses the credential in current closure.
- credentialDefaultProvider: () => async () => closureSourceCreds,
- region: resolvedRegion,
- requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
- logger
- });
- }
- const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
- if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
- throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
- }
- const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
- const credentials = {
- accessKeyId: Credentials2.AccessKeyId,
- secretAccessKey: Credentials2.SecretAccessKey,
- sessionToken: Credentials2.SessionToken,
- expiration: Credentials2.Expiration,
- // TODO(credentialScope): access normally when shape is updated.
- ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
- ...accountId && { accountId }
- };
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
- return credentials;
- };
-}, "getDefaultRoleAssumer");
-var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => {
- let stsClient;
- return async (params) => {
- var _a2, _b, _c;
- if (!stsClient) {
- const {
- logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger,
- region,
- requestHandler = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _b.requestHandler,
- credentialProviderLogger
- } = stsOptions;
- const resolvedRegion = await resolveRegion(
- region,
- (_c = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c.region,
- credentialProviderLogger
- );
- const isCompatibleRequestHandler = !isH2(requestHandler);
- stsClient = new stsClientCtor({
- region: resolvedRegion,
- requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
- logger
- });
- }
- const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
- if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
- throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
- }
- const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
- const credentials = {
- accessKeyId: Credentials2.AccessKeyId,
- secretAccessKey: Credentials2.SecretAccessKey,
- sessionToken: Credentials2.SessionToken,
- expiration: Credentials2.Expiration,
- // TODO(credentialScope): access normally when shape is updated.
- ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
- ...accountId && { accountId }
- };
- if (accountId) {
- (0, import_client.setCredentialFeature)(credentials, "RESOLVED_ACCOUNT_ID", "T");
- }
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
- return credentials;
- };
-}, "getDefaultRoleAssumerWithWebIdentity");
-var isH2 = /* @__PURE__ */ __name((requestHandler) => {
- var _a2;
- return ((_a2 = requestHandler == null ? void 0 : requestHandler.metadata) == null ? void 0 : _a2.handlerProtocol) === "h2";
-}, "isH2");
-
-// src/defaultRoleAssumers.ts
-var import_STSClient2 = __nccwpck_require__(51548);
-var getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => {
- var _a2;
- if (!customizations)
- return baseCtor;
- else
- return _a2 = class extends baseCtor {
- constructor(config) {
- super(config);
- for (const customization of customizations) {
- this.middlewareStack.use(customization);
- }
- }
- }, __name(_a2, "CustomizableSTSClient"), _a2;
-}, "getCustomizableStsClientCtor");
-var getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumer");
-var getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity");
-var decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({
- roleAssumer: getDefaultRoleAssumer2(input),
- roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
- ...input
-}), "decorateDefaultCredentialProvider");
+}, "loggerMiddleware");
+var loggerMiddlewareOptions = {
+ name: "loggerMiddleware",
+ tags: ["LOGGER"],
+ step: "initialize",
+ override: true
+};
+var getLoggerPlugin = /* @__PURE__ */ __name((options) => ({
+ applyToStack: (clientStack) => {
+ clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
+ }
+}), "getLoggerPlugin");
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
@@ -12766,171 +11985,8 @@ var decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (in
/***/ }),
-/***/ 12769:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getRuntimeConfig = void 0;
-const tslib_1 = __nccwpck_require__(61860);
-const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(74959));
-const core_1 = __nccwpck_require__(8704);
-const credential_provider_node_1 = __nccwpck_require__(5861);
-const util_user_agent_node_1 = __nccwpck_require__(51656);
-const config_resolver_1 = __nccwpck_require__(39316);
-const core_2 = __nccwpck_require__(90402);
-const hash_node_1 = __nccwpck_require__(5092);
-const middleware_retry_1 = __nccwpck_require__(19618);
-const node_config_provider_1 = __nccwpck_require__(55704);
-const node_http_handler_1 = __nccwpck_require__(61279);
-const util_body_length_node_1 = __nccwpck_require__(13638);
-const util_retry_1 = __nccwpck_require__(15518);
-const runtimeConfig_shared_1 = __nccwpck_require__(13238);
-const smithy_client_1 = __nccwpck_require__(61411);
-const util_defaults_mode_node_1 = __nccwpck_require__(15435);
-const smithy_client_2 = __nccwpck_require__(61411);
-const getRuntimeConfig = (config) => {
- (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
- const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
- const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
- const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
- (0, core_1.emitWarningIfUnsupportedVersion)(process.version);
- return {
- ...clientSharedValues,
- ...config,
- runtime: "node",
- defaultsMode,
- bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
- (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
- httpAuthSchemes: config?.httpAuthSchemes ?? [
- {
- schemeId: "aws.auth#sigv4",
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
- (async (idProps) => await (0, credential_provider_node_1.defaultProvider)(idProps?.__config || {})()),
- signer: new core_1.AwsSdkSigV4Signer(),
- },
- {
- schemeId: "smithy.api#noAuth",
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
- signer: new core_2.NoAuthSigner(),
- },
- ],
- maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
- region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
- requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
- retryMode: config?.retryMode ??
- (0, node_config_provider_1.loadConfig)({
- ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
- default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
- }),
- sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
- streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
- useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
- userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS),
- };
-};
-exports.getRuntimeConfig = getRuntimeConfig;
-
-
-/***/ }),
-
-/***/ 13238:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getRuntimeConfig = void 0;
-const core_1 = __nccwpck_require__(8704);
-const core_2 = __nccwpck_require__(90402);
-const smithy_client_1 = __nccwpck_require__(61411);
-const url_parser_1 = __nccwpck_require__(14494);
-const util_base64_1 = __nccwpck_require__(68385);
-const util_utf8_1 = __nccwpck_require__(71577);
-const httpAuthSchemeProvider_1 = __nccwpck_require__(39232);
-const endpointResolver_1 = __nccwpck_require__(51030);
-const getRuntimeConfig = (config) => {
- return {
- apiVersion: "2011-06-15",
- base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
- base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
- disableHostPrefix: config?.disableHostPrefix ?? false,
- endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
- extensions: config?.extensions ?? [],
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,
- httpAuthSchemes: config?.httpAuthSchemes ?? [
- {
- schemeId: "aws.auth#sigv4",
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
- signer: new core_1.AwsSdkSigV4Signer(),
- },
- {
- schemeId: "smithy.api#noAuth",
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
- signer: new core_2.NoAuthSigner(),
- },
- ],
- logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
- serviceId: config?.serviceId ?? "STS",
- urlParser: config?.urlParser ?? url_parser_1.parseUrl,
- utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
- utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
- };
-};
-exports.getRuntimeConfig = getRuntimeConfig;
-
-
-/***/ }),
-
-/***/ 60309:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.resolveRuntimeExtensions = void 0;
-const region_config_resolver_1 = __nccwpck_require__(36463);
-const protocol_http_1 = __nccwpck_require__(72356);
-const smithy_client_1 = __nccwpck_require__(61411);
-const httpAuthExtensionConfiguration_1 = __nccwpck_require__(79915);
-const asPartial = (t) => t;
-const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
- const extensionConfiguration = {
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
- ...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)),
- };
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
- return {
- ...runtimeConfig,
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
- ...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration),
- };
-};
-exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
-
-
-/***/ }),
-
-/***/ 8704:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const tslib_1 = __nccwpck_require__(61860);
-tslib_1.__exportStar(__nccwpck_require__(5152), exports);
-tslib_1.__exportStar(__nccwpck_require__(97523), exports);
-tslib_1.__exportStar(__nccwpck_require__(37288), exports);
-
-
-/***/ }),
-
-/***/ 5152:
-/***/ ((module) => {
+/***/ 81568:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var __defProp = Object.defineProperty;
@@ -12952,64 +12008,59 @@ var __copyProps = (to, from, except, desc) => {
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/submodules/client/index.ts
-var client_exports = {};
-__export(client_exports, {
- emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,
- setCredentialFeature: () => setCredentialFeature,
- setFeature: () => setFeature,
- state: () => state
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ addRecursionDetectionMiddlewareOptions: () => addRecursionDetectionMiddlewareOptions,
+ getRecursionDetectionPlugin: () => getRecursionDetectionPlugin,
+ recursionDetectionMiddleware: () => recursionDetectionMiddleware
});
-module.exports = __toCommonJS(client_exports);
-
-// src/submodules/client/emitWarningIfUnsupportedVersion.ts
-var state = {
- warningEmitted: false
-};
-var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
- state.warningEmitted = true;
- process.emitWarning(
- `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
-no longer support Node.js 16.x on January 6, 2025.
-
-To continue receiving updates to AWS services, bug fixes, and security
-updates please upgrade to a supported Node.js LTS version.
-
-More information can be found at: https://a.co/74kJMmI`
- );
+module.exports = __toCommonJS(index_exports);
+var import_protocol_http = __nccwpck_require__(72356);
+var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
+var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
+var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
+var recursionDetectionMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
+ const { request } = args;
+ if (!import_protocol_http.HttpRequest.isInstance(request) || options.runtime !== "node") {
+ return next(args);
}
-}, "emitWarningIfUnsupportedVersion");
-
-// src/submodules/client/setCredentialFeature.ts
-function setCredentialFeature(credentials, feature, value) {
- if (!credentials.$source) {
- credentials.$source = {};
+ const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME;
+ if (request.headers.hasOwnProperty(traceIdHeader)) {
+ return next(args);
}
- credentials.$source[feature] = value;
- return credentials;
-}
-__name(setCredentialFeature, "setCredentialFeature");
-
-// src/submodules/client/setFeature.ts
-function setFeature(context, feature, value) {
- if (!context.__aws_sdk_context) {
- context.__aws_sdk_context = {
- features: {}
- };
- } else if (!context.__aws_sdk_context.features) {
- context.__aws_sdk_context.features = {};
+ const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
+ const traceId = process.env[ENV_TRACE_ID];
+ const nonEmptyString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0, "nonEmptyString");
+ if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
+ request.headers[TRACE_ID_HEADER_NAME] = traceId;
}
- context.__aws_sdk_context.features[feature] = value;
-}
-__name(setFeature, "setFeature");
+ return next({
+ ...args,
+ request
+ });
+}, "recursionDetectionMiddleware");
+var addRecursionDetectionMiddlewareOptions = {
+ step: "build",
+ tags: ["RECURSION_DETECTION"],
+ name: "recursionDetectionMiddleware",
+ override: true,
+ priority: "low"
+};
+var getRecursionDetectionPlugin = /* @__PURE__ */ __name((options) => ({
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
+ clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
+ }, "applyToStack")
+}), "getRecursionDetectionPlugin");
// Annotate the CommonJS export names for ESM import in node:
+
0 && (0);
+
/***/ }),
-/***/ 97523:
+/***/ 32959:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
@@ -13032,509 +12083,314 @@ var __copyProps = (to, from, except, desc) => {
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/submodules/httpAuthSchemes/index.ts
-var httpAuthSchemes_exports = {};
-__export(httpAuthSchemes_exports, {
- AWSSDKSigV4Signer: () => AWSSDKSigV4Signer,
- AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner,
- AwsSdkSigV4Signer: () => AwsSdkSigV4Signer,
- NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS,
- resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config,
- resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig,
- resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config,
- validateSigningProperties: () => validateSigningProperties
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ DEFAULT_UA_APP_ID: () => DEFAULT_UA_APP_ID,
+ getUserAgentMiddlewareOptions: () => getUserAgentMiddlewareOptions,
+ getUserAgentPlugin: () => getUserAgentPlugin,
+ resolveUserAgentConfig: () => resolveUserAgentConfig,
+ userAgentMiddleware: () => userAgentMiddleware
});
-module.exports = __toCommonJS(httpAuthSchemes_exports);
+module.exports = __toCommonJS(index_exports);
-// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts
-var import_protocol_http2 = __nccwpck_require__(72356);
+// src/configurations.ts
+var import_core = __nccwpck_require__(90402);
+var DEFAULT_UA_APP_ID = void 0;
+function isValidUserAgentAppId(appId) {
+ if (appId === void 0) {
+ return true;
+ }
+ return typeof appId === "string" && appId.length <= 50;
+}
+__name(isValidUserAgentAppId, "isValidUserAgentAppId");
+function resolveUserAgentConfig(input) {
+ const normalizedAppIdProvider = (0, import_core.normalizeProvider)(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
+ return {
+ ...input,
+ customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent,
+ userAgentAppId: /* @__PURE__ */ __name(async () => {
+ const appId = await normalizedAppIdProvider();
+ if (!isValidUserAgentAppId(appId)) {
+ const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
+ if (typeof appId !== "string") {
+ logger?.warn("userAgentAppId must be a string or undefined.");
+ } else if (appId.length > 50) {
+ logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
+ }
+ }
+ return appId;
+ }, "userAgentAppId")
+ };
+}
+__name(resolveUserAgentConfig, "resolveUserAgentConfig");
-// src/submodules/httpAuthSchemes/utils/getDateHeader.ts
+// src/user-agent-middleware.ts
+var import_util_endpoints = __nccwpck_require__(83068);
var import_protocol_http = __nccwpck_require__(72356);
-var getDateHeader = /* @__PURE__ */ __name((response) => {
- var _a, _b;
- return import_protocol_http.HttpResponse.isInstance(response) ? ((_a = response.headers) == null ? void 0 : _a.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date) : void 0;
-}, "getDateHeader");
-// src/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.ts
-var getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate");
-
-// src/submodules/httpAuthSchemes/utils/isClockSkewed.ts
-var isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed");
-
-// src/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts
-var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => {
- const clockTimeInMs = Date.parse(clockTime);
- if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
- return clockTimeInMs - Date.now();
- }
- return currentSystemClockOffset;
-}, "getUpdatedSystemClockOffset");
-
-// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts
-var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => {
- if (!property) {
- throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
+// src/check-features.ts
+var import_core2 = __nccwpck_require__(8704);
+var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
+async function checkFeatures(context, config, args) {
+ const request = args.request;
+ if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
+ (0, import_core2.setFeature)(context, "PROTOCOL_RPC_V2_CBOR", "M");
}
- return property;
-}, "throwSigningPropertyError");
-var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
- var _a, _b, _c;
- const context = throwSigningPropertyError(
- "context",
- signingProperties.context
- );
- const config = throwSigningPropertyError("config", signingProperties.config);
- const authScheme = (_c = (_b = (_a = context.endpointV2) == null ? void 0 : _a.properties) == null ? void 0 : _b.authSchemes) == null ? void 0 : _c[0];
- const signerFunction = throwSigningPropertyError(
- "signer",
- config.signer
- );
- const signer = await signerFunction(authScheme);
- const signingRegion = signingProperties == null ? void 0 : signingProperties.signingRegion;
- const signingRegionSet = signingProperties == null ? void 0 : signingProperties.signingRegionSet;
- const signingName = signingProperties == null ? void 0 : signingProperties.signingName;
- return {
- config,
- signer,
- signingRegion,
- signingRegionSet,
- signingName
- };
-}, "validateSigningProperties");
-var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
- async sign(httpRequest, identity, signingProperties) {
- var _a;
- if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
- throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
- }
- const validatedProps = await validateSigningProperties(signingProperties);
- const { config, signer } = validatedProps;
- let { signingRegion, signingName } = validatedProps;
- const handlerExecutionContext = signingProperties.context;
- if (((_a = handlerExecutionContext == null ? void 0 : handlerExecutionContext.authSchemes) == null ? void 0 : _a.length) ?? 0 > 1) {
- const [first, second] = handlerExecutionContext.authSchemes;
- if ((first == null ? void 0 : first.name) === "sigv4a" && (second == null ? void 0 : second.name) === "sigv4") {
- signingRegion = (second == null ? void 0 : second.signingRegion) ?? signingRegion;
- signingName = (second == null ? void 0 : second.signingName) ?? signingName;
+ if (typeof config.retryStrategy === "function") {
+ const retryStrategy = await config.retryStrategy();
+ if (typeof retryStrategy.acquireInitialRetryToken === "function") {
+ if (retryStrategy.constructor?.name?.includes("Adaptive")) {
+ (0, import_core2.setFeature)(context, "RETRY_MODE_ADAPTIVE", "F");
+ } else {
+ (0, import_core2.setFeature)(context, "RETRY_MODE_STANDARD", "E");
}
+ } else {
+ (0, import_core2.setFeature)(context, "RETRY_MODE_LEGACY", "D");
}
- const signedRequest = await signer.sign(httpRequest, {
- signingDate: getSkewCorrectedDate(config.systemClockOffset),
- signingRegion,
- signingService: signingName
- });
- return signedRequest;
- }
- errorHandler(signingProperties) {
- return (error) => {
- const serverTime = error.ServerTime ?? getDateHeader(error.$response);
- if (serverTime) {
- const config = throwSigningPropertyError("config", signingProperties.config);
- const initialSystemClockOffset = config.systemClockOffset;
- config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
- const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
- if (clockSkewCorrected && error.$metadata) {
- error.$metadata.clockSkewCorrected = true;
- }
- }
- throw error;
- };
}
- successHandler(httpResponse, signingProperties) {
- const dateHeader = getDateHeader(httpResponse);
- if (dateHeader) {
- const config = throwSigningPropertyError("config", signingProperties.config);
- config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
+ if (typeof config.accountIdEndpointMode === "function") {
+ const endpointV2 = context.endpointV2;
+ if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
+ (0, import_core2.setFeature)(context, "ACCOUNT_ID_ENDPOINT", "O");
+ }
+ switch (await config.accountIdEndpointMode?.()) {
+ case "disabled":
+ (0, import_core2.setFeature)(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
+ break;
+ case "preferred":
+ (0, import_core2.setFeature)(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
+ break;
+ case "required":
+ (0, import_core2.setFeature)(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
+ break;
}
}
-};
-__name(_AwsSdkSigV4Signer, "AwsSdkSigV4Signer");
-var AwsSdkSigV4Signer = _AwsSdkSigV4Signer;
-var AWSSDKSigV4Signer = AwsSdkSigV4Signer;
-
-// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.ts
-var import_protocol_http3 = __nccwpck_require__(72356);
-var _AwsSdkSigV4ASigner = class _AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
- async sign(httpRequest, identity, signingProperties) {
- var _a;
- if (!import_protocol_http3.HttpRequest.isInstance(httpRequest)) {
- throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
+ const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
+ if (identity?.$source) {
+ const credentials = identity;
+ if (credentials.accountId) {
+ (0, import_core2.setFeature)(context, "RESOLVED_ACCOUNT_ID", "T");
+ }
+ for (const [key, value] of Object.entries(credentials.$source ?? {})) {
+ (0, import_core2.setFeature)(context, key, value);
}
- const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(
- signingProperties
- );
- const configResolvedSigningRegionSet = await ((_a = config.sigv4aSigningRegionSet) == null ? void 0 : _a.call(config));
- const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
- const signedRequest = await signer.sign(httpRequest, {
- signingDate: getSkewCorrectedDate(config.systemClockOffset),
- signingRegion: multiRegionOverride,
- signingService: signingName
- });
- return signedRequest;
}
-};
-__name(_AwsSdkSigV4ASigner, "AwsSdkSigV4ASigner");
-var AwsSdkSigV4ASigner = _AwsSdkSigV4ASigner;
+}
+__name(checkFeatures, "checkFeatures");
-// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.ts
-var import_core = __nccwpck_require__(90402);
-var import_property_provider = __nccwpck_require__(71238);
-var resolveAwsSdkSigV4AConfig = /* @__PURE__ */ __name((config) => {
- config.sigv4aSigningRegionSet = (0, import_core.normalizeProvider)(config.sigv4aSigningRegionSet);
- return config;
-}, "resolveAwsSdkSigV4AConfig");
-var NODE_SIGV4A_CONFIG_OPTIONS = {
- environmentVariableSelector(env) {
- if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
- return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
- }
- throw new import_property_provider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
- tryNextLink: true
- });
- },
- configFileSelector(profile) {
- if (profile.sigv4a_signing_region_set) {
- return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
+// src/constants.ts
+var USER_AGENT = "user-agent";
+var X_AMZ_USER_AGENT = "x-amz-user-agent";
+var SPACE = " ";
+var UA_NAME_SEPARATOR = "/";
+var UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
+var UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
+var UA_ESCAPE_CHAR = "-";
+
+// src/encode-features.ts
+var BYTE_LIMIT = 1024;
+function encodeFeatures(features) {
+ let buffer = "";
+ for (const key in features) {
+ const val = features[key];
+ if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
+ if (buffer.length) {
+ buffer += "," + val;
+ } else {
+ buffer += val;
+ }
+ continue;
}
- throw new import_property_provider.ProviderError("sigv4a_signing_region_set not set in profile.", {
- tryNextLink: true
- });
- },
- default: void 0
-};
+ break;
+ }
+ return buffer;
+}
+__name(encodeFeatures, "encodeFeatures");
-// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts
-var import_client = __nccwpck_require__(5152);
-var import_core2 = __nccwpck_require__(90402);
-var import_signature_v4 = __nccwpck_require__(75118);
-var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
- let isUserSupplied = false;
- let normalizedCreds;
- if (config.credentials) {
- isUserSupplied = true;
- normalizedCreds = (0, import_core2.memoizeIdentityProvider)(config.credentials, import_core2.isIdentityExpired, import_core2.doesIdentityRequireRefresh);
+// src/user-agent-middleware.ts
+var userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
+ const { request } = args;
+ if (!import_protocol_http.HttpRequest.isInstance(request)) {
+ return next(args);
}
- if (!normalizedCreds) {
- if (config.credentialDefaultProvider) {
- normalizedCreds = (0, import_core2.normalizeProvider)(
- config.credentialDefaultProvider(
- Object.assign({}, config, {
- parentClientConfig: config
- })
- )
- );
- } else {
- normalizedCreds = /* @__PURE__ */ __name(async () => {
- throw new Error("`credentials` is missing");
- }, "normalizedCreds");
- }
+ const { headers } = request;
+ const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
+ const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
+ await checkFeatures(context, options, args);
+ const awsContext = context;
+ defaultUserAgent.push(
+ `m/${encodeFeatures(
+ Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features)
+ )}`
+ );
+ const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
+ const appId = await options.userAgentAppId();
+ if (appId) {
+ defaultUserAgent.push(escapeUserAgent([`app/${appId}`]));
}
- const {
- // Default for signingEscapePath
- signingEscapePath = true,
- // Default for systemClockOffset
- systemClockOffset = config.systemClockOffset || 0,
- // No default for sha256 since it is platform dependent
- sha256
- } = config;
- let signer;
- if (config.signer) {
- signer = (0, import_core2.normalizeProvider)(config.signer);
- } else if (config.regionInfoProvider) {
- signer = /* @__PURE__ */ __name(() => (0, import_core2.normalizeProvider)(config.region)().then(
- async (region) => [
- await config.regionInfoProvider(region, {
- useFipsEndpoint: await config.useFipsEndpoint(),
- useDualstackEndpoint: await config.useDualstackEndpoint()
- }) || {},
- region
- ]
- ).then(([regionInfo, region]) => {
- const { signingRegion, signingService } = regionInfo;
- config.signingRegion = config.signingRegion || signingRegion || region;
- config.signingName = config.signingName || signingService || config.serviceId;
- const params = {
- ...config,
- credentials: normalizedCreds,
- region: config.signingRegion,
- service: config.signingName,
- sha256,
- uriEscapePath: signingEscapePath
- };
- const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
- return new SignerCtor(params);
- }), "signer");
+ const prefix = (0, import_util_endpoints.getUserAgentPrefix)();
+ const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE);
+ const normalUAValue = [
+ ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
+ ...customUserAgent
+ ].join(SPACE);
+ if (options.runtime !== "browser") {
+ if (normalUAValue) {
+ headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
+ }
+ headers[USER_AGENT] = sdkUserAgentValue;
} else {
- signer = /* @__PURE__ */ __name(async (authScheme) => {
- authScheme = Object.assign(
- {},
- {
- name: "sigv4",
- signingName: config.signingName || config.defaultSigningName,
- signingRegion: await (0, import_core2.normalizeProvider)(config.region)(),
- properties: {}
- },
- authScheme
- );
- const signingRegion = authScheme.signingRegion;
- const signingService = authScheme.signingName;
- config.signingRegion = config.signingRegion || signingRegion;
- config.signingName = config.signingName || signingService || config.serviceId;
- const params = {
- ...config,
- credentials: normalizedCreds,
- region: config.signingRegion,
- service: config.signingName,
- sha256,
- uriEscapePath: signingEscapePath
- };
- const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
- return new SignerCtor(params);
- }, "signer");
+ headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
}
- return {
- ...config,
- systemClockOffset,
- signingEscapePath,
- credentials: isUserSupplied ? async () => normalizedCreds().then(
- (creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_CODE", "e")
- ) : normalizedCreds,
- signer
- };
-}, "resolveAwsSdkSigV4Config");
-var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
+ return next({
+ ...args,
+ request
+ });
+}, "userAgentMiddleware");
+var escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => {
+ const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
+ const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
+ const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
+ const prefix = name.substring(0, prefixSeparatorIndex);
+ let uaName = name.substring(prefixSeparatorIndex + 1);
+ if (prefix === "api") {
+ uaName = uaName.toLowerCase();
+ }
+ return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
+ switch (index) {
+ case 0:
+ return item;
+ case 1:
+ return `${acc}/${item}`;
+ default:
+ return `${acc}#${item}`;
+ }
+ }, "");
+}, "escapeUserAgent");
+var getUserAgentMiddlewareOptions = {
+ name: "getUserAgentMiddleware",
+ step: "build",
+ priority: "low",
+ tags: ["SET_USER_AGENT", "USER_AGENT"],
+ override: true
+};
+var getUserAgentPlugin = /* @__PURE__ */ __name((config) => ({
+ applyToStack: /* @__PURE__ */ __name((clientStack) => {
+ clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
+ }, "applyToStack")
+}), "getUserAgentPlugin");
// Annotate the CommonJS export names for ESM import in node:
+
0 && (0);
+
/***/ }),
-/***/ 37288:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 8396:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.resolveHttpAuthSchemeConfig = exports.defaultSSOOIDCHttpAuthSchemeProvider = exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0;
+const core_1 = __nccwpck_require__(8704);
+const util_middleware_1 = __nccwpck_require__(76324);
+const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
+ return {
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
+ (() => {
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
+ })(),
+ };
};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
+exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider;
+function createAwsAuthSigv4HttpAuthOption(authParameters) {
+ return {
+ schemeId: "aws.auth#sigv4",
+ signingProperties: {
+ name: "sso-oauth",
+ region: authParameters.region,
+ },
+ propertiesExtractor: (config, context) => ({
+ signingProperties: {
+ config,
+ context,
+ },
+ }),
+ };
+}
+function createSmithyApiNoAuthHttpAuthOption(authParameters) {
+ return {
+ schemeId: "smithy.api#noAuth",
+ };
+}
+const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
+ const options = [];
+ switch (authParameters.operation) {
+ case "CreateToken": {
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
+ break;
+ }
+ default: {
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
+ }
+ }
+ return options;
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider;
+const resolveHttpAuthSchemeConfig = (config) => {
+ const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
+ return {
+ ...config_0,
+ };
+};
+exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
-// src/submodules/protocols/index.ts
-var protocols_exports = {};
-__export(protocols_exports, {
- _toBool: () => _toBool,
- _toNum: () => _toNum,
- _toStr: () => _toStr,
- awsExpectUnion: () => awsExpectUnion,
- loadRestJsonErrorCode: () => loadRestJsonErrorCode,
- loadRestXmlErrorCode: () => loadRestXmlErrorCode,
- parseJsonBody: () => parseJsonBody,
- parseJsonErrorBody: () => parseJsonErrorBody,
- parseXmlBody: () => parseXmlBody,
- parseXmlErrorBody: () => parseXmlErrorBody
+
+/***/ }),
+
+/***/ 90546:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.defaultEndpointResolver = void 0;
+const util_endpoints_1 = __nccwpck_require__(83068);
+const util_endpoints_2 = __nccwpck_require__(79674);
+const ruleset_1 = __nccwpck_require__(69947);
+const cache = new util_endpoints_2.EndpointCache({
+ size: 50,
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
});
-module.exports = __toCommonJS(protocols_exports);
+const defaultEndpointResolver = (endpointParams, context = {}) => {
+ return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
+ endpointParams: endpointParams,
+ logger: context.logger,
+ }));
+};
+exports.defaultEndpointResolver = defaultEndpointResolver;
+util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
-// src/submodules/protocols/coercing-serializers.ts
-var _toStr = /* @__PURE__ */ __name((val) => {
- if (val == null) {
- return val;
- }
- if (typeof val === "number" || typeof val === "bigint") {
- const warning = new Error(`Received number ${val} where a string was expected.`);
- warning.name = "Warning";
- console.warn(warning);
- return String(val);
- }
- if (typeof val === "boolean") {
- const warning = new Error(`Received boolean ${val} where a string was expected.`);
- warning.name = "Warning";
- console.warn(warning);
- return String(val);
- }
- return val;
-}, "_toStr");
-var _toBool = /* @__PURE__ */ __name((val) => {
- if (val == null) {
- return val;
- }
- if (typeof val === "number") {
- }
- if (typeof val === "string") {
- const lowercase = val.toLowerCase();
- if (val !== "" && lowercase !== "false" && lowercase !== "true") {
- const warning = new Error(`Received string "${val}" where a boolean was expected.`);
- warning.name = "Warning";
- console.warn(warning);
- }
- return val !== "" && lowercase !== "false";
- }
- return val;
-}, "_toBool");
-var _toNum = /* @__PURE__ */ __name((val) => {
- if (val == null) {
- return val;
- }
- if (typeof val === "boolean") {
- }
- if (typeof val === "string") {
- const num = Number(val);
- if (num.toString() !== val) {
- const warning = new Error(`Received string "${val}" where a number was expected.`);
- warning.name = "Warning";
- console.warn(warning);
- return val;
- }
- return num;
- }
- return val;
-}, "_toNum");
-// src/submodules/protocols/json/awsExpectUnion.ts
-var import_smithy_client = __nccwpck_require__(61411);
-var awsExpectUnion = /* @__PURE__ */ __name((value) => {
- if (value == null) {
- return void 0;
- }
- if (typeof value === "object" && "__type" in value) {
- delete value.__type;
- }
- return (0, import_smithy_client.expectUnion)(value);
-}, "awsExpectUnion");
+/***/ }),
-// src/submodules/protocols/common.ts
-var import_smithy_client2 = __nccwpck_require__(61411);
-var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client2.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
+/***/ 69947:
+/***/ ((__unused_webpack_module, exports) => {
-// src/submodules/protocols/json/parseJsonBody.ts
-var parseJsonBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
- if (encoded.length) {
- try {
- return JSON.parse(encoded);
- } catch (e) {
- if ((e == null ? void 0 : e.name) === "SyntaxError") {
- Object.defineProperty(e, "$responseBodyText", {
- value: encoded
- });
- }
- throw e;
- }
- }
- return {};
-}), "parseJsonBody");
-var parseJsonErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
- const value = await parseJsonBody(errorBody, context);
- value.message = value.message ?? value.Message;
- return value;
-}, "parseJsonErrorBody");
-var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
- let cleanValue = rawValue;
- if (typeof cleanValue === "number") {
- cleanValue = cleanValue.toString();
- }
- if (cleanValue.indexOf(",") >= 0) {
- cleanValue = cleanValue.split(",")[0];
- }
- if (cleanValue.indexOf(":") >= 0) {
- cleanValue = cleanValue.split(":")[0];
- }
- if (cleanValue.indexOf("#") >= 0) {
- cleanValue = cleanValue.split("#")[1];
- }
- return cleanValue;
- }, "sanitizeErrorCode");
- const headerKey = findKey(output.headers, "x-amzn-errortype");
- if (headerKey !== void 0) {
- return sanitizeErrorCode(output.headers[headerKey]);
- }
- if (data.code !== void 0) {
- return sanitizeErrorCode(data.code);
- }
- if (data["__type"] !== void 0) {
- return sanitizeErrorCode(data["__type"]);
- }
-}, "loadRestJsonErrorCode");
-// src/submodules/protocols/xml/parseXmlBody.ts
-var import_smithy_client3 = __nccwpck_require__(61411);
-var import_fast_xml_parser = __nccwpck_require__(39741);
-var parseXmlBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
- if (encoded.length) {
- const parser = new import_fast_xml_parser.XMLParser({
- attributeNamePrefix: "",
- htmlEntities: true,
- ignoreAttributes: false,
- ignoreDeclaration: true,
- parseTagValue: false,
- trimValues: false,
- tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0
- });
- parser.addEntity("#xD", "\r");
- parser.addEntity("#10", "\n");
- let parsedObj;
- try {
- parsedObj = parser.parse(encoded, true);
- } catch (e) {
- if (e && typeof e === "object") {
- Object.defineProperty(e, "$responseBodyText", {
- value: encoded
- });
- }
- throw e;
- }
- const textNodeName = "#text";
- const key = Object.keys(parsedObj)[0];
- const parsedObjToReturn = parsedObj[key];
- if (parsedObjToReturn[textNodeName]) {
- parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
- delete parsedObjToReturn[textNodeName];
- }
- return (0, import_smithy_client3.getValueFromTextNode)(parsedObjToReturn);
- }
- return {};
-}), "parseXmlBody");
-var parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
- const value = await parseXmlBody(errorBody, context);
- if (value.Error) {
- value.Error.message = value.Error.message ?? value.Error.Message;
- }
- return value;
-}, "parseXmlErrorBody");
-var loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => {
- var _a;
- if (((_a = data == null ? void 0 : data.Error) == null ? void 0 : _a.Code) !== void 0) {
- return data.Error.Code;
- }
- if ((data == null ? void 0 : data.Code) !== void 0) {
- return data.Code;
- }
- if (output.statusCode == 404) {
- return "NotFound";
- }
-}, "loadRestXmlErrorCode");
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.ruleSet = void 0;
+const u = "required", v = "fn", w = "argv", x = "ref";
+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" }];
+const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
+exports.ruleSet = _data;
/***/ }),
-/***/ 55606:
+/***/ 89443:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
@@ -13557,1423 +12413,1192 @@ var __copyProps = (to, from, except, desc) => {
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
- ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
- ENV_EXPIRATION: () => ENV_EXPIRATION,
- ENV_KEY: () => ENV_KEY,
- ENV_SECRET: () => ENV_SECRET,
- ENV_SESSION: () => ENV_SESSION,
- fromEnv: () => fromEnv
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/fromEnv.ts
-var import_client = __nccwpck_require__(5152);
-var import_property_provider = __nccwpck_require__(71238);
-var ENV_KEY = "AWS_ACCESS_KEY_ID";
-var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
-var ENV_SESSION = "AWS_SESSION_TOKEN";
-var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
-var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
-var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
-var fromEnv = /* @__PURE__ */ __name((init) => async () => {
- var _a;
- (_a = init == null ? void 0 : init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-env - fromEnv");
- const accessKeyId = process.env[ENV_KEY];
- const secretAccessKey = process.env[ENV_SECRET];
- const sessionToken = process.env[ENV_SESSION];
- const expiry = process.env[ENV_EXPIRATION];
- const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
- const accountId = process.env[ENV_ACCOUNT_ID];
- if (accessKeyId && secretAccessKey) {
- const credentials = {
- accessKeyId,
- secretAccessKey,
- ...sessionToken && { sessionToken },
- ...expiry && { expiration: new Date(expiry) },
- ...credentialScope && { credentialScope },
- ...accountId && { accountId }
- };
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
- return credentials;
- }
- throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init == null ? void 0 : init.logger });
-}, "fromEnv");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 1509:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.checkUrl = void 0;
-const property_provider_1 = __nccwpck_require__(71238);
-const LOOPBACK_CIDR_IPv4 = "127.0.0.0/8";
-const LOOPBACK_CIDR_IPv6 = "::1/128";
-const ECS_CONTAINER_HOST = "169.254.170.2";
-const EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
-const EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
-const checkUrl = (url, logger) => {
- if (url.protocol === "https:") {
- return;
- }
- if (url.hostname === ECS_CONTAINER_HOST ||
- url.hostname === EKS_CONTAINER_HOST_IPv4 ||
- url.hostname === EKS_CONTAINER_HOST_IPv6) {
- return;
- }
- if (url.hostname.includes("[")) {
- if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") {
- return;
- }
- }
- else {
- if (url.hostname === "localhost") {
- return;
- }
- const ipComponents = url.hostname.split(".");
- const inRange = (component) => {
- const num = parseInt(component, 10);
- return 0 <= num && num <= 255;
- };
- if (ipComponents[0] === "127" &&
- inRange(ipComponents[1]) &&
- inRange(ipComponents[2]) &&
- inRange(ipComponents[3]) &&
- ipComponents.length === 4) {
- return;
- }
- }
- throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
- - loopback CIDR 127.0.0.0/8 or [::1/128]
- - ECS container host 169.254.170.2
- - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger });
-};
-exports.checkUrl = checkUrl;
-
-
-/***/ }),
-
-/***/ 68712:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+// src/submodules/sso-oidc/index.ts
+var index_exports = {};
+__export(index_exports, {
+ $Command: () => import_smithy_client6.Command,
+ AccessDeniedException: () => AccessDeniedException,
+ AuthorizationPendingException: () => AuthorizationPendingException,
+ CreateTokenCommand: () => CreateTokenCommand,
+ CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog,
+ CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog,
+ ExpiredTokenException: () => ExpiredTokenException,
+ InternalServerException: () => InternalServerException,
+ InvalidClientException: () => InvalidClientException,
+ InvalidGrantException: () => InvalidGrantException,
+ InvalidRequestException: () => InvalidRequestException,
+ InvalidScopeException: () => InvalidScopeException,
+ SSOOIDC: () => SSOOIDC,
+ SSOOIDCClient: () => SSOOIDCClient,
+ SSOOIDCServiceException: () => SSOOIDCServiceException,
+ SlowDownException: () => SlowDownException,
+ UnauthorizedClientException: () => UnauthorizedClientException,
+ UnsupportedGrantTypeException: () => UnsupportedGrantTypeException,
+ __Client: () => import_smithy_client2.Client
+});
+module.exports = __toCommonJS(index_exports);
+// src/submodules/sso-oidc/SSOOIDCClient.ts
+var import_middleware_host_header = __nccwpck_require__(52590);
+var import_middleware_logger = __nccwpck_require__(85242);
+var import_middleware_recursion_detection = __nccwpck_require__(81568);
+var import_middleware_user_agent = __nccwpck_require__(32959);
+var import_config_resolver = __nccwpck_require__(39316);
+var import_core = __nccwpck_require__(90402);
+var import_middleware_content_length = __nccwpck_require__(47212);
+var import_middleware_endpoint = __nccwpck_require__(40099);
+var import_middleware_retry = __nccwpck_require__(19618);
+var import_smithy_client2 = __nccwpck_require__(61411);
+var import_httpAuthSchemeProvider = __nccwpck_require__(8396);
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.fromHttp = void 0;
-const tslib_1 = __nccwpck_require__(61860);
-const client_1 = __nccwpck_require__(5152);
-const node_http_handler_1 = __nccwpck_require__(61279);
-const property_provider_1 = __nccwpck_require__(71238);
-const promises_1 = tslib_1.__importDefault(__nccwpck_require__(91943));
-const checkUrl_1 = __nccwpck_require__(1509);
-const requestHelpers_1 = __nccwpck_require__(78914);
-const retry_wrapper_1 = __nccwpck_require__(51122);
-const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
-const DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
-const AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
-const AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
-const AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
-const fromHttp = (options = {}) => {
- options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
- let host;
- const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
- const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
- const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
- const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
- const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger ? console.warn : options.logger.warn;
- if (relative && full) {
- warn("@aws-sdk/credential-provider-http: " +
- "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
- warn("awsContainerCredentialsFullUri will take precedence.");
- }
- if (token && tokenFile) {
- warn("@aws-sdk/credential-provider-http: " +
- "you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
- warn("awsContainerAuthorizationToken will take precedence.");
- }
- if (full) {
- host = full;
- }
- else if (relative) {
- host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`;
- }
- else {
- throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
-Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
- }
- const url = new URL(host);
- (0, checkUrl_1.checkUrl)(url, options.logger);
- const requestHandler = new node_http_handler_1.NodeHttpHandler({
- requestTimeout: options.timeout ?? 1000,
- connectionTimeout: options.timeout ?? 1000,
- });
- return (0, retry_wrapper_1.retryWrapper)(async () => {
- const request = (0, requestHelpers_1.createGetRequest)(url);
- if (token) {
- request.headers.Authorization = token;
- }
- else if (tokenFile) {
- request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString();
- }
- try {
- const result = await requestHandler.handle(request);
- return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z"));
- }
- catch (e) {
- throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger });
- }
- }, options.maxRetries ?? 3, options.timeout ?? 1000);
+// src/submodules/sso-oidc/endpoint/EndpointParameters.ts
+var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
+ return {
+ ...options,
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
+ defaultSigningName: "sso-oauth"
+ };
+}, "resolveClientEndpointParameters");
+var commonParams = {
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
+ Endpoint: { type: "builtInParams", name: "endpoint" },
+ Region: { type: "builtInParams", name: "region" },
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
};
-exports.fromHttp = fromHttp;
-
-
-/***/ }),
-/***/ 78914:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+// src/submodules/sso-oidc/SSOOIDCClient.ts
+var import_runtimeConfig = __nccwpck_require__(16901);
+// src/submodules/sso-oidc/runtimeExtensions.ts
+var import_region_config_resolver = __nccwpck_require__(36463);
+var import_protocol_http = __nccwpck_require__(72356);
+var import_smithy_client = __nccwpck_require__(61411);
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getCredentials = exports.createGetRequest = void 0;
-const property_provider_1 = __nccwpck_require__(71238);
-const protocol_http_1 = __nccwpck_require__(72356);
-const smithy_client_1 = __nccwpck_require__(61411);
-const util_stream_1 = __nccwpck_require__(4252);
-function createGetRequest(url) {
- return new protocol_http_1.HttpRequest({
- protocol: url.protocol,
- hostname: url.hostname,
- port: Number(url.port),
- path: url.pathname,
- query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => {
- acc[k] = v;
- return acc;
- }, {}),
- fragment: url.hash,
- });
-}
-exports.createGetRequest = createGetRequest;
-async function getCredentials(response, logger) {
- const stream = (0, util_stream_1.sdkStreamMixin)(response.body);
- const str = await stream.transformToString();
- if (response.statusCode === 200) {
- const parsed = JSON.parse(str);
- if (typeof parsed.AccessKeyId !== "string" ||
- typeof parsed.SecretAccessKey !== "string" ||
- typeof parsed.Token !== "string" ||
- typeof parsed.Expiration !== "string") {
- throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: " +
- "{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger });
- }
- return {
- accessKeyId: parsed.AccessKeyId,
- secretAccessKey: parsed.SecretAccessKey,
- sessionToken: parsed.Token,
- expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration),
- };
- }
- if (response.statusCode >= 400 && response.statusCode < 500) {
- let parsedBody = {};
- try {
- parsedBody = JSON.parse(str);
- }
- catch (e) { }
- throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), {
- Code: parsedBody.Code,
- Message: parsedBody.Message,
- });
+// src/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.ts
+var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
+ let _credentials = runtimeConfig.credentials;
+ return {
+ setHttpAuthScheme(httpAuthScheme) {
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
+ if (index === -1) {
+ _httpAuthSchemes.push(httpAuthScheme);
+ } else {
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
+ }
+ },
+ httpAuthSchemes() {
+ return _httpAuthSchemes;
+ },
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
+ },
+ httpAuthSchemeProvider() {
+ return _httpAuthSchemeProvider;
+ },
+ setCredentials(credentials) {
+ _credentials = credentials;
+ },
+ credentials() {
+ return _credentials;
}
- throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger });
-}
-exports.getCredentials = getCredentials;
-
-
-/***/ }),
-
-/***/ 51122:
-/***/ ((__unused_webpack_module, exports) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.retryWrapper = void 0;
-const retryWrapper = (toRetry, maxRetries, delayMs) => {
- return async () => {
- for (let i = 0; i < maxRetries; ++i) {
- try {
- return await toRetry();
- }
- catch (e) {
- await new Promise((resolve) => setTimeout(resolve, delayMs));
- }
- }
- return await toRetry();
- };
-};
-exports.retryWrapper = retryWrapper;
-
-
-/***/ }),
-
-/***/ 98605:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.fromHttp = void 0;
-var fromHttp_1 = __nccwpck_require__(68712);
-Object.defineProperty(exports, "fromHttp", ({ enumerable: true, get: function () { return fromHttp_1.fromHttp; } }));
-
-
-/***/ }),
-
-/***/ 75869:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ };
+}, "getHttpAuthExtensionConfiguration");
+var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
+ return {
+ httpAuthSchemes: config.httpAuthSchemes(),
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
+ credentials: config.credentials()
+ };
+}, "resolveHttpAuthRuntimeConfig");
+// src/submodules/sso-oidc/runtimeExtensions.ts
+var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
+var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
+ const extensionConfiguration = {
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
+ };
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
+ return {
+ ...runtimeConfig,
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
+ };
+}, "resolveRuntimeExtensions");
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+// src/submodules/sso-oidc/SSOOIDCClient.ts
+var SSOOIDCClient = class extends import_smithy_client2.Client {
+ static {
+ __name(this, "SSOOIDCClient");
+ }
+ /**
+ * The resolved configuration of SSOOIDCClient class. This is resolved and normalized from the {@link SSOOIDCClientConfig | constructor configuration interface}.
+ */
+ config;
+ constructor(...[configuration]) {
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
+ const _config_1 = resolveClientEndpointParameters(_config_0);
+ const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
+ const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
+ const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
+ const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
+ const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
+ super(_config_8);
+ this.config = _config_8;
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
+ this.middlewareStack.use(
+ (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
+ httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider,
+ identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
+ "aws.auth#sigv4": config.credentials
+ }), "identityProviderConfigProvider")
+ })
+ );
+ this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
+ }
+ /**
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
+ */
+ destroy() {
+ super.destroy();
}
- return to;
};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
- mod
-));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- fromIni: () => fromIni
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/fromIni.ts
-
-// src/resolveProfileData.ts
-
-
-// src/resolveAssumeRoleCredentials.ts
+// src/submodules/sso-oidc/SSOOIDC.ts
+var import_smithy_client7 = __nccwpck_require__(61411);
+// src/submodules/sso-oidc/commands/CreateTokenCommand.ts
+var import_middleware_endpoint2 = __nccwpck_require__(40099);
+var import_middleware_serde = __nccwpck_require__(83255);
+var import_smithy_client6 = __nccwpck_require__(61411);
-var import_shared_ini_file_loader = __nccwpck_require__(94964);
+// src/submodules/sso-oidc/models/models_0.ts
+var import_smithy_client4 = __nccwpck_require__(61411);
-// src/resolveCredentialSource.ts
-var import_client = __nccwpck_require__(5152);
-var import_property_provider = __nccwpck_require__(71238);
-var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger) => {
- const sourceProvidersMap = {
- EcsContainer: async (options) => {
- const { fromHttp } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(98605)));
- const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(40566)));
- logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
- return async () => (0, import_property_provider.chain)(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
- },
- Ec2InstanceMetadata: async (options) => {
- logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
- const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(40566)));
- return async () => fromInstanceMetadata(options)().then(setNamedProvider);
- },
- Environment: async (options) => {
- logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
- const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(55606)));
- return async () => fromEnv(options)().then(setNamedProvider);
- }
- };
- if (credentialSource in sourceProvidersMap) {
- return sourceProvidersMap[credentialSource];
- } else {
- throw new import_property_provider.CredentialsProviderError(
- `Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,
- { logger }
- );
+// src/submodules/sso-oidc/models/SSOOIDCServiceException.ts
+var import_smithy_client3 = __nccwpck_require__(61411);
+var SSOOIDCServiceException = class _SSOOIDCServiceException extends import_smithy_client3.ServiceException {
+ static {
+ __name(this, "SSOOIDCServiceException");
}
-}, "resolveCredentialSource");
-var setNamedProvider = /* @__PURE__ */ __name((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), "setNamedProvider");
-
-// src/resolveAssumeRoleCredentials.ts
-var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger } = {}) => {
- return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger }));
-}, "isAssumeRoleProfile");
-var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger }) => {
- var _a;
- const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
- if (withSourceProfile) {
- (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, ` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
+ /**
+ * @internal
+ */
+ constructor(options) {
+ super(options);
+ Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype);
}
- return withSourceProfile;
-}, "isAssumeRoleWithSourceProfile");
-var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger }) => {
- var _a;
- const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
- if (withProviderProfile) {
- (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, ` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
+};
+
+// src/submodules/sso-oidc/models/models_0.ts
+var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException {
+ static {
+ __name(this, "AccessDeniedException");
}
- return withProviderProfile;
-}, "isCredentialSourceProfile");
-var resolveAssumeRoleCredentials = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}) => {
- var _a, _b;
- (_a = options.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
- const data = profiles[profileName];
- if (!options.roleAssumer) {
- const { getDefaultRoleAssumer } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(71695)));
- options.roleAssumer = getDefaultRoleAssumer(
- {
- ...options.clientConfig,
- credentialProviderLogger: options.logger,
- parentClientConfig: options == null ? void 0 : options.parentClientConfig
- },
- options.clientPlugins
- );
+ name = "AccessDeniedException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be access_denied.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "AccessDeniedException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _AccessDeniedException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- const { source_profile } = data;
- if (source_profile && source_profile in visitedProfiles) {
- throw new import_property_provider.CredentialsProviderError(
- `Detected a cycle attempting to resolve credentials for profile ${(0, import_shared_ini_file_loader.getProfileName)(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "),
- { logger: options.logger }
- );
+};
+var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException {
+ static {
+ __name(this, "AuthorizationPendingException");
}
- (_b = options.logger) == null ? void 0 : _b.debug(
- `@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`
- );
- const sourceCredsProvider = source_profile ? resolveProfileData(
- source_profile,
- profiles,
- options,
- {
- ...visitedProfiles,
- [source_profile]: true
- },
- isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})
- ) : (await resolveCredentialSource(data.credential_source, profileName, options.logger)(options))();
- if (isCredentialSourceWithoutRoleArn(data)) {
- return sourceCredsProvider.then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
- } else {
- const params = {
- RoleArn: data.role_arn,
- RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`,
- ExternalId: data.external_id,
- DurationSeconds: parseInt(data.duration_seconds || "3600", 10)
- };
- const { mfa_serial } = data;
- if (mfa_serial) {
- if (!options.mfaCodeProvider) {
- throw new import_property_provider.CredentialsProviderError(
- `Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`,
- { logger: options.logger, tryNextLink: false }
- );
- }
- params.SerialNumber = mfa_serial;
- params.TokenCode = await options.mfaCodeProvider(mfa_serial);
- }
- const sourceCreds = await sourceCredsProvider;
- return options.roleAssumer(sourceCreds, params).then(
- (creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")
- );
+ name = "AuthorizationPendingException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be
+ * authorization_pending.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "AuthorizationPendingException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _AuthorizationPendingException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
-}, "resolveAssumeRoleCredentials");
-var isCredentialSourceWithoutRoleArn = /* @__PURE__ */ __name((section) => {
- return !section.role_arn && !!section.credential_source;
-}, "isCredentialSourceWithoutRoleArn");
-
-// src/resolveProcessCredentials.ts
-
-var isProcessProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", "isProcessProfile");
-var resolveProcessCredentials = /* @__PURE__ */ __name(async (options, profile) => Promise.resolve().then(() => __toESM(__nccwpck_require__(75360))).then(
- ({ fromProcess }) => fromProcess({
- ...options,
- profile
- })().then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))
-), "resolveProcessCredentials");
-
-// src/resolveSsoCredentials.ts
-
-var resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, profileData, options = {}) => {
- const { fromSSO } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(60998)));
- return fromSSO({
- profile,
- logger: options.logger
- })().then((creds) => {
- if (profileData.sso_session) {
- return (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SSO", "r");
- } else {
- return (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
- }
- });
-}, "resolveSsoCredentials");
-var isSsoProfile = /* @__PURE__ */ __name((arg) => 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"), "isSsoProfile");
-
-// src/resolveStaticCredentials.ts
-
-var isStaticCredsProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1, "isStaticCredsProfile");
-var resolveStaticCredentials = /* @__PURE__ */ __name(async (profile, options) => {
- var _a;
- (_a = options == null ? void 0 : options.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
- const credentials = {
- accessKeyId: profile.aws_access_key_id,
- secretAccessKey: profile.aws_secret_access_key,
- sessionToken: profile.aws_session_token,
- ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
- ...profile.aws_account_id && { accountId: profile.aws_account_id }
- };
- return (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_PROFILE", "n");
-}, "resolveStaticCredentials");
-
-// src/resolveWebIdentityCredentials.ts
-
-var isWebIdentityProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, "isWebIdentityProfile");
-var resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options) => Promise.resolve().then(() => __toESM(__nccwpck_require__(29956))).then(
- ({ fromTokenFile }) => fromTokenFile({
- webIdentityTokenFile: profile.web_identity_token_file,
- roleArn: profile.role_arn,
- roleSessionName: profile.role_session_name,
- roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
- logger: options.logger,
- parentClientConfig: options.parentClientConfig
- })().then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))
-), "resolveWebIdentityCredentials");
-
-// src/resolveProfileData.ts
-var resolveProfileData = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
- const data = profiles[profileName];
- if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
- return resolveStaticCredentials(data, options);
+};
+var CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj,
+ ...obj.clientSecret && { clientSecret: import_smithy_client4.SENSITIVE_STRING },
+ ...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING },
+ ...obj.codeVerifier && { codeVerifier: import_smithy_client4.SENSITIVE_STRING }
+}), "CreateTokenRequestFilterSensitiveLog");
+var CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj,
+ ...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING },
+ ...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING },
+ ...obj.idToken && { idToken: import_smithy_client4.SENSITIVE_STRING }
+}), "CreateTokenResponseFilterSensitiveLog");
+var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException {
+ static {
+ __name(this, "ExpiredTokenException");
}
- if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
- return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
+ name = "ExpiredTokenException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be expired_token.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "ExpiredTokenException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- if (isStaticCredsProfile(data)) {
- return resolveStaticCredentials(data, options);
+};
+var InternalServerException = class _InternalServerException extends SSOOIDCServiceException {
+ static {
+ __name(this, "InternalServerException");
}
- if (isWebIdentityProfile(data)) {
- return resolveWebIdentityCredentials(data, options);
+ name = "InternalServerException";
+ $fault = "server";
+ /**
+ * Single error code. For this exception the value will be server_error.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "InternalServerException",
+ $fault: "server",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _InternalServerException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- if (isProcessProfile(data)) {
- return resolveProcessCredentials(options, profileName);
+};
+var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException {
+ static {
+ __name(this, "InvalidClientException");
}
- if (isSsoProfile(data)) {
- return await resolveSsoCredentials(profileName, data, options);
+ name = "InvalidClientException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be
+ * invalid_client.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "InvalidClientException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _InvalidClientException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- throw new import_property_provider.CredentialsProviderError(
- `Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`,
- { logger: options.logger }
- );
-}, "resolveProfileData");
-
-// src/fromIni.ts
-var fromIni = /* @__PURE__ */ __name((init = {}) => async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini - fromIni");
- const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
- return resolveProfileData((0, import_shared_ini_file_loader.getProfileName)(init), profiles, init);
-}, "fromIni");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 5861:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException {
+ static {
+ __name(this, "InvalidGrantException");
+ }
+ name = "InvalidGrantException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be invalid_grant.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "InvalidGrantException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _InvalidGrantException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- return to;
};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
- mod
-));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- credentialsTreatedAsExpired: () => credentialsTreatedAsExpired,
- credentialsWillNeedRefresh: () => credentialsWillNeedRefresh,
- defaultProvider: () => defaultProvider
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/defaultProvider.ts
-var import_credential_provider_env = __nccwpck_require__(55606);
-
-var import_shared_ini_file_loader = __nccwpck_require__(94964);
-
-// src/remoteProvider.ts
-var import_property_provider = __nccwpck_require__(71238);
-var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
-var remoteProvider = /* @__PURE__ */ __name(async (init) => {
- var _a, _b;
- const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(40566)));
- if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
- const { fromHttp } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(98605)));
- return (0, import_property_provider.chain)(fromHttp(init), fromContainerMetadata(init));
+var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException {
+ static {
+ __name(this, "InvalidRequestException");
}
- if (process.env[ENV_IMDS_DISABLED]) {
- return async () => {
- throw new import_property_provider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger });
- };
+ name = "InvalidRequestException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be
+ * invalid_request.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "InvalidRequestException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _InvalidRequestException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- (_b = init.logger) == null ? void 0 : _b.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata");
- return fromInstanceMetadata(init);
-}, "remoteProvider");
-
-// src/defaultProvider.ts
-var multipleCredentialSourceWarningEmitted = false;
-var defaultProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)(
- (0, import_property_provider.chain)(
- async () => {
- var _a, _b, _c, _d;
- const profile = init.profile ?? process.env[import_shared_ini_file_loader.ENV_PROFILE];
- if (profile) {
- const envStaticCredentialsAreSet = process.env[import_credential_provider_env.ENV_KEY] && process.env[import_credential_provider_env.ENV_SECRET];
- if (envStaticCredentialsAreSet) {
- if (!multipleCredentialSourceWarningEmitted) {
- const warnFn = ((_a = init.logger) == null ? void 0 : _a.warn) && ((_c = (_b = init.logger) == null ? void 0 : _b.constructor) == null ? void 0 : _c.name) !== "NoOpLogger" ? init.logger.warn : console.warn;
- warnFn(
- `@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
- Multiple credential sources detected:
- Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
- This SDK will proceed with the AWS_PROFILE value.
-
- However, a future version may change this behavior to prefer the ENV static credentials.
- Please ensure that your environment only sets either the AWS_PROFILE or the
- AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
-`
- );
- multipleCredentialSourceWarningEmitted = true;
- }
- }
- throw new import_property_provider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", {
- logger: init.logger,
- tryNextLink: true
- });
- }
- (_d = init.logger) == null ? void 0 : _d.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv");
- return (0, import_credential_provider_env.fromEnv)(init)();
- },
- async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");
- const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
- if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
- throw new import_property_provider.CredentialsProviderError(
- "Skipping SSO provider in default chain (inputs do not include SSO fields).",
- { logger: init.logger }
- );
- }
- const { fromSSO } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(60998)));
- return fromSSO(init)();
- },
- async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
- const { fromIni } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(75869)));
- return fromIni(init)();
- },
- async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
- const { fromProcess } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(75360)));
- return fromProcess(init)();
- },
- async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
- const { fromTokenFile } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(29956)));
- return fromTokenFile(init)();
- },
- async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider");
- return (await remoteProvider(init))();
- },
- async () => {
- throw new import_property_provider.CredentialsProviderError("Could not load credentials from any providers", {
- tryNextLink: false,
- logger: init.logger
- });
- }
- ),
- credentialsTreatedAsExpired,
- credentialsWillNeedRefresh
-), "defaultProvider");
-var credentialsWillNeedRefresh = /* @__PURE__ */ __name((credentials) => (credentials == null ? void 0 : credentials.expiration) !== void 0, "credentialsWillNeedRefresh");
-var credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => (credentials == null ? void 0 : credentials.expiration) !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5, "credentialsTreatedAsExpired");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 75360:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException {
+ static {
+ __name(this, "InvalidScopeException");
+ }
+ name = "InvalidScopeException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be invalid_scope.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "InvalidScopeException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _InvalidScopeException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- return to;
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- fromProcess: () => fromProcess
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/fromProcess.ts
-var import_shared_ini_file_loader = __nccwpck_require__(94964);
-
-// src/resolveProcessCredentials.ts
-var import_property_provider = __nccwpck_require__(71238);
-var import_child_process = __nccwpck_require__(35317);
-var import_util = __nccwpck_require__(39023);
-
-// src/getValidatedProcessCredentials.ts
-var import_client = __nccwpck_require__(5152);
-var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data, profiles) => {
- var _a;
- if (data.Version !== 1) {
- throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
+var SlowDownException = class _SlowDownException extends SSOOIDCServiceException {
+ static {
+ __name(this, "SlowDownException");
}
- if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) {
- throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
+ name = "SlowDownException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be slow_down.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "SlowDownException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _SlowDownException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- if (data.Expiration) {
- const currentTime = /* @__PURE__ */ new Date();
- const expireTime = new Date(data.Expiration);
- if (expireTime < currentTime) {
- throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
- }
+};
+var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException {
+ static {
+ __name(this, "UnauthorizedClientException");
}
- let accountId = data.AccountId;
- if (!accountId && ((_a = profiles == null ? void 0 : profiles[profileName]) == null ? void 0 : _a.aws_account_id)) {
- accountId = profiles[profileName].aws_account_id;
+ name = "UnauthorizedClientException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be
+ * unauthorized_client.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "UnauthorizedClientException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _UnauthorizedClientException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- const credentials = {
- accessKeyId: data.AccessKeyId,
- secretAccessKey: data.SecretAccessKey,
- ...data.SessionToken && { sessionToken: data.SessionToken },
- ...data.Expiration && { expiration: new Date(data.Expiration) },
- ...data.CredentialScope && { credentialScope: data.CredentialScope },
- ...accountId && { accountId }
- };
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_PROCESS", "w");
- return credentials;
-}, "getValidatedProcessCredentials");
-
-// src/resolveProcessCredentials.ts
-var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger) => {
- const profile = profiles[profileName];
- if (profiles[profileName]) {
- const credentialProcess = profile["credential_process"];
- if (credentialProcess !== void 0) {
- const execPromise = (0, import_util.promisify)(import_child_process.exec);
- try {
- const { stdout } = await execPromise(credentialProcess);
- let data;
- try {
- data = JSON.parse(stdout.trim());
- } catch {
- throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
- }
- return getValidatedProcessCredentials(profileName, data, profiles);
- } catch (error) {
- throw new import_property_provider.CredentialsProviderError(error.message, { logger });
- }
- } else {
- throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
- }
- } else {
- throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
- logger
- });
- }
-}, "resolveProcessCredentials");
-
-// src/fromProcess.ts
-var fromProcess = /* @__PURE__ */ __name((init = {}) => async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-process - fromProcess");
- const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
- return resolveProcessCredentials((0, import_shared_ini_file_loader.getProfileName)(init), profiles, init.logger);
-}, "fromProcess");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 60998:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __esm = (fn, res) => function __init() {
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
-};
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/loadSso.ts
-var loadSso_exports = {};
-__export(loadSso_exports, {
- GetRoleCredentialsCommand: () => import_client_sso.GetRoleCredentialsCommand,
- SSOClient: () => import_client_sso.SSOClient
-});
-var import_client_sso;
-var init_loadSso = __esm({
- "src/loadSso.ts"() {
- "use strict";
- import_client_sso = __nccwpck_require__(62054);
- }
-});
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- fromSSO: () => fromSSO,
- isSsoProfile: () => isSsoProfile,
- validateSsoProfile: () => validateSsoProfile
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/fromSSO.ts
-
-
-
-// src/isSsoProfile.ts
-var isSsoProfile = /* @__PURE__ */ __name((arg) => 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"), "isSsoProfile");
-
-// src/resolveSSOCredentials.ts
-var import_client = __nccwpck_require__(5152);
-var import_token_providers = __nccwpck_require__(75433);
-var import_property_provider = __nccwpck_require__(71238);
-var import_shared_ini_file_loader = __nccwpck_require__(94964);
-var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
-var resolveSSOCredentials = /* @__PURE__ */ __name(async ({
- ssoStartUrl,
- ssoSession,
- ssoAccountId,
- ssoRegion,
- ssoRoleName,
- ssoClient,
- clientConfig,
- profile,
- logger
-}) => {
- let token;
- const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
- if (ssoSession) {
- try {
- const _token = await (0, import_token_providers.fromSso)({ profile })();
- token = {
- accessToken: _token.token,
- expiresAt: new Date(_token.expiration).toISOString()
- };
- } catch (e) {
- throw new import_property_provider.CredentialsProviderError(e.message, {
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
- logger
- });
- }
- } else {
- try {
- token = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoStartUrl);
- } catch (e) {
- throw new import_property_provider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
- logger
- });
- }
+var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException {
+ static {
+ __name(this, "UnsupportedGrantTypeException");
}
- if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
- throw new import_property_provider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
- logger
+ name = "UnsupportedGrantTypeException";
+ $fault = "client";
+ /**
+ * Single error code. For this exception the value will be
+ * unsupported_grant_type.
+ * @public
+ */
+ error;
+ /**
+ * Human-readable text providing additional information, used to assist the client developer
+ * in understanding the error that occurred.
+ * @public
+ */
+ error_description;
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "UnsupportedGrantTypeException",
+ $fault: "client",
+ ...opts
});
+ Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype);
+ this.error = opts.error;
+ this.error_description = opts.error_description;
}
- const { accessToken } = token;
- const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports));
- const sso = ssoClient || new SSOClient2(
- Object.assign({}, clientConfig ?? {}, {
- region: (clientConfig == null ? void 0 : clientConfig.region) ?? ssoRegion
+};
+
+// src/submodules/sso-oidc/protocols/Aws_restJson1.ts
+var import_core2 = __nccwpck_require__(8704);
+var import_core3 = __nccwpck_require__(90402);
+var import_smithy_client5 = __nccwpck_require__(61411);
+var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
+ const b = (0, import_core3.requestBuilder)(input, context);
+ const headers = {
+ "content-type": "application/json"
+ };
+ b.bp("/token");
+ let body;
+ body = JSON.stringify(
+ (0, import_smithy_client5.take)(input, {
+ clientId: [],
+ clientSecret: [],
+ code: [],
+ codeVerifier: [],
+ deviceCode: [],
+ grantType: [],
+ redirectUri: [],
+ refreshToken: [],
+ scope: /* @__PURE__ */ __name((_) => (0, import_smithy_client5._json)(_), "scope")
})
);
- let ssoResp;
- try {
- ssoResp = await sso.send(
- new GetRoleCredentialsCommand2({
- accountId: ssoAccountId,
- roleName: ssoRoleName,
- accessToken
- })
- );
- } catch (e) {
- throw new import_property_provider.CredentialsProviderError(e, {
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
- logger
- });
- }
- const {
- roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}
- } = ssoResp;
- if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
- throw new import_property_provider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
- logger
- });
+ b.m("POST").h(headers).b(body);
+ return b.build();
+}, "se_CreateTokenCommand");
+var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
}
- const credentials = {
- accessKeyId,
- secretAccessKey,
- sessionToken,
- expiration: new Date(expiration),
- ...credentialScope && { credentialScope },
- ...accountId && { accountId }
+ const contents = (0, import_smithy_client5.map)({
+ $metadata: deserializeMetadata(output)
+ });
+ const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
+ const doc = (0, import_smithy_client5.take)(data, {
+ accessToken: import_smithy_client5.expectString,
+ expiresIn: import_smithy_client5.expectInt32,
+ idToken: import_smithy_client5.expectString,
+ refreshToken: import_smithy_client5.expectString,
+ tokenType: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ return contents;
+}, "de_CreateTokenCommand");
+var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
+ const parsedOutput = {
+ ...output,
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
};
- if (ssoSession) {
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_SSO", "s");
- } else {
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_SSO_LEGACY", "u");
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
+ switch (errorCode) {
+ case "AccessDeniedException":
+ case "com.amazonaws.ssooidc#AccessDeniedException":
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
+ case "AuthorizationPendingException":
+ case "com.amazonaws.ssooidc#AuthorizationPendingException":
+ throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
+ case "ExpiredTokenException":
+ case "com.amazonaws.ssooidc#ExpiredTokenException":
+ throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
+ case "InternalServerException":
+ case "com.amazonaws.ssooidc#InternalServerException":
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
+ case "InvalidClientException":
+ case "com.amazonaws.ssooidc#InvalidClientException":
+ throw await de_InvalidClientExceptionRes(parsedOutput, context);
+ case "InvalidGrantException":
+ case "com.amazonaws.ssooidc#InvalidGrantException":
+ throw await de_InvalidGrantExceptionRes(parsedOutput, context);
+ case "InvalidRequestException":
+ case "com.amazonaws.ssooidc#InvalidRequestException":
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context);
+ case "InvalidScopeException":
+ case "com.amazonaws.ssooidc#InvalidScopeException":
+ throw await de_InvalidScopeExceptionRes(parsedOutput, context);
+ case "SlowDownException":
+ case "com.amazonaws.ssooidc#SlowDownException":
+ throw await de_SlowDownExceptionRes(parsedOutput, context);
+ case "UnauthorizedClientException":
+ case "com.amazonaws.ssooidc#UnauthorizedClientException":
+ throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
+ case "UnsupportedGrantTypeException":
+ case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
+ throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
+ default:
+ const parsedBody = parsedOutput.body;
+ return throwDefaultError({
+ output,
+ parsedBody,
+ errorCode
+ });
}
- return credentials;
-}, "resolveSSOCredentials");
-
-// src/validateSsoProfile.ts
+}, "de_CommandError");
+var throwDefaultError = (0, import_smithy_client5.withBaseException)(SSOOIDCServiceException);
+var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new AccessDeniedException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_AccessDeniedExceptionRes");
+var de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new AuthorizationPendingException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_AuthorizationPendingExceptionRes");
+var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new ExpiredTokenException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_ExpiredTokenExceptionRes");
+var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new InternalServerException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_InternalServerExceptionRes");
+var de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new InvalidClientException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_InvalidClientExceptionRes");
+var de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new InvalidGrantException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_InvalidGrantExceptionRes");
+var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new InvalidRequestException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_InvalidRequestExceptionRes");
+var de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new InvalidScopeException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_InvalidScopeExceptionRes");
+var de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new SlowDownException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_SlowDownExceptionRes");
+var de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new UnauthorizedClientException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_UnauthorizedClientExceptionRes");
+var de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const contents = (0, import_smithy_client5.map)({});
+ const data = parsedOutput.body;
+ const doc = (0, import_smithy_client5.take)(data, {
+ error: import_smithy_client5.expectString,
+ error_description: import_smithy_client5.expectString
+ });
+ Object.assign(contents, doc);
+ const exception = new UnsupportedGrantTypeException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents
+ });
+ return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
+}, "de_UnsupportedGrantTypeExceptionRes");
+var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
+ httpStatusCode: output.statusCode,
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
+ extendedRequestId: output.headers["x-amz-id-2"],
+ cfId: output.headers["x-amz-cf-id"]
+}), "deserializeMetadata");
-var validateSsoProfile = /* @__PURE__ */ __name((profile, logger) => {
- const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
- if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
- throw new import_property_provider.CredentialsProviderError(
- `Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(
- ", "
- )}
-Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,
- { tryNextLink: false, logger }
- );
+// src/submodules/sso-oidc/commands/CreateTokenCommand.ts
+var CreateTokenCommand = class extends import_smithy_client6.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
+ return [
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
+ (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
+ ];
+}).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() {
+ static {
+ __name(this, "CreateTokenCommand");
}
- return profile;
-}, "validateSsoProfile");
+};
-// src/fromSSO.ts
-var fromSSO = /* @__PURE__ */ __name((init = {}) => async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-sso - fromSSO");
- const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
- const { ssoClient } = init;
- const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
- if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
- const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
- const profile = profiles[profileName];
- if (!profile) {
- throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
- }
- if (!isSsoProfile(profile)) {
- throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
- logger: init.logger
- });
- }
- if (profile == null ? void 0 : profile.sso_session) {
- const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
- const session = ssoSessions[profile.sso_session];
- const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
- if (ssoRegion && ssoRegion !== session.sso_region) {
- throw new import_property_provider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
- tryNextLink: false,
- logger: init.logger
- });
- }
- if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
- throw new import_property_provider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
- tryNextLink: false,
- logger: init.logger
- });
- }
- profile.sso_region = session.sso_region;
- profile.sso_start_url = session.sso_start_url;
- }
- const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(
- profile,
- init.logger
- );
- return resolveSSOCredentials({
- ssoStartUrl: sso_start_url,
- ssoSession: sso_session,
- ssoAccountId: sso_account_id,
- ssoRegion: sso_region,
- ssoRoleName: sso_role_name,
- ssoClient,
- clientConfig: init.clientConfig,
- profile: profileName
- });
- } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
- throw new import_property_provider.CredentialsProviderError(
- 'Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',
- { tryNextLink: false, logger: init.logger }
- );
- } else {
- return resolveSSOCredentials({
- ssoStartUrl,
- ssoSession,
- ssoAccountId,
- ssoRegion,
- ssoRoleName,
- ssoClient,
- clientConfig: init.clientConfig,
- profile: profileName
- });
+// src/submodules/sso-oidc/SSOOIDC.ts
+var commands = {
+ CreateTokenCommand
+};
+var SSOOIDC = class extends SSOOIDCClient {
+ static {
+ __name(this, "SSOOIDC");
}
-}, "fromSSO");
+};
+(0, import_smithy_client7.createAggregatedClient)(commands, SSOOIDC);
// Annotate the CommonJS export names for ESM import in node:
-
0 && (0);
+/***/ }),
+
+/***/ 16901:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getRuntimeConfig = void 0;
+const tslib_1 = __nccwpck_require__(61860);
+const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(39955));
+const core_1 = __nccwpck_require__(8704);
+const util_user_agent_node_1 = __nccwpck_require__(51656);
+const config_resolver_1 = __nccwpck_require__(39316);
+const hash_node_1 = __nccwpck_require__(5092);
+const middleware_retry_1 = __nccwpck_require__(19618);
+const node_config_provider_1 = __nccwpck_require__(55704);
+const node_http_handler_1 = __nccwpck_require__(61279);
+const util_body_length_node_1 = __nccwpck_require__(13638);
+const util_retry_1 = __nccwpck_require__(15518);
+const runtimeConfig_shared_1 = __nccwpck_require__(1546);
+const smithy_client_1 = __nccwpck_require__(61411);
+const util_defaults_mode_node_1 = __nccwpck_require__(15435);
+const smithy_client_2 = __nccwpck_require__(61411);
+const getRuntimeConfig = (config) => {
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
+ (0, core_1.emitWarningIfUnsupportedVersion)(process.version);
+ const profileConfig = { profile: config?.profile };
+ return {
+ ...clientSharedValues,
+ ...config,
+ runtime: "node",
+ defaultsMode,
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
+ (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
+ region: config?.region ??
+ (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
+ requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
+ retryMode: config?.retryMode ??
+ (0, node_config_provider_1.loadConfig)({
+ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
+ default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
+ }, config),
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
+ };
+};
+exports.getRuntimeConfig = getRuntimeConfig;
+
/***/ }),
-/***/ 88079:
+/***/ 1546:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.fromTokenFile = void 0;
-const client_1 = __nccwpck_require__(5152);
-const property_provider_1 = __nccwpck_require__(71238);
-const fs_1 = __nccwpck_require__(79896);
-const fromWebToken_1 = __nccwpck_require__(34453);
-const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
-const ENV_ROLE_ARN = "AWS_ROLE_ARN";
-const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
-const fromTokenFile = (init = {}) => async () => {
- init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
- const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
- const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
- const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
- if (!webIdentityTokenFile || !roleArn) {
- throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", {
- logger: init.logger,
- });
- }
- const credentials = await (0, fromWebToken_1.fromWebToken)({
- ...init,
- webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }),
- roleArn,
- roleSessionName,
- })();
- if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
- (0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
- }
- return credentials;
+exports.getRuntimeConfig = void 0;
+const core_1 = __nccwpck_require__(8704);
+const core_2 = __nccwpck_require__(90402);
+const smithy_client_1 = __nccwpck_require__(61411);
+const url_parser_1 = __nccwpck_require__(14494);
+const util_base64_1 = __nccwpck_require__(68385);
+const util_utf8_1 = __nccwpck_require__(71577);
+const httpAuthSchemeProvider_1 = __nccwpck_require__(8396);
+const endpointResolver_1 = __nccwpck_require__(90546);
+const getRuntimeConfig = (config) => {
+ return {
+ apiVersion: "2019-06-10",
+ base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
+ base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
+ disableHostPrefix: config?.disableHostPrefix ?? false,
+ endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
+ extensions: config?.extensions ?? [],
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOOIDCHttpAuthSchemeProvider,
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
+ {
+ schemeId: "aws.auth#sigv4",
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
+ signer: new core_1.AwsSdkSigV4Signer(),
+ },
+ {
+ schemeId: "smithy.api#noAuth",
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
+ signer: new core_2.NoAuthSigner(),
+ },
+ ],
+ logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
+ serviceId: config?.serviceId ?? "SSO OIDC",
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
+ };
};
-exports.fromTokenFile = fromTokenFile;
+exports.getRuntimeConfig = getRuntimeConfig;
/***/ }),
-/***/ 34453:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+/***/ 63723:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.fromWebToken = void 0;
-const fromWebToken = (init) => async () => {
- init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
- const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
- let { roleAssumerWithWebIdentity } = init;
- if (!roleAssumerWithWebIdentity) {
- const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(71695)));
- roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
- ...init.clientConfig,
- credentialProviderLogger: init.logger,
- parentClientConfig: init.parentClientConfig,
- }, init.clientPlugins);
+exports.STSClient = exports.__Client = void 0;
+const middleware_host_header_1 = __nccwpck_require__(52590);
+const middleware_logger_1 = __nccwpck_require__(85242);
+const middleware_recursion_detection_1 = __nccwpck_require__(81568);
+const middleware_user_agent_1 = __nccwpck_require__(32959);
+const config_resolver_1 = __nccwpck_require__(39316);
+const core_1 = __nccwpck_require__(90402);
+const middleware_content_length_1 = __nccwpck_require__(47212);
+const middleware_endpoint_1 = __nccwpck_require__(40099);
+const middleware_retry_1 = __nccwpck_require__(19618);
+const smithy_client_1 = __nccwpck_require__(61411);
+Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } }));
+const httpAuthSchemeProvider_1 = __nccwpck_require__(27851);
+const EndpointParameters_1 = __nccwpck_require__(76811);
+const runtimeConfig_1 = __nccwpck_require__(36578);
+const runtimeExtensions_1 = __nccwpck_require__(37742);
+class STSClient extends smithy_client_1.Client {
+ config;
+ constructor(...[configuration]) {
+ const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
+ const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
+ const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1);
+ const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);
+ const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);
+ const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
+ const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5);
+ const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);
+ const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
+ super(_config_8);
+ this.config = _config_8;
+ this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
+ this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
+ this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
+ this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
+ this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
+ this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
+ this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider,
+ identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({
+ "aws.auth#sigv4": config.credentials,
+ }),
+ }));
+ this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));
}
- return roleAssumerWithWebIdentity({
- RoleArn: roleArn,
- RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
- WebIdentityToken: webIdentityToken,
- ProviderId: providerId,
- PolicyArns: policyArns,
- Policy: policy,
- DurationSeconds: durationSeconds,
- });
-};
-exports.fromWebToken = fromWebToken;
+ destroy() {
+ super.destroy();
+ }
+}
+exports.STSClient = STSClient;
/***/ }),
-/***/ 29956:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 34532:
+/***/ ((__unused_webpack_module, exports) => {
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;
+const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
+ let _credentials = runtimeConfig.credentials;
+ return {
+ setHttpAuthScheme(httpAuthScheme) {
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
+ if (index === -1) {
+ _httpAuthSchemes.push(httpAuthScheme);
+ }
+ else {
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
+ }
+ },
+ httpAuthSchemes() {
+ return _httpAuthSchemes;
+ },
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
+ },
+ httpAuthSchemeProvider() {
+ return _httpAuthSchemeProvider;
+ },
+ setCredentials(credentials) {
+ _credentials = credentials;
+ },
+ credentials() {
+ return _credentials;
+ },
+ };
};
-var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-module.exports = __toCommonJS(src_exports);
-__reExport(src_exports, __nccwpck_require__(88079), module.exports);
-__reExport(src_exports, __nccwpck_require__(34453), module.exports);
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
+exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;
+const resolveHttpAuthRuntimeConfig = (config) => {
+ return {
+ httpAuthSchemes: config.httpAuthSchemes(),
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
+ credentials: config.credentials(),
+ };
+};
+exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;
/***/ }),
-/***/ 52590:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 27851:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;
+const core_1 = __nccwpck_require__(8704);
+const util_middleware_1 = __nccwpck_require__(76324);
+const STSClient_1 = __nccwpck_require__(63723);
+const defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
+ return {
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
+ (() => {
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
+ })(),
+ };
};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
+exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;
+function createAwsAuthSigv4HttpAuthOption(authParameters) {
+ return {
+ schemeId: "aws.auth#sigv4",
+ signingProperties: {
+ name: "sts",
+ region: authParameters.region,
+ },
+ propertiesExtractor: (config, context) => ({
+ signingProperties: {
+ config,
+ context,
+ },
+ }),
+ };
+}
+function createSmithyApiNoAuthHttpAuthOption(authParameters) {
+ return {
+ schemeId: "smithy.api#noAuth",
+ };
+}
+const defaultSTSHttpAuthSchemeProvider = (authParameters) => {
+ const options = [];
+ switch (authParameters.operation) {
+ case "AssumeRoleWithWebIdentity": {
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
+ break;
+ }
+ default: {
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
+ }
+ }
+ return options;
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- getHostHeaderPlugin: () => getHostHeaderPlugin,
- hostHeaderMiddleware: () => hostHeaderMiddleware,
- hostHeaderMiddlewareOptions: () => hostHeaderMiddlewareOptions,
- resolveHostHeaderConfig: () => resolveHostHeaderConfig
+exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;
+const resolveStsAuthConfig = (input) => ({
+ ...input,
+ stsClientCtor: STSClient_1.STSClient,
});
-module.exports = __toCommonJS(src_exports);
-var import_protocol_http = __nccwpck_require__(72356);
-function resolveHostHeaderConfig(input) {
- return input;
-}
-__name(resolveHostHeaderConfig, "resolveHostHeaderConfig");
-var hostHeaderMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
- if (!import_protocol_http.HttpRequest.isInstance(args.request))
- return next(args);
- const { request } = args;
- const { handlerProtocol = "" } = options.requestHandler.metadata || {};
- if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
- delete request.headers["host"];
- request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
- } else if (!request.headers["host"]) {
- let host = request.hostname;
- if (request.port != null)
- host += `:${request.port}`;
- request.headers["host"] = host;
- }
- return next(args);
-}, "hostHeaderMiddleware");
-var hostHeaderMiddlewareOptions = {
- name: "hostHeaderMiddleware",
- step: "build",
- priority: "low",
- tags: ["HOST"],
- override: true
+exports.resolveStsAuthConfig = resolveStsAuthConfig;
+const resolveHttpAuthSchemeConfig = (config) => {
+ const config_0 = (0, exports.resolveStsAuthConfig)(config);
+ const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);
+ return {
+ ...config_1,
+ };
};
-var getHostHeaderPlugin = /* @__PURE__ */ __name((options) => ({
- applyToStack: (clientStack) => {
- clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
- }
-}), "getHostHeaderPlugin");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
+exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
/***/ }),
-/***/ 85242:
-/***/ ((module) => {
+/***/ 76811:
+/***/ ((__unused_webpack_module, exports) => {
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.commonParams = exports.resolveClientEndpointParameters = void 0;
+const resolveClientEndpointParameters = (options) => {
+ return {
+ ...options,
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
+ useGlobalEndpoint: options.useGlobalEndpoint ?? false,
+ defaultSigningName: "sts",
+ };
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- getLoggerPlugin: () => getLoggerPlugin,
- loggerMiddleware: () => loggerMiddleware,
- loggerMiddlewareOptions: () => loggerMiddlewareOptions
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/loggerMiddleware.ts
-var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => {
- var _a, _b;
- try {
- const response = await next(args);
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
- const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
- const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
- const { $metadata, ...outputWithoutMetadata } = response.output;
- (_a = logger == null ? void 0 : logger.info) == null ? void 0 : _a.call(logger, {
- clientName,
- commandName,
- input: inputFilterSensitiveLog(args.input),
- output: outputFilterSensitiveLog(outputWithoutMetadata),
- metadata: $metadata
- });
- return response;
- } catch (error) {
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
- const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
- (_b = logger == null ? void 0 : logger.error) == null ? void 0 : _b.call(logger, {
- clientName,
- commandName,
- input: inputFilterSensitiveLog(args.input),
- error,
- metadata: error.$metadata
- });
- throw error;
- }
-}, "loggerMiddleware");
-var loggerMiddlewareOptions = {
- name: "loggerMiddleware",
- tags: ["LOGGER"],
- step: "initialize",
- override: true
+exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
+exports.commonParams = {
+ UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
+ Endpoint: { type: "builtInParams", name: "endpoint" },
+ Region: { type: "builtInParams", name: "region" },
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
-var getLoggerPlugin = /* @__PURE__ */ __name((options) => ({
- applyToStack: (clientStack) => {
- clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
- }
-}), "getLoggerPlugin");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
/***/ }),
-/***/ 81568:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
+/***/ 59765:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- addRecursionDetectionMiddlewareOptions: () => addRecursionDetectionMiddlewareOptions,
- getRecursionDetectionPlugin: () => getRecursionDetectionPlugin,
- recursionDetectionMiddleware: () => recursionDetectionMiddleware
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.defaultEndpointResolver = void 0;
+const util_endpoints_1 = __nccwpck_require__(83068);
+const util_endpoints_2 = __nccwpck_require__(79674);
+const ruleset_1 = __nccwpck_require__(31670);
+const cache = new util_endpoints_2.EndpointCache({
+ size: 50,
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
});
-module.exports = __toCommonJS(src_exports);
-var import_protocol_http = __nccwpck_require__(72356);
-var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
-var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
-var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
-var recursionDetectionMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
- const { request } = args;
- if (!import_protocol_http.HttpRequest.isInstance(request) || options.runtime !== "node" || request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) {
- return next(args);
- }
- const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
- const traceId = process.env[ENV_TRACE_ID];
- const nonEmptyString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0, "nonEmptyString");
- if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
- request.headers[TRACE_ID_HEADER_NAME] = traceId;
- }
- return next({
- ...args,
- request
- });
-}, "recursionDetectionMiddleware");
-var addRecursionDetectionMiddlewareOptions = {
- step: "build",
- tags: ["RECURSION_DETECTION"],
- name: "recursionDetectionMiddleware",
- override: true,
- priority: "low"
+const defaultEndpointResolver = (endpointParams, context = {}) => {
+ return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
+ endpointParams: endpointParams,
+ logger: context.logger,
+ }));
};
-var getRecursionDetectionPlugin = /* @__PURE__ */ __name((options) => ({
- applyToStack: (clientStack) => {
- clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
- }
-}), "getRecursionDetectionPlugin");
-// Annotate the CommonJS export names for ESM import in node:
+exports.defaultEndpointResolver = defaultEndpointResolver;
+util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
+
+
+/***/ }),
+
+/***/ 31670:
+/***/ ((__unused_webpack_module, exports) => {
-0 && (0);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.ruleSet = void 0;
+const F = "required", G = "type", H = "fn", I = "argv", J = "ref";
+const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "String" }, n = { [F]: true, "default": false, [G]: "Boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y];
+const _data = { version: "1.0", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] };
+exports.ruleSet = _data;
/***/ }),
-/***/ 32959:
+/***/ 1136:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
@@ -14994,1666 +13619,1952 @@ var __copyProps = (to, from, except, desc) => {
}
return to;
};
+var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- DEFAULT_UA_APP_ID: () => DEFAULT_UA_APP_ID,
- getUserAgentMiddlewareOptions: () => getUserAgentMiddlewareOptions,
- getUserAgentPlugin: () => getUserAgentPlugin,
- resolveUserAgentConfig: () => resolveUserAgentConfig,
- userAgentMiddleware: () => userAgentMiddleware
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/configurations.ts
-var import_core = __nccwpck_require__(90402);
-var DEFAULT_UA_APP_ID = void 0;
-function isValidUserAgentAppId(appId) {
- if (appId === void 0) {
- return true;
- }
- return typeof appId === "string" && appId.length <= 50;
-}
-__name(isValidUserAgentAppId, "isValidUserAgentAppId");
-function resolveUserAgentConfig(input) {
- const normalizedAppIdProvider = (0, import_core.normalizeProvider)(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
- return {
- ...input,
- customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent,
- userAgentAppId: async () => {
- var _a, _b;
- const appId = await normalizedAppIdProvider();
- if (!isValidUserAgentAppId(appId)) {
- const logger = ((_b = (_a = input.logger) == null ? void 0 : _a.constructor) == null ? void 0 : _b.name) === "NoOpLogger" || !input.logger ? console : input.logger;
- if (typeof appId !== "string") {
- logger == null ? void 0 : logger.warn("userAgentAppId must be a string or undefined.");
- } else if (appId.length > 50) {
- logger == null ? void 0 : logger.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
- }
- }
- return appId;
- }
- };
-}
-__name(resolveUserAgentConfig, "resolveUserAgentConfig");
+// src/submodules/sts/index.ts
+var index_exports = {};
+__export(index_exports, {
+ AssumeRoleCommand: () => AssumeRoleCommand,
+ AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog,
+ AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand,
+ AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
+ AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
+ ClientInputEndpointParameters: () => import_EndpointParameters3.ClientInputEndpointParameters,
+ CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
+ ExpiredTokenException: () => ExpiredTokenException,
+ IDPCommunicationErrorException: () => IDPCommunicationErrorException,
+ IDPRejectedClaimException: () => IDPRejectedClaimException,
+ InvalidIdentityTokenException: () => InvalidIdentityTokenException,
+ MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
+ PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
+ RegionDisabledException: () => RegionDisabledException,
+ STS: () => STS,
+ STSServiceException: () => STSServiceException,
+ decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
+ getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
+ getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2
+});
+module.exports = __toCommonJS(index_exports);
+__reExport(index_exports, __nccwpck_require__(63723), module.exports);
-// src/user-agent-middleware.ts
-var import_util_endpoints = __nccwpck_require__(83068);
-var import_protocol_http = __nccwpck_require__(72356);
+// src/submodules/sts/STS.ts
+var import_smithy_client6 = __nccwpck_require__(61411);
-// src/check-features.ts
-var import_core2 = __nccwpck_require__(8704);
-var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
-async function checkFeatures(context, config, args) {
- var _a, _b, _c, _d, _e, _f, _g;
- const request = args.request;
- if (((_a = request == null ? void 0 : request.headers) == null ? void 0 : _a["smithy-protocol"]) === "rpc-v2-cbor") {
- (0, import_core2.setFeature)(context, "PROTOCOL_RPC_V2_CBOR", "M");
- }
- if (typeof config.retryStrategy === "function") {
- const retryStrategy = await config.retryStrategy();
- if (typeof retryStrategy.acquireInitialRetryToken === "function") {
- if ((_c = (_b = retryStrategy.constructor) == null ? void 0 : _b.name) == null ? void 0 : _c.includes("Adaptive")) {
- (0, import_core2.setFeature)(context, "RETRY_MODE_ADAPTIVE", "F");
- } else {
- (0, import_core2.setFeature)(context, "RETRY_MODE_STANDARD", "E");
- }
- } else {
- (0, import_core2.setFeature)(context, "RETRY_MODE_LEGACY", "D");
- }
- }
- if (typeof config.accountIdEndpointMode === "function") {
- const endpointV2 = context.endpointV2;
- if (String((_d = endpointV2 == null ? void 0 : endpointV2.url) == null ? void 0 : _d.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
- (0, import_core2.setFeature)(context, "ACCOUNT_ID_ENDPOINT", "O");
- }
- switch (await ((_e = config.accountIdEndpointMode) == null ? void 0 : _e.call(config))) {
- case "disabled":
- (0, import_core2.setFeature)(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
- break;
- case "preferred":
- (0, import_core2.setFeature)(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
- break;
- case "required":
- (0, import_core2.setFeature)(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
- break;
- }
- }
- const identity = (_g = (_f = context.__smithy_context) == null ? void 0 : _f.selectedHttpAuthScheme) == null ? void 0 : _g.identity;
- if (identity == null ? void 0 : identity.$source) {
- const credentials = identity;
- if (credentials.accountId) {
- (0, import_core2.setFeature)(context, "RESOLVED_ACCOUNT_ID", "T");
- }
- for (const [key, value] of Object.entries(credentials.$source ?? {})) {
- (0, import_core2.setFeature)(context, key, value);
- }
- }
-}
-__name(checkFeatures, "checkFeatures");
+// src/submodules/sts/commands/AssumeRoleCommand.ts
+var import_middleware_endpoint = __nccwpck_require__(40099);
+var import_middleware_serde = __nccwpck_require__(83255);
+var import_smithy_client4 = __nccwpck_require__(61411);
+var import_EndpointParameters = __nccwpck_require__(76811);
-// src/constants.ts
-var USER_AGENT = "user-agent";
-var X_AMZ_USER_AGENT = "x-amz-user-agent";
-var SPACE = " ";
-var UA_NAME_SEPARATOR = "/";
-var UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
-var UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
-var UA_ESCAPE_CHAR = "-";
+// src/submodules/sts/models/models_0.ts
+var import_smithy_client2 = __nccwpck_require__(61411);
-// src/encode-features.ts
-var BYTE_LIMIT = 1024;
-function encodeFeatures(features) {
- let buffer = "";
- for (const key in features) {
- const val = features[key];
- if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
- if (buffer.length) {
- buffer += "," + val;
- } else {
- buffer += val;
- }
- continue;
- }
- break;
+// src/submodules/sts/models/STSServiceException.ts
+var import_smithy_client = __nccwpck_require__(61411);
+var STSServiceException = class _STSServiceException extends import_smithy_client.ServiceException {
+ static {
+ __name(this, "STSServiceException");
}
- return buffer;
-}
-__name(encodeFeatures, "encodeFeatures");
+ /**
+ * @internal
+ */
+ constructor(options) {
+ super(options);
+ Object.setPrototypeOf(this, _STSServiceException.prototype);
+ }
+};
-// src/user-agent-middleware.ts
-var userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
- var _a, _b, _c, _d;
- const { request } = args;
- if (!import_protocol_http.HttpRequest.isInstance(request)) {
- return next(args);
+// src/submodules/sts/models/models_0.ts
+var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj,
+ ...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client2.SENSITIVE_STRING }
+}), "CredentialsFilterSensitiveLog");
+var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj,
+ ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
+}), "AssumeRoleResponseFilterSensitiveLog");
+var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
+ static {
+ __name(this, "ExpiredTokenException");
}
- const { headers } = request;
- const userAgent = ((_a = context == null ? void 0 : context.userAgent) == null ? void 0 : _a.map(escapeUserAgent)) || [];
- const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
- await checkFeatures(context, options, args);
- const awsContext = context;
- defaultUserAgent.push(
- `m/${encodeFeatures(
- Object.assign({}, (_b = context.__smithy_context) == null ? void 0 : _b.features, (_c = awsContext.__aws_sdk_context) == null ? void 0 : _c.features)
- )}`
- );
- const customUserAgent = ((_d = options == null ? void 0 : options.customUserAgent) == null ? void 0 : _d.map(escapeUserAgent)) || [];
- const appId = await options.userAgentAppId();
- if (appId) {
- defaultUserAgent.push(escapeUserAgent([`app/${appId}`]));
+ name = "ExpiredTokenException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "ExpiredTokenException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
}
- const prefix = (0, import_util_endpoints.getUserAgentPrefix)();
- const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE);
- const normalUAValue = [
- ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
- ...customUserAgent
- ].join(SPACE);
- if (options.runtime !== "browser") {
- if (normalUAValue) {
- headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
- }
- headers[USER_AGENT] = sdkUserAgentValue;
- } else {
- headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
+};
+var MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
+ static {
+ __name(this, "MalformedPolicyDocumentException");
}
- return next({
- ...args,
- request
- });
-}, "userAgentMiddleware");
-var escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => {
- var _a;
- const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
- const version = (_a = userAgentPair[1]) == null ? void 0 : _a.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
- const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
- const prefix = name.substring(0, prefixSeparatorIndex);
- let uaName = name.substring(prefixSeparatorIndex + 1);
- if (prefix === "api") {
- uaName = uaName.toLowerCase();
+ name = "MalformedPolicyDocumentException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "MalformedPolicyDocumentException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
}
- return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
- switch (index) {
- case 0:
- return item;
- case 1:
- return `${acc}/${item}`;
- default:
- return `${acc}#${item}`;
- }
- }, "");
-}, "escapeUserAgent");
-var getUserAgentMiddlewareOptions = {
- name: "getUserAgentMiddleware",
- step: "build",
- priority: "low",
- tags: ["SET_USER_AGENT", "USER_AGENT"],
- override: true
};
-var getUserAgentPlugin = /* @__PURE__ */ __name((config) => ({
- applyToStack: (clientStack) => {
- clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
+var PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
+ static {
+ __name(this, "PackedPolicyTooLargeException");
}
-}), "getUserAgentPlugin");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 36463:
-/***/ ((module) => {
-
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ name = "PackedPolicyTooLargeException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "PackedPolicyTooLargeException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
}
- return to;
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS,
- NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS,
- REGION_ENV_NAME: () => REGION_ENV_NAME,
- REGION_INI_NAME: () => REGION_INI_NAME,
- getAwsRegionExtensionConfiguration: () => getAwsRegionExtensionConfiguration,
- resolveAwsRegionExtensionConfiguration: () => resolveAwsRegionExtensionConfiguration,
- resolveRegionConfig: () => resolveRegionConfig
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/extensions/index.ts
-var getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
- let runtimeConfigRegion = /* @__PURE__ */ __name(async () => {
- if (runtimeConfig.region === void 0) {
- throw new Error("Region is missing from runtimeConfig");
- }
- const region = runtimeConfig.region;
- if (typeof region === "string") {
- return region;
- }
- return region();
- }, "runtimeConfigRegion");
- return {
- setRegion(region) {
- runtimeConfigRegion = region;
- },
- region() {
- return runtimeConfigRegion;
- }
- };
-}, "getAwsRegionExtensionConfiguration");
-var resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => {
- return {
- region: awsRegionExtensionConfiguration.region()
- };
-}, "resolveAwsRegionExtensionConfiguration");
-
-// src/regionConfig/config.ts
-var REGION_ENV_NAME = "AWS_REGION";
-var REGION_INI_NAME = "region";
-var NODE_REGION_CONFIG_OPTIONS = {
- environmentVariableSelector: (env) => env[REGION_ENV_NAME],
- configFileSelector: (profile) => profile[REGION_INI_NAME],
- default: () => {
- throw new Error("Region is missing");
+var RegionDisabledException = class _RegionDisabledException extends STSServiceException {
+ static {
+ __name(this, "RegionDisabledException");
}
-};
-var NODE_REGION_CONFIG_FILE_OPTIONS = {
- preferredFile: "credentials"
-};
-
-// src/regionConfig/isFipsRegion.ts
-var isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion");
-
-// src/regionConfig/getRealRegion.ts
-var getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion");
-
-// src/regionConfig/resolveRegionConfig.ts
-var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
- const { region, useFipsEndpoint } = input;
- if (!region) {
- throw new Error("Region is missing");
+ name = "RegionDisabledException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "RegionDisabledException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _RegionDisabledException.prototype);
}
- return {
- ...input,
- region: async () => {
- if (typeof region === "string") {
- return getRealRegion(region);
- }
- const providedRegion = await region();
- return getRealRegion(providedRegion);
- },
- useFipsEndpoint: async () => {
- const providedRegion = typeof region === "string" ? region : await region();
- if (isFipsRegion(providedRegion)) {
- return true;
- }
- return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
- }
- };
-}, "resolveRegionConfig");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 75433:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+var IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
+ static {
+ __name(this, "IDPRejectedClaimException");
+ }
+ name = "IDPRejectedClaimException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "IDPRejectedClaimException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
}
- return to;
};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
- mod
-));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- fromSso: () => fromSso,
- fromStatic: () => fromStatic,
- nodeProvider: () => nodeProvider
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/fromSso.ts
-
-
-
-// src/constants.ts
-var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
-var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
-
-// src/getSsoOidcClient.ts
-var ssoOidcClientsHash = {};
-var getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion) => {
- const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(29260)));
- if (ssoOidcClientsHash[ssoRegion]) {
- return ssoOidcClientsHash[ssoRegion];
- }
- const ssoOidcClient = new SSOOIDCClient({ region: ssoRegion });
- ssoOidcClientsHash[ssoRegion] = ssoOidcClient;
- return ssoOidcClient;
-}, "getSsoOidcClient");
-
-// src/getNewSsoOidcToken.ts
-var getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion) => {
- const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(29260)));
- const ssoOidcClient = await getSsoOidcClient(ssoRegion);
- return ssoOidcClient.send(
- new CreateTokenCommand({
- clientId: ssoToken.clientId,
- clientSecret: ssoToken.clientSecret,
- refreshToken: ssoToken.refreshToken,
- grantType: "refresh_token"
- })
- );
-}, "getNewSsoOidcToken");
-
-// src/validateTokenExpiry.ts
-var import_property_provider = __nccwpck_require__(71238);
-var validateTokenExpiry = /* @__PURE__ */ __name((token) => {
- if (token.expiration && token.expiration.getTime() < Date.now()) {
- throw new import_property_provider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
+var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
+ static {
+ __name(this, "InvalidIdentityTokenException");
}
-}, "validateTokenExpiry");
-
-// src/validateTokenKey.ts
-
-var validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
- if (typeof value === "undefined") {
- throw new import_property_provider.TokenProviderError(
- `Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`,
- false
- );
+ name = "InvalidIdentityTokenException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "InvalidIdentityTokenException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
}
-}, "validateTokenKey");
-
-// src/writeSSOTokenToFile.ts
-var import_shared_ini_file_loader = __nccwpck_require__(94964);
-var import_fs = __nccwpck_require__(79896);
-var { writeFile } = import_fs.promises;
-var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
- const tokenFilepath = (0, import_shared_ini_file_loader.getSSOTokenFilepath)(id);
- const tokenString = JSON.stringify(ssoToken, null, 2);
- return writeFile(tokenFilepath, tokenString);
-}, "writeSSOTokenToFile");
-
-// src/fromSso.ts
-var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
-var fromSso = /* @__PURE__ */ __name((init = {}) => async () => {
- var _a;
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
- const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
- const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
- const profile = profiles[profileName];
- if (!profile) {
- throw new import_property_provider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
- } else if (!profile["sso_session"]) {
- throw new import_property_provider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
+};
+var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj,
+ ...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client2.SENSITIVE_STRING }
+}), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog");
+var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
+ ...obj,
+ ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
+}), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog");
+var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
+ static {
+ __name(this, "IDPCommunicationErrorException");
}
- const ssoSessionName = profile["sso_session"];
- const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
- const ssoSession = ssoSessions[ssoSessionName];
- if (!ssoSession) {
- throw new import_property_provider.TokenProviderError(
- `Sso session '${ssoSessionName}' could not be found in shared credentials file.`,
- false
- );
+ name = "IDPCommunicationErrorException";
+ $fault = "client";
+ /**
+ * @internal
+ */
+ constructor(opts) {
+ super({
+ name: "IDPCommunicationErrorException",
+ $fault: "client",
+ ...opts
+ });
+ Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
}
- for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
- if (!ssoSession[ssoSessionRequiredKey]) {
- throw new import_property_provider.TokenProviderError(
- `Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`,
- false
- );
+};
+
+// src/submodules/sts/protocols/Aws_query.ts
+var import_core = __nccwpck_require__(8704);
+var import_protocol_http = __nccwpck_require__(72356);
+var import_smithy_client3 = __nccwpck_require__(61411);
+var se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context) => {
+ const headers = SHARED_HEADERS;
+ let body;
+ body = buildFormUrlencodedString({
+ ...se_AssumeRoleRequest(input, context),
+ [_A]: _AR,
+ [_V]: _
+ });
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
+}, "se_AssumeRoleCommand");
+var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
+ const headers = SHARED_HEADERS;
+ let body;
+ body = buildFormUrlencodedString({
+ ...se_AssumeRoleWithWebIdentityRequest(input, context),
+ [_A]: _ARWWI,
+ [_V]: _
+ });
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
+}, "se_AssumeRoleWithWebIdentityCommand");
+var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => {
+ if (output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const data = await (0, import_core.parseXmlBody)(output.body, context);
+ let contents = {};
+ contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
+ const response = {
+ $metadata: deserializeMetadata(output),
+ ...contents
+ };
+ return response;
+}, "de_AssumeRoleCommand");
+var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
+ if (output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const data = await (0, import_core.parseXmlBody)(output.body, context);
+ let contents = {};
+ contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
+ const response = {
+ $metadata: deserializeMetadata(output),
+ ...contents
+ };
+ return response;
+}, "de_AssumeRoleWithWebIdentityCommand");
+var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
+ const parsedOutput = {
+ ...output,
+ body: await (0, import_core.parseXmlErrorBody)(output.body, context)
+ };
+ const errorCode = loadQueryErrorCode(output, parsedOutput.body);
+ switch (errorCode) {
+ case "ExpiredTokenException":
+ case "com.amazonaws.sts#ExpiredTokenException":
+ throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
+ case "MalformedPolicyDocument":
+ case "com.amazonaws.sts#MalformedPolicyDocumentException":
+ throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
+ case "PackedPolicyTooLarge":
+ case "com.amazonaws.sts#PackedPolicyTooLargeException":
+ throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
+ case "RegionDisabledException":
+ case "com.amazonaws.sts#RegionDisabledException":
+ throw await de_RegionDisabledExceptionRes(parsedOutput, context);
+ case "IDPCommunicationError":
+ case "com.amazonaws.sts#IDPCommunicationErrorException":
+ throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
+ case "IDPRejectedClaim":
+ case "com.amazonaws.sts#IDPRejectedClaimException":
+ throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
+ case "InvalidIdentityToken":
+ case "com.amazonaws.sts#InvalidIdentityTokenException":
+ throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
+ default:
+ const parsedBody = parsedOutput.body;
+ return throwDefaultError({
+ output,
+ parsedBody: parsedBody.Error,
+ errorCode
+ });
+ }
+}, "de_CommandError");
+var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_ExpiredTokenException(body.Error, context);
+ const exception = new ExpiredTokenException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_ExpiredTokenExceptionRes");
+var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_IDPCommunicationErrorException(body.Error, context);
+ const exception = new IDPCommunicationErrorException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_IDPCommunicationErrorExceptionRes");
+var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_IDPRejectedClaimException(body.Error, context);
+ const exception = new IDPRejectedClaimException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_IDPRejectedClaimExceptionRes");
+var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_InvalidIdentityTokenException(body.Error, context);
+ const exception = new InvalidIdentityTokenException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_InvalidIdentityTokenExceptionRes");
+var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
+ const exception = new MalformedPolicyDocumentException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_MalformedPolicyDocumentExceptionRes");
+var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
+ const exception = new PackedPolicyTooLargeException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_PackedPolicyTooLargeExceptionRes");
+var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
+ const body = parsedOutput.body;
+ const deserialized = de_RegionDisabledException(body.Error, context);
+ const exception = new RegionDisabledException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...deserialized
+ });
+ return (0, import_smithy_client3.decorateServiceException)(exception, body);
+}, "de_RegionDisabledExceptionRes");
+var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_RA] != null) {
+ entries[_RA] = input[_RA];
+ }
+ if (input[_RSN] != null) {
+ entries[_RSN] = input[_RSN];
+ }
+ if (input[_PA] != null) {
+ const memberEntries = se_policyDescriptorListType(input[_PA], context);
+ if (input[_PA]?.length === 0) {
+ entries.PolicyArns = [];
}
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `PolicyArns.${key}`;
+ entries[loc] = value;
+ });
}
- const ssoStartUrl = ssoSession["sso_start_url"];
- const ssoRegion = ssoSession["sso_region"];
- let ssoToken;
- try {
- ssoToken = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoSessionName);
- } catch (e) {
- throw new import_property_provider.TokenProviderError(
- `The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`,
- false
- );
+ if (input[_P] != null) {
+ entries[_P] = input[_P];
}
- validateTokenKey("accessToken", ssoToken.accessToken);
- validateTokenKey("expiresAt", ssoToken.expiresAt);
- const { accessToken, expiresAt } = ssoToken;
- const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
- if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
- return existingToken;
+ if (input[_DS] != null) {
+ entries[_DS] = input[_DS];
}
- if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
- validateTokenExpiry(existingToken);
- return existingToken;
+ if (input[_T] != null) {
+ const memberEntries = se_tagListType(input[_T], context);
+ if (input[_T]?.length === 0) {
+ entries.Tags = [];
+ }
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `Tags.${key}`;
+ entries[loc] = value;
+ });
}
- validateTokenKey("clientId", ssoToken.clientId, true);
- validateTokenKey("clientSecret", ssoToken.clientSecret, true);
- validateTokenKey("refreshToken", ssoToken.refreshToken, true);
- try {
- lastRefreshAttemptTime.setTime(Date.now());
- const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion);
- validateTokenKey("accessToken", newSsoOidcToken.accessToken);
- validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
- const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
- try {
- await writeSSOTokenToFile(ssoSessionName, {
- ...ssoToken,
- accessToken: newSsoOidcToken.accessToken,
- expiresAt: newTokenExpiration.toISOString(),
- refreshToken: newSsoOidcToken.refreshToken
- });
- } catch (error) {
+ if (input[_TTK] != null) {
+ const memberEntries = se_tagKeyListType(input[_TTK], context);
+ if (input[_TTK]?.length === 0) {
+ entries.TransitiveTagKeys = [];
}
- return {
- token: newSsoOidcToken.accessToken,
- expiration: newTokenExpiration
- };
- } catch (error) {
- validateTokenExpiry(existingToken);
- return existingToken;
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `TransitiveTagKeys.${key}`;
+ entries[loc] = value;
+ });
}
-}, "fromSso");
-
-// src/fromStatic.ts
-
-var fromStatic = /* @__PURE__ */ __name(({ token, logger }) => async () => {
- logger == null ? void 0 : logger.debug("@aws-sdk/token-providers - fromStatic");
- if (!token || !token.token) {
- throw new import_property_provider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
+ if (input[_EI] != null) {
+ entries[_EI] = input[_EI];
}
- return token;
-}, "fromStatic");
-
-// src/nodeProvider.ts
-
-var nodeProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)(
- (0, import_property_provider.chain)(fromSso(init), async () => {
- throw new import_property_provider.TokenProviderError("Could not load token from any providers", false);
- }),
- (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5,
- (token) => token.expiration !== void 0
-), "nodeProvider");
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 83068:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ if (input[_SN] != null) {
+ entries[_SN] = input[_SN];
}
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- ConditionObject: () => import_util_endpoints.ConditionObject,
- DeprecatedObject: () => import_util_endpoints.DeprecatedObject,
- EndpointError: () => import_util_endpoints.EndpointError,
- EndpointObject: () => import_util_endpoints.EndpointObject,
- EndpointObjectHeaders: () => import_util_endpoints.EndpointObjectHeaders,
- EndpointObjectProperties: () => import_util_endpoints.EndpointObjectProperties,
- EndpointParams: () => import_util_endpoints.EndpointParams,
- EndpointResolverOptions: () => import_util_endpoints.EndpointResolverOptions,
- EndpointRuleObject: () => import_util_endpoints.EndpointRuleObject,
- ErrorRuleObject: () => import_util_endpoints.ErrorRuleObject,
- EvaluateOptions: () => import_util_endpoints.EvaluateOptions,
- Expression: () => import_util_endpoints.Expression,
- FunctionArgv: () => import_util_endpoints.FunctionArgv,
- FunctionObject: () => import_util_endpoints.FunctionObject,
- FunctionReturn: () => import_util_endpoints.FunctionReturn,
- ParameterObject: () => import_util_endpoints.ParameterObject,
- ReferenceObject: () => import_util_endpoints.ReferenceObject,
- ReferenceRecord: () => import_util_endpoints.ReferenceRecord,
- RuleSetObject: () => import_util_endpoints.RuleSetObject,
- RuleSetRules: () => import_util_endpoints.RuleSetRules,
- TreeRuleObject: () => import_util_endpoints.TreeRuleObject,
- awsEndpointFunctions: () => awsEndpointFunctions,
- getUserAgentPrefix: () => getUserAgentPrefix,
- isIpAddress: () => import_util_endpoints.isIpAddress,
- partition: () => partition,
- resolveEndpoint: () => import_util_endpoints.resolveEndpoint,
- setPartitionInfo: () => setPartitionInfo,
- useDefaultPartitionInfo: () => useDefaultPartitionInfo
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/aws.ts
-
-
-// src/lib/aws/isVirtualHostableS3Bucket.ts
-
-
-// src/lib/isIpAddress.ts
-var import_util_endpoints = __nccwpck_require__(79674);
-
-// src/lib/aws/isVirtualHostableS3Bucket.ts
-var isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
- if (allowSubDomains) {
- for (const label of value.split(".")) {
- if (!isVirtualHostableS3Bucket(label)) {
- return false;
- }
+ if (input[_TC] != null) {
+ entries[_TC] = input[_TC];
+ }
+ if (input[_SI] != null) {
+ entries[_SI] = input[_SI];
+ }
+ if (input[_PC] != null) {
+ const memberEntries = se_ProvidedContextsListType(input[_PC], context);
+ if (input[_PC]?.length === 0) {
+ entries.ProvidedContexts = [];
}
- return true;
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `ProvidedContexts.${key}`;
+ entries[loc] = value;
+ });
}
- if (!(0, import_util_endpoints.isValidHostLabel)(value)) {
- return false;
+ return entries;
+}, "se_AssumeRoleRequest");
+var se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_RA] != null) {
+ entries[_RA] = input[_RA];
}
- if (value.length < 3 || value.length > 63) {
- return false;
+ if (input[_RSN] != null) {
+ entries[_RSN] = input[_RSN];
}
- if (value !== value.toLowerCase()) {
- return false;
+ if (input[_WIT] != null) {
+ entries[_WIT] = input[_WIT];
}
- if ((0, import_util_endpoints.isIpAddress)(value)) {
- return false;
+ if (input[_PI] != null) {
+ entries[_PI] = input[_PI];
}
- return true;
-}, "isVirtualHostableS3Bucket");
-
-// src/lib/aws/parseArn.ts
-var ARN_DELIMITER = ":";
-var RESOURCE_DELIMITER = "/";
-var parseArn = /* @__PURE__ */ __name((value) => {
- const segments = value.split(ARN_DELIMITER);
- if (segments.length < 6)
- return null;
- const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
- if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
- return null;
- const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
- return {
- partition: partition2,
- service,
- region,
- accountId,
- resourceId
- };
-}, "parseArn");
-
-// src/lib/aws/partitions.json
-var partitions_default = {
- partitions: [{
- id: "aws",
- outputs: {
- dnsSuffix: "amazonaws.com",
- dualStackDnsSuffix: "api.aws",
- implicitGlobalRegion: "us-east-1",
- name: "aws",
- supportsDualStack: true,
- supportsFIPS: true
- },
- regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
- regions: {
- "af-south-1": {
- description: "Africa (Cape Town)"
- },
- "ap-east-1": {
- description: "Asia Pacific (Hong Kong)"
- },
- "ap-northeast-1": {
- description: "Asia Pacific (Tokyo)"
- },
- "ap-northeast-2": {
- description: "Asia Pacific (Seoul)"
- },
- "ap-northeast-3": {
- description: "Asia Pacific (Osaka)"
- },
- "ap-south-1": {
- description: "Asia Pacific (Mumbai)"
- },
- "ap-south-2": {
- description: "Asia Pacific (Hyderabad)"
- },
- "ap-southeast-1": {
- description: "Asia Pacific (Singapore)"
- },
- "ap-southeast-2": {
- description: "Asia Pacific (Sydney)"
- },
- "ap-southeast-3": {
- description: "Asia Pacific (Jakarta)"
- },
- "ap-southeast-4": {
- description: "Asia Pacific (Melbourne)"
- },
- "ap-southeast-5": {
- description: "Asia Pacific (Malaysia)"
- },
- "aws-global": {
- description: "AWS Standard global region"
- },
- "ca-central-1": {
- description: "Canada (Central)"
- },
- "ca-west-1": {
- description: "Canada West (Calgary)"
- },
- "eu-central-1": {
- description: "Europe (Frankfurt)"
- },
- "eu-central-2": {
- description: "Europe (Zurich)"
- },
- "eu-north-1": {
- description: "Europe (Stockholm)"
- },
- "eu-south-1": {
- description: "Europe (Milan)"
- },
- "eu-south-2": {
- description: "Europe (Spain)"
- },
- "eu-west-1": {
- description: "Europe (Ireland)"
- },
- "eu-west-2": {
- description: "Europe (London)"
- },
- "eu-west-3": {
- description: "Europe (Paris)"
- },
- "il-central-1": {
- description: "Israel (Tel Aviv)"
- },
- "me-central-1": {
- description: "Middle East (UAE)"
- },
- "me-south-1": {
- description: "Middle East (Bahrain)"
- },
- "sa-east-1": {
- description: "South America (Sao Paulo)"
- },
- "us-east-1": {
- description: "US East (N. Virginia)"
- },
- "us-east-2": {
- description: "US East (Ohio)"
- },
- "us-west-1": {
- description: "US West (N. California)"
- },
- "us-west-2": {
- description: "US West (Oregon)"
- }
+ if (input[_PA] != null) {
+ const memberEntries = se_policyDescriptorListType(input[_PA], context);
+ if (input[_PA]?.length === 0) {
+ entries.PolicyArns = [];
}
- }, {
- id: "aws-cn",
- outputs: {
- dnsSuffix: "amazonaws.com.cn",
- dualStackDnsSuffix: "api.amazonwebservices.com.cn",
- implicitGlobalRegion: "cn-northwest-1",
- name: "aws-cn",
- supportsDualStack: true,
- supportsFIPS: true
- },
- regionRegex: "^cn\\-\\w+\\-\\d+$",
- regions: {
- "aws-cn-global": {
- description: "AWS China global region"
- },
- "cn-north-1": {
- description: "China (Beijing)"
- },
- "cn-northwest-1": {
- description: "China (Ningxia)"
- }
- }
- }, {
- id: "aws-us-gov",
- outputs: {
- dnsSuffix: "amazonaws.com",
- dualStackDnsSuffix: "api.aws",
- implicitGlobalRegion: "us-gov-west-1",
- name: "aws-us-gov",
- supportsDualStack: true,
- supportsFIPS: true
- },
- regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
- regions: {
- "aws-us-gov-global": {
- description: "AWS GovCloud (US) global region"
- },
- "us-gov-east-1": {
- description: "AWS GovCloud (US-East)"
- },
- "us-gov-west-1": {
- description: "AWS GovCloud (US-West)"
- }
- }
- }, {
- id: "aws-iso",
- outputs: {
- dnsSuffix: "c2s.ic.gov",
- dualStackDnsSuffix: "c2s.ic.gov",
- implicitGlobalRegion: "us-iso-east-1",
- name: "aws-iso",
- supportsDualStack: false,
- supportsFIPS: true
- },
- regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
- regions: {
- "aws-iso-global": {
- description: "AWS ISO (US) global region"
- },
- "us-iso-east-1": {
- description: "US ISO East"
- },
- "us-iso-west-1": {
- description: "US ISO WEST"
- }
- }
- }, {
- id: "aws-iso-b",
- outputs: {
- dnsSuffix: "sc2s.sgov.gov",
- dualStackDnsSuffix: "sc2s.sgov.gov",
- implicitGlobalRegion: "us-isob-east-1",
- name: "aws-iso-b",
- supportsDualStack: false,
- supportsFIPS: true
- },
- regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
- regions: {
- "aws-iso-b-global": {
- description: "AWS ISOB (US) global region"
- },
- "us-isob-east-1": {
- description: "US ISOB East (Ohio)"
- }
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ const loc = `PolicyArns.${key}`;
+ entries[loc] = value;
+ });
+ }
+ if (input[_P] != null) {
+ entries[_P] = input[_P];
+ }
+ if (input[_DS] != null) {
+ entries[_DS] = input[_DS];
+ }
+ return entries;
+}, "se_AssumeRoleWithWebIdentityRequest");
+var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ for (const entry of input) {
+ if (entry === null) {
+ continue;
}
- }, {
- id: "aws-iso-e",
- outputs: {
- dnsSuffix: "cloud.adc-e.uk",
- dualStackDnsSuffix: "cloud.adc-e.uk",
- implicitGlobalRegion: "eu-isoe-west-1",
- name: "aws-iso-e",
- supportsDualStack: false,
- supportsFIPS: true
- },
- regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
- regions: {
- "eu-isoe-west-1": {
- description: "EU ISOE West"
- }
+ const memberEntries = se_PolicyDescriptorType(entry, context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ entries[`member.${counter}.${key}`] = value;
+ });
+ counter++;
+ }
+ return entries;
+}, "se_policyDescriptorListType");
+var se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_a] != null) {
+ entries[_a] = input[_a];
+ }
+ return entries;
+}, "se_PolicyDescriptorType");
+var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_PAr] != null) {
+ entries[_PAr] = input[_PAr];
+ }
+ if (input[_CA] != null) {
+ entries[_CA] = input[_CA];
+ }
+ return entries;
+}, "se_ProvidedContext");
+var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ for (const entry of input) {
+ if (entry === null) {
+ continue;
}
- }, {
- id: "aws-iso-f",
- outputs: {
- dnsSuffix: "csp.hci.ic.gov",
- dualStackDnsSuffix: "csp.hci.ic.gov",
- implicitGlobalRegion: "us-isof-south-1",
- name: "aws-iso-f",
- supportsDualStack: false,
- supportsFIPS: true
- },
- regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
- regions: {}
- }],
- version: "1.1"
-};
-
-// src/lib/aws/partition.ts
-var selectedPartitionsInfo = partitions_default;
-var selectedUserAgentPrefix = "";
-var partition = /* @__PURE__ */ __name((value) => {
- const { partitions } = selectedPartitionsInfo;
- for (const partition2 of partitions) {
- const { regions, outputs } = partition2;
- for (const [region, regionData] of Object.entries(regions)) {
- if (region === value) {
- return {
- ...outputs,
- ...regionData
- };
- }
+ const memberEntries = se_ProvidedContext(entry, context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ entries[`member.${counter}.${key}`] = value;
+ });
+ counter++;
+ }
+ return entries;
+}, "se_ProvidedContextsListType");
+var se_Tag = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ if (input[_K] != null) {
+ entries[_K] = input[_K];
+ }
+ if (input[_Va] != null) {
+ entries[_Va] = input[_Va];
+ }
+ return entries;
+}, "se_Tag");
+var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ for (const entry of input) {
+ if (entry === null) {
+ continue;
}
+ entries[`member.${counter}`] = entry;
+ counter++;
}
- for (const partition2 of partitions) {
- const { regionRegex, outputs } = partition2;
- if (new RegExp(regionRegex).test(value)) {
- return {
- ...outputs
- };
+ return entries;
+}, "se_tagKeyListType");
+var se_tagListType = /* @__PURE__ */ __name((input, context) => {
+ const entries = {};
+ let counter = 1;
+ for (const entry of input) {
+ if (entry === null) {
+ continue;
}
+ const memberEntries = se_Tag(entry, context);
+ Object.entries(memberEntries).forEach(([key, value]) => {
+ entries[`member.${counter}.${key}`] = value;
+ });
+ counter++;
}
- const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
- if (!DEFAULT_PARTITION) {
- throw new Error(
- "Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."
- );
+ return entries;
+}, "se_tagListType");
+var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_ARI] != null) {
+ contents[_ARI] = (0, import_smithy_client3.expectString)(output[_ARI]);
}
- return {
- ...DEFAULT_PARTITION.outputs
+ if (output[_Ar] != null) {
+ contents[_Ar] = (0, import_smithy_client3.expectString)(output[_Ar]);
+ }
+ return contents;
+}, "de_AssumedRoleUser");
+var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_C] != null) {
+ contents[_C] = de_Credentials(output[_C], context);
+ }
+ if (output[_ARU] != null) {
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
+ }
+ if (output[_PPS] != null) {
+ contents[_PPS] = (0, import_smithy_client3.strictParseInt32)(output[_PPS]);
+ }
+ if (output[_SI] != null) {
+ contents[_SI] = (0, import_smithy_client3.expectString)(output[_SI]);
+ }
+ return contents;
+}, "de_AssumeRoleResponse");
+var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_C] != null) {
+ contents[_C] = de_Credentials(output[_C], context);
+ }
+ if (output[_SFWIT] != null) {
+ contents[_SFWIT] = (0, import_smithy_client3.expectString)(output[_SFWIT]);
+ }
+ if (output[_ARU] != null) {
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
+ }
+ if (output[_PPS] != null) {
+ contents[_PPS] = (0, import_smithy_client3.strictParseInt32)(output[_PPS]);
+ }
+ if (output[_Pr] != null) {
+ contents[_Pr] = (0, import_smithy_client3.expectString)(output[_Pr]);
+ }
+ if (output[_Au] != null) {
+ contents[_Au] = (0, import_smithy_client3.expectString)(output[_Au]);
+ }
+ if (output[_SI] != null) {
+ contents[_SI] = (0, import_smithy_client3.expectString)(output[_SI]);
+ }
+ return contents;
+}, "de_AssumeRoleWithWebIdentityResponse");
+var de_Credentials = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_AKI] != null) {
+ contents[_AKI] = (0, import_smithy_client3.expectString)(output[_AKI]);
+ }
+ if (output[_SAK] != null) {
+ contents[_SAK] = (0, import_smithy_client3.expectString)(output[_SAK]);
+ }
+ if (output[_ST] != null) {
+ contents[_ST] = (0, import_smithy_client3.expectString)(output[_ST]);
+ }
+ if (output[_E] != null) {
+ contents[_E] = (0, import_smithy_client3.expectNonNull)((0, import_smithy_client3.parseRfc3339DateTimeWithOffset)(output[_E]));
+ }
+ return contents;
+}, "de_Credentials");
+var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_ExpiredTokenException");
+var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_IDPCommunicationErrorException");
+var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_IDPRejectedClaimException");
+var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_InvalidIdentityTokenException");
+var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_MalformedPolicyDocumentException");
+var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_PackedPolicyTooLargeException");
+var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => {
+ const contents = {};
+ if (output[_m] != null) {
+ contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
+ }
+ return contents;
+}, "de_RegionDisabledException");
+var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
+ httpStatusCode: output.statusCode,
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
+ extendedRequestId: output.headers["x-amz-id-2"],
+ cfId: output.headers["x-amz-cf-id"]
+}), "deserializeMetadata");
+var throwDefaultError = (0, import_smithy_client3.withBaseException)(STSServiceException);
+var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
+ const contents = {
+ protocol,
+ hostname,
+ port,
+ method: "POST",
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
+ headers
};
-}, "partition");
-var setPartitionInfo = /* @__PURE__ */ __name((partitionsInfo, userAgentPrefix = "") => {
- selectedPartitionsInfo = partitionsInfo;
- selectedUserAgentPrefix = userAgentPrefix;
-}, "setPartitionInfo");
-var useDefaultPartitionInfo = /* @__PURE__ */ __name(() => {
- setPartitionInfo(partitions_default, "");
-}, "useDefaultPartitionInfo");
-var getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix");
-
-// src/aws.ts
-var awsEndpointFunctions = {
- isVirtualHostableS3Bucket,
- parseArn,
- partition
+ if (resolvedHostname !== void 0) {
+ contents.hostname = resolvedHostname;
+ }
+ if (body !== void 0) {
+ contents.body = body;
+ }
+ return new import_protocol_http.HttpRequest(contents);
+}, "buildHttpRpcRequest");
+var SHARED_HEADERS = {
+ "content-type": "application/x-www-form-urlencoded"
};
-import_util_endpoints.customEndpointFunctions.aws = awsEndpointFunctions;
-
-// src/resolveEndpoint.ts
-
-
-// src/types/EndpointError.ts
-
-
-// src/types/EndpointRuleObject.ts
-
-
-// src/types/ErrorRuleObject.ts
-
-
-// src/types/RuleSetObject.ts
-
-
-// src/types/TreeRuleObject.ts
-
-
-// src/types/shared.ts
-
-// Annotate the CommonJS export names for ESM import in node:
-
-0 && (0);
-
-
-
-/***/ }),
-
-/***/ 51656:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
+var _ = "2011-06-15";
+var _A = "Action";
+var _AKI = "AccessKeyId";
+var _AR = "AssumeRole";
+var _ARI = "AssumedRoleId";
+var _ARU = "AssumedRoleUser";
+var _ARWWI = "AssumeRoleWithWebIdentity";
+var _Ar = "Arn";
+var _Au = "Audience";
+var _C = "Credentials";
+var _CA = "ContextAssertion";
+var _DS = "DurationSeconds";
+var _E = "Expiration";
+var _EI = "ExternalId";
+var _K = "Key";
+var _P = "Policy";
+var _PA = "PolicyArns";
+var _PAr = "ProviderArn";
+var _PC = "ProvidedContexts";
+var _PI = "ProviderId";
+var _PPS = "PackedPolicySize";
+var _Pr = "Provider";
+var _RA = "RoleArn";
+var _RSN = "RoleSessionName";
+var _SAK = "SecretAccessKey";
+var _SFWIT = "SubjectFromWebIdentityToken";
+var _SI = "SourceIdentity";
+var _SN = "SerialNumber";
+var _ST = "SessionToken";
+var _T = "Tags";
+var _TC = "TokenCode";
+var _TTK = "TransitiveTagKeys";
+var _V = "Version";
+var _Va = "Value";
+var _WIT = "WebIdentityToken";
+var _a = "arn";
+var _m = "message";
+var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client3.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client3.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString");
+var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
+ if (data.Error?.Code !== void 0) {
+ return data.Error.Code;
+ }
+ if (output.statusCode == 404) {
+ return "NotFound";
+ }
+}, "loadQueryErrorCode");
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+// src/submodules/sts/commands/AssumeRoleCommand.ts
+var AssumeRoleCommand = class extends import_smithy_client4.Command.classBuilder().ep(import_EndpointParameters.commonParams).m(function(Command, cs, config, o) {
+ return [
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
+ ];
+}).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() {
+ static {
+ __name(this, "AssumeRoleCommand");
}
- return to;
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-// src/index.ts
-var src_exports = {};
-__export(src_exports, {
- NODE_APP_ID_CONFIG_OPTIONS: () => NODE_APP_ID_CONFIG_OPTIONS,
- UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME,
- UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME,
- createDefaultUserAgentProvider: () => createDefaultUserAgentProvider,
- crtAvailability: () => crtAvailability,
- defaultUserAgent: () => defaultUserAgent
-});
-module.exports = __toCommonJS(src_exports);
-
-// src/defaultUserAgent.ts
-var import_os = __nccwpck_require__(70857);
-var import_process = __nccwpck_require__(932);
-
-// src/crt-availability.ts
-var crtAvailability = {
- isCrtAvailable: false
+// src/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.ts
+var import_middleware_endpoint2 = __nccwpck_require__(40099);
+var import_middleware_serde2 = __nccwpck_require__(83255);
+var import_smithy_client5 = __nccwpck_require__(61411);
+var import_EndpointParameters2 = __nccwpck_require__(76811);
+var AssumeRoleWithWebIdentityCommand = class extends import_smithy_client5.Command.classBuilder().ep(import_EndpointParameters2.commonParams).m(function(Command, cs, config, o) {
+ return [
+ (0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize),
+ (0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
+ ];
+}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() {
+ static {
+ __name(this, "AssumeRoleWithWebIdentityCommand");
+ }
};
-// src/is-crt-available.ts
-var isCrtAvailable = /* @__PURE__ */ __name(() => {
- if (crtAvailability.isCrtAvailable) {
- return ["md/crt-avail"];
+// src/submodules/sts/STS.ts
+var import_STSClient = __nccwpck_require__(63723);
+var commands = {
+ AssumeRoleCommand,
+ AssumeRoleWithWebIdentityCommand
+};
+var STS = class extends import_STSClient.STSClient {
+ static {
+ __name(this, "STS");
}
- return null;
-}, "isCrtAvailable");
+};
+(0, import_smithy_client6.createAggregatedClient)(commands, STS);
-// src/defaultUserAgent.ts
-var createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
- return async (config) => {
- var _a;
- const sections = [
- // sdk-metadata
- ["aws-sdk-js", clientVersion],
- // ua-metadata
- ["ua", "2.1"],
- // os-metadata
- [`os/${(0, import_os.platform)()}`, (0, import_os.release)()],
- // language-metadata
- // ECMAScript edition doesn't matter in JS, so no version needed.
- ["lang/js"],
- ["md/nodejs", `${import_process.versions.node}`]
- ];
- const crtAvailable = isCrtAvailable();
- if (crtAvailable) {
- sections.push(crtAvailable);
- }
- if (serviceId) {
- sections.push([`api/${serviceId}`, clientVersion]);
+// src/submodules/sts/index.ts
+var import_EndpointParameters3 = __nccwpck_require__(76811);
+
+// src/submodules/sts/defaultStsRoleAssumers.ts
+var import_client = __nccwpck_require__(5152);
+var ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
+var getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => {
+ if (typeof assumedRoleUser?.Arn === "string") {
+ const arnComponents = assumedRoleUser.Arn.split(":");
+ if (arnComponents.length > 4 && arnComponents[4] !== "") {
+ return arnComponents[4];
}
- if (import_process.env.AWS_EXECUTION_ENV) {
- sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]);
+ }
+ return void 0;
+}, "getAccountIdFromAssumedRoleUser");
+var resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => {
+ const region = typeof _region === "function" ? await _region() : _region;
+ const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
+ credentialProviderLogger?.debug?.(
+ "@aws-sdk/client-sts::resolveRegion",
+ "accepting first of:",
+ `${region} (provider)`,
+ `${parentRegion} (parent client)`,
+ `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`
+ );
+ return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
+}, "resolveRegion");
+var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
+ let stsClient;
+ let closureSourceCreds;
+ return async (sourceCreds, params) => {
+ closureSourceCreds = sourceCreds;
+ if (!stsClient) {
+ const {
+ logger = stsOptions?.parentClientConfig?.logger,
+ region,
+ requestHandler = stsOptions?.parentClientConfig?.requestHandler,
+ credentialProviderLogger
+ } = stsOptions;
+ const resolvedRegion = await resolveRegion(
+ region,
+ stsOptions?.parentClientConfig?.region,
+ credentialProviderLogger
+ );
+ const isCompatibleRequestHandler = !isH2(requestHandler);
+ stsClient = new STSClient3({
+ profile: stsOptions?.parentClientConfig?.profile,
+ // A hack to make sts client uses the credential in current closure.
+ credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
+ region: resolvedRegion,
+ requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
+ logger
+ });
}
- const appId = await ((_a = config == null ? void 0 : config.userAgentAppId) == null ? void 0 : _a.call(config));
- const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
- return resolvedUserAgent;
+ const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
+ if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
+ throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
+ }
+ const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
+ const credentials = {
+ accessKeyId: Credentials2.AccessKeyId,
+ secretAccessKey: Credentials2.SecretAccessKey,
+ sessionToken: Credentials2.SessionToken,
+ expiration: Credentials2.Expiration,
+ // TODO(credentialScope): access normally when shape is updated.
+ ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
+ ...accountId && { accountId }
+ };
+ (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
+ return credentials;
};
-}, "createDefaultUserAgentProvider");
-var defaultUserAgent = createDefaultUserAgentProvider;
+}, "getDefaultRoleAssumer");
+var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
+ let stsClient;
+ return async (params) => {
+ if (!stsClient) {
+ const {
+ logger = stsOptions?.parentClientConfig?.logger,
+ region,
+ requestHandler = stsOptions?.parentClientConfig?.requestHandler,
+ credentialProviderLogger
+ } = stsOptions;
+ const resolvedRegion = await resolveRegion(
+ region,
+ stsOptions?.parentClientConfig?.region,
+ credentialProviderLogger
+ );
+ const isCompatibleRequestHandler = !isH2(requestHandler);
+ stsClient = new STSClient3({
+ profile: stsOptions?.parentClientConfig?.profile,
+ region: resolvedRegion,
+ requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
+ logger
+ });
+ }
+ const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
+ if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
+ throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
+ }
+ const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
+ const credentials = {
+ accessKeyId: Credentials2.AccessKeyId,
+ secretAccessKey: Credentials2.SecretAccessKey,
+ sessionToken: Credentials2.SessionToken,
+ expiration: Credentials2.Expiration,
+ // TODO(credentialScope): access normally when shape is updated.
+ ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
+ ...accountId && { accountId }
+ };
+ if (accountId) {
+ (0, import_client.setCredentialFeature)(credentials, "RESOLVED_ACCOUNT_ID", "T");
+ }
+ (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
+ return credentials;
+ };
+}, "getDefaultRoleAssumerWithWebIdentity");
+var isH2 = /* @__PURE__ */ __name((requestHandler) => {
+ return requestHandler?.metadata?.handlerProtocol === "h2";
+}, "isH2");
-// src/nodeAppIdConfigOptions.ts
-var import_middleware_user_agent = __nccwpck_require__(32959);
-var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
-var UA_APP_ID_INI_NAME = "sdk-ua-app-id";
-var NODE_APP_ID_CONFIG_OPTIONS = {
- environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
- configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME],
- default: import_middleware_user_agent.DEFAULT_UA_APP_ID
-};
+// src/submodules/sts/defaultRoleAssumers.ts
+var import_STSClient2 = __nccwpck_require__(63723);
+var getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => {
+ if (!customizations) return baseCtor;
+ else
+ return class CustomizableSTSClient extends baseCtor {
+ static {
+ __name(this, "CustomizableSTSClient");
+ }
+ constructor(config) {
+ super(config);
+ for (const customization of customizations) {
+ this.middlewareStack.use(customization);
+ }
+ }
+ };
+}, "getCustomizableStsClientCtor");
+var getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumer");
+var getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity");
+var decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({
+ roleAssumer: getDefaultRoleAssumer2(input),
+ roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
+ ...input
+}), "decorateDefaultCredentialProvider");
// Annotate the CommonJS export names for ESM import in node:
-
0 && (0);
-
/***/ }),
-/***/ 39693:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-/*
-
-The MIT License (MIT)
-
-Original Library
- - Copyright (c) Marak Squires
+/***/ 36578:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-Additional functionality
- - Copyright (c) Sindre Sorhus (sindresorhus.com)
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getRuntimeConfig = void 0;
+const tslib_1 = __nccwpck_require__(61860);
+const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(39955));
+const core_1 = __nccwpck_require__(8704);
+const util_user_agent_node_1 = __nccwpck_require__(51656);
+const config_resolver_1 = __nccwpck_require__(39316);
+const core_2 = __nccwpck_require__(90402);
+const hash_node_1 = __nccwpck_require__(5092);
+const middleware_retry_1 = __nccwpck_require__(19618);
+const node_config_provider_1 = __nccwpck_require__(55704);
+const node_http_handler_1 = __nccwpck_require__(61279);
+const util_body_length_node_1 = __nccwpck_require__(13638);
+const util_retry_1 = __nccwpck_require__(15518);
+const runtimeConfig_shared_1 = __nccwpck_require__(24443);
+const smithy_client_1 = __nccwpck_require__(61411);
+const util_defaults_mode_node_1 = __nccwpck_require__(15435);
+const smithy_client_2 = __nccwpck_require__(61411);
+const getRuntimeConfig = (config) => {
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
+ (0, core_1.emitWarningIfUnsupportedVersion)(process.version);
+ const profileConfig = { profile: config?.profile };
+ return {
+ ...clientSharedValues,
+ ...config,
+ runtime: "node",
+ defaultsMode,
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
+ (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
+ {
+ schemeId: "aws.auth#sigv4",
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
+ (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
+ signer: new core_1.AwsSdkSigV4Signer(),
+ },
+ {
+ schemeId: "smithy.api#noAuth",
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
+ signer: new core_2.NoAuthSigner(),
+ },
+ ],
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
+ region: config?.region ??
+ (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
+ requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
+ retryMode: config?.retryMode ??
+ (0, node_config_provider_1.loadConfig)({
+ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
+ default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
+ }, config),
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
+ userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
+ };
+};
+exports.getRuntimeConfig = getRuntimeConfig;
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+/***/ }),
-*/
+/***/ 24443:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-var colors = {};
-module['exports'] = colors;
-colors.themes = {};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getRuntimeConfig = void 0;
+const core_1 = __nccwpck_require__(8704);
+const core_2 = __nccwpck_require__(90402);
+const smithy_client_1 = __nccwpck_require__(61411);
+const url_parser_1 = __nccwpck_require__(14494);
+const util_base64_1 = __nccwpck_require__(68385);
+const util_utf8_1 = __nccwpck_require__(71577);
+const httpAuthSchemeProvider_1 = __nccwpck_require__(27851);
+const endpointResolver_1 = __nccwpck_require__(59765);
+const getRuntimeConfig = (config) => {
+ return {
+ apiVersion: "2011-06-15",
+ base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
+ base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
+ disableHostPrefix: config?.disableHostPrefix ?? false,
+ endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
+ extensions: config?.extensions ?? [],
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
+ {
+ schemeId: "aws.auth#sigv4",
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
+ signer: new core_1.AwsSdkSigV4Signer(),
+ },
+ {
+ schemeId: "smithy.api#noAuth",
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
+ signer: new core_2.NoAuthSigner(),
+ },
+ ],
+ logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
+ serviceId: config?.serviceId ?? "STS",
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
+ };
+};
+exports.getRuntimeConfig = getRuntimeConfig;
-var util = __nccwpck_require__(39023);
-var ansiStyles = colors.styles = __nccwpck_require__(72251);
-var defineProps = Object.defineProperties;
-var newLineRegex = new RegExp(/[\r\n]+/g);
-colors.supportsColor = (__nccwpck_require__(98740).supportsColor);
+/***/ }),
-if (typeof colors.enabled === 'undefined') {
- colors.enabled = colors.supportsColor() !== false;
-}
+/***/ 37742:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-colors.enable = function() {
- colors.enabled = true;
-};
-colors.disable = function() {
- colors.enabled = false;
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.resolveRuntimeExtensions = void 0;
+const region_config_resolver_1 = __nccwpck_require__(36463);
+const protocol_http_1 = __nccwpck_require__(72356);
+const smithy_client_1 = __nccwpck_require__(61411);
+const httpAuthExtensionConfiguration_1 = __nccwpck_require__(34532);
+const asPartial = (t) => t;
+const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
+ const extensionConfiguration = {
+ ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
+ ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
+ ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
+ ...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)),
+ };
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
+ return {
+ ...runtimeConfig,
+ ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
+ ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
+ ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
+ ...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration),
+ };
};
+exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
-colors.stripColors = colors.strip = function(str) {
- return ('' + str).replace(/\x1B\[\d+m/g, '');
-};
-// eslint-disable-next-line no-unused-vars
-var stylize = colors.stylize = function stylize(str, style) {
- if (!colors.enabled) {
- return str+'';
- }
+/***/ }),
- var styleMap = ansiStyles[style];
+/***/ 36463:
+/***/ ((module) => {
- // Stylize should work for non-ANSI styles, too
- if (!styleMap && style in colors) {
- // Style maps like trap operate as functions on strings;
- // they don't have properties like open or close.
- return colors[style](str);
- }
- return styleMap.open + str + styleMap.close;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
};
-
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-var escapeStringRegexp = function(str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
- return str.replace(matchOperatorsRe, '\\$&');
+ return to;
};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-function build(_styles) {
- var builder = function builder() {
- return applyStyle.apply(builder, arguments);
- };
- builder._styles = _styles;
- // __proto__ is used because we must return a function, but there is
- // no way to create a function with a different prototype.
- builder.__proto__ = proto;
- return builder;
-}
-
-var styles = (function() {
- var ret = {};
- ansiStyles.grey = ansiStyles.gray;
- Object.keys(ansiStyles).forEach(function(key) {
- ansiStyles[key].closeRe =
- new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
- ret[key] = {
- get: function() {
- return build(this._styles.concat(key));
- },
- };
- });
- return ret;
-})();
-
-var proto = defineProps(function colors() {}, styles);
-
-function applyStyle() {
- var args = Array.prototype.slice.call(arguments);
+// src/index.ts
+var src_exports = {};
+__export(src_exports, {
+ NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS,
+ NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS,
+ REGION_ENV_NAME: () => REGION_ENV_NAME,
+ REGION_INI_NAME: () => REGION_INI_NAME,
+ getAwsRegionExtensionConfiguration: () => getAwsRegionExtensionConfiguration,
+ resolveAwsRegionExtensionConfiguration: () => resolveAwsRegionExtensionConfiguration,
+ resolveRegionConfig: () => resolveRegionConfig
+});
+module.exports = __toCommonJS(src_exports);
- var str = args.map(function(arg) {
- // Use weak equality check so we can colorize null/undefined in safe mode
- if (arg != null && arg.constructor === String) {
- return arg;
- } else {
- return util.inspect(arg);
+// src/extensions/index.ts
+var getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
+ let runtimeConfigRegion = /* @__PURE__ */ __name(async () => {
+ if (runtimeConfig.region === void 0) {
+ throw new Error("Region is missing from runtimeConfig");
}
- }).join(' ');
+ const region = runtimeConfig.region;
+ if (typeof region === "string") {
+ return region;
+ }
+ return region();
+ }, "runtimeConfigRegion");
+ return {
+ setRegion(region) {
+ runtimeConfigRegion = region;
+ },
+ region() {
+ return runtimeConfigRegion;
+ }
+ };
+}, "getAwsRegionExtensionConfiguration");
+var resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => {
+ return {
+ region: awsRegionExtensionConfiguration.region()
+ };
+}, "resolveAwsRegionExtensionConfiguration");
- if (!colors.enabled || !str) {
- return str;
+// src/regionConfig/config.ts
+var REGION_ENV_NAME = "AWS_REGION";
+var REGION_INI_NAME = "region";
+var NODE_REGION_CONFIG_OPTIONS = {
+ environmentVariableSelector: (env) => env[REGION_ENV_NAME],
+ configFileSelector: (profile) => profile[REGION_INI_NAME],
+ default: () => {
+ throw new Error("Region is missing");
}
+};
+var NODE_REGION_CONFIG_FILE_OPTIONS = {
+ preferredFile: "credentials"
+};
- var newLinesPresent = str.indexOf('\n') != -1;
+// src/regionConfig/isFipsRegion.ts
+var isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion");
- var nestedStyles = this._styles;
+// src/regionConfig/getRealRegion.ts
+var getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion");
- var i = nestedStyles.length;
- while (i--) {
- var code = ansiStyles[nestedStyles[i]];
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
- if (newLinesPresent) {
- str = str.replace(newLineRegex, function(match) {
- return code.close + match + code.open;
- });
- }
+// src/regionConfig/resolveRegionConfig.ts
+var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
+ const { region, useFipsEndpoint } = input;
+ if (!region) {
+ throw new Error("Region is missing");
}
+ return {
+ ...input,
+ region: async () => {
+ if (typeof region === "string") {
+ return getRealRegion(region);
+ }
+ const providedRegion = await region();
+ return getRealRegion(providedRegion);
+ },
+ useFipsEndpoint: async () => {
+ const providedRegion = typeof region === "string" ? region : await region();
+ if (isFipsRegion(providedRegion)) {
+ return true;
+ }
+ return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
+ }
+ };
+}, "resolveRegionConfig");
+// Annotate the CommonJS export names for ESM import in node:
- return str;
-}
+0 && (0);
-colors.setTheme = function(theme) {
- if (typeof theme === 'string') {
- console.log('colors.setTheme now only accepts an object, not a string. ' +
- 'If you are trying to set a theme from a file, it is now your (the ' +
- 'caller\'s) responsibility to require the file. The old syntax ' +
- 'looked like colors.setTheme(__dirname + ' +
- '\'/../themes/generic-logging.js\'); The new syntax looks like '+
- 'colors.setTheme(require(__dirname + ' +
- '\'/../themes/generic-logging.js\'));');
- return;
- }
- for (var style in theme) {
- (function(style) {
- colors[style] = function(str) {
- if (typeof theme[style] === 'object') {
- var out = str;
- for (var i in theme[style]) {
- out = colors[theme[style][i]](out);
- }
- return out;
- }
- return colors[theme[style]](str);
- };
- })(style);
- }
-};
-function init() {
- var ret = {};
- Object.keys(styles).forEach(function(name) {
- ret[name] = {
- get: function() {
- return build([name]);
- },
- };
- });
- return ret;
-}
-var sequencer = function sequencer(map, str) {
- var exploded = str.split('');
- exploded = exploded.map(map);
- return exploded.join('');
-};
+/***/ }),
-// custom formatter methods
-colors.trap = __nccwpck_require__(32154);
-colors.zalgo = __nccwpck_require__(89312);
+/***/ 75433:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-// maps
-colors.maps = {};
-colors.maps.america = __nccwpck_require__(88881)(colors);
-colors.maps.zebra = __nccwpck_require__(45337)(colors);
-colors.maps.rainbow = __nccwpck_require__(18543)(colors);
-colors.maps.random = __nccwpck_require__(51298)(colors);
-for (var map in colors.maps) {
- (function(map) {
- colors[map] = function(str) {
- return sequencer(colors.maps[map], str);
- };
- })(map);
-}
-
-defineProps(colors, init());
-
-
-/***/ }),
-
-/***/ 32154:
-/***/ ((module) => {
-
-module['exports'] = function runTheTrap(text, options) {
- var result = '';
- text = text || 'Run the trap, drop the bass';
- text = text.split('');
- var trap = {
- a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
- b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
- c: ['\u00a9', '\u023b', '\u03fe'],
- d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
- e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
- '\u0a6c'],
- f: ['\u04fa'],
- g: ['\u0262'],
- h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
- i: ['\u0f0f'],
- j: ['\u0134'],
- k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
- l: ['\u0139'],
- m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
- n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
- o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
- '\u06dd', '\u0e4f'],
- p: ['\u01f7', '\u048e'],
- q: ['\u09cd'],
- r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
- s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
- t: ['\u0141', '\u0166', '\u0373'],
- u: ['\u01b1', '\u054d'],
- v: ['\u05d8'],
- w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
- x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
- y: ['\u00a5', '\u04b0', '\u04cb'],
- z: ['\u01b5', '\u0240'],
- };
- text.forEach(function(c) {
- c = c.toLowerCase();
- var chars = trap[c] || [' '];
- var rand = Math.floor(Math.random() * chars.length);
- if (typeof trap[c] !== 'undefined') {
- result += trap[c][rand];
- } else {
- result += c;
- }
- });
- return result;
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ fromSso: () => fromSso,
+ fromStatic: () => fromStatic,
+ nodeProvider: () => nodeProvider
+});
+module.exports = __toCommonJS(index_exports);
-/***/ }),
-
-/***/ 89312:
-/***/ ((module) => {
+// src/fromSso.ts
-// please no
-module['exports'] = function zalgo(text, options) {
- text = text || ' he is here ';
- var soul = {
- 'up': [
- '̍', '̎', '̄', '̅',
- '̿', '̑', '̆', '̐',
- '͒', '͗', '͑', '̇',
- '̈', '̊', '͂', '̓',
- '̈', '͊', '͋', '͌',
- '̃', '̂', '̌', '͐',
- '̀', '́', '̋', '̏',
- '̒', '̓', '̔', '̽',
- '̉', 'ͣ', 'ͤ', 'ͥ',
- 'ͦ', 'ͧ', 'ͨ', 'ͩ',
- 'ͪ', 'ͫ', 'ͬ', 'ͭ',
- 'ͮ', 'ͯ', '̾', '͛',
- '͆', '̚',
- ],
- 'down': [
- '̖', '̗', '̘', '̙',
- '̜', '̝', '̞', '̟',
- '̠', '̤', '̥', '̦',
- '̩', '̪', '̫', '̬',
- '̭', '̮', '̯', '̰',
- '̱', '̲', '̳', '̹',
- '̺', '̻', '̼', 'ͅ',
- '͇', '͈', '͉', '͍',
- '͎', '͓', '͔', '͕',
- '͖', '͙', '͚', '̣',
- ],
- 'mid': [
- '̕', '̛', '̀', '́',
- '͘', '̡', '̢', '̧',
- '̨', '̴', '̵', '̶',
- '͜', '͝', '͞',
- '͟', '͠', '͢', '̸',
- '̷', '͡', ' ҉',
- ],
- };
- var all = [].concat(soul.up, soul.down, soul.mid);
- function randomNumber(range) {
- var r = Math.floor(Math.random() * range);
- return r;
- }
- function isChar(character) {
- var bool = false;
- all.filter(function(i) {
- bool = (i === character);
- });
- return bool;
- }
+// src/constants.ts
+var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
+var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
+// src/getSsoOidcClient.ts
+var getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion, init = {}) => {
+ const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(89443)));
+ const ssoOidcClient = new SSOOIDCClient(
+ Object.assign({}, init.clientConfig ?? {}, {
+ region: ssoRegion ?? init.clientConfig?.region,
+ logger: init.clientConfig?.logger ?? init.parentClientConfig?.logger
+ })
+ );
+ return ssoOidcClient;
+}, "getSsoOidcClient");
- function heComes(text, options) {
- var result = '';
- var counts;
- var l;
- options = options || {};
- options['up'] =
- typeof options['up'] !== 'undefined' ? options['up'] : true;
- options['mid'] =
- typeof options['mid'] !== 'undefined' ? options['mid'] : true;
- options['down'] =
- typeof options['down'] !== 'undefined' ? options['down'] : true;
- options['size'] =
- typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
- text = text.split('');
- for (l in text) {
- if (isChar(l)) {
- continue;
- }
- result = result + text[l];
- counts = {'up': 0, 'down': 0, 'mid': 0};
- switch (options.size) {
- case 'mini':
- counts.up = randomNumber(8);
- counts.mid = randomNumber(2);
- counts.down = randomNumber(8);
- break;
- case 'maxi':
- counts.up = randomNumber(16) + 3;
- counts.mid = randomNumber(4) + 1;
- counts.down = randomNumber(64) + 3;
- break;
- default:
- counts.up = randomNumber(8) + 1;
- counts.mid = randomNumber(6) / 2;
- counts.down = randomNumber(8) + 1;
- break;
- }
+// src/getNewSsoOidcToken.ts
+var getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion, init = {}) => {
+ const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(89443)));
+ const ssoOidcClient = await getSsoOidcClient(ssoRegion, init);
+ return ssoOidcClient.send(
+ new CreateTokenCommand({
+ clientId: ssoToken.clientId,
+ clientSecret: ssoToken.clientSecret,
+ refreshToken: ssoToken.refreshToken,
+ grantType: "refresh_token"
+ })
+ );
+}, "getNewSsoOidcToken");
- var arr = ['up', 'mid', 'down'];
- for (var d in arr) {
- var index = arr[d];
- for (var i = 0; i <= counts[index]; i++) {
- if (options[index]) {
- result = result + soul[index][randomNumber(soul[index].length)];
- }
- }
- }
- }
- return result;
+// src/validateTokenExpiry.ts
+var import_property_provider = __nccwpck_require__(71238);
+var validateTokenExpiry = /* @__PURE__ */ __name((token) => {
+ if (token.expiration && token.expiration.getTime() < Date.now()) {
+ throw new import_property_provider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
}
- // don't summon him
- return heComes(text, options);
-};
-
+}, "validateTokenExpiry");
+// src/validateTokenKey.ts
-/***/ }),
+var validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
+ if (typeof value === "undefined") {
+ throw new import_property_provider.TokenProviderError(
+ `Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`,
+ false
+ );
+ }
+}, "validateTokenKey");
-/***/ 88881:
-/***/ ((module) => {
+// src/writeSSOTokenToFile.ts
+var import_shared_ini_file_loader = __nccwpck_require__(94964);
+var import_fs = __nccwpck_require__(79896);
+var { writeFile } = import_fs.promises;
+var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
+ const tokenFilepath = (0, import_shared_ini_file_loader.getSSOTokenFilepath)(id);
+ const tokenString = JSON.stringify(ssoToken, null, 2);
+ return writeFile(tokenFilepath, tokenString);
+}, "writeSSOTokenToFile");
-module['exports'] = function(colors) {
- return function(letter, i, exploded) {
- if (letter === ' ') return letter;
- switch (i%3) {
- case 0: return colors.red(letter);
- case 1: return colors.white(letter);
- case 2: return colors.blue(letter);
+// src/fromSso.ts
+var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
+var fromSso = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => {
+ const init = {
+ ..._init,
+ parentClientConfig: {
+ ...callerClientConfig,
+ ..._init.parentClientConfig
}
};
-};
-
-
-/***/ }),
-
-/***/ 18543:
-/***/ ((module) => {
-
-module['exports'] = function(colors) {
- // RoY G BiV
- var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
- return function(letter, i, exploded) {
- if (letter === ' ') {
- return letter;
- } else {
- return colors[rainbowColors[i++ % rainbowColors.length]](letter);
+ init.logger?.debug("@aws-sdk/token-providers - fromSso");
+ const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
+ const profileName = (0, import_shared_ini_file_loader.getProfileName)({
+ profile: init.profile ?? callerClientConfig?.profile
+ });
+ const profile = profiles[profileName];
+ if (!profile) {
+ throw new import_property_provider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
+ } else if (!profile["sso_session"]) {
+ throw new import_property_provider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
+ }
+ const ssoSessionName = profile["sso_session"];
+ const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
+ const ssoSession = ssoSessions[ssoSessionName];
+ if (!ssoSession) {
+ throw new import_property_provider.TokenProviderError(
+ `Sso session '${ssoSessionName}' could not be found in shared credentials file.`,
+ false
+ );
+ }
+ for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
+ if (!ssoSession[ssoSessionRequiredKey]) {
+ throw new import_property_provider.TokenProviderError(
+ `Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`,
+ false
+ );
}
- };
-};
-
-
-
-/***/ }),
+ }
+ const ssoStartUrl = ssoSession["sso_start_url"];
+ const ssoRegion = ssoSession["sso_region"];
+ let ssoToken;
+ try {
+ ssoToken = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoSessionName);
+ } catch (e) {
+ throw new import_property_provider.TokenProviderError(
+ `The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`,
+ false
+ );
+ }
+ validateTokenKey("accessToken", ssoToken.accessToken);
+ validateTokenKey("expiresAt", ssoToken.expiresAt);
+ const { accessToken, expiresAt } = ssoToken;
+ const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
+ if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
+ return existingToken;
+ }
+ if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
+ validateTokenExpiry(existingToken);
+ return existingToken;
+ }
+ validateTokenKey("clientId", ssoToken.clientId, true);
+ validateTokenKey("clientSecret", ssoToken.clientSecret, true);
+ validateTokenKey("refreshToken", ssoToken.refreshToken, true);
+ try {
+ lastRefreshAttemptTime.setTime(Date.now());
+ const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init);
+ validateTokenKey("accessToken", newSsoOidcToken.accessToken);
+ validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
+ const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
+ try {
+ await writeSSOTokenToFile(ssoSessionName, {
+ ...ssoToken,
+ accessToken: newSsoOidcToken.accessToken,
+ expiresAt: newTokenExpiration.toISOString(),
+ refreshToken: newSsoOidcToken.refreshToken
+ });
+ } catch (error) {
+ }
+ return {
+ token: newSsoOidcToken.accessToken,
+ expiration: newTokenExpiration
+ };
+ } catch (error) {
+ validateTokenExpiry(existingToken);
+ return existingToken;
+ }
+}, "fromSso");
-/***/ 51298:
-/***/ ((module) => {
+// src/fromStatic.ts
-module['exports'] = function(colors) {
- var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
- 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
- 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
- return function(letter, i, exploded) {
- return letter === ' ' ? letter :
- colors[
- available[Math.round(Math.random() * (available.length - 2))]
- ](letter);
- };
-};
+var fromStatic = /* @__PURE__ */ __name(({ token, logger }) => async () => {
+ logger?.debug("@aws-sdk/token-providers - fromStatic");
+ if (!token || !token.token) {
+ throw new import_property_provider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
+ }
+ return token;
+}, "fromStatic");
+// src/nodeProvider.ts
-/***/ }),
+var nodeProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)(
+ (0, import_property_provider.chain)(fromSso(init), async () => {
+ throw new import_property_provider.TokenProviderError("Could not load token from any providers", false);
+ }),
+ (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5,
+ (token) => token.expiration !== void 0
+), "nodeProvider");
+// Annotate the CommonJS export names for ESM import in node:
-/***/ 45337:
-/***/ ((module) => {
+0 && (0);
-module['exports'] = function(colors) {
- return function(letter, i, exploded) {
- return i % 2 === 0 ? letter : colors.inverse(letter);
- };
-};
/***/ }),
-/***/ 72251:
-/***/ ((module) => {
-
-/*
-The MIT License (MIT)
+/***/ 83068:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-Copyright (c) Sindre Sorhus (sindresorhus.com)
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+// src/index.ts
+var src_exports = {};
+__export(src_exports, {
+ ConditionObject: () => import_util_endpoints.ConditionObject,
+ DeprecatedObject: () => import_util_endpoints.DeprecatedObject,
+ EndpointError: () => import_util_endpoints.EndpointError,
+ EndpointObject: () => import_util_endpoints.EndpointObject,
+ EndpointObjectHeaders: () => import_util_endpoints.EndpointObjectHeaders,
+ EndpointObjectProperties: () => import_util_endpoints.EndpointObjectProperties,
+ EndpointParams: () => import_util_endpoints.EndpointParams,
+ EndpointResolverOptions: () => import_util_endpoints.EndpointResolverOptions,
+ EndpointRuleObject: () => import_util_endpoints.EndpointRuleObject,
+ ErrorRuleObject: () => import_util_endpoints.ErrorRuleObject,
+ EvaluateOptions: () => import_util_endpoints.EvaluateOptions,
+ Expression: () => import_util_endpoints.Expression,
+ FunctionArgv: () => import_util_endpoints.FunctionArgv,
+ FunctionObject: () => import_util_endpoints.FunctionObject,
+ FunctionReturn: () => import_util_endpoints.FunctionReturn,
+ ParameterObject: () => import_util_endpoints.ParameterObject,
+ ReferenceObject: () => import_util_endpoints.ReferenceObject,
+ ReferenceRecord: () => import_util_endpoints.ReferenceRecord,
+ RuleSetObject: () => import_util_endpoints.RuleSetObject,
+ RuleSetRules: () => import_util_endpoints.RuleSetRules,
+ TreeRuleObject: () => import_util_endpoints.TreeRuleObject,
+ awsEndpointFunctions: () => awsEndpointFunctions,
+ getUserAgentPrefix: () => getUserAgentPrefix,
+ isIpAddress: () => import_util_endpoints.isIpAddress,
+ partition: () => partition,
+ resolveEndpoint: () => import_util_endpoints.resolveEndpoint,
+ setPartitionInfo: () => setPartitionInfo,
+ useDefaultPartitionInfo: () => useDefaultPartitionInfo
+});
+module.exports = __toCommonJS(src_exports);
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+// src/aws.ts
-*/
-var styles = {};
-module['exports'] = styles;
+// src/lib/aws/isVirtualHostableS3Bucket.ts
-var codes = {
- reset: [0, 0],
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29],
+// src/lib/isIpAddress.ts
+var import_util_endpoints = __nccwpck_require__(79674);
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39],
- grey: [90, 39],
+// src/lib/aws/isVirtualHostableS3Bucket.ts
+var isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
+ if (allowSubDomains) {
+ for (const label of value.split(".")) {
+ if (!isVirtualHostableS3Bucket(label)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ if (!(0, import_util_endpoints.isValidHostLabel)(value)) {
+ return false;
+ }
+ if (value.length < 3 || value.length > 63) {
+ return false;
+ }
+ if (value !== value.toLowerCase()) {
+ return false;
+ }
+ if ((0, import_util_endpoints.isIpAddress)(value)) {
+ return false;
+ }
+ return true;
+}, "isVirtualHostableS3Bucket");
- brightRed: [91, 39],
- brightGreen: [92, 39],
- brightYellow: [93, 39],
- brightBlue: [94, 39],
- brightMagenta: [95, 39],
- brightCyan: [96, 39],
- brightWhite: [97, 39],
-
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
- bgGray: [100, 49],
- bgGrey: [100, 49],
+// src/lib/aws/parseArn.ts
+var ARN_DELIMITER = ":";
+var RESOURCE_DELIMITER = "/";
+var parseArn = /* @__PURE__ */ __name((value) => {
+ const segments = value.split(ARN_DELIMITER);
+ if (segments.length < 6)
+ return null;
+ const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
+ if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
+ return null;
+ const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
+ return {
+ partition: partition2,
+ service,
+ region,
+ accountId,
+ resourceId
+ };
+}, "parseArn");
- bgBrightRed: [101, 49],
- bgBrightGreen: [102, 49],
- bgBrightYellow: [103, 49],
- bgBrightBlue: [104, 49],
- bgBrightMagenta: [105, 49],
- bgBrightCyan: [106, 49],
- bgBrightWhite: [107, 49],
+// src/lib/aws/partitions.json
+var partitions_default = {
+ partitions: [{
+ id: "aws",
+ outputs: {
+ dnsSuffix: "amazonaws.com",
+ dualStackDnsSuffix: "api.aws",
+ implicitGlobalRegion: "us-east-1",
+ name: "aws",
+ supportsDualStack: true,
+ supportsFIPS: true
+ },
+ regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
+ regions: {
+ "af-south-1": {
+ description: "Africa (Cape Town)"
+ },
+ "ap-east-1": {
+ description: "Asia Pacific (Hong Kong)"
+ },
+ "ap-northeast-1": {
+ description: "Asia Pacific (Tokyo)"
+ },
+ "ap-northeast-2": {
+ description: "Asia Pacific (Seoul)"
+ },
+ "ap-northeast-3": {
+ description: "Asia Pacific (Osaka)"
+ },
+ "ap-south-1": {
+ description: "Asia Pacific (Mumbai)"
+ },
+ "ap-south-2": {
+ description: "Asia Pacific (Hyderabad)"
+ },
+ "ap-southeast-1": {
+ description: "Asia Pacific (Singapore)"
+ },
+ "ap-southeast-2": {
+ description: "Asia Pacific (Sydney)"
+ },
+ "ap-southeast-3": {
+ description: "Asia Pacific (Jakarta)"
+ },
+ "ap-southeast-4": {
+ description: "Asia Pacific (Melbourne)"
+ },
+ "ap-southeast-5": {
+ description: "Asia Pacific (Malaysia)"
+ },
+ "ap-southeast-7": {
+ description: "Asia Pacific (Thailand)"
+ },
+ "aws-global": {
+ description: "AWS Standard global region"
+ },
+ "ca-central-1": {
+ description: "Canada (Central)"
+ },
+ "ca-west-1": {
+ description: "Canada West (Calgary)"
+ },
+ "eu-central-1": {
+ description: "Europe (Frankfurt)"
+ },
+ "eu-central-2": {
+ description: "Europe (Zurich)"
+ },
+ "eu-north-1": {
+ description: "Europe (Stockholm)"
+ },
+ "eu-south-1": {
+ description: "Europe (Milan)"
+ },
+ "eu-south-2": {
+ description: "Europe (Spain)"
+ },
+ "eu-west-1": {
+ description: "Europe (Ireland)"
+ },
+ "eu-west-2": {
+ description: "Europe (London)"
+ },
+ "eu-west-3": {
+ description: "Europe (Paris)"
+ },
+ "il-central-1": {
+ description: "Israel (Tel Aviv)"
+ },
+ "me-central-1": {
+ description: "Middle East (UAE)"
+ },
+ "me-south-1": {
+ description: "Middle East (Bahrain)"
+ },
+ "mx-central-1": {
+ description: "Mexico (Central)"
+ },
+ "sa-east-1": {
+ description: "South America (Sao Paulo)"
+ },
+ "us-east-1": {
+ description: "US East (N. Virginia)"
+ },
+ "us-east-2": {
+ description: "US East (Ohio)"
+ },
+ "us-west-1": {
+ description: "US West (N. California)"
+ },
+ "us-west-2": {
+ description: "US West (Oregon)"
+ }
+ }
+ }, {
+ id: "aws-cn",
+ outputs: {
+ dnsSuffix: "amazonaws.com.cn",
+ dualStackDnsSuffix: "api.amazonwebservices.com.cn",
+ implicitGlobalRegion: "cn-northwest-1",
+ name: "aws-cn",
+ supportsDualStack: true,
+ supportsFIPS: true
+ },
+ regionRegex: "^cn\\-\\w+\\-\\d+$",
+ regions: {
+ "aws-cn-global": {
+ description: "AWS China global region"
+ },
+ "cn-north-1": {
+ description: "China (Beijing)"
+ },
+ "cn-northwest-1": {
+ description: "China (Ningxia)"
+ }
+ }
+ }, {
+ id: "aws-us-gov",
+ outputs: {
+ dnsSuffix: "amazonaws.com",
+ dualStackDnsSuffix: "api.aws",
+ implicitGlobalRegion: "us-gov-west-1",
+ name: "aws-us-gov",
+ supportsDualStack: true,
+ supportsFIPS: true
+ },
+ regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
+ regions: {
+ "aws-us-gov-global": {
+ description: "AWS GovCloud (US) global region"
+ },
+ "us-gov-east-1": {
+ description: "AWS GovCloud (US-East)"
+ },
+ "us-gov-west-1": {
+ description: "AWS GovCloud (US-West)"
+ }
+ }
+ }, {
+ id: "aws-iso",
+ outputs: {
+ dnsSuffix: "c2s.ic.gov",
+ dualStackDnsSuffix: "c2s.ic.gov",
+ implicitGlobalRegion: "us-iso-east-1",
+ name: "aws-iso",
+ supportsDualStack: false,
+ supportsFIPS: true
+ },
+ regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
+ regions: {
+ "aws-iso-global": {
+ description: "AWS ISO (US) global region"
+ },
+ "us-iso-east-1": {
+ description: "US ISO East"
+ },
+ "us-iso-west-1": {
+ description: "US ISO WEST"
+ }
+ }
+ }, {
+ id: "aws-iso-b",
+ outputs: {
+ dnsSuffix: "sc2s.sgov.gov",
+ dualStackDnsSuffix: "sc2s.sgov.gov",
+ implicitGlobalRegion: "us-isob-east-1",
+ name: "aws-iso-b",
+ supportsDualStack: false,
+ supportsFIPS: true
+ },
+ regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
+ regions: {
+ "aws-iso-b-global": {
+ description: "AWS ISOB (US) global region"
+ },
+ "us-isob-east-1": {
+ description: "US ISOB East (Ohio)"
+ }
+ }
+ }, {
+ id: "aws-iso-e",
+ outputs: {
+ dnsSuffix: "cloud.adc-e.uk",
+ dualStackDnsSuffix: "cloud.adc-e.uk",
+ implicitGlobalRegion: "eu-isoe-west-1",
+ name: "aws-iso-e",
+ supportsDualStack: false,
+ supportsFIPS: true
+ },
+ regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
+ regions: {
+ "eu-isoe-west-1": {
+ description: "EU ISOE West"
+ }
+ }
+ }, {
+ id: "aws-iso-f",
+ outputs: {
+ dnsSuffix: "csp.hci.ic.gov",
+ dualStackDnsSuffix: "csp.hci.ic.gov",
+ implicitGlobalRegion: "us-isof-south-1",
+ name: "aws-iso-f",
+ supportsDualStack: false,
+ supportsFIPS: true
+ },
+ regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
+ regions: {
+ "aws-iso-f-global": {
+ description: "AWS ISOF global region"
+ },
+ "us-isof-east-1": {
+ description: "US ISOF EAST"
+ },
+ "us-isof-south-1": {
+ description: "US ISOF SOUTH"
+ }
+ }
+ }],
+ version: "1.1"
+};
- // legacy styles for colors pre v1.0.0
- blackBG: [40, 49],
- redBG: [41, 49],
- greenBG: [42, 49],
- yellowBG: [43, 49],
- blueBG: [44, 49],
- magentaBG: [45, 49],
- cyanBG: [46, 49],
- whiteBG: [47, 49],
+// src/lib/aws/partition.ts
+var selectedPartitionsInfo = partitions_default;
+var selectedUserAgentPrefix = "";
+var partition = /* @__PURE__ */ __name((value) => {
+ const { partitions } = selectedPartitionsInfo;
+ for (const partition2 of partitions) {
+ const { regions, outputs } = partition2;
+ for (const [region, regionData] of Object.entries(regions)) {
+ if (region === value) {
+ return {
+ ...outputs,
+ ...regionData
+ };
+ }
+ }
+ }
+ for (const partition2 of partitions) {
+ const { regionRegex, outputs } = partition2;
+ if (new RegExp(regionRegex).test(value)) {
+ return {
+ ...outputs
+ };
+ }
+ }
+ const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
+ if (!DEFAULT_PARTITION) {
+ throw new Error(
+ "Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."
+ );
+ }
+ return {
+ ...DEFAULT_PARTITION.outputs
+ };
+}, "partition");
+var setPartitionInfo = /* @__PURE__ */ __name((partitionsInfo, userAgentPrefix = "") => {
+ selectedPartitionsInfo = partitionsInfo;
+ selectedUserAgentPrefix = userAgentPrefix;
+}, "setPartitionInfo");
+var useDefaultPartitionInfo = /* @__PURE__ */ __name(() => {
+ setPartitionInfo(partitions_default, "");
+}, "useDefaultPartitionInfo");
+var getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix");
+// src/aws.ts
+var awsEndpointFunctions = {
+ isVirtualHostableS3Bucket,
+ parseArn,
+ partition
};
+import_util_endpoints.customEndpointFunctions.aws = awsEndpointFunctions;
-Object.keys(codes).forEach(function(key) {
- var val = codes[key];
- var style = styles[key] = [];
- style.open = '\u001b[' + val[0] + 'm';
- style.close = '\u001b[' + val[1] + 'm';
-});
+// src/resolveEndpoint.ts
-/***/ }),
+// src/types/EndpointError.ts
-/***/ 34982:
-/***/ ((module) => {
-/*
-MIT License
+// src/types/EndpointRuleObject.ts
-Copyright (c) Sindre Sorhus (sindresorhus.com)
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
+// src/types/ErrorRuleObject.ts
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
+// src/types/RuleSetObject.ts
+// src/types/TreeRuleObject.ts
-module.exports = function(flag, argv) {
- argv = argv || process.argv || [];
- var terminatorPos = argv.indexOf('--');
- var prefix = /^-{1,2}/.test(flag) ? '' : '--';
- var pos = argv.indexOf(prefix + flag);
+// src/types/shared.ts
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+// Annotate the CommonJS export names for ESM import in node:
+
+0 && (0);
+
+
+
+/***/ }),
+
+/***/ 51656:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// src/index.ts
+var index_exports = {};
+__export(index_exports, {
+ NODE_APP_ID_CONFIG_OPTIONS: () => NODE_APP_ID_CONFIG_OPTIONS,
+ UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME,
+ UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME,
+ createDefaultUserAgentProvider: () => createDefaultUserAgentProvider,
+ crtAvailability: () => crtAvailability,
+ defaultUserAgent: () => defaultUserAgent
+});
+module.exports = __toCommonJS(index_exports);
+
+// src/defaultUserAgent.ts
+var import_os = __nccwpck_require__(70857);
+var import_process = __nccwpck_require__(932);
+
+// src/crt-availability.ts
+var crtAvailability = {
+ isCrtAvailable: false
+};
+
+// src/is-crt-available.ts
+var isCrtAvailable = /* @__PURE__ */ __name(() => {
+ if (crtAvailability.isCrtAvailable) {
+ return ["md/crt-avail"];
+ }
+ return null;
+}, "isCrtAvailable");
+
+// src/defaultUserAgent.ts
+var createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
+ return async (config) => {
+ const sections = [
+ // sdk-metadata
+ ["aws-sdk-js", clientVersion],
+ // ua-metadata
+ ["ua", "2.1"],
+ // os-metadata
+ [`os/${(0, import_os.platform)()}`, (0, import_os.release)()],
+ // language-metadata
+ // ECMAScript edition doesn't matter in JS, so no version needed.
+ ["lang/js"],
+ ["md/nodejs", `${import_process.versions.node}`]
+ ];
+ const crtAvailable = isCrtAvailable();
+ if (crtAvailable) {
+ sections.push(crtAvailable);
+ }
+ if (serviceId) {
+ sections.push([`api/${serviceId}`, clientVersion]);
+ }
+ if (import_process.env.AWS_EXECUTION_ENV) {
+ sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]);
+ }
+ const appId = await config?.userAgentAppId?.();
+ const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
+ return resolvedUserAgent;
+ };
+}, "createDefaultUserAgentProvider");
+var defaultUserAgent = createDefaultUserAgentProvider;
+
+// src/nodeAppIdConfigOptions.ts
+var import_middleware_user_agent = __nccwpck_require__(32959);
+var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
+var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
+var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
+var NODE_APP_ID_CONFIG_OPTIONS = {
+ environmentVariableSelector: /* @__PURE__ */ __name((env2) => env2[UA_APP_ID_ENV_NAME], "environmentVariableSelector"),
+ configFileSelector: /* @__PURE__ */ __name((profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], "configFileSelector"),
+ default: import_middleware_user_agent.DEFAULT_UA_APP_ID
};
+// Annotate the CommonJS export names for ESM import in node:
+
+0 && (0);
+
/***/ }),
-/***/ 98740:
+/***/ 39693:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
/*
+
The MIT License (MIT)
-Copyright (c) Sindre Sorhus (sindresorhus.com)
+Original Library
+ - Copyright (c) Marak Squires
+
+Additional functionality
+ - Copyright (c) Sindre Sorhus (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -16675,269 +15586,862 @@ THE SOFTWARE.
*/
+var colors = {};
+module['exports'] = colors;
+colors.themes = {};
-var os = __nccwpck_require__(70857);
-var hasFlag = __nccwpck_require__(34982);
+var util = __nccwpck_require__(39023);
+var ansiStyles = colors.styles = __nccwpck_require__(72251);
+var defineProps = Object.defineProperties;
+var newLineRegex = new RegExp(/[\r\n]+/g);
-var env = process.env;
+colors.supportsColor = (__nccwpck_require__(98740).supportsColor);
-var forceColor = void 0;
-if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
- forceColor = false;
-} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
- || hasFlag('color=always')) {
- forceColor = true;
-}
-if ('FORCE_COLOR' in env) {
- forceColor = env.FORCE_COLOR.length === 0
- || parseInt(env.FORCE_COLOR, 10) !== 0;
+if (typeof colors.enabled === 'undefined') {
+ colors.enabled = colors.supportsColor() !== false;
}
-function translateLevel(level) {
- if (level === 0) {
- return false;
- }
+colors.enable = function() {
+ colors.enabled = true;
+};
- return {
- level: level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3,
- };
-}
+colors.disable = function() {
+ colors.enabled = false;
+};
-function supportsColor(stream) {
- if (forceColor === false) {
- return 0;
- }
+colors.stripColors = colors.strip = function(str) {
+ return ('' + str).replace(/\x1B\[\d+m/g, '');
+};
- if (hasFlag('color=16m') || hasFlag('color=full')
- || hasFlag('color=truecolor')) {
- return 3;
+// eslint-disable-next-line no-unused-vars
+var stylize = colors.stylize = function stylize(str, style) {
+ if (!colors.enabled) {
+ return str+'';
}
- if (hasFlag('color=256')) {
- return 2;
+ var styleMap = ansiStyles[style];
+
+ // Stylize should work for non-ANSI styles, too
+ if (!styleMap && style in colors) {
+ // Style maps like trap operate as functions on strings;
+ // they don't have properties like open or close.
+ return colors[style](str);
}
- if (stream && !stream.isTTY && forceColor !== true) {
- return 0;
+ return styleMap.open + str + styleMap.close;
+};
+
+var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
+var escapeStringRegexp = function(str) {
+ if (typeof str !== 'string') {
+ throw new TypeError('Expected a string');
}
+ return str.replace(matchOperatorsRe, '\\$&');
+};
- var min = forceColor ? 1 : 0;
+function build(_styles) {
+ var builder = function builder() {
+ return applyStyle.apply(builder, arguments);
+ };
+ builder._styles = _styles;
+ // __proto__ is used because we must return a function, but there is
+ // no way to create a function with a different prototype.
+ builder.__proto__ = proto;
+ return builder;
+}
- if (process.platform === 'win32') {
- // Node.js 7.5.0 is the first version of Node.js to include a patch to
- // libuv that enables 256 color output on Windows. Anything earlier and it
- // won't work. However, here we target Node.js 8 at minimum as it is an LTS
- // release, and Node.js 7 is not. Windows 10 build 10586 is the first
- // Windows release that supports 256 colors. Windows 10 build 14931 is the
- // first release that supports 16m/TrueColor.
- var osRelease = os.release().split('.');
- if (Number(process.versions.node.split('.')[0]) >= 8
- && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
+var styles = (function() {
+ var ret = {};
+ ansiStyles.grey = ansiStyles.gray;
+ Object.keys(ansiStyles).forEach(function(key) {
+ ansiStyles[key].closeRe =
+ new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
+ ret[key] = {
+ get: function() {
+ return build(this._styles.concat(key));
+ },
+ };
+ });
+ return ret;
+})();
- return 1;
- }
+var proto = defineProps(function colors() {}, styles);
- if ('CI' in env) {
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
- return sign in env;
- }) || env.CI_NAME === 'codeship') {
- return 1;
+function applyStyle() {
+ var args = Array.prototype.slice.call(arguments);
+
+ var str = args.map(function(arg) {
+ // Use weak equality check so we can colorize null/undefined in safe mode
+ if (arg != null && arg.constructor === String) {
+ return arg;
+ } else {
+ return util.inspect(arg);
}
+ }).join(' ');
- return min;
+ if (!colors.enabled || !str) {
+ return str;
}
- if ('TEAMCITY_VERSION' in env) {
- return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
- );
- }
+ var newLinesPresent = str.indexOf('\n') != -1;
- if ('TERM_PROGRAM' in env) {
- var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+ var nestedStyles = this._styles;
- switch (env.TERM_PROGRAM) {
- case 'iTerm.app':
- return version >= 3 ? 3 : 2;
- case 'Hyper':
- return 3;
- case 'Apple_Terminal':
- return 2;
- // No default
+ var i = nestedStyles.length;
+ while (i--) {
+ var code = ansiStyles[nestedStyles[i]];
+ str = code.open + str.replace(code.closeRe, code.open) + code.close;
+ if (newLinesPresent) {
+ str = str.replace(newLineRegex, function(match) {
+ return code.close + match + code.open;
+ });
}
}
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
-
- if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
+ return str;
+}
- if ('COLORTERM' in env) {
- return 1;
+colors.setTheme = function(theme) {
+ if (typeof theme === 'string') {
+ console.log('colors.setTheme now only accepts an object, not a string. ' +
+ 'If you are trying to set a theme from a file, it is now your (the ' +
+ 'caller\'s) responsibility to require the file. The old syntax ' +
+ 'looked like colors.setTheme(__dirname + ' +
+ '\'/../themes/generic-logging.js\'); The new syntax looks like '+
+ 'colors.setTheme(require(__dirname + ' +
+ '\'/../themes/generic-logging.js\'));');
+ return;
}
-
- if (env.TERM === 'dumb') {
- return min;
+ for (var style in theme) {
+ (function(style) {
+ colors[style] = function(str) {
+ if (typeof theme[style] === 'object') {
+ var out = str;
+ for (var i in theme[style]) {
+ out = colors[theme[style][i]](out);
+ }
+ return out;
+ }
+ return colors[theme[style]](str);
+ };
+ })(style);
}
+};
- return min;
+function init() {
+ var ret = {};
+ Object.keys(styles).forEach(function(name) {
+ ret[name] = {
+ get: function() {
+ return build([name]);
+ },
+ };
+ });
+ return ret;
}
-function getSupportLevel(stream) {
- var level = supportsColor(stream);
- return translateLevel(level);
+var sequencer = function sequencer(map, str) {
+ var exploded = str.split('');
+ exploded = exploded.map(map);
+ return exploded.join('');
+};
+
+// custom formatter methods
+colors.trap = __nccwpck_require__(32154);
+colors.zalgo = __nccwpck_require__(89312);
+
+// maps
+colors.maps = {};
+colors.maps.america = __nccwpck_require__(88881)(colors);
+colors.maps.zebra = __nccwpck_require__(45337)(colors);
+colors.maps.rainbow = __nccwpck_require__(18543)(colors);
+colors.maps.random = __nccwpck_require__(51298)(colors);
+
+for (var map in colors.maps) {
+ (function(map) {
+ colors[map] = function(str) {
+ return sequencer(colors.maps[map], str);
+ };
+ })(map);
}
-module.exports = {
- supportsColor: getSupportLevel,
- stdout: getSupportLevel(process.stdout),
- stderr: getSupportLevel(process.stderr),
-};
+defineProps(colors, init());
/***/ }),
-/***/ 72708:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 32154:
+/***/ ((module) => {
-//
-// Remark: Requiring this file will use the "safe" colors API,
-// which will not touch String.prototype.
-//
-// var colors = require('colors/safe');
-// colors.red("foo")
-//
-//
-var colors = __nccwpck_require__(39693);
-module['exports'] = colors;
+module['exports'] = function runTheTrap(text, options) {
+ var result = '';
+ text = text || 'Run the trap, drop the bass';
+ text = text.split('');
+ var trap = {
+ a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
+ b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
+ c: ['\u00a9', '\u023b', '\u03fe'],
+ d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
+ e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
+ '\u0a6c'],
+ f: ['\u04fa'],
+ g: ['\u0262'],
+ h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
+ i: ['\u0f0f'],
+ j: ['\u0134'],
+ k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
+ l: ['\u0139'],
+ m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
+ n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
+ o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
+ '\u06dd', '\u0e4f'],
+ p: ['\u01f7', '\u048e'],
+ q: ['\u09cd'],
+ r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
+ s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
+ t: ['\u0141', '\u0166', '\u0373'],
+ u: ['\u01b1', '\u054d'],
+ v: ['\u05d8'],
+ w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
+ x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
+ y: ['\u00a5', '\u04b0', '\u04cb'],
+ z: ['\u01b5', '\u0240'],
+ };
+ text.forEach(function(c) {
+ c = c.toLowerCase();
+ var chars = trap[c] || [' '];
+ var rand = Math.floor(Math.random() * chars.length);
+ if (typeof trap[c] !== 'undefined') {
+ result += trap[c][rand];
+ } else {
+ result += c;
+ }
+ });
+ return result;
+};
/***/ }),
-/***/ 63451:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 89312:
+/***/ ((module) => {
-var enabled = __nccwpck_require__(85909);
+// please no
+module['exports'] = function zalgo(text, options) {
+ text = text || ' he is here ';
+ var soul = {
+ 'up': [
+ '̍', '̎', '̄', '̅',
+ '̿', '̑', '̆', '̐',
+ '͒', '͗', '͑', '̇',
+ '̈', '̊', '͂', '̓',
+ '̈', '͊', '͋', '͌',
+ '̃', '̂', '̌', '͐',
+ '̀', '́', '̋', '̏',
+ '̒', '̓', '̔', '̽',
+ '̉', 'ͣ', 'ͤ', 'ͥ',
+ 'ͦ', 'ͧ', 'ͨ', 'ͩ',
+ 'ͪ', 'ͫ', 'ͬ', 'ͭ',
+ 'ͮ', 'ͯ', '̾', '͛',
+ '͆', '̚',
+ ],
+ 'down': [
+ '̖', '̗', '̘', '̙',
+ '̜', '̝', '̞', '̟',
+ '̠', '̤', '̥', '̦',
+ '̩', '̪', '̫', '̬',
+ '̭', '̮', '̯', '̰',
+ '̱', '̲', '̳', '̹',
+ '̺', '̻', '̼', 'ͅ',
+ '͇', '͈', '͉', '͍',
+ '͎', '͓', '͔', '͕',
+ '͖', '͙', '͚', '̣',
+ ],
+ 'mid': [
+ '̕', '̛', '̀', '́',
+ '͘', '̡', '̢', '̧',
+ '̨', '̴', '̵', '̶',
+ '͜', '͝', '͞',
+ '͟', '͠', '͢', '̸',
+ '̷', '͡', ' ҉',
+ ],
+ };
+ var all = [].concat(soul.up, soul.down, soul.mid);
-/**
- * Creates a new Adapter.
- *
- * @param {Function} fn Function that returns the value.
- * @returns {Function} The adapter logic.
- * @public
- */
-module.exports = function create(fn) {
- return function adapter(namespace) {
- try {
- return enabled(namespace, fn());
- } catch (e) { /* Any failure means that we found nothing */ }
+ function randomNumber(range) {
+ var r = Math.floor(Math.random() * range);
+ return r;
+ }
- return false;
+ function isChar(character) {
+ var bool = false;
+ all.filter(function(i) {
+ bool = (i === character);
+ });
+ return bool;
+ }
+
+
+ function heComes(text, options) {
+ var result = '';
+ var counts;
+ var l;
+ options = options || {};
+ options['up'] =
+ typeof options['up'] !== 'undefined' ? options['up'] : true;
+ options['mid'] =
+ typeof options['mid'] !== 'undefined' ? options['mid'] : true;
+ options['down'] =
+ typeof options['down'] !== 'undefined' ? options['down'] : true;
+ options['size'] =
+ typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
+ text = text.split('');
+ for (l in text) {
+ if (isChar(l)) {
+ continue;
+ }
+ result = result + text[l];
+ counts = {'up': 0, 'down': 0, 'mid': 0};
+ switch (options.size) {
+ case 'mini':
+ counts.up = randomNumber(8);
+ counts.mid = randomNumber(2);
+ counts.down = randomNumber(8);
+ break;
+ case 'maxi':
+ counts.up = randomNumber(16) + 3;
+ counts.mid = randomNumber(4) + 1;
+ counts.down = randomNumber(64) + 3;
+ break;
+ default:
+ counts.up = randomNumber(8) + 1;
+ counts.mid = randomNumber(6) / 2;
+ counts.down = randomNumber(8) + 1;
+ break;
+ }
+
+ var arr = ['up', 'mid', 'down'];
+ for (var d in arr) {
+ var index = arr[d];
+ for (var i = 0; i <= counts[index]; i++) {
+ if (options[index]) {
+ result = result + soul[index][randomNumber(soul[index].length)];
+ }
+ }
+ }
+ }
+ return result;
+ }
+ // don't summon him
+ return heComes(text, options);
+};
+
+
+
+/***/ }),
+
+/***/ 88881:
+/***/ ((module) => {
+
+module['exports'] = function(colors) {
+ return function(letter, i, exploded) {
+ if (letter === ' ') return letter;
+ switch (i%3) {
+ case 0: return colors.red(letter);
+ case 1: return colors.white(letter);
+ case 2: return colors.blue(letter);
+ }
};
-}
+};
/***/ }),
-/***/ 11159:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 18543:
+/***/ ((module) => {
-var adapter = __nccwpck_require__(63451);
+module['exports'] = function(colors) {
+ // RoY G BiV
+ var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
+ return function(letter, i, exploded) {
+ if (letter === ' ') {
+ return letter;
+ } else {
+ return colors[rainbowColors[i++ % rainbowColors.length]](letter);
+ }
+ };
+};
-/**
- * Extracts the values from process.env.
- *
- * @type {Function}
- * @public
- */
-module.exports = adapter(function processenv() {
- return process.env.DEBUG || process.env.DIAGNOSTICS;
-});
/***/ }),
-/***/ 39094:
+/***/ 51298:
/***/ ((module) => {
-/**
- * Contains all configured adapters for the given environment.
- *
- * @type {Array}
- * @public
- */
-var adapters = [];
+module['exports'] = function(colors) {
+ var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
+ 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
+ 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
+ return function(letter, i, exploded) {
+ return letter === ' ' ? letter :
+ colors[
+ available[Math.round(Math.random() * (available.length - 2))]
+ ](letter);
+ };
+};
-/**
- * Contains all modifier functions.
- *
- * @typs {Array}
- * @public
- */
-var modifiers = [];
-/**
- * Our default logger.
- *
- * @public
- */
-var logger = function devnull() {};
+/***/ }),
-/**
- * Register a new adapter that will used to find environments.
- *
- * @param {Function} adapter A function that will return the possible env.
- * @returns {Boolean} Indication of a successful add.
- * @public
- */
-function use(adapter) {
- if (~adapters.indexOf(adapter)) return false;
+/***/ 45337:
+/***/ ((module) => {
- adapters.push(adapter);
- return true;
-}
+module['exports'] = function(colors) {
+ return function(letter, i, exploded) {
+ return i % 2 === 0 ? letter : colors.inverse(letter);
+ };
+};
-/**
- * Assign a new log method.
- *
- * @param {Function} custom The log method.
- * @public
- */
-function set(custom) {
- logger = custom;
-}
-/**
- * Check if the namespace is allowed by any of our adapters.
- *
- * @param {String} namespace The namespace that needs to be enabled
- * @returns {Boolean|Promise} Indication if the namespace is enabled by our adapters.
- * @public
- */
-function enabled(namespace) {
- var async = [];
+/***/ }),
- for (var i = 0; i < adapters.length; i++) {
- if (adapters[i].async) {
- async.push(adapters[i]);
- continue;
- }
+/***/ 72251:
+/***/ ((module) => {
- if (adapters[i](namespace)) return true;
- }
+/*
+The MIT License (MIT)
- if (!async.length) return false;
+Copyright (c) Sindre Sorhus (sindresorhus.com)
- //
- // Now that we know that we Async functions, we know we run in an ES6
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+
+var styles = {};
+module['exports'] = styles;
+
+var codes = {
+ reset: [0, 0],
+
+ bold: [1, 22],
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29],
+
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ gray: [90, 39],
+ grey: [90, 39],
+
+ brightRed: [91, 39],
+ brightGreen: [92, 39],
+ brightYellow: [93, 39],
+ brightBlue: [94, 39],
+ brightMagenta: [95, 39],
+ brightCyan: [96, 39],
+ brightWhite: [97, 39],
+
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49],
+ bgGray: [100, 49],
+ bgGrey: [100, 49],
+
+ bgBrightRed: [101, 49],
+ bgBrightGreen: [102, 49],
+ bgBrightYellow: [103, 49],
+ bgBrightBlue: [104, 49],
+ bgBrightMagenta: [105, 49],
+ bgBrightCyan: [106, 49],
+ bgBrightWhite: [107, 49],
+
+ // legacy styles for colors pre v1.0.0
+ blackBG: [40, 49],
+ redBG: [41, 49],
+ greenBG: [42, 49],
+ yellowBG: [43, 49],
+ blueBG: [44, 49],
+ magentaBG: [45, 49],
+ cyanBG: [46, 49],
+ whiteBG: [47, 49],
+
+};
+
+Object.keys(codes).forEach(function(key) {
+ var val = codes[key];
+ var style = styles[key] = [];
+ style.open = '\u001b[' + val[0] + 'm';
+ style.close = '\u001b[' + val[1] + 'm';
+});
+
+
+/***/ }),
+
+/***/ 34982:
+/***/ ((module) => {
+
+/*
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+
+
+module.exports = function(flag, argv) {
+ argv = argv || process.argv || [];
+
+ var terminatorPos = argv.indexOf('--');
+ var prefix = /^-{1,2}/.test(flag) ? '' : '--';
+ var pos = argv.indexOf(prefix + flag);
+
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+};
+
+
+/***/ }),
+
+/***/ 98740:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+/*
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+
+
+
+var os = __nccwpck_require__(70857);
+var hasFlag = __nccwpck_require__(34982);
+
+var env = process.env;
+
+var forceColor = void 0;
+if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
+ forceColor = false;
+} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
+ || hasFlag('color=always')) {
+ forceColor = true;
+}
+if ('FORCE_COLOR' in env) {
+ forceColor = env.FORCE_COLOR.length === 0
+ || parseInt(env.FORCE_COLOR, 10) !== 0;
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level: level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3,
+ };
+}
+
+function supportsColor(stream) {
+ if (forceColor === false) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') || hasFlag('color=full')
+ || hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (stream && !stream.isTTY && forceColor !== true) {
+ return 0;
+ }
+
+ var min = forceColor ? 1 : 0;
+
+ if (process.platform === 'win32') {
+ // Node.js 7.5.0 is the first version of Node.js to include a patch to
+ // libuv that enables 256 color output on Windows. Anything earlier and it
+ // won't work. However, here we target Node.js 8 at minimum as it is an LTS
+ // release, and Node.js 7 is not. Windows 10 build 10586 is the first
+ // Windows release that supports 256 colors. Windows 10 build 14931 is the
+ // first release that supports 16m/TrueColor.
+ var osRelease = os.release().split('.');
+ if (Number(process.versions.node.split('.')[0]) >= 8
+ && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+
+ return 1;
+ }
+
+ if ('CI' in env) {
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
+ return sign in env;
+ }) || env.CI_NAME === 'codeship') {
+ return 1;
+ }
+
+ return min;
+ }
+
+ if ('TEAMCITY_VERSION' in env) {
+ return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
+ );
+ }
+
+ if ('TERM_PROGRAM' in env) {
+ var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+
+ switch (env.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return version >= 3 ? 3 : 2;
+ case 'Hyper':
+ return 3;
+ case 'Apple_Terminal':
+ return 2;
+ // No default
+ }
+ }
+
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
+
+ if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+
+ if ('COLORTERM' in env) {
+ return 1;
+ }
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ return min;
+}
+
+function getSupportLevel(stream) {
+ var level = supportsColor(stream);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: getSupportLevel(process.stdout),
+ stderr: getSupportLevel(process.stderr),
+};
+
+
+/***/ }),
+
+/***/ 72708:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+//
+// Remark: Requiring this file will use the "safe" colors API,
+// which will not touch String.prototype.
+//
+// var colors = require('colors/safe');
+// colors.red("foo")
+//
+//
+var colors = __nccwpck_require__(39693);
+module['exports'] = colors;
+
+
+/***/ }),
+
+/***/ 63451:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var enabled = __nccwpck_require__(85909);
+
+/**
+ * Creates a new Adapter.
+ *
+ * @param {Function} fn Function that returns the value.
+ * @returns {Function} The adapter logic.
+ * @public
+ */
+module.exports = function create(fn) {
+ return function adapter(namespace) {
+ try {
+ return enabled(namespace, fn());
+ } catch (e) { /* Any failure means that we found nothing */ }
+
+ return false;
+ };
+}
+
+
+/***/ }),
+
+/***/ 11159:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var adapter = __nccwpck_require__(63451);
+
+/**
+ * Extracts the values from process.env.
+ *
+ * @type {Function}
+ * @public
+ */
+module.exports = adapter(function processenv() {
+ return process.env.DEBUG || process.env.DIAGNOSTICS;
+});
+
+
+/***/ }),
+
+/***/ 39094:
+/***/ ((module) => {
+
+/**
+ * Contains all configured adapters for the given environment.
+ *
+ * @type {Array}
+ * @public
+ */
+var adapters = [];
+
+/**
+ * Contains all modifier functions.
+ *
+ * @typs {Array}
+ * @public
+ */
+var modifiers = [];
+
+/**
+ * Our default logger.
+ *
+ * @public
+ */
+var logger = function devnull() {};
+
+/**
+ * Register a new adapter that will used to find environments.
+ *
+ * @param {Function} adapter A function that will return the possible env.
+ * @returns {Boolean} Indication of a successful add.
+ * @public
+ */
+function use(adapter) {
+ if (~adapters.indexOf(adapter)) return false;
+
+ adapters.push(adapter);
+ return true;
+}
+
+/**
+ * Assign a new log method.
+ *
+ * @param {Function} custom The log method.
+ * @public
+ */
+function set(custom) {
+ logger = custom;
+}
+
+/**
+ * Check if the namespace is allowed by any of our adapters.
+ *
+ * @param {String} namespace The namespace that needs to be enabled
+ * @returns {Boolean|Promise} Indication if the namespace is enabled by our adapters.
+ * @public
+ */
+function enabled(namespace) {
+ var async = [];
+
+ for (var i = 0; i < adapters.length; i++) {
+ if (adapters[i].async) {
+ async.push(adapters[i]);
+ continue;
+ }
+
+ if (adapters[i](namespace)) return true;
+ }
+
+ if (!async.length) return false;
+
+ //
+ // Now that we know that we Async functions, we know we run in an ES6
// environment and can use all the API's that they offer, in this case
// we want to return a Promise so that we can `await` in React-Native
// for an async adapter.
@@ -21523,7 +21027,7 @@ class WebClient extends methods_1.Methods {
* @param {Function} [webClientOptions.requestInterceptor] - An interceptor to mutate outgoing requests. See {@link https://axios-http.com/docs/interceptors Axios interceptors}
* @param {Function} [webClientOptions.adapter] - An adapter to allow custom handling of requests. Useful if you would like to use a pre-configured http client. See {@link https://github.com/axios/axios/blob/v1.x/README.md?plain=1#L586 Axios adapter}
*/
- constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, attachOriginalToWebAPIRequestError = true, requestInterceptor = undefined, adapter = undefined, } = {}) {
+ constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, allowAbsoluteUrls = true, attachOriginalToWebAPIRequestError = true, requestInterceptor = undefined, adapter = undefined, } = {}) {
super();
this.token = token;
this.slackApiUrl = slackApiUrl;
@@ -21533,6 +21037,7 @@ class WebClient extends methods_1.Methods {
this.tlsConfig = tls !== undefined ? tls : {};
this.rejectRateLimitedCalls = rejectRateLimitedCalls;
this.teamId = teamId;
+ this.allowAbsoluteUrls = allowAbsoluteUrls;
this.attachOriginalToWebAPIRequestError = attachOriginalToWebAPIRequestError;
// Logging
if (typeof logger !== 'undefined') {
@@ -21550,6 +21055,7 @@ class WebClient extends methods_1.Methods {
adapter: adapter ? (config) => adapter(Object.assign(Object.assign({}, config), { adapter: undefined })) : undefined,
timeout,
baseURL: slackApiUrl,
+ allowAbsoluteUrls,
headers: (0, is_electron_1.default)() ? headers : Object.assign({ 'User-Agent': (0, instrument_1.getUserAgent)() }, headers),
httpAgent: agent,
httpsAgent: agent,
@@ -21822,7 +21328,7 @@ class WebClient extends methods_1.Methods {
return __awaiter(this, void 0, void 0, function* () {
// TODO: better input types - remove any
const task = () => this.requestQueue.add(() => __awaiter(this, void 0, void 0, function* () {
- const requestURL = url.startsWith('https' || 0) ? url : `${this.axios.getUri() + url}`;
+ const requestURL = this.deriveRequestUrl(url);
try {
// biome-ignore lint/suspicious/noExplicitAny: TODO: type this
const config = Object.assign({ headers }, this.tlsConfig);
@@ -21895,6 +21401,17 @@ class WebClient extends methods_1.Methods {
return (0, p_retry_1.default)(task, this.retryConfig);
});
}
+ /**
+ * Get the complete request URL for the provided URL.
+ * @param url - The resource to POST to. Either a Slack API method or absolute URL.
+ */
+ deriveRequestUrl(url) {
+ const isAbsoluteURL = url.startsWith('https://') || url.startsWith('http://');
+ if (isAbsoluteURL && this.allowAbsoluteUrls) {
+ return url;
+ }
+ return `${this.axios.getUri() + url}`;
+ }
/**
* Transforms options (a simple key-value object) into an acceptable value for a body. This can be either
* a string, used when posting with a content-type of url-encoded. Or, it can be a readable stream, used
@@ -23895,7 +23412,7 @@ class Methods extends eventemitter3_1.EventEmitter {
* - multiple upload_files
* Will try to honor both single file or content data supplied as well
* as multiple file uploads property.
- * @see {@link https://slack.dev/node-slack-sdk/web-api#upload-a-file `@slack/web-api` Upload a file documentation}.
+ * @see {@link https://tools.slack.dev/node-slack-sdk/web-api#upload-a-file `@slack/web-api` Upload a file documentation}.
*/
uploadV2: bindFilesUploadV2(this),
comments: {
@@ -24474,14 +23991,13 @@ var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
// src/endpointsConfig/resolveCustomEndpointsConfig.ts
var import_util_middleware = __nccwpck_require__(76324);
var resolveCustomEndpointsConfig = /* @__PURE__ */ __name((input) => {
- const { endpoint, urlParser } = input;
- return {
- ...input,
- tls: input.tls ?? true,
+ const { tls, endpoint, urlParser, useDualstackEndpoint } = input;
+ return Object.assign(input, {
+ tls: tls ?? true,
endpoint: (0, import_util_middleware.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint),
isCustomEndpoint: true,
- useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false)
- };
+ useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(useDualstackEndpoint ?? false)
+ });
}, "resolveCustomEndpointsConfig");
// src/endpointsConfig/resolveEndpointsConfig.ts
@@ -24507,14 +24023,13 @@ var getEndpointFromRegion = /* @__PURE__ */ __name(async (input) => {
// src/endpointsConfig/resolveEndpointsConfig.ts
var resolveEndpointsConfig = /* @__PURE__ */ __name((input) => {
const useDualstackEndpoint = (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false);
- const { endpoint, useFipsEndpoint, urlParser } = input;
- return {
- ...input,
- tls: input.tls ?? true,
+ const { endpoint, useFipsEndpoint, urlParser, tls } = input;
+ return Object.assign(input, {
+ tls: tls ?? true,
endpoint: endpoint ? (0, import_util_middleware.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }),
isCustomEndpoint: !!endpoint,
useDualstackEndpoint
- };
+ });
}, "resolveEndpointsConfig");
// src/regionConfig/config.ts
@@ -24543,8 +24058,7 @@ var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
if (!region) {
throw new Error("Region is missing");
}
- return {
- ...input,
+ return Object.assign(input, {
region: async () => {
if (typeof region === "string") {
return getRealRegion(region);
@@ -24559,16 +24073,13 @@ var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
}
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
}
- };
+ });
}, "resolveRegionConfig");
// src/regionInfo/getHostnameFromVariants.ts
-var getHostnameFromVariants = /* @__PURE__ */ __name((variants = [], { useFipsEndpoint, useDualstackEndpoint }) => {
- var _a;
- return (_a = variants.find(
- ({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack")
- )) == null ? void 0 : _a.hostname;
-}, "getHostnameFromVariants");
+var getHostnameFromVariants = /* @__PURE__ */ __name((variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(
+ ({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack")
+)?.hostname, "getHostnameFromVariants");
// src/regionInfo/getResolvedHostname.ts
var getResolvedHostname = /* @__PURE__ */ __name((resolvedRegion, { regionHostname, partitionHostname }) => regionHostname ? regionHostname : partitionHostname ? partitionHostname.replace("{region}", resolvedRegion) : void 0, "getResolvedHostname");
@@ -24597,18 +24108,17 @@ var getRegionInfo = /* @__PURE__ */ __name((region, {
regionHash,
partitionHash
}) => {
- var _a, _b, _c, _d, _e;
const partition = getResolvedPartition(region, { partitionHash });
- const resolvedRegion = region in regionHash ? region : ((_a = partitionHash[partition]) == null ? void 0 : _a.endpoint) ?? region;
+ const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region;
const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint };
- const regionHostname = getHostnameFromVariants((_b = regionHash[resolvedRegion]) == null ? void 0 : _b.variants, hostnameOptions);
- const partitionHostname = getHostnameFromVariants((_c = partitionHash[partition]) == null ? void 0 : _c.variants, hostnameOptions);
+ const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions);
+ const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions);
const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname });
if (hostname === void 0) {
throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`);
}
const signingRegion = getResolvedSigningRegion(hostname, {
- signingRegion: (_d = regionHash[resolvedRegion]) == null ? void 0 : _d.signingRegion,
+ signingRegion: regionHash[resolvedRegion]?.signingRegion,
regionRegex: partitionHash[partition].regionRegex,
useFipsEndpoint
});
@@ -24617,7 +24127,7 @@ var getRegionInfo = /* @__PURE__ */ __name((region, {
signingService,
hostname,
...signingRegion && { signingRegion },
- ...((_e = regionHash[resolvedRegion]) == null ? void 0 : _e.signingService) && {
+ ...regionHash[resolvedRegion]?.signingService && {
signingService: regionHash[resolvedRegion].signingService
}
};
@@ -24695,7 +24205,6 @@ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
}
__name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap");
var httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (next, context) => async (args) => {
- var _a;
const options = config.httpAuthSchemeProvider(
await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)
);
@@ -24713,7 +24222,7 @@ var httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (ne
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
continue;
}
- const { identityProperties = {}, signingProperties = {} } = ((_a = option.propertiesExtractor) == null ? void 0 : _a.call(option, config, context)) || {};
+ const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
smithyContext.selectedHttpAuthScheme = {
@@ -24833,21 +24342,30 @@ var normalizeProvider = /* @__PURE__ */ __name((input) => {
}, "normalizeProvider");
// src/pagination/createPaginator.ts
-var makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, ...args) => {
- return await client.send(new CommandCtor(input), ...args);
+var makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
+ let command = new CommandCtor(input);
+ command = withCommand(command) ?? command;
+ return await client.send(command, ...args);
}, "makePagedClientRequest");
function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
return /* @__PURE__ */ __name(async function* paginateOperation(config, input, ...additionalArguments) {
- let token = config.startingToken || void 0;
+ const _input = input;
+ let token = config.startingToken ?? _input[inputTokenName];
let hasNext = true;
let page;
while (hasNext) {
- input[inputTokenName] = token;
+ _input[inputTokenName] = token;
if (pageSizeTokenName) {
- input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize;
+ _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
}
if (config.client instanceof ClientCtor) {
- page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments);
+ page = await makePagedClientRequest(
+ CommandCtor,
+ config.client,
+ input,
+ config.withCommand,
+ ...additionalArguments
+ );
} else {
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
}
@@ -24889,7 +24407,7 @@ function setFeature(context, feature, value) {
__name(setFeature, "setFeature");
// src/util-identity-and-auth/DefaultIdentityProviderConfig.ts
-var _DefaultIdentityProviderConfig = class _DefaultIdentityProviderConfig {
+var DefaultIdentityProviderConfig = class {
/**
* Creates an IdentityProviderConfig with a record of scheme IDs to identity providers.
*
@@ -24903,17 +24421,21 @@ var _DefaultIdentityProviderConfig = class _DefaultIdentityProviderConfig {
}
}
}
+ static {
+ __name(this, "DefaultIdentityProviderConfig");
+ }
getIdentityProvider(schemeId) {
return this.authSchemes.get(schemeId);
}
};
-__name(_DefaultIdentityProviderConfig, "DefaultIdentityProviderConfig");
-var DefaultIdentityProviderConfig = _DefaultIdentityProviderConfig;
// src/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.ts
-var _HttpApiKeyAuthSigner = class _HttpApiKeyAuthSigner {
+var HttpApiKeyAuthSigner = class {
+ static {
+ __name(this, "HttpApiKeyAuthSigner");
+ }
async sign(httpRequest, identity, signingProperties) {
if (!signingProperties) {
throw new Error(
@@ -24942,12 +24464,13 @@ var _HttpApiKeyAuthSigner = class _HttpApiKeyAuthSigner {
return clonedRequest;
}
};
-__name(_HttpApiKeyAuthSigner, "HttpApiKeyAuthSigner");
-var HttpApiKeyAuthSigner = _HttpApiKeyAuthSigner;
// src/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.ts
-var _HttpBearerAuthSigner = class _HttpBearerAuthSigner {
+var HttpBearerAuthSigner = class {
+ static {
+ __name(this, "HttpBearerAuthSigner");
+ }
async sign(httpRequest, identity, signingProperties) {
const clonedRequest = import_protocol_http.HttpRequest.clone(httpRequest);
if (!identity.token) {
@@ -24957,17 +24480,16 @@ var _HttpBearerAuthSigner = class _HttpBearerAuthSigner {
return clonedRequest;
}
};
-__name(_HttpBearerAuthSigner, "HttpBearerAuthSigner");
-var HttpBearerAuthSigner = _HttpBearerAuthSigner;
// src/util-identity-and-auth/httpAuthSchemes/noAuth.ts
-var _NoAuthSigner = class _NoAuthSigner {
+var NoAuthSigner = class {
+ static {
+ __name(this, "NoAuthSigner");
+ }
async sign(httpRequest, identity, signingProperties) {
return httpRequest;
}
};
-__name(_NoAuthSigner, "NoAuthSigner");
-var NoAuthSigner = _NoAuthSigner;
// src/util-identity-and-auth/memoizeIdentityProvider.ts
var createIsIdentityExpiredFunction = /* @__PURE__ */ __name((expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs, "createIsIdentityExpiredFunction");
@@ -24998,14 +24520,14 @@ var memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requi
}, "coalesceProvider");
if (isExpired === void 0) {
return async (options) => {
- if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
+ if (!hasResult || options?.forceRefresh) {
resolved = await coalesceProvider(options);
}
return resolved;
};
}
return async (options) => {
- if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
+ if (!hasResult || options?.forceRefresh) {
resolved = await coalesceProvider(options);
}
if (isConstant) {
@@ -25058,7 +24580,7 @@ __export(protocols_exports, {
collectBody: () => collectBody,
extendedEncodeURIComponent: () => extendedEncodeURIComponent,
requestBuilder: () => requestBuilder,
- resolvedPath: () => resolvedPath2
+ resolvedPath: () => resolvedPath
});
module.exports = __toCommonJS(protocols_exports);
@@ -25083,8 +24605,26 @@ function extendedEncodeURIComponent(str) {
}
// src/submodules/protocols/requestBuilder.ts
-var import_protocols = __nccwpck_require__(93422);
var import_protocol_http = __nccwpck_require__(72356);
+
+// src/submodules/protocols/resolve-path.ts
+var resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
+ if (input != null && input[memberName] !== void 0) {
+ const labelValue = labelValueProvider();
+ if (labelValue.length <= 0) {
+ throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
+ }
+ resolvedPath2 = resolvedPath2.replace(
+ uriLabel,
+ isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)
+ );
+ } else {
+ throw new Error("No value provided for input HTTP label: " + memberName + ".");
+ }
+ return resolvedPath2;
+};
+
+// src/submodules/protocols/requestBuilder.ts
function requestBuilder(input, context) {
return new RequestBuilder(input, context);
}
@@ -25129,7 +24669,7 @@ var RequestBuilder = class {
*/
bp(uriLabel) {
this.resolvePathStack.push((basePath) => {
- this.path = `${(basePath == null ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
+ this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
});
return this;
}
@@ -25138,7 +24678,7 @@ var RequestBuilder = class {
*/
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
this.resolvePathStack.push((path) => {
- this.path = (0, import_protocols.resolvedPath)(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
+ this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
});
return this;
}
@@ -25171,23 +24711,6 @@ var RequestBuilder = class {
return this;
}
};
-
-// src/submodules/protocols/resolve-path.ts
-var resolvedPath2 = (resolvedPath3, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
- if (input != null && input[memberName] !== void 0) {
- const labelValue = labelValueProvider();
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
- }
- resolvedPath3 = resolvedPath3.replace(
- uriLabel,
- isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)
- );
- } else {
- throw new Error("No value provided for input HTTP label: " + memberName + ".");
- }
- return resolvedPath3;
-};
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
@@ -25243,13 +24766,12 @@ var import_buffer = __nccwpck_require__(20181);
var import_http = __nccwpck_require__(58611);
function httpRequest(options) {
return new Promise((resolve, reject) => {
- var _a;
const req = (0, import_http.request)({
method: "GET",
...options,
// Node.js http module doesn't accept hostname with square brackets
// Refs: https://github.com/nodejs/node/issues/39738
- hostname: (_a = options.hostname) == null ? void 0 : _a.replace(/^\[(.+)\]$/, "$1")
+ hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1")
});
req.on("error", (err) => {
reject(Object.assign(new import_property_provider.ProviderError("Unable to connect to instance metadata service"), err));
@@ -25388,16 +24910,17 @@ var getCmdsUri = /* @__PURE__ */ __name(async ({ logger }) => {
// src/error/InstanceMetadataV1FallbackError.ts
-var _InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends import_property_provider.CredentialsProviderError {
+var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends import_property_provider.CredentialsProviderError {
constructor(message, tryNextLink = true) {
super(message, tryNextLink);
this.tryNextLink = tryNextLink;
this.name = "InstanceMetadataV1FallbackError";
Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
}
+ static {
+ __name(this, "InstanceMetadataV1FallbackError");
+ }
};
-__name(_InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError");
-var InstanceMetadataV1FallbackError = _InstanceMetadataV1FallbackError;
// src/utils/getInstanceMetadataEndpoint.ts
var import_node_config_provider = __nccwpck_require__(55704);
@@ -25471,7 +24994,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL
// src/utils/staticStabilityProvider.ts
var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => {
- const logger = (options == null ? void 0 : options.logger) || console;
+ const logger = options?.logger || console;
let pastCredentials;
return async () => {
let credentials;
@@ -25505,8 +25028,7 @@ var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
const { logger, profile } = init;
const { timeout, maxRetries } = providerConfigFromInit(init);
const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => {
- var _a;
- const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) == null ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null;
+ const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
if (isImdsV1Fallback) {
let fallbackBlockedFromProfile = false;
let fallbackBlockedFromProcessEnv = false;
@@ -25577,21 +25099,21 @@ var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
return async () => {
const endpoint = await getInstanceMetadataEndpoint();
if (disableFetchToken) {
- logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
+ logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
return getCredentials(maxRetries, { ...endpoint, timeout });
} else {
let token;
try {
token = (await getMetadataToken({ ...endpoint, timeout })).toString();
} catch (error) {
- if ((error == null ? void 0 : error.statusCode) === 400) {
+ if (error?.statusCode === 400) {
throw Object.assign(error, {
message: "EC2 Metadata token request returned error"
});
} else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) {
disableFetchToken = true;
}
- logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
+ logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
return getCredentials(maxRetries, { ...endpoint, timeout });
}
return getCredentials(maxRetries, {
@@ -25670,6 +25192,12 @@ module.exports = __toCommonJS(src_exports);
var import_protocol_http = __nccwpck_require__(72356);
var import_querystring_builder = __nccwpck_require__(18256);
+// src/create-request.ts
+function createRequest(url, requestOptions) {
+ return new Request(url, requestOptions);
+}
+__name(createRequest, "createRequest");
+
// src/request-timeout.ts
function requestTimeout(timeoutInMs = 0) {
return new Promise((resolve, reject) => {
@@ -25688,13 +25216,16 @@ __name(requestTimeout, "requestTimeout");
var keepAliveSupport = {
supported: void 0
};
-var _FetchHttpHandler = class _FetchHttpHandler {
+var FetchHttpHandler = class _FetchHttpHandler {
+ static {
+ __name(this, "FetchHttpHandler");
+ }
/**
* @returns the input if it is an HttpHandler of any class,
* or instantiates a new instance of this handler.
*/
static create(instanceOrOptions) {
- if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") {
+ if (typeof instanceOrOptions?.handle === "function") {
return instanceOrOptions;
}
return new _FetchHttpHandler(instanceOrOptions);
@@ -25708,21 +25239,20 @@ var _FetchHttpHandler = class _FetchHttpHandler {
}
if (keepAliveSupport.supported === void 0) {
keepAliveSupport.supported = Boolean(
- typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")
+ typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")
);
}
}
destroy() {
}
async handle(request, { abortSignal } = {}) {
- var _a;
if (!this.config) {
this.config = await this.configProvider;
}
const requestTimeoutInMs = this.config.requestTimeout;
const keepAlive = this.config.keepAlive === true;
const credentials = this.config.credentials;
- if (abortSignal == null ? void 0 : abortSignal.aborted) {
+ if (abortSignal?.aborted) {
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
return Promise.reject(abortError);
@@ -25750,7 +25280,7 @@ var _FetchHttpHandler = class _FetchHttpHandler {
method,
credentials
};
- if ((_a = this.config) == null ? void 0 : _a.cache) {
+ if (this.config?.cache) {
requestOptions.cache = this.config.cache;
}
if (body) {
@@ -25767,7 +25297,7 @@ var _FetchHttpHandler = class _FetchHttpHandler {
}
let removeSignalEventListener = /* @__PURE__ */ __name(() => {
}, "removeSignalEventListener");
- const fetchRequest = new Request(url, requestOptions);
+ const fetchRequest = createRequest(url, requestOptions);
const raceOfPromises = [
fetch(fetchRequest).then((response) => {
const fetchHeaders = response.headers;
@@ -25828,16 +25358,24 @@ var _FetchHttpHandler = class _FetchHttpHandler {
return this.config ?? {};
}
};
-__name(_FetchHttpHandler, "FetchHttpHandler");
-var FetchHttpHandler = _FetchHttpHandler;
// src/stream-collector.ts
+var import_util_base64 = __nccwpck_require__(68385);
var streamCollector = /* @__PURE__ */ __name(async (stream) => {
- if (typeof Blob === "function" && stream instanceof Blob) {
- return new Uint8Array(await stream.arrayBuffer());
+ if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
+ if (Blob.prototype.arrayBuffer !== void 0) {
+ return new Uint8Array(await stream.arrayBuffer());
+ }
+ return collectBlob(stream);
}
return collectStream(stream);
}, "streamCollector");
+async function collectBlob(blob) {
+ const base64 = await readToBase64(blob);
+ const arrayBuffer = (0, import_util_base64.fromBase64)(base64);
+ return new Uint8Array(arrayBuffer);
+}
+__name(collectBlob, "collectBlob");
async function collectStream(stream) {
const chunks = [];
const reader = stream.getReader();
@@ -25860,6 +25398,24 @@ async function collectStream(stream) {
return collected;
}
__name(collectStream, "collectStream");
+function readToBase64(blob) {
+ return new Promise((resolve, reject) => {
+ const reader = new FileReader();
+ reader.onloadend = () => {
+ if (reader.readyState !== 2) {
+ return reject(new Error("Reader aborted too early"));
+ }
+ const result = reader.result ?? "";
+ const commaIndex = result.indexOf(",");
+ const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
+ resolve(result.substring(dataOffset));
+ };
+ reader.onabort = () => reject(new Error("Read aborted"));
+ reader.onerror = () => reject(reader.error);
+ reader.readAsDataURL(blob);
+ });
+}
+__name(readToBase64, "readToBase64");
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
@@ -25900,7 +25456,10 @@ var import_util_buffer_from = __nccwpck_require__(44151);
var import_util_utf8 = __nccwpck_require__(71577);
var import_buffer = __nccwpck_require__(20181);
var import_crypto = __nccwpck_require__(76982);
-var _Hash = class _Hash {
+var Hash = class {
+ static {
+ __name(this, "Hash");
+ }
constructor(algorithmIdentifier, secret) {
this.algorithmIdentifier = algorithmIdentifier;
this.secret = secret;
@@ -25916,8 +25475,6 @@ var _Hash = class _Hash {
this.hash = this.secret ? (0, import_crypto.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto.createHash)(this.algorithmIdentifier);
}
};
-__name(_Hash, "Hash");
-var Hash = _Hash;
function castSourceData(toCast, encoding) {
if (import_buffer.Buffer.isBuffer(toCast)) {
return toCast;
@@ -26141,19 +25698,21 @@ var getCompressionPlugin = /* @__PURE__ */ __name((config, middlewareConfig) =>
// src/resolveCompressionConfig.ts
var import_util_middleware = __nccwpck_require__(76324);
-var resolveCompressionConfig = /* @__PURE__ */ __name((input) => ({
- ...input,
- disableRequestCompression: (0, import_util_middleware.normalizeProvider)(input.disableRequestCompression),
- requestMinCompressionSizeBytes: async () => {
- const requestMinCompressionSizeBytes = await (0, import_util_middleware.normalizeProvider)(input.requestMinCompressionSizeBytes)();
- if (requestMinCompressionSizeBytes < 0 || requestMinCompressionSizeBytes > 10485760) {
- throw new RangeError(
- `The value for requestMinCompressionSizeBytes must be between 0 and 10485760 inclusive. The provided value ${requestMinCompressionSizeBytes} is outside this range."`
- );
+var resolveCompressionConfig = /* @__PURE__ */ __name((input) => {
+ const { disableRequestCompression, requestMinCompressionSizeBytes: _requestMinCompressionSizeBytes } = input;
+ return Object.assign(input, {
+ disableRequestCompression: (0, import_util_middleware.normalizeProvider)(disableRequestCompression),
+ requestMinCompressionSizeBytes: async () => {
+ const requestMinCompressionSizeBytes = await (0, import_util_middleware.normalizeProvider)(_requestMinCompressionSizeBytes)();
+ if (requestMinCompressionSizeBytes < 0 || requestMinCompressionSizeBytes > 10485760) {
+ throw new RangeError(
+ `The value for requestMinCompressionSizeBytes must be between 0 and 10485760 inclusive. The provided value ${requestMinCompressionSizeBytes} is outside this range."`
+ );
+ }
+ return requestMinCompressionSizeBytes;
}
- return requestMinCompressionSizeBytes;
- }
-}), "resolveCompressionConfig");
+ });
+}, "resolveCompressionConfig");
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
@@ -26329,7 +25888,7 @@ module.exports = __toCommonJS(src_exports);
// src/service-customizations/s3.ts
var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => {
- const bucket = (endpointParams == null ? void 0 : endpointParams.Bucket) || "";
+ const bucket = endpointParams?.Bucket || "";
if (typeof endpointParams.Bucket === "string") {
endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
}
@@ -26372,14 +25931,14 @@ var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndp
if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
return async () => {
const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
- const configValue = (credentials == null ? void 0 : credentials.credentialScope) ?? (credentials == null ? void 0 : credentials.CredentialScope);
+ const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
return configValue;
};
}
if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
return async () => {
const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
- const configValue = (credentials == null ? void 0 : credentials.accountId) ?? (credentials == null ? void 0 : credentials.AccountId);
+ const configValue = credentials?.accountId ?? credentials?.AccountId;
return configValue;
};
}
@@ -26437,9 +25996,8 @@ var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, in
return endpoint;
}, "getEndpointFromInstructions");
var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => {
- var _a;
const endpointParams = {};
- const instructions = ((_a = instructionsSupplier == null ? void 0 : instructionsSupplier.getEndpointParameterInstructions) == null ? void 0 : _a.call(instructionsSupplier)) || {};
+ const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
for (const [name, instruction] of Object.entries(instructions)) {
switch (instruction.type) {
case "staticContextParams":
@@ -26452,6 +26010,9 @@ var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupp
case "builtInParams":
endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)();
break;
+ case "operationContextParams":
+ endpointParams[name] = instruction.get(commandInput);
+ break;
default:
throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
}
@@ -26473,7 +26034,6 @@ var endpointMiddleware = /* @__PURE__ */ __name(({
instructions
}) => {
return (next, context) => async (args) => {
- var _a, _b, _c;
if (config.endpoint) {
(0, import_core.setFeature)(context, "ENDPOINT_OVERRIDE", "N");
}
@@ -26488,13 +26048,13 @@ var endpointMiddleware = /* @__PURE__ */ __name(({
context
);
context.endpointV2 = endpoint;
- context.authSchemes = (_a = endpoint.properties) == null ? void 0 : _a.authSchemes;
- const authScheme = (_b = context.authSchemes) == null ? void 0 : _b[0];
+ context.authSchemes = endpoint.properties?.authSchemes;
+ const authScheme = context.authSchemes?.[0];
if (authScheme) {
context["signing_region"] = authScheme.signingRegion;
context["signing_service"] = authScheme.signingName;
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
- const httpAuthOption = (_c = smithyContext == null ? void 0 : smithyContext.selectedHttpAuthScheme) == null ? void 0 : _c.httpAuthOption;
+ const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
if (httpAuthOption) {
httpAuthOption.signingProperties = Object.assign(
httpAuthOption.signingProperties || {},
@@ -26542,17 +26102,16 @@ var getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({
var import_getEndpointFromConfig2 = __nccwpck_require__(76041);
var resolveEndpointConfig = /* @__PURE__ */ __name((input) => {
const tls = input.tls ?? true;
- const { endpoint } = input;
+ const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await (0, import_util_middleware.normalizeProvider)(endpoint)()) : void 0;
const isCustomEndpoint = !!endpoint;
- const resolvedConfig = {
- ...input,
+ const resolvedConfig = Object.assign(input, {
endpoint: customEndpointProvider,
tls,
isCustomEndpoint,
- useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false),
- useFipsEndpoint: (0, import_util_middleware.normalizeProvider)(input.useFipsEndpoint ?? false)
- };
+ useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(useDualstackEndpoint ?? false),
+ useFipsEndpoint: (0, import_util_middleware.normalizeProvider)(useFipsEndpoint ?? false)
+ });
let configuredEndpointPromise = void 0;
resolvedConfig.serviceConfiguredEndpoint = async () => {
if (input.serviceId && !configuredEndpointPromise) {
@@ -26629,9 +26188,9 @@ var import_uuid = __nccwpck_require__(12048);
var import_util_retry = __nccwpck_require__(15518);
var getDefaultRetryQuota = /* @__PURE__ */ __name((initialRetryTokens, options) => {
const MAX_CAPACITY = initialRetryTokens;
- const noRetryIncrement = (options == null ? void 0 : options.noRetryIncrement) ?? import_util_retry.NO_RETRY_INCREMENT;
- const retryCost = (options == null ? void 0 : options.retryCost) ?? import_util_retry.RETRY_COST;
- const timeoutRetryCost = (options == null ? void 0 : options.timeoutRetryCost) ?? import_util_retry.TIMEOUT_RETRY_COST;
+ const noRetryIncrement = options?.noRetryIncrement ?? import_util_retry.NO_RETRY_INCREMENT;
+ const retryCost = options?.retryCost ?? import_util_retry.RETRY_COST;
+ const timeoutRetryCost = options?.timeoutRetryCost ?? import_util_retry.TIMEOUT_RETRY_COST;
let availableCapacity = initialRetryTokens;
const getCapacityAmount = /* @__PURE__ */ __name((error) => error.name === "TimeoutError" ? timeoutRetryCost : retryCost, "getCapacityAmount");
const hasRetryTokens = /* @__PURE__ */ __name((error) => getCapacityAmount(error) <= availableCapacity, "hasRetryTokens");
@@ -26679,13 +26238,16 @@ var asSdkError = /* @__PURE__ */ __name((error) => {
}, "asSdkError");
// src/StandardRetryStrategy.ts
-var _StandardRetryStrategy = class _StandardRetryStrategy {
+var StandardRetryStrategy = class {
constructor(maxAttemptsProvider, options) {
this.maxAttemptsProvider = maxAttemptsProvider;
this.mode = import_util_retry.RETRY_MODES.STANDARD;
- this.retryDecider = (options == null ? void 0 : options.retryDecider) ?? defaultRetryDecider;
- this.delayDecider = (options == null ? void 0 : options.delayDecider) ?? defaultDelayDecider;
- this.retryQuota = (options == null ? void 0 : options.retryQuota) ?? getDefaultRetryQuota(import_util_retry.INITIAL_RETRY_TOKENS);
+ this.retryDecider = options?.retryDecider ?? defaultRetryDecider;
+ this.delayDecider = options?.delayDecider ?? defaultDelayDecider;
+ this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(import_util_retry.INITIAL_RETRY_TOKENS);
+ }
+ static {
+ __name(this, "StandardRetryStrategy");
}
shouldRetry(error, attempts, maxAttempts) {
return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);
@@ -26713,11 +26275,11 @@ var _StandardRetryStrategy = class _StandardRetryStrategy {
if (import_protocol_http.HttpRequest.isInstance(request)) {
request.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
}
- if (options == null ? void 0 : options.beforeRequest) {
+ if (options?.beforeRequest) {
await options.beforeRequest();
}
const { response, output } = await next(args);
- if (options == null ? void 0 : options.afterRequest) {
+ if (options?.afterRequest) {
options.afterRequest(response);
}
this.retryQuota.releaseRetryTokens(retryTokenAmount);
@@ -26749,8 +26311,6 @@ var _StandardRetryStrategy = class _StandardRetryStrategy {
}
}
};
-__name(_StandardRetryStrategy, "StandardRetryStrategy");
-var StandardRetryStrategy = _StandardRetryStrategy;
var getDelayFromRetryAfterHeader = /* @__PURE__ */ __name((response) => {
if (!import_protocol_http.HttpResponse.isInstance(response))
return;
@@ -26766,7 +26326,10 @@ var getDelayFromRetryAfterHeader = /* @__PURE__ */ __name((response) => {
}, "getDelayFromRetryAfterHeader");
// src/AdaptiveRetryStrategy.ts
-var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy extends StandardRetryStrategy {
+var AdaptiveRetryStrategy = class extends StandardRetryStrategy {
+ static {
+ __name(this, "AdaptiveRetryStrategy");
+ }
constructor(maxAttemptsProvider, options) {
const { rateLimiter, ...superOptions } = options ?? {};
super(maxAttemptsProvider, superOptions);
@@ -26784,8 +26347,6 @@ var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy extends StandardRetryS
});
}
};
-__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy");
-var AdaptiveRetryStrategy = _AdaptiveRetryStrategy;
// src/configurations.ts
var import_util_middleware = __nccwpck_require__(76324);
@@ -26816,22 +26377,21 @@ var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
default: import_util_retry.DEFAULT_MAX_ATTEMPTS
};
var resolveRetryConfig = /* @__PURE__ */ __name((input) => {
- const { retryStrategy } = input;
- const maxAttempts = (0, import_util_middleware.normalizeProvider)(input.maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS);
- return {
- ...input,
+ const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
+ const maxAttempts = (0, import_util_middleware.normalizeProvider)(_maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS);
+ return Object.assign(input, {
maxAttempts,
retryStrategy: async () => {
if (retryStrategy) {
return retryStrategy;
}
- const retryMode = await (0, import_util_middleware.normalizeProvider)(input.retryMode)();
+ const retryMode = await (0, import_util_middleware.normalizeProvider)(_retryMode)();
if (retryMode === import_util_retry.RETRY_MODES.ADAPTIVE) {
return new import_util_retry.AdaptiveRetryStrategy(maxAttempts);
}
return new import_util_retry.StandardRetryStrategy(maxAttempts);
}
- };
+ });
}, "resolveRetryConfig");
var ENV_RETRY_MODE = "AWS_RETRY_MODE";
var CONFIG_RETRY_MODE = "retry_mode";
@@ -26873,7 +26433,6 @@ var import_smithy_client = __nccwpck_require__(61411);
var import_isStreamingPayload = __nccwpck_require__(49831);
var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
- var _a;
let retryStrategy = await options.retryStrategy();
const maxAttempts = await options.maxAttempts();
if (isRetryStrategyV2(retryStrategy)) {
@@ -26901,7 +26460,7 @@ var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => asy
const retryErrorInfo = getRetryErrorInfo(e);
lastError = asSdkError(e);
if (isRequest && (0, import_isStreamingPayload.isStreamingPayload)(request)) {
- (_a = context.logger instanceof import_smithy_client.NoOpLogger ? console : context.logger) == null ? void 0 : _a.warn(
+ (context.logger instanceof import_smithy_client.NoOpLogger ? console : context.logger)?.warn(
"An error was encountered in a non-retryable streaming request."
);
throw lastError;
@@ -26924,7 +26483,7 @@ var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => asy
}
} else {
retryStrategy = retryStrategy;
- if (retryStrategy == null ? void 0 : retryStrategy.mode)
+ if (retryStrategy?.mode)
context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
return retryStrategy.retry(next, args);
}
@@ -27031,7 +26590,7 @@ __export(src_exports, {
module.exports = __toCommonJS(src_exports);
// src/deserializerMiddleware.ts
-var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next) => async (args) => {
+var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next, context) => async (args) => {
const { response } = await next(args);
try {
const parsed = await deserializer(response, options);
@@ -27045,7 +26604,15 @@ var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (
});
if (!("$metadata" in error)) {
const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
- error.message += "\n " + hint;
+ try {
+ error.message += "\n " + hint;
+ } catch (e) {
+ if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
+ console.warn(hint);
+ } else {
+ context.logger?.warn?.(hint);
+ }
+ }
if (typeof error.$responseBodyText !== "undefined") {
if (error.$response) {
error.$response.body = error.$responseBodyText;
@@ -27058,8 +26625,7 @@ var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (
// src/serializerMiddleware.ts
var serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context) => async (args) => {
- var _a;
- const endpoint = ((_a = context.endpointV2) == null ? void 0 : _a.url) && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint;
+ const endpoint = context.endpointV2?.url && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint;
if (!endpoint) {
throw new Error("No valid endpoint provider available.");
}
@@ -27187,14 +26753,13 @@ var constructStack = /* @__PURE__ */ __name(() => {
return isRemoved;
}, "removeByReference");
const cloneTo = /* @__PURE__ */ __name((toStack) => {
- var _a;
absoluteEntries.forEach((entry) => {
toStack.add(entry.middleware, { ...entry });
});
relativeEntries.forEach((entry) => {
toStack.addRelativeTo(entry.middleware, { ...entry });
});
- (_a = toStack.identifyOnResolve) == null ? void 0 : _a.call(toStack, stack.identifyOnResolve());
+ toStack.identifyOnResolve?.(stack.identifyOnResolve());
return toStack;
}, "cloneTo");
const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => {
@@ -27286,10 +26851,7 @@ var constructStack = /* @__PURE__ */ __name(() => {
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
for (const alias of aliases) {
const toOverrideIndex = absoluteEntries.findIndex(
- (entry2) => {
- var _a;
- return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias));
- }
+ (entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias)
);
if (toOverrideIndex === -1) {
continue;
@@ -27322,10 +26884,7 @@ var constructStack = /* @__PURE__ */ __name(() => {
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
for (const alias of aliases) {
const toOverrideIndex = relativeEntries.findIndex(
- (entry2) => {
- var _a;
- return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias));
- }
+ (entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias)
);
if (toOverrideIndex === -1) {
continue;
@@ -27374,11 +26933,10 @@ var constructStack = /* @__PURE__ */ __name(() => {
return isRemoved;
},
concat: (from) => {
- var _a;
const cloned = cloneTo(constructStack());
cloned.use(from);
cloned.identifyOnResolve(
- identifyOnResolve || cloned.identifyOnResolve() || (((_a = from.identifyOnResolve) == null ? void 0 : _a.call(from)) ?? false)
+ identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false)
);
return cloned;
},
@@ -27597,6 +27155,12 @@ var getTransformedHeaders = /* @__PURE__ */ __name((headers) => {
return transformedHeaders;
}, "getTransformedHeaders");
+// src/timing.ts
+var timing = {
+ setTimeout: (cb, ms) => setTimeout(cb, ms),
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId)
+};
+
// src/set-connection-timeout.ts
var DEFER_EVENT_LISTENER_TIME = 1e3;
var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => {
@@ -27604,7 +27168,7 @@ var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs
return -1;
}
const registerTimeout = /* @__PURE__ */ __name((offset) => {
- const timeoutId = setTimeout(() => {
+ const timeoutId = timing.setTimeout(() => {
request.destroy();
reject(
Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), {
@@ -27613,12 +27177,12 @@ var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs
);
}, timeoutInMs - offset);
const doWithSocket = /* @__PURE__ */ __name((socket) => {
- if (socket == null ? void 0 : socket.connecting) {
+ if (socket?.connecting) {
socket.on("connect", () => {
- clearTimeout(timeoutId);
+ timing.clearTimeout(timeoutId);
});
} else {
- clearTimeout(timeoutId);
+ timing.clearTimeout(timeoutId);
}
}, "doWithSocket");
if (request.socket) {
@@ -27631,7 +27195,7 @@ var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs
registerTimeout(0);
return 0;
}
- return setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
+ return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
}, "setConnectionTimeout");
// src/set-socket-keep-alive.ts
@@ -27653,23 +27217,30 @@ var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAlive
registerListener();
return 0;
}
- return setTimeout(registerListener, deferTimeMs);
+ return timing.setTimeout(registerListener, deferTimeMs);
}, "setSocketKeepAlive");
// src/set-socket-timeout.ts
var DEFER_EVENT_LISTENER_TIME3 = 3e3;
-var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => {
+var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = DEFAULT_REQUEST_TIMEOUT) => {
const registerTimeout = /* @__PURE__ */ __name((offset) => {
- request.setTimeout(timeoutInMs - offset, () => {
+ const timeout = timeoutInMs - offset;
+ const onTimeout = /* @__PURE__ */ __name(() => {
request.destroy();
reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" }));
- });
+ }, "onTimeout");
+ if (request.socket) {
+ request.socket.setTimeout(timeout, onTimeout);
+ request.on("close", () => request.socket?.removeListener("timeout", onTimeout));
+ } else {
+ request.setTimeout(timeout, onTimeout);
+ }
}, "registerTimeout");
if (0 < timeoutInMs && timeoutInMs < 6e3) {
registerTimeout(0);
return 0;
}
- return setTimeout(
+ return timing.setTimeout(
registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3),
DEFER_EVENT_LISTENER_TIME3
);
@@ -27677,31 +27248,34 @@ var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0)
// src/write-request-body.ts
var import_stream = __nccwpck_require__(2203);
-var MIN_WAIT_TIME = 1e3;
+var MIN_WAIT_TIME = 6e3;
async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) {
const headers = request.headers ?? {};
const expect = headers["Expect"] || headers["expect"];
let timeoutId = -1;
- let hasError = false;
+ let sendBody = true;
if (expect === "100-continue") {
- await Promise.race([
+ sendBody = await Promise.race([
new Promise((resolve) => {
- timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
+ timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
}),
new Promise((resolve) => {
httpRequest.on("continue", () => {
- clearTimeout(timeoutId);
- resolve();
+ timing.clearTimeout(timeoutId);
+ resolve(true);
+ });
+ httpRequest.on("response", () => {
+ timing.clearTimeout(timeoutId);
+ resolve(false);
});
httpRequest.on("error", () => {
- hasError = true;
- clearTimeout(timeoutId);
- resolve();
+ timing.clearTimeout(timeoutId);
+ resolve(false);
});
})
]);
}
- if (!hasError) {
+ if (sendBody) {
writeBody(httpRequest, request.body);
}
}
@@ -27730,7 +27304,7 @@ __name(writeBody, "writeBody");
// src/node-http-handler.ts
var DEFAULT_REQUEST_TIMEOUT = 0;
-var _NodeHttpHandler = class _NodeHttpHandler {
+var NodeHttpHandler = class _NodeHttpHandler {
constructor(options) {
this.socketWarningTimestamp = 0;
// Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286
@@ -27745,12 +27319,15 @@ var _NodeHttpHandler = class _NodeHttpHandler {
}
});
}
+ static {
+ __name(this, "NodeHttpHandler");
+ }
/**
* @returns the input if it is an HttpHandler of any class,
* or instantiates a new instance of this handler.
*/
static create(instanceOrOptions) {
- if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") {
+ if (typeof instanceOrOptions?.handle === "function") {
return instanceOrOptions;
}
return new _NodeHttpHandler(instanceOrOptions);
@@ -27764,7 +27341,6 @@ var _NodeHttpHandler = class _NodeHttpHandler {
* @returns timestamp of last emitted warning.
*/
static checkSocketUsage(agent, socketWarningTimestamp, logger = console) {
- var _a, _b, _c;
const { sockets, requests, maxSockets } = agent;
if (typeof maxSockets !== "number" || maxSockets === Infinity) {
return socketWarningTimestamp;
@@ -27775,11 +27351,10 @@ var _NodeHttpHandler = class _NodeHttpHandler {
}
if (sockets && requests) {
for (const origin in sockets) {
- const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0;
- const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0;
+ const socketsInUse = sockets[origin]?.length ?? 0;
+ const requestsEnqueued = requests[origin]?.length ?? 0;
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
- (_c = logger == null ? void 0 : logger.warn) == null ? void 0 : _c.call(
- logger,
+ logger?.warn?.(
`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`
@@ -27791,20 +27366,21 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
return socketWarningTimestamp;
}
resolveDefaultConfig(options) {
- const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {};
+ const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent } = options || {};
const keepAlive = true;
const maxSockets = 50;
return {
connectionTimeout,
requestTimeout: requestTimeout ?? socketTimeout,
+ socketAcquisitionWarningTimeout,
httpAgent: (() => {
- if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") {
+ if (httpAgent instanceof import_http.Agent || typeof httpAgent?.destroy === "function") {
return httpAgent;
}
return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent });
})(),
httpsAgent: (() => {
- if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") {
+ if (httpsAgent instanceof import_https.Agent || typeof httpsAgent?.destroy === "function") {
return httpsAgent;
}
return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent });
@@ -27813,9 +27389,8 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
};
}
destroy() {
- var _a, _b, _c, _d;
- (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy();
- (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy();
+ this.config?.httpAgent?.destroy();
+ this.config?.httpsAgent?.destroy();
}
async handle(request, { abortSignal } = {}) {
if (!this.config) {
@@ -27826,18 +27401,18 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
const timeouts = [];
const resolve = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise;
- timeouts.forEach(clearTimeout);
+ timeouts.forEach(timing.clearTimeout);
_resolve(arg);
}, "resolve");
const reject = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise;
- timeouts.forEach(clearTimeout);
+ timeouts.forEach(timing.clearTimeout);
_reject(arg);
}, "reject");
if (!this.config) {
throw new Error("Node HTTP request handler config is not resolved");
}
- if (abortSignal == null ? void 0 : abortSignal.aborted) {
+ if (abortSignal?.aborted) {
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
reject(abortError);
@@ -27846,7 +27421,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
const isSSL = request.protocol === "https:";
const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
timeouts.push(
- setTimeout(
+ timing.setTimeout(
() => {
this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(
agent,
@@ -27932,7 +27507,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
);
}
writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e) => {
- timeouts.forEach(clearTimeout);
+ timeouts.forEach(timing.clearTimeout);
return _reject(e);
});
});
@@ -27950,8 +27525,6 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
return this.config ?? {};
}
};
-__name(_NodeHttpHandler, "NodeHttpHandler");
-var NodeHttpHandler = _NodeHttpHandler;
// src/node-http2-handler.ts
@@ -27962,11 +27535,14 @@ var import_http22 = __nccwpck_require__(85675);
var import_http2 = __toESM(__nccwpck_require__(85675));
// src/node-http2-connection-pool.ts
-var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool {
+var NodeHttp2ConnectionPool = class {
constructor(sessions) {
this.sessions = [];
this.sessions = sessions ?? [];
}
+ static {
+ __name(this, "NodeHttp2ConnectionPool");
+ }
poll() {
if (this.sessions.length > 0) {
return this.sessions.shift();
@@ -27994,11 +27570,9 @@ var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool {
}
}
};
-__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool");
-var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool;
// src/node-http2-connection-manager.ts
-var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {
+var NodeHttp2ConnectionManager = class {
constructor(config) {
this.sessionCache = /* @__PURE__ */ new Map();
this.config = config;
@@ -28006,6 +27580,9 @@ var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {
throw new RangeError("maxConcurrency must be greater than zero.");
}
}
+ static {
+ __name(this, "NodeHttp2ConnectionManager");
+ }
lease(requestContext, connectionConfiguration) {
const url = this.getUrlString(requestContext);
const existingPool = this.sessionCache.get(url);
@@ -28059,9 +27636,8 @@ var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {
this.sessionCache.set(authority, existingConnectionPool);
}
release(requestContext, session) {
- var _a;
const cacheKey = this.getUrlString(requestContext);
- (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session);
+ this.sessionCache.get(cacheKey)?.offerLast(session);
}
destroy() {
for (const [key, connectionPool] of this.sessionCache) {
@@ -28075,7 +27651,7 @@ var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {
}
}
setMaxConcurrentStreams(maxConcurrentStreams) {
- if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {
+ if (maxConcurrentStreams && maxConcurrentStreams <= 0) {
throw new RangeError("maxConcurrentStreams must be greater than zero.");
}
this.config.maxConcurrency = maxConcurrentStreams;
@@ -28087,11 +27663,9 @@ var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {
return request.destination.toString();
}
};
-__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager");
-var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager;
// src/node-http2-handler.ts
-var _NodeHttp2Handler = class _NodeHttp2Handler {
+var NodeHttp2Handler = class _NodeHttp2Handler {
constructor(options) {
this.metadata = { handlerProtocol: "h2" };
this.connectionManager = new NodeHttp2ConnectionManager({});
@@ -28105,12 +27679,15 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
}
});
}
+ static {
+ __name(this, "NodeHttp2Handler");
+ }
/**
* @returns the input if it is an HttpHandler of any class,
* or instantiates a new instance of this handler.
*/
static create(instanceOrOptions) {
- if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") {
+ if (typeof instanceOrOptions?.handle === "function") {
return instanceOrOptions;
}
return new _NodeHttp2Handler(instanceOrOptions);
@@ -28128,7 +27705,6 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
}
const { requestTimeout, disableConcurrentStreams } = this.config;
return new Promise((_resolve, _reject) => {
- var _a;
let fulfilled = false;
let writeRequestBodyPromise = void 0;
const resolve = /* @__PURE__ */ __name(async (arg) => {
@@ -28139,7 +27715,7 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
await writeRequestBodyPromise;
_reject(arg);
}, "reject");
- if (abortSignal == null ? void 0 : abortSignal.aborted) {
+ if (abortSignal?.aborted) {
fulfilled = true;
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
@@ -28156,7 +27732,7 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`;
const requestContext = { destination: new URL(authority) };
const session = this.connectionManager.lease(requestContext, {
- requestTimeout: (_a = this.config) == null ? void 0 : _a.sessionTimeout,
+ requestTimeout: this.config?.sessionTimeout,
disableConcurrentStreams: disableConcurrentStreams || false
});
const rejectWithDestroy = /* @__PURE__ */ __name((err) => {
@@ -28251,7 +27827,7 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
}
/**
* Destroys a session.
- * @param session The session to destroy.
+ * @param session - the session to destroy.
*/
destroySession(session) {
if (!session.destroyed) {
@@ -28259,23 +27835,22 @@ var _NodeHttp2Handler = class _NodeHttp2Handler {
}
}
};
-__name(_NodeHttp2Handler, "NodeHttp2Handler");
-var NodeHttp2Handler = _NodeHttp2Handler;
// src/stream-collector/collector.ts
-var _Collector = class _Collector extends import_stream.Writable {
+var Collector = class extends import_stream.Writable {
constructor() {
super(...arguments);
this.bufferedBytes = [];
}
+ static {
+ __name(this, "Collector");
+ }
_write(chunk, encoding, callback) {
this.bufferedBytes.push(chunk);
callback();
}
};
-__name(_Collector, "Collector");
-var Collector = _Collector;
// src/stream-collector/index.ts
var streamCollector = /* @__PURE__ */ __name((stream) => {
@@ -28362,9 +27937,8 @@ __export(src_exports, {
module.exports = __toCommonJS(src_exports);
// src/ProviderError.ts
-var _ProviderError = class _ProviderError extends Error {
+var ProviderError = class _ProviderError extends Error {
constructor(message, options = true) {
- var _a;
let logger;
let tryNextLink = true;
if (typeof options === "boolean") {
@@ -28378,7 +27952,10 @@ var _ProviderError = class _ProviderError extends Error {
this.name = "ProviderError";
this.tryNextLink = tryNextLink;
Object.setPrototypeOf(this, _ProviderError.prototype);
- (_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
+ logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
+ }
+ static {
+ __name(this, "ProviderError");
}
/**
* @deprecated use new operator.
@@ -28387,11 +27964,9 @@ var _ProviderError = class _ProviderError extends Error {
return Object.assign(new this(error.message, options), error);
}
};
-__name(_ProviderError, "ProviderError");
-var ProviderError = _ProviderError;
// src/CredentialsProviderError.ts
-var _CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
+var CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
/**
* @override
*/
@@ -28400,12 +27975,13 @@ var _CredentialsProviderError = class _CredentialsProviderError extends Provider
this.name = "CredentialsProviderError";
Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
}
+ static {
+ __name(this, "CredentialsProviderError");
+ }
};
-__name(_CredentialsProviderError, "CredentialsProviderError");
-var CredentialsProviderError = _CredentialsProviderError;
// src/TokenProviderError.ts
-var _TokenProviderError = class _TokenProviderError extends ProviderError {
+var TokenProviderError = class _TokenProviderError extends ProviderError {
/**
* @override
*/
@@ -28414,9 +27990,10 @@ var _TokenProviderError = class _TokenProviderError extends ProviderError {
this.name = "TokenProviderError";
Object.setPrototypeOf(this, _TokenProviderError.prototype);
}
+ static {
+ __name(this, "TokenProviderError");
+ }
};
-__name(_TokenProviderError, "TokenProviderError");
-var TokenProviderError = _TokenProviderError;
// src/chain.ts
var chain = /* @__PURE__ */ __name((...providers) => async () => {
@@ -28430,7 +28007,7 @@ var chain = /* @__PURE__ */ __name((...providers) => async () => {
return credentials;
} catch (err) {
lastProviderError = err;
- if (err == null ? void 0 : err.tryNextLink) {
+ if (err?.tryNextLink) {
continue;
}
throw err;
@@ -28463,14 +28040,14 @@ var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
}, "coalesceProvider");
if (isExpired === void 0) {
return async (options) => {
- if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
+ if (!hasResult || options?.forceRefresh) {
resolved = await coalesceProvider();
}
return resolved;
};
}
return async (options) => {
- if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
+ if (!hasResult || options?.forceRefresh) {
resolved = await coalesceProvider();
}
if (isConstant) {
@@ -28533,19 +28110,18 @@ module.exports = __toCommonJS(src_exports);
// src/extensions/httpExtensionConfiguration.ts
var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
- let httpHandler = runtimeConfig.httpHandler;
return {
setHttpHandler(handler) {
- httpHandler = handler;
+ runtimeConfig.httpHandler = handler;
},
httpHandler() {
- return httpHandler;
+ return runtimeConfig.httpHandler;
},
updateHttpClientConfig(key, value) {
- httpHandler.updateHttpClientConfig(key, value);
+ runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
},
httpHandlerConfigs() {
- return httpHandler.httpHandlerConfigs();
+ return runtimeConfig.httpHandler.httpHandlerConfigs();
}
};
}, "getHttpHandlerExtensionConfiguration");
@@ -28557,7 +28133,10 @@ var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensi
// src/Field.ts
var import_types = __nccwpck_require__(90690);
-var _Field = class _Field {
+var Field = class {
+ static {
+ __name(this, "Field");
+ }
constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) {
this.name = name;
this.kind = kind;
@@ -28604,16 +28183,17 @@ var _Field = class _Field {
return this.values;
}
};
-__name(_Field, "Field");
-var Field = _Field;
// src/Fields.ts
-var _Fields = class _Fields {
+var Fields = class {
constructor({ fields = [], encoding = "utf-8" }) {
this.entries = {};
fields.forEach(this.setField.bind(this));
this.encoding = encoding;
}
+ static {
+ __name(this, "Fields");
+ }
/**
* Set entry for a {@link Field} name. The `name`
* attribute will be used to key the collection.
@@ -28653,12 +28233,13 @@ var _Fields = class _Fields {
return Object.values(this.entries).filter((field) => field.kind === kind);
}
};
-__name(_Fields, "Fields");
-var Fields = _Fields;
// src/httpRequest.ts
-var _HttpRequest = class _HttpRequest {
+var HttpRequest = class _HttpRequest {
+ static {
+ __name(this, "HttpRequest");
+ }
constructor(options) {
this.method = options.method || "GET";
this.hostname = options.hostname || "localhost";
@@ -28708,8 +28289,6 @@ var _HttpRequest = class _HttpRequest {
return _HttpRequest.clone(this);
}
};
-__name(_HttpRequest, "HttpRequest");
-var HttpRequest = _HttpRequest;
function cloneQuery(query) {
return Object.keys(query).reduce((carry, paramName) => {
const param = query[paramName];
@@ -28722,7 +28301,10 @@ function cloneQuery(query) {
__name(cloneQuery, "cloneQuery");
// src/httpResponse.ts
-var _HttpResponse = class _HttpResponse {
+var HttpResponse = class {
+ static {
+ __name(this, "HttpResponse");
+ }
constructor(options) {
this.statusCode = options.statusCode;
this.reason = options.reason;
@@ -28736,8 +28318,6 @@ var _HttpResponse = class _HttpResponse {
return typeof resp.statusCode === "number" && typeof resp.headers === "object";
}
};
-__name(_HttpResponse, "HttpResponse");
-var HttpResponse = _HttpResponse;
// src/isValidHostname.ts
function isValidHostname(hostname) {
@@ -28935,21 +28515,11 @@ var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMED
// src/index.ts
var isRetryableByTrait = /* @__PURE__ */ __name((error) => error.$retryable !== void 0, "isRetryableByTrait");
var isClockSkewError = /* @__PURE__ */ __name((error) => CLOCK_SKEW_ERROR_CODES.includes(error.name), "isClockSkewError");
-var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => {
- var _a;
- return (_a = error.$metadata) == null ? void 0 : _a.clockSkewCorrected;
-}, "isClockSkewCorrectedError");
-var isThrottlingError = /* @__PURE__ */ __name((error) => {
- var _a, _b;
- return ((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true;
-}, "isThrottlingError");
-var isTransientError = /* @__PURE__ */ __name((error) => {
- var _a;
- return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0);
-}, "isTransientError");
+var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => error.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError");
+var isThrottlingError = /* @__PURE__ */ __name((error) => error.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error.name) || error.$retryable?.throttling == true, "isThrottlingError");
+var isTransientError = /* @__PURE__ */ __name((error, depth = 0) => isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1), "isTransientError");
var isServerError = /* @__PURE__ */ __name((error) => {
- var _a;
- if (((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) !== void 0) {
+ if (error.$metadata?.httpStatusCode !== void 0) {
const statusCode = error.$metadata.httpStatusCode;
if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
return true;
@@ -29385,7 +28955,7 @@ var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders
continue;
}
const canonicalHeaderName = headerName.toLowerCase();
- if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
+ if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {
continue;
}
@@ -29439,7 +29009,10 @@ var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstr
// src/HeaderFormatter.ts
var import_util_utf83 = __nccwpck_require__(71577);
-var _HeaderFormatter = class _HeaderFormatter {
+var HeaderFormatter = class {
+ static {
+ __name(this, "HeaderFormatter");
+ }
format(headers) {
const chunks = [];
for (const headerName of Object.keys(headers)) {
@@ -29506,16 +29079,17 @@ var _HeaderFormatter = class _HeaderFormatter {
}
}
};
-__name(_HeaderFormatter, "HeaderFormatter");
-var HeaderFormatter = _HeaderFormatter;
var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
-var _Int64 = class _Int64 {
+var Int64 = class _Int64 {
constructor(bytes) {
this.bytes = bytes;
if (bytes.byteLength !== 8) {
throw new Error("Int64 buffers must be exactly 8 bytes");
}
}
+ static {
+ __name(this, "Int64");
+ }
static fromNumber(number) {
if (number > 9223372036854776e3 || number < -9223372036854776e3) {
throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
@@ -29544,8 +29118,6 @@ var _Int64 = class _Int64 {
return String(this.valueOf());
}
};
-__name(_Int64, "Int64");
-var Int64 = _Int64;
function negate(bytes) {
for (let i = 0; i < 8; i++) {
bytes[i] ^= 255;
@@ -29572,11 +29144,10 @@ var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => {
// src/moveHeadersToQuery.ts
var import_protocol_http = __nccwpck_require__(72356);
var moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => {
- var _a, _b;
const { headers, query = {} } = import_protocol_http.HttpRequest.clone(request);
for (const name of Object.keys(headers)) {
const lname = name.toLowerCase();
- if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) == null ? void 0 : _a.has(lname)) || ((_b = options.hoistableHeaders) == null ? void 0 : _b.has(lname))) {
+ if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) {
query[name] = headers[name];
delete headers[name];
}
@@ -29616,7 +29187,7 @@ var toDate = /* @__PURE__ */ __name((time) => {
}, "toDate");
// src/SignatureV4.ts
-var _SignatureV4 = class _SignatureV4 {
+var SignatureV4 = class {
constructor({
applyChecksum,
credentials,
@@ -29633,6 +29204,9 @@ var _SignatureV4 = class _SignatureV4 {
this.regionProvider = (0, import_util_middleware.normalizeProvider)(region);
this.credentialProvider = (0, import_util_middleware.normalizeProvider)(credentials);
}
+ static {
+ __name(this, "SignatureV4");
+ }
async presign(originalRequest, options = {}) {
const {
signingDate = /* @__PURE__ */ new Date(),
@@ -29781,7 +29355,7 @@ ${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;
if (this.uriEscapePath) {
const normalizedPathSegments = [];
for (const pathSegment of path.split("/")) {
- if ((pathSegment == null ? void 0 : pathSegment.length) === 0)
+ if (pathSegment?.length === 0)
continue;
if (pathSegment === ".")
continue;
@@ -29791,7 +29365,7 @@ ${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;
normalizedPathSegments.push(pathSegment);
}
}
- const normalizedPath = `${(path == null ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith("/")) ? "/" : ""}`;
+ const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`;
const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath);
return doubleEncoded.replace(/%2F/g, "/");
}
@@ -29814,8 +29388,6 @@ ${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;
}
}
};
-__name(_SignatureV4, "SignatureV4");
-var SignatureV4 = _SignatureV4;
var formatDate = /* @__PURE__ */ __name((now) => {
const longDate = iso8601(now).replace(/[\-:]/g, "");
return {
@@ -29863,7 +29435,6 @@ __export(src_exports, {
NoOpLogger: () => NoOpLogger,
SENSITIVE_STRING: () => SENSITIVE_STRING,
ServiceException: () => ServiceException,
- StringWrapper: () => StringWrapper,
_json: () => _json,
collectBody: () => import_protocols.collectBody,
convertMap: () => convertMap,
@@ -29924,11 +29495,14 @@ module.exports = __toCommonJS(src_exports);
// src/client.ts
var import_middleware_stack = __nccwpck_require__(9208);
-var _Client = class _Client {
+var Client = class {
constructor(config) {
this.config = config;
this.middlewareStack = (0, import_middleware_stack.constructStack)();
}
+ static {
+ __name(this, "Client");
+ }
send(command, optionsOrCb, cb) {
const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
@@ -29964,13 +29538,10 @@ var _Client = class _Client {
}
}
destroy() {
- var _a, _b, _c;
- (_c = (_b = (_a = this.config) == null ? void 0 : _a.requestHandler) == null ? void 0 : _b.destroy) == null ? void 0 : _c.call(_b);
+ this.config?.requestHandler?.destroy?.();
delete this.handlers;
}
};
-__name(_Client, "Client");
-var Client = _Client;
// src/collect-stream-body.ts
var import_protocols = __nccwpck_require__(93422);
@@ -29978,10 +29549,13 @@ var import_protocols = __nccwpck_require__(93422);
// src/command.ts
var import_types = __nccwpck_require__(90690);
-var _Command = class _Command {
+var Command = class {
constructor() {
this.middlewareStack = (0, import_middleware_stack.constructStack)();
}
+ static {
+ __name(this, "Command");
+ }
/**
* Factory for Command ClassBuilder.
* @internal
@@ -30026,9 +29600,7 @@ var _Command = class _Command {
);
}
};
-__name(_Command, "Command");
-var Command = _Command;
-var _ClassBuilder = class _ClassBuilder {
+var ClassBuilder = class {
constructor() {
this._init = () => {
};
@@ -30043,6 +29615,9 @@ var _ClassBuilder = class _ClassBuilder {
this._serializer = null;
this._deserializer = null;
}
+ static {
+ __name(this, "ClassBuilder");
+ }
/**
* Optional init callback.
*/
@@ -30115,10 +29690,9 @@ var _ClassBuilder = class _ClassBuilder {
* @returns a Command class with the classBuilder properties.
*/
build() {
- var _a;
const closure = this;
let CommandRef;
- return CommandRef = (_a = class extends Command {
+ return CommandRef = class extends Command {
/**
* @public
*/
@@ -30137,6 +29711,9 @@ var _ClassBuilder = class _ClassBuilder {
this.input = input ?? {};
closure._init(this);
}
+ static {
+ __name(this, "CommandRef");
+ }
/**
* @public
*/
@@ -30158,11 +29735,9 @@ var _ClassBuilder = class _ClassBuilder {
additionalContext: closure._additionalContext
});
}
- }, __name(_a, "CommandRef"), _a);
+ };
}
};
-__name(_ClassBuilder, "ClassBuilder");
-var ClassBuilder = _ClassBuilder;
// src/constants.ts
var SENSITIVE_STRING = "***SensitiveInformation***";
@@ -30643,17 +30218,45 @@ var stripLeadingZeroes = /* @__PURE__ */ __name((value) => {
}, "stripLeadingZeroes");
// src/exceptions.ts
-var _ServiceException = class _ServiceException extends Error {
+var ServiceException = class _ServiceException extends Error {
+ static {
+ __name(this, "ServiceException");
+ }
constructor(options) {
super(options.message);
- Object.setPrototypeOf(this, _ServiceException.prototype);
+ Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);
this.name = options.name;
this.$fault = options.$fault;
this.$metadata = options.$metadata;
}
+ /**
+ * Checks if a value is an instance of ServiceException (duck typed)
+ */
+ static isInstance(value) {
+ if (!value)
+ return false;
+ const candidate = value;
+ return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server");
+ }
+ /**
+ * Custom instanceof check to support the operator for ServiceException base class
+ */
+ static [Symbol.hasInstance](instance) {
+ if (!instance)
+ return false;
+ const candidate = instance;
+ if (this === _ServiceException) {
+ return _ServiceException.isInstance(instance);
+ }
+ if (_ServiceException.isInstance(instance)) {
+ if (candidate.name && this.name) {
+ return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;
+ }
+ return this.prototype.isPrototypeOf(instance);
+ }
+ return false;
+ }
};
-__name(_ServiceException, "ServiceException");
-var ServiceException = _ServiceException;
var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => {
Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => {
if (exception[k] == void 0 || exception[k] === "") {
@@ -30671,7 +30274,7 @@ var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionC
const $metadata = deserializeMetadata(output);
const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0;
const response = new exceptionCtor({
- name: (parsedBody == null ? void 0 : parsedBody.code) || (parsedBody == null ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError",
+ name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
$fault: "client",
$metadata
});
@@ -30743,12 +30346,11 @@ var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
});
}
return {
- _checksumAlgorithms: checksumAlgorithms,
addChecksumAlgorithm(algo) {
- this._checksumAlgorithms.push(algo);
+ checksumAlgorithms.push(algo);
},
checksumAlgorithms() {
- return this._checksumAlgorithms;
+ return checksumAlgorithms;
}
};
}, "getChecksumConfiguration");
@@ -30762,13 +30364,12 @@ var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {
// src/extensions/retry.ts
var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
- let _retryStrategy = runtimeConfig.retryStrategy;
return {
setRetryStrategy(retryStrategy) {
- _retryStrategy = retryStrategy;
+ runtimeConfig.retryStrategy = retryStrategy;
},
retryStrategy() {
- return _retryStrategy;
+ return runtimeConfig.retryStrategy;
}
};
}, "getRetryConfiguration");
@@ -30780,17 +30381,11 @@ var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfigurati
// src/extensions/defaultExtensionConfiguration.ts
var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
- return {
- ...getChecksumConfiguration(runtimeConfig),
- ...getRetryConfiguration(runtimeConfig)
- };
+ return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));
}, "getDefaultExtensionConfiguration");
var getDefaultClientConfiguration = getDefaultExtensionConfiguration;
var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
- return {
- ...resolveChecksumRuntimeConfig(config),
- ...resolveRetryRuntimeConfig(config)
- };
+ return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
}, "resolveDefaultRuntimeConfig");
// src/get-array-if-single-item.ts
@@ -30815,43 +30410,35 @@ var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => {
}, "isSerializableHeaderValue");
// src/lazy-json.ts
-var StringWrapper = /* @__PURE__ */ __name(function() {
- const Class = Object.getPrototypeOf(this).constructor;
- const Constructor = Function.bind.apply(String, [null, ...arguments]);
- const instance = new Constructor();
- Object.setPrototypeOf(instance, Class.prototype);
- return instance;
-}, "StringWrapper");
-StringWrapper.prototype = Object.create(String.prototype, {
- constructor: {
- value: StringWrapper,
- enumerable: false,
- writable: true,
- configurable: true
- }
-});
-Object.setPrototypeOf(StringWrapper, String);
-var _LazyJsonString = class _LazyJsonString extends StringWrapper {
- deserializeJSON() {
- return JSON.parse(super.toString());
- }
- toJSON() {
- return super.toString();
- }
- static fromObject(object) {
- if (object instanceof _LazyJsonString) {
- return object;
- } else if (object instanceof String || typeof object === "string") {
- return new _LazyJsonString(object);
+var LazyJsonString = /* @__PURE__ */ __name(function LazyJsonString2(val) {
+ const str = Object.assign(new String(val), {
+ deserializeJSON() {
+ return JSON.parse(String(val));
+ },
+ toString() {
+ return String(val);
+ },
+ toJSON() {
+ return String(val);
}
- return new _LazyJsonString(JSON.stringify(object));
+ });
+ return str;
+}, "LazyJsonString");
+LazyJsonString.from = (object) => {
+ if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) {
+ return object;
+ } else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) {
+ return LazyJsonString(String(object));
}
+ return LazyJsonString(JSON.stringify(object));
};
-__name(_LazyJsonString, "LazyJsonString");
-var LazyJsonString = _LazyJsonString;
+LazyJsonString.fromObject = LazyJsonString.from;
// src/NoOpLogger.ts
-var _NoOpLogger = class _NoOpLogger {
+var NoOpLogger = class {
+ static {
+ __name(this, "NoOpLogger");
+ }
trace() {
}
debug() {
@@ -30863,8 +30450,6 @@ var _NoOpLogger = class _NoOpLogger {
error() {
}
};
-__name(_NoOpLogger, "NoOpLogger");
-var NoOpLogger = _NoOpLogger;
// src/object-mapping.ts
function map(arg0, arg1, arg2) {
@@ -31168,12 +30753,11 @@ var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
});
}
return {
- _checksumAlgorithms: checksumAlgorithms,
addChecksumAlgorithm(algo) {
- this._checksumAlgorithms.push(algo);
+ checksumAlgorithms.push(algo);
},
checksumAlgorithms() {
- return this._checksumAlgorithms;
+ return checksumAlgorithms;
}
};
}, "getChecksumConfiguration");
@@ -31187,14 +30771,10 @@ var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {
// src/extensions/defaultClientConfiguration.ts
var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
- return {
- ...getChecksumConfiguration(runtimeConfig)
- };
+ return getChecksumConfiguration(runtimeConfig);
}, "getDefaultClientConfiguration");
var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
- return {
- ...resolveChecksumRuntimeConfig(config)
- };
+ return resolveChecksumRuntimeConfig(config);
}, "resolveDefaultRuntimeConfig");
// src/http.ts
@@ -31611,7 +31191,7 @@ var resolveDefaultsModeConfig = /* @__PURE__ */ __name(({
defaultsMode = (0, import_node_config_provider.loadConfig)(NODE_DEFAULTS_MODE_CONFIG_OPTIONS)
} = {}) => (0, import_property_provider.memoize)(async () => {
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
- switch (mode == null ? void 0 : mode.toLowerCase()) {
+ switch (mode?.toLowerCase()) {
case "auto":
return resolveNodeDefaultsModeAuto(region);
case "in-region":
@@ -31619,7 +31199,7 @@ var resolveDefaultsModeConfig = /* @__PURE__ */ __name(({
case "mobile":
case "standard":
case "legacy":
- return Promise.resolve(mode == null ? void 0 : mode.toLocaleLowerCase());
+ return Promise.resolve(mode?.toLocaleLowerCase());
case void 0:
return Promise.resolve("legacy");
default:
@@ -31699,7 +31279,7 @@ __export(src_exports, {
module.exports = __toCommonJS(src_exports);
// src/cache/EndpointCache.ts
-var _EndpointCache = class _EndpointCache {
+var EndpointCache = class {
/**
* @param [size] - desired average maximum capacity. A buffer of 10 additional keys will be allowed
* before keys are dropped.
@@ -31716,6 +31296,9 @@ var _EndpointCache = class _EndpointCache {
this.parameters = params;
}
}
+ static {
+ __name(this, "EndpointCache");
+ }
/**
* @param endpointParams - query for endpoint.
* @param resolver - provider of the value if not present.
@@ -31764,8 +31347,6 @@ var _EndpointCache = class _EndpointCache {
return buffer;
}
};
-__name(_EndpointCache, "EndpointCache");
-var EndpointCache = _EndpointCache;
// src/lib/isIpAddress.ts
var IP_V4_REGEX = new RegExp(
@@ -31810,14 +31391,15 @@ function toDebugString(input) {
__name(toDebugString, "toDebugString");
// src/types/EndpointError.ts
-var _EndpointError = class _EndpointError extends Error {
+var EndpointError = class extends Error {
+ static {
+ __name(this, "EndpointError");
+ }
constructor(message) {
super(message);
this.name = "EndpointError";
}
};
-__name(_EndpointError, "EndpointError");
-var EndpointError = _EndpointError;
// src/lib/booleanEquals.ts
var booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals");
@@ -32012,12 +31594,11 @@ var callFunction = /* @__PURE__ */ __name(({ fn, argv }, options) => {
// src/utils/evaluateCondition.ts
var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => {
- var _a, _b;
if (assign && assign in options.referenceRecord) {
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
}
const value = callFunction(fnArgs, options);
- (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
+ options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
return {
result: value === "" ? true : !!value,
...assign != null && { toAssign: { name: assign, value } }
@@ -32026,7 +31607,6 @@ var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options)
// src/utils/evaluateConditions.ts
var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => {
- var _a, _b;
const conditionsReferenceRecord = {};
for (const condition of conditions) {
const { result, toAssign } = evaluateCondition(condition, {
@@ -32041,7 +31621,7 @@ var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => {
}
if (toAssign) {
conditionsReferenceRecord[toAssign.name] = toAssign.value;
- (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
+ options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
}
}
return { result: true, referenceRecord: conditionsReferenceRecord };
@@ -32107,7 +31687,6 @@ var getEndpointUrl = /* @__PURE__ */ __name((endpointUrl, options) => {
// src/utils/evaluateEndpointRule.ts
var evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => {
- var _a, _b;
const { conditions, endpoint } = endpointRule;
const { result, referenceRecord } = evaluateConditions(conditions, options);
if (!result) {
@@ -32118,7 +31697,7 @@ var evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => {
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
};
const { url, properties, headers } = endpoint;
- (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
+ options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
return {
...headers != void 0 && {
headers: getEndpointHeaders(headers, endpointRuleOptions)
@@ -32182,10 +31761,9 @@ var evaluateRules = /* @__PURE__ */ __name((rules, options) => {
// src/resolveEndpoint.ts
var resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => {
- var _a, _b, _c, _d;
const { endpointParams, logger } = options;
const { parameters, rules } = ruleSetObject;
- (_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
+ options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
const paramsWithDefault = Object.entries(parameters).filter(([, v]) => v.default != null).map(([k, v]) => [k, v.default]);
if (paramsWithDefault.length > 0) {
for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
@@ -32199,7 +31777,7 @@ var resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => {
}
}
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
- (_d = (_c = options.logger) == null ? void 0 : _c.debug) == null ? void 0 : _d.call(_c, `${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
+ options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
return endpoint;
}, "resolveEndpoint");
// Annotate the CommonJS export names for ESM import in node:
@@ -32385,7 +31963,7 @@ var DEFAULT_RETRY_MODE = "standard" /* STANDARD */;
// src/DefaultRateLimiter.ts
var import_service_error_classification = __nccwpck_require__(42058);
-var _DefaultRateLimiter = class _DefaultRateLimiter {
+var DefaultRateLimiter = class _DefaultRateLimiter {
constructor(options) {
// Pre-set state variables
this.currentCapacity = 0;
@@ -32395,17 +31973,26 @@ var _DefaultRateLimiter = class _DefaultRateLimiter {
this.requestCount = 0;
this.lastTimestamp = 0;
this.timeWindow = 0;
- this.beta = (options == null ? void 0 : options.beta) ?? 0.7;
- this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1;
- this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5;
- this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4;
- this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8;
+ this.beta = options?.beta ?? 0.7;
+ this.minCapacity = options?.minCapacity ?? 1;
+ this.minFillRate = options?.minFillRate ?? 0.5;
+ this.scaleConstant = options?.scaleConstant ?? 0.4;
+ this.smooth = options?.smooth ?? 0.8;
const currentTimeInSeconds = this.getCurrentTimeInSeconds();
this.lastThrottleTime = currentTimeInSeconds;
this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
this.fillRate = this.minFillRate;
this.maxCapacity = this.minCapacity;
}
+ static {
+ __name(this, "DefaultRateLimiter");
+ }
+ static {
+ /**
+ * Only used in testing.
+ */
+ this.setTimeoutFn = setTimeout;
+ }
getCurrentTimeInSeconds() {
return Date.now() / 1e3;
}
@@ -32419,7 +32006,7 @@ var _DefaultRateLimiter = class _DefaultRateLimiter {
this.refillTokenBucket();
if (amount > this.currentCapacity) {
const delay = (amount - this.currentCapacity) / this.fillRate * 1e3;
- await new Promise((resolve) => setTimeout(resolve, delay));
+ await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
}
this.currentCapacity = this.currentCapacity - amount;
}
@@ -32485,8 +32072,6 @@ var _DefaultRateLimiter = class _DefaultRateLimiter {
return parseFloat(num.toFixed(8));
}
};
-__name(_DefaultRateLimiter, "DefaultRateLimiter");
-var DefaultRateLimiter = _DefaultRateLimiter;
// src/constants.ts
var DEFAULT_RETRY_DELAY_BASE = 100;
@@ -32531,7 +32116,7 @@ var createDefaultRetryToken = /* @__PURE__ */ __name(({
}, "createDefaultRetryToken");
// src/StandardRetryStrategy.ts
-var _StandardRetryStrategy = class _StandardRetryStrategy {
+var StandardRetryStrategy = class {
constructor(maxAttempts) {
this.maxAttempts = maxAttempts;
this.mode = "standard" /* STANDARD */;
@@ -32539,6 +32124,9 @@ var _StandardRetryStrategy = class _StandardRetryStrategy {
this.retryBackoffStrategy = getDefaultRetryBackoffStrategy();
this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
}
+ static {
+ __name(this, "StandardRetryStrategy");
+ }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async acquireInitialRetryToken(retryTokenScope) {
return createDefaultRetryToken({
@@ -32595,11 +32183,9 @@ var _StandardRetryStrategy = class _StandardRetryStrategy {
return errorType === "THROTTLING" || errorType === "TRANSIENT";
}
};
-__name(_StandardRetryStrategy, "StandardRetryStrategy");
-var StandardRetryStrategy = _StandardRetryStrategy;
// src/AdaptiveRetryStrategy.ts
-var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy {
+var AdaptiveRetryStrategy = class {
constructor(maxAttemptsProvider, options) {
this.maxAttemptsProvider = maxAttemptsProvider;
this.mode = "adaptive" /* ADAPTIVE */;
@@ -32607,6 +32193,9 @@ var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy {
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
}
+ static {
+ __name(this, "AdaptiveRetryStrategy");
+ }
async acquireInitialRetryToken(retryTokenScope) {
await this.rateLimiter.getSendToken();
return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
@@ -32620,11 +32209,12 @@ var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy {
this.standardRetryStrategy.recordSuccess(token);
}
};
-__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy");
-var AdaptiveRetryStrategy = _AdaptiveRetryStrategy;
// src/ConfiguredRetryStrategy.ts
-var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy {
+var ConfiguredRetryStrategy = class extends StandardRetryStrategy {
+ static {
+ __name(this, "ConfiguredRetryStrategy");
+ }
/**
* @param maxAttempts - the maximum number of retry attempts allowed.
* e.g., if set to 3, then 4 total requests are possible.
@@ -32658,14 +32248,54 @@ var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRe
return token;
}
};
-__name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy");
-var ConfiguredRetryStrategy = _ConfiguredRetryStrategy;
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
+/***/ }),
+
+/***/ 31732:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.ByteArrayCollector = void 0;
+class ByteArrayCollector {
+ constructor(allocByteArray) {
+ this.allocByteArray = allocByteArray;
+ this.byteLength = 0;
+ this.byteArrays = [];
+ }
+ push(byteArray) {
+ this.byteArrays.push(byteArray);
+ this.byteLength += byteArray.byteLength;
+ }
+ flush() {
+ if (this.byteArrays.length === 1) {
+ const bytes = this.byteArrays[0];
+ this.reset();
+ return bytes;
+ }
+ const aggregation = this.allocByteArray(this.byteLength);
+ let cursor = 0;
+ for (let i = 0; i < this.byteArrays.length; ++i) {
+ const bytes = this.byteArrays[i];
+ aggregation.set(bytes, cursor);
+ cursor += bytes.byteLength;
+ }
+ this.reset();
+ return aggregation;
+ }
+ reset() {
+ this.byteArrays = [];
+ this.byteLength = 0;
+ }
+}
+exports.ByteArrayCollector = ByteArrayCollector;
+
+
/***/ }),
/***/ 87753:
@@ -32803,6 +32433,185 @@ function createChecksumStream(init) {
exports.createChecksumStream = createChecksumStream;
+/***/ }),
+
+/***/ 72005:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.createBufferedReadable = void 0;
+const node_stream_1 = __nccwpck_require__(57075);
+const ByteArrayCollector_1 = __nccwpck_require__(31732);
+const createBufferedReadableStream_1 = __nccwpck_require__(78213);
+const stream_type_check_1 = __nccwpck_require__(4414);
+function createBufferedReadable(upstream, size, logger) {
+ if ((0, stream_type_check_1.isReadableStream)(upstream)) {
+ return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger);
+ }
+ const downstream = new node_stream_1.Readable({ read() { } });
+ let streamBufferingLoggedWarning = false;
+ let bytesSeen = 0;
+ const buffers = [
+ "",
+ new ByteArrayCollector_1.ByteArrayCollector((size) => new Uint8Array(size)),
+ new ByteArrayCollector_1.ByteArrayCollector((size) => Buffer.from(new Uint8Array(size))),
+ ];
+ let mode = -1;
+ upstream.on("data", (chunk) => {
+ const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true);
+ if (mode !== chunkMode) {
+ if (mode >= 0) {
+ downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
+ }
+ mode = chunkMode;
+ }
+ if (mode === -1) {
+ downstream.push(chunk);
+ return;
+ }
+ const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk);
+ bytesSeen += chunkSize;
+ const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]);
+ if (chunkSize >= size && bufferSize === 0) {
+ downstream.push(chunk);
+ }
+ else {
+ const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk);
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
+ streamBufferingLoggedWarning = true;
+ logger === null || logger === void 0 ? void 0 : logger.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
+ }
+ if (newSize >= size) {
+ downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
+ }
+ }
+ });
+ upstream.on("end", () => {
+ if (mode !== -1) {
+ const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode);
+ if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) {
+ downstream.push(remainder);
+ }
+ }
+ downstream.push(null);
+ });
+ return downstream;
+}
+exports.createBufferedReadable = createBufferedReadable;
+
+
+/***/ }),
+
+/***/ 78213:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.modeOf = exports.sizeOf = exports.flush = exports.merge = exports.createBufferedReadable = exports.createBufferedReadableStream = void 0;
+const ByteArrayCollector_1 = __nccwpck_require__(31732);
+function createBufferedReadableStream(upstream, size, logger) {
+ const reader = upstream.getReader();
+ let streamBufferingLoggedWarning = false;
+ let bytesSeen = 0;
+ const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size) => new Uint8Array(size))];
+ let mode = -1;
+ const pull = async (controller) => {
+ const { value, done } = await reader.read();
+ const chunk = value;
+ if (done) {
+ if (mode !== -1) {
+ const remainder = flush(buffers, mode);
+ if (sizeOf(remainder) > 0) {
+ controller.enqueue(remainder);
+ }
+ }
+ controller.close();
+ }
+ else {
+ const chunkMode = modeOf(chunk, false);
+ if (mode !== chunkMode) {
+ if (mode >= 0) {
+ controller.enqueue(flush(buffers, mode));
+ }
+ mode = chunkMode;
+ }
+ if (mode === -1) {
+ controller.enqueue(chunk);
+ return;
+ }
+ const chunkSize = sizeOf(chunk);
+ bytesSeen += chunkSize;
+ const bufferSize = sizeOf(buffers[mode]);
+ if (chunkSize >= size && bufferSize === 0) {
+ controller.enqueue(chunk);
+ }
+ else {
+ const newSize = merge(buffers, mode, chunk);
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
+ streamBufferingLoggedWarning = true;
+ logger === null || logger === void 0 ? void 0 : logger.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
+ }
+ if (newSize >= size) {
+ controller.enqueue(flush(buffers, mode));
+ }
+ else {
+ await pull(controller);
+ }
+ }
+ }
+ };
+ return new ReadableStream({
+ pull,
+ });
+}
+exports.createBufferedReadableStream = createBufferedReadableStream;
+exports.createBufferedReadable = createBufferedReadableStream;
+function merge(buffers, mode, chunk) {
+ switch (mode) {
+ case 0:
+ buffers[0] += chunk;
+ return sizeOf(buffers[0]);
+ case 1:
+ case 2:
+ buffers[mode].push(chunk);
+ return sizeOf(buffers[mode]);
+ }
+}
+exports.merge = merge;
+function flush(buffers, mode) {
+ switch (mode) {
+ case 0:
+ const s = buffers[0];
+ buffers[0] = "";
+ return s;
+ case 1:
+ case 2:
+ return buffers[mode].flush();
+ }
+ throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
+}
+exports.flush = flush;
+function sizeOf(chunk) {
+ var _a, _b;
+ return (_b = (_a = chunk === null || chunk === void 0 ? void 0 : chunk.byteLength) !== null && _a !== void 0 ? _a : chunk === null || chunk === void 0 ? void 0 : chunk.length) !== null && _b !== void 0 ? _b : 0;
+}
+exports.sizeOf = sizeOf;
+function modeOf(chunk, allowBuffer = true) {
+ if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) {
+ return 2;
+ }
+ if (chunk instanceof Uint8Array) {
+ return 1;
+ }
+ if (typeof chunk === "string") {
+ return 0;
+ }
+ return -1;
+}
+exports.modeOf = modeOf;
+
+
/***/ }),
/***/ 6522:
@@ -32987,7 +32796,10 @@ function transformFromString(str, encoding) {
__name(transformFromString, "transformFromString");
// src/blob/Uint8ArrayBlobAdapter.ts
-var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
+var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
+ static {
+ __name(this, "Uint8ArrayBlobAdapter");
+ }
/**
* @param source - such as a string or Stream.
* @returns a new Uint8ArrayBlobAdapter extending Uint8Array.
@@ -33016,17 +32828,16 @@ var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
return transformToString(this, encoding);
}
};
-__name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter");
-var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter;
// src/index.ts
+__reExport(src_exports, __nccwpck_require__(71775), module.exports);
+__reExport(src_exports, __nccwpck_require__(5639), module.exports);
+__reExport(src_exports, __nccwpck_require__(72005), module.exports);
__reExport(src_exports, __nccwpck_require__(6522), module.exports);
+__reExport(src_exports, __nccwpck_require__(88412), module.exports);
__reExport(src_exports, __nccwpck_require__(77201), module.exports);
__reExport(src_exports, __nccwpck_require__(82108), module.exports);
-__reExport(src_exports, __nccwpck_require__(88412), module.exports);
__reExport(src_exports, __nccwpck_require__(4414), module.exports);
-__reExport(src_exports, __nccwpck_require__(5639), module.exports);
-__reExport(src_exports, __nccwpck_require__(71775), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
@@ -33120,7 +32931,6 @@ exports.sdkStreamMixin = void 0;
const node_http_handler_1 = __nccwpck_require__(61279);
const util_buffer_from_1 = __nccwpck_require__(44151);
const stream_1 = __nccwpck_require__(2203);
-const util_1 = __nccwpck_require__(39023);
const sdk_stream_mixin_browser_1 = __nccwpck_require__(82207);
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
const sdkStreamMixin = (stream) => {
@@ -33150,7 +32960,7 @@ const sdkStreamMixin = (stream) => {
return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
}
else {
- const decoder = new util_1.TextDecoder(encoding);
+ const decoder = new TextDecoder(encoding);
return decoder.decode(buf);
}
},
@@ -33162,7 +32972,7 @@ const sdkStreamMixin = (stream) => {
throw new Error("The stream has been consumed by other callbacks.");
}
if (typeof stream_1.Readable.toWeb !== "function") {
- throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");
+ throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
}
transformed = true;
return stream_1.Readable.toWeb(stream);
@@ -33202,7 +33012,7 @@ const stream_1 = __nccwpck_require__(2203);
const splitStream_browser_1 = __nccwpck_require__(17570);
const stream_type_check_1 = __nccwpck_require__(4414);
async function splitStream(stream) {
- if ((0, stream_type_check_1.isReadableStream)(stream)) {
+ if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) {
return (0, splitStream_browser_1.splitStream)(stream);
}
const stream1 = new stream_1.PassThrough();
@@ -33221,13 +33031,18 @@ exports.splitStream = splitStream;
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.isReadableStream = void 0;
+exports.isBlob = exports.isReadableStream = void 0;
const isReadableStream = (stream) => {
var _a;
return typeof ReadableStream === "function" &&
(((_a = stream === null || stream === void 0 ? void 0 : stream.constructor) === null || _a === void 0 ? void 0 : _a.name) === ReadableStream.name || stream instanceof ReadableStream);
};
exports.isReadableStream = isReadableStream;
+const isBlob = (blob) => {
+ var _a;
+ return typeof Blob === "function" && (((_a = blob === null || blob === void 0 ? void 0 : blob.constructor) === null || _a === void 0 ? void 0 : _a.name) === Blob.name || blob instanceof Blob);
+};
+exports.isBlob = isBlob;
/***/ }),
@@ -33431,38 +33246,63 @@ var exponentialBackoffWithJitter = /* @__PURE__ */ __name((minDelay, maxDelay, a
}, "exponentialBackoffWithJitter");
var randomInRange = /* @__PURE__ */ __name((min, max) => min + Math.random() * (max - min), "randomInRange");
var runPolling = /* @__PURE__ */ __name(async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => {
- var _a;
+ const observedResponses = {};
const { state, reason } = await acceptorChecks(client, input);
+ if (reason) {
+ const message = createMessageFromResponse(reason);
+ observedResponses[message] |= 0;
+ observedResponses[message] += 1;
+ }
if (state !== "RETRY" /* RETRY */) {
- return { state, reason };
+ return { state, reason, observedResponses };
}
let currentAttempt = 1;
const waitUntil = Date.now() + maxWaitTime * 1e3;
const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1;
while (true) {
- if (((_a = abortController == null ? void 0 : abortController.signal) == null ? void 0 : _a.aborted) || (abortSignal == null ? void 0 : abortSignal.aborted)) {
- return { state: "ABORTED" /* ABORTED */ };
+ if (abortController?.signal?.aborted || abortSignal?.aborted) {
+ const message = "AbortController signal aborted.";
+ observedResponses[message] |= 0;
+ observedResponses[message] += 1;
+ return { state: "ABORTED" /* ABORTED */, observedResponses };
}
const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt);
if (Date.now() + delay * 1e3 > waitUntil) {
- return { state: "TIMEOUT" /* TIMEOUT */ };
+ return { state: "TIMEOUT" /* TIMEOUT */, observedResponses };
}
await sleep(delay);
const { state: state2, reason: reason2 } = await acceptorChecks(client, input);
+ if (reason2) {
+ const message = createMessageFromResponse(reason2);
+ observedResponses[message] |= 0;
+ observedResponses[message] += 1;
+ }
if (state2 !== "RETRY" /* RETRY */) {
- return { state: state2, reason: reason2 };
+ return { state: state2, reason: reason2, observedResponses };
}
currentAttempt += 1;
}
}, "runPolling");
+var createMessageFromResponse = /* @__PURE__ */ __name((reason) => {
+ if (reason?.$responseBodyText) {
+ return `Deserialization error for body: ${reason.$responseBodyText}`;
+ }
+ if (reason?.$metadata?.httpStatusCode) {
+ if (reason.$response || reason.message) {
+ return `${reason.$response.statusCode ?? reason.$metadata.httpStatusCode ?? "Unknown"}: ${reason.message}`;
+ }
+ return `${reason.$metadata.httpStatusCode}: OK`;
+ }
+ return String(reason?.message ?? JSON.stringify(reason) ?? "Unknown");
+}, "createMessageFromResponse");
// src/utils/validate.ts
var validateWaiterOptions = /* @__PURE__ */ __name((options) => {
- if (options.maxWaitTime < 1) {
+ if (options.maxWaitTime <= 0) {
throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`);
- } else if (options.minDelay < 1) {
+ } else if (options.minDelay <= 0) {
throw new Error(`WaiterConfiguration.minDelay must be greater than 0`);
- } else if (options.maxDelay < 1) {
+ } else if (options.maxDelay <= 0) {
throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`);
} else if (options.maxWaitTime <= options.minDelay) {
throw new Error(
@@ -33507,140 +33347,6 @@ var createWaiter = /* @__PURE__ */ __name(async (options, input, acceptorChecks)
-/***/ }),
-
-/***/ 17413:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-/**
- * @author Toru Nagashima
- * See LICENSE file in root directory for full license.
- */
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-var eventTargetShim = __nccwpck_require__(16577);
-
-/**
- * The signal class.
- * @see https://dom.spec.whatwg.org/#abortsignal
- */
-class AbortSignal extends eventTargetShim.EventTarget {
- /**
- * AbortSignal cannot be constructed directly.
- */
- constructor() {
- super();
- throw new TypeError("AbortSignal cannot be constructed directly");
- }
- /**
- * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.
- */
- get aborted() {
- const aborted = abortedFlags.get(this);
- if (typeof aborted !== "boolean") {
- throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
- }
- return aborted;
- }
-}
-eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort");
-/**
- * Create an AbortSignal object.
- */
-function createAbortSignal() {
- const signal = Object.create(AbortSignal.prototype);
- eventTargetShim.EventTarget.call(signal);
- abortedFlags.set(signal, false);
- return signal;
-}
-/**
- * Abort a given signal.
- */
-function abortSignal(signal) {
- if (abortedFlags.get(signal) !== false) {
- return;
- }
- abortedFlags.set(signal, true);
- signal.dispatchEvent({ type: "abort" });
-}
-/**
- * Aborted flag for each instances.
- */
-const abortedFlags = new WeakMap();
-// Properties should be enumerable.
-Object.defineProperties(AbortSignal.prototype, {
- aborted: { enumerable: true },
-});
-// `toString()` should return `"[object AbortSignal]"`
-if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
- Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {
- configurable: true,
- value: "AbortSignal",
- });
-}
-
-/**
- * The AbortController.
- * @see https://dom.spec.whatwg.org/#abortcontroller
- */
-class AbortController {
- /**
- * Initialize this controller.
- */
- constructor() {
- signals.set(this, createAbortSignal());
- }
- /**
- * Returns the `AbortSignal` object associated with this object.
- */
- get signal() {
- return getSignal(this);
- }
- /**
- * Abort and signal to any observers that the associated activity is to be aborted.
- */
- abort() {
- abortSignal(getSignal(this));
- }
-}
-/**
- * Associated signals.
- */
-const signals = new WeakMap();
-/**
- * Get the associated signal of a given controller.
- */
-function getSignal(controller) {
- const signal = signals.get(controller);
- if (signal == null) {
- throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`);
- }
- return signal;
-}
-// Properties should be enumerable.
-Object.defineProperties(AbortController.prototype, {
- signal: { enumerable: true },
- abort: { enumerable: true },
-});
-if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
- Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {
- configurable: true,
- value: "AbortController",
- });
-}
-
-exports.AbortController = AbortController;
-exports.AbortSignal = AbortSignal;
-exports["default"] = AbortController;
-
-module.exports = AbortController
-module.exports.AbortController = module.exports["default"] = AbortController
-module.exports.AbortSignal = AbortSignal
-//# sourceMappingURL=abort-controller.js.map
-
-
/***/ }),
/***/ 54412:
@@ -35697,6 +35403,78 @@ function removeHook(state, name, method) {
}
+/***/ }),
+
+/***/ 22639:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var bind = __nccwpck_require__(37564);
+
+var $apply = __nccwpck_require__(33945);
+var $call = __nccwpck_require__(88093);
+var $reflectApply = __nccwpck_require__(31330);
+
+/** @type {import('./actualApply')} */
+module.exports = $reflectApply || bind.call($call, $apply);
+
+
+/***/ }),
+
+/***/ 33945:
+/***/ ((module) => {
+
+
+
+/** @type {import('./functionApply')} */
+module.exports = Function.prototype.apply;
+
+
+/***/ }),
+
+/***/ 88093:
+/***/ ((module) => {
+
+
+
+/** @type {import('./functionCall')} */
+module.exports = Function.prototype.call;
+
+
+/***/ }),
+
+/***/ 88705:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var bind = __nccwpck_require__(37564);
+var $TypeError = __nccwpck_require__(73314);
+
+var $call = __nccwpck_require__(88093);
+var $actualApply = __nccwpck_require__(22639);
+
+/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
+module.exports = function callBindBasic(args) {
+ if (args.length < 1 || typeof args[0] !== 'function') {
+ throw new $TypeError('a function is required');
+ }
+ return $actualApply(bind, $call, args);
+};
+
+
+/***/ }),
+
+/***/ 31330:
+/***/ ((module) => {
+
+
+
+/** @type {import('./reflectApply')} */
+module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
+
+
/***/ }),
/***/ 80465:
@@ -40516,6 +40294,411 @@ class Deprecation extends Error {
exports.Deprecation = Deprecation;
+/***/ }),
+
+/***/ 18889:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+const fs = __nccwpck_require__(79896)
+const path = __nccwpck_require__(16928)
+const os = __nccwpck_require__(70857)
+const crypto = __nccwpck_require__(76982)
+const packageJson = __nccwpck_require__(80056)
+
+const version = packageJson.version
+
+const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg
+
+// Parse src into an Object
+function parse (src) {
+ const obj = {}
+
+ // Convert buffer to string
+ let lines = src.toString()
+
+ // Convert line breaks to same format
+ lines = lines.replace(/\r\n?/mg, '\n')
+
+ let match
+ while ((match = LINE.exec(lines)) != null) {
+ const key = match[1]
+
+ // Default undefined or null to empty string
+ let value = (match[2] || '')
+
+ // Remove whitespace
+ value = value.trim()
+
+ // Check if double quoted
+ const maybeQuote = value[0]
+
+ // Remove surrounding quotes
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2')
+
+ // Expand newlines if double quoted
+ if (maybeQuote === '"') {
+ value = value.replace(/\\n/g, '\n')
+ value = value.replace(/\\r/g, '\r')
+ }
+
+ // Add to object
+ obj[key] = value
+ }
+
+ return obj
+}
+
+function _parseVault (options) {
+ const vaultPath = _vaultPath(options)
+
+ // Parse .env.vault
+ const result = DotenvModule.configDotenv({ path: vaultPath })
+ if (!result.parsed) {
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
+ err.code = 'MISSING_DATA'
+ throw err
+ }
+
+ // handle scenario for comma separated keys - for use with key rotation
+ // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
+ const keys = _dotenvKey(options).split(',')
+ const length = keys.length
+
+ let decrypted
+ for (let i = 0; i < length; i++) {
+ try {
+ // Get full key
+ const key = keys[i].trim()
+
+ // Get instructions for decrypt
+ const attrs = _instructions(result, key)
+
+ // Decrypt
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)
+
+ break
+ } catch (error) {
+ // last key
+ if (i + 1 >= length) {
+ throw error
+ }
+ // try next key
+ }
+ }
+
+ // Parse decrypted .env string
+ return DotenvModule.parse(decrypted)
+}
+
+function _log (message) {
+ console.log(`[dotenv@${version}][INFO] ${message}`)
+}
+
+function _warn (message) {
+ console.log(`[dotenv@${version}][WARN] ${message}`)
+}
+
+function _debug (message) {
+ console.log(`[dotenv@${version}][DEBUG] ${message}`)
+}
+
+function _dotenvKey (options) {
+ // prioritize developer directly setting options.DOTENV_KEY
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
+ return options.DOTENV_KEY
+ }
+
+ // secondary infra already contains a DOTENV_KEY environment variable
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
+ return process.env.DOTENV_KEY
+ }
+
+ // fallback to empty string
+ return ''
+}
+
+function _instructions (result, dotenvKey) {
+ // Parse DOTENV_KEY. Format is a URI
+ let uri
+ try {
+ uri = new URL(dotenvKey)
+ } catch (error) {
+ if (error.code === 'ERR_INVALID_URL') {
+ const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')
+ err.code = 'INVALID_DOTENV_KEY'
+ throw err
+ }
+
+ throw error
+ }
+
+ // Get decrypt key
+ const key = uri.password
+ if (!key) {
+ const err = new Error('INVALID_DOTENV_KEY: Missing key part')
+ err.code = 'INVALID_DOTENV_KEY'
+ throw err
+ }
+
+ // Get environment
+ const environment = uri.searchParams.get('environment')
+ if (!environment) {
+ const err = new Error('INVALID_DOTENV_KEY: Missing environment part')
+ err.code = 'INVALID_DOTENV_KEY'
+ throw err
+ }
+
+ // Get ciphertext payload
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`
+ const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION
+ if (!ciphertext) {
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
+ err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'
+ throw err
+ }
+
+ return { ciphertext, key }
+}
+
+function _vaultPath (options) {
+ let possibleVaultPath = null
+
+ if (options && options.path && options.path.length > 0) {
+ if (Array.isArray(options.path)) {
+ for (const filepath of options.path) {
+ if (fs.existsSync(filepath)) {
+ possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`
+ }
+ }
+ } else {
+ possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`
+ }
+ } else {
+ possibleVaultPath = path.resolve(process.cwd(), '.env.vault')
+ }
+
+ if (fs.existsSync(possibleVaultPath)) {
+ return possibleVaultPath
+ }
+
+ return null
+}
+
+function _resolveHome (envPath) {
+ return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
+}
+
+function _configVault (options) {
+ _log('Loading env from encrypted .env.vault')
+
+ const parsed = DotenvModule._parseVault(options)
+
+ let processEnv = process.env
+ if (options && options.processEnv != null) {
+ processEnv = options.processEnv
+ }
+
+ DotenvModule.populate(processEnv, parsed, options)
+
+ return { parsed }
+}
+
+function configDotenv (options) {
+ const dotenvPath = path.resolve(process.cwd(), '.env')
+ let encoding = 'utf8'
+ const debug = Boolean(options && options.debug)
+
+ if (options && options.encoding) {
+ encoding = options.encoding
+ } else {
+ if (debug) {
+ _debug('No encoding is specified. UTF-8 is used by default')
+ }
+ }
+
+ let optionPaths = [dotenvPath] // default, look for .env
+ if (options && options.path) {
+ if (!Array.isArray(options.path)) {
+ optionPaths = [_resolveHome(options.path)]
+ } else {
+ optionPaths = [] // reset default
+ for (const filepath of options.path) {
+ optionPaths.push(_resolveHome(filepath))
+ }
+ }
+ }
+
+ // Build the parsed data in a temporary object (because we need to return it). Once we have the final
+ // parsed data, we will combine it with process.env (or options.processEnv if provided).
+ let lastError
+ const parsedAll = {}
+ for (const path of optionPaths) {
+ try {
+ // Specifying an encoding returns a string instead of a buffer
+ const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))
+
+ DotenvModule.populate(parsedAll, parsed, options)
+ } catch (e) {
+ if (debug) {
+ _debug(`Failed to load ${path} ${e.message}`)
+ }
+ lastError = e
+ }
+ }
+
+ let processEnv = process.env
+ if (options && options.processEnv != null) {
+ processEnv = options.processEnv
+ }
+
+ DotenvModule.populate(processEnv, parsedAll, options)
+
+ if (lastError) {
+ return { parsed: parsedAll, error: lastError }
+ } else {
+ return { parsed: parsedAll }
+ }
+}
+
+// Populates process.env from .env file
+function config (options) {
+ // fallback to original dotenv if DOTENV_KEY is not set
+ if (_dotenvKey(options).length === 0) {
+ return DotenvModule.configDotenv(options)
+ }
+
+ const vaultPath = _vaultPath(options)
+
+ // dotenvKey exists but .env.vault file does not exist
+ if (!vaultPath) {
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)
+
+ return DotenvModule.configDotenv(options)
+ }
+
+ return DotenvModule._configVault(options)
+}
+
+function decrypt (encrypted, keyStr) {
+ const key = Buffer.from(keyStr.slice(-64), 'hex')
+ let ciphertext = Buffer.from(encrypted, 'base64')
+
+ const nonce = ciphertext.subarray(0, 12)
+ const authTag = ciphertext.subarray(-16)
+ ciphertext = ciphertext.subarray(12, -16)
+
+ try {
+ const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)
+ aesgcm.setAuthTag(authTag)
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
+ } catch (error) {
+ const isRange = error instanceof RangeError
+ const invalidKeyLength = error.message === 'Invalid key length'
+ const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'
+
+ if (isRange || invalidKeyLength) {
+ const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')
+ err.code = 'INVALID_DOTENV_KEY'
+ throw err
+ } else if (decryptionFailed) {
+ const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')
+ err.code = 'DECRYPTION_FAILED'
+ throw err
+ } else {
+ throw error
+ }
+ }
+}
+
+// Populate process.env with parsed values
+function populate (processEnv, parsed, options = {}) {
+ const debug = Boolean(options && options.debug)
+ const override = Boolean(options && options.override)
+
+ if (typeof parsed !== 'object') {
+ const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
+ err.code = 'OBJECT_REQUIRED'
+ throw err
+ }
+
+ // Set process.env
+ for (const key of Object.keys(parsed)) {
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
+ if (override === true) {
+ processEnv[key] = parsed[key]
+ }
+
+ if (debug) {
+ if (override === true) {
+ _debug(`"${key}" is already defined and WAS overwritten`)
+ } else {
+ _debug(`"${key}" is already defined and was NOT overwritten`)
+ }
+ }
+ } else {
+ processEnv[key] = parsed[key]
+ }
+ }
+}
+
+const DotenvModule = {
+ configDotenv,
+ _configVault,
+ _parseVault,
+ config,
+ decrypt,
+ parse,
+ populate
+}
+
+module.exports.configDotenv = DotenvModule.configDotenv
+module.exports._configVault = DotenvModule._configVault
+module.exports._parseVault = DotenvModule._parseVault
+module.exports.config = DotenvModule.config
+module.exports.decrypt = DotenvModule.decrypt
+module.exports.parse = DotenvModule.parse
+module.exports.populate = DotenvModule.populate
+
+module.exports = DotenvModule
+
+
+/***/ }),
+
+/***/ 26669:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var callBind = __nccwpck_require__(88705);
+var gOPD = __nccwpck_require__(33170);
+
+var hasProtoAccessor;
+try {
+ // eslint-disable-next-line no-extra-parens, no-proto
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
+} catch (e) {
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
+ throw e;
+ }
+}
+
+// eslint-disable-next-line no-extra-parens
+var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
+
+var $Object = Object;
+var $getPrototypeOf = $Object.getPrototypeOf;
+
+/** @type {import('./get')} */
+module.exports = desc && typeof desc.get === 'function'
+ ? callBind([desc.get])
+ : typeof $getPrototypeOf === 'function'
+ ? /** @type {import('./get')} */ function getDunder(value) {
+ // eslint-disable-next-line eqeqeq
+ return $getPrototypeOf(value == null ? value : $Object(value));
+ }
+ : false;
+
+
/***/ }),
/***/ 85909:
@@ -40559,881 +40742,154 @@ module.exports = function enabled(name, variable) {
/***/ }),
-/***/ 16577:
-/***/ ((module, exports) => {
-
-/**
- * @author Toru Nagashima
- * @copyright 2015 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-/**
- * @typedef {object} PrivateData
- * @property {EventTarget} eventTarget The event target.
- * @property {{type:string}} event The original event object.
- * @property {number} eventPhase The current event phase.
- * @property {EventTarget|null} currentTarget The current event target.
- * @property {boolean} canceled The flag to prevent default.
- * @property {boolean} stopped The flag to stop propagation.
- * @property {boolean} immediateStopped The flag to stop propagation immediately.
- * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.
- * @property {number} timeStamp The unix time.
- * @private
- */
-
-/**
- * Private data for event wrappers.
- * @type {WeakMap}
- * @private
- */
-const privateData = new WeakMap();
-
-/**
- * Cache for wrapper classes.
- * @type {WeakMap